SuccessChanges

Summary

  1. [test] Add explicit dso_local to function declarations in static relocation model tests (details)
  2. [TargetMachine] Don't imply dso_local on function declarations in Reloc::Static model for ELF/wasm (details)
Commit 6b6c3aaeacfdc4a482de4af41719b0a4b50aeadf by i
[test] Add explicit dso_local to function declarations in static relocation model tests

They are currently implicit because TargetMachine::shouldAssumeDSOLocal implies
dso_local.

For such function declarations, clang -fno-pic emits the dso_local specifier.
Adding explicit dso_local makes these tests align with the clang behavior and
helps implementing an option to use GOT indirection when taking the address of a
function symbol in -fno-pic (to avoid a canonical PLT entry (SHN_UNDEF with
non-zero st_value)).
The file was modifiedllvm/test/CodeGen/X86/shrink-compare-pgso.ll
The file was modifiedllvm/test/CodeGen/X86/tailcall-assume.ll
The file was modifiedllvm/test/CodeGen/X86/fp128-i128.ll
The file was modifiedllvm/test/CodeGen/X86/rd-mod-wr-eflags.ll
The file was modifiedllvm/test/CodeGen/X86/neg_cmp.ll
The file was modifiedllvm/test/CodeGen/X86/pr37063.ll
The file was modifiedllvm/test/CodeGen/X86/tail-dup-asm-goto.ll
The file was modifiedllvm/test/CodeGen/X86/memcmp-more-load-pairs.ll
The file was modifiedllvm/test/CodeGen/X86/retpoline-external.ll
The file was modifiedllvm/test/CodeGen/X86/sqrt-partial.ll
The file was modifiedllvm/test/CodeGen/X86/mov-zero-to-xor.ll
The file was modifiedllvm/test/CodeGen/X86/win64_sibcall.ll
The file was modifiedllvm/test/CodeGen/X86/tailcall-extract.ll
The file was modifiedllvm/test/CodeGen/X86/shrink-compare.ll
The file was modifiedllvm/test/CodeGen/X86/fp-une-cmp.ll
The file was modifiedllvm/test/CodeGen/X86/nomerge.ll
The file was modifiedllvm/test/CodeGen/X86/memcmp-minsize.ll
The file was modifiedllvm/test/CodeGen/X86/dagcombine-shifts.ll
The file was modifiedllvm/test/CodeGen/X86/sse-fcopysign.ll
The file was modifiedllvm/test/CodeGen/X86/statepoint-vreg-details.ll
The file was modifiedllvm/test/CodeGen/X86/tailcall-tailcc.ll
The file was modifiedllvm/test/CodeGen/X86/copy-eflags.ll
The file was modifiedllvm/test/CodeGen/X86/memcmp-pgso.ll
The file was modifiedllvm/test/CodeGen/X86/pr47024.ll
The file was modifiedllvm/test/CodeGen/X86/btq.ll
The file was modifiedllvm/test/CodeGen/X86/shrinkwrap-callbr.ll
The file was modifiedllvm/test/CodeGen/X86/avx-vzeroupper.ll
The file was modifiedllvm/test/CodeGen/X86/statepoint-vreg-unlimited-tied-opnds.ll
The file was modifiedllvm/test/CodeGen/X86/tail-call-deref.ll
The file was modifiedllvm/test/CodeGen/X86/memcmp-optsize.ll
The file was modifiedllvm/test/CodeGen/X86/sibcall.ll
The file was modifiedllvm/test/CodeGen/X86/sibcall-win64.ll
The file was modifiedllvm/test/CodeGen/X86/musttail-tailcc.ll
The file was modifiedllvm/test/CodeGen/X86/xor-icmp.ll
The file was modifiedllvm/test/CodeGen/AArch64/tagged-globals-static.ll
The file was modifiedllvm/test/CodeGen/X86/fp-strict-scalar-cmp.ll
The file was modifiedllvm/test/CodeGen/X86/cmp.ll
The file was modifiedllvm/test/CodeGen/X86/peep-test-4.ll
The file was modifiedllvm/test/CodeGen/SystemZ/la-01.ll
The file was modifiedllvm/test/CodeGen/X86/callbr-asm-branch-folding.ll
The file was modifiedllvm/test/CodeGen/X86/memcmp.ll
The file was modifiedllvm/test/CodeGen/X86/conditional-tailcall.ll
The file was modifiedllvm/test/CodeGen/X86/pr38865.ll
The file was modifiedllvm/test/CodeGen/X86/bool-zext.ll
The file was modifiedllvm/test/CodeGen/AArch64/funcptr_cast.ll
The file was modifiedllvm/test/CodeGen/X86/avx512-i1test.ll
The file was modifiedllvm/test/CodeGen/X86/fold-rmw-ops.ll
The file was modifiedllvm/test/CodeGen/X86/tail-opts.ll
The file was modifiedllvm/test/DebugInfo/X86/live-debug-values-remove-range.ll
The file was modifiedllvm/test/CodeGen/X86/lvi-hardening-indirectbr.ll
The file was modifiedllvm/test/CodeGen/X86/bmi.ll
The file was modifiedllvm/test/CodeGen/AArch64/extern-weak.ll
The file was modifiedllvm/test/CodeGen/X86/add.ll
Commit a084c0388e2a59b9556f2de0083333232da3f1d6 by i
[TargetMachine] Don't imply dso_local on function declarations in Reloc::Static model for ELF/wasm

clang/lib/CodeGen/CodeGenModule sets dso_local on applicable function declarations,
we don't need to duplicate the work in TargetMachine:shouldAssumeDSOLocal.
(Actually the long-term goal (started by r324535) is to drop TargetMachine::shouldAssumeDSOLocal.)

By not implying dso_local, we will respect dso_local/dso_preemptable specifiers
set by the frontend. This allows the proposed -fno-direct-access-external-data
option to work with -fno-pic and prevent a canonical PLT entry (SHN_UNDEF with non-zero st_value)
when taking the address of a function symbol.

This patch should be NFC in terms of the Clang emitted assembly because the case
we don't set dso_local is a case Clang sets dso_local. However, some tests don't
set dso_local on some function declarations and expose some differences. Most
tests have been fixed to be more robust in the previous commit.
The file was modifiedllvm/test/CodeGen/RISCV/mir-target-flags.ll
The file was modifiedllvm/test/CodeGen/X86/or-branch.ll
The file was modifiedllvm/test/CodeGen/X86/abi-isel.ll
The file was modifiedllvm/test/CodeGen/X86/csr-split.ll
The file was modifiedllvm/test/CodeGen/X86/code-model-elf.ll
The file was modifiedllvm/lib/Target/X86/X86Subtarget.cpp
The file was modifiedllvm/test/CodeGen/X86/tailcall.ll
The file was modifiedllvm/test/CodeGen/X86/linux-preemption.ll
The file was modifiedllvm/test/CodeGen/X86/slow-incdec.ll
The file was modifiedllvm/test/CodeGen/X86/no-plt.ll
The file was modifiedllvm/test/CodeGen/ARM/fast-isel-call.ll
The file was modifiedllvm/test/CodeGen/X86/fp-stack-direct-ret.ll
The file was modifiedllvm/test/CodeGen/X86/retpoline.ll
The file was modifiedllvm/test/CodeGen/X86/jump_sign.ll
The file was modifiedllvm/test/CodeGen/X86/absolute-cmp.ll
The file was modifiedllvm/test/CodeGen/X86/absolute-constant.ll
The file was modifiedllvm/test/CodeGen/X86/conditional-tailcall-pgso.ll
The file was modifiedllvm/lib/Target/TargetMachine.cpp
The file was modifiedllvm/test/CodeGen/AArch64/tiny_model.ll