llvm-project/llvm/lib/Transforms
Fangrui Song 04c3040f41 [InstrProfiling] Place __llvm_prf_vnodes and __llvm_prf_names in llvm.used on ELF
`__llvm_prf_vnodes` and `__llvm_prf_names` are used by runtime but not
referenced via relocation in the translation unit.

With `-z start-stop-gc` (D96914 https://sourceware.org/bugzilla/show_bug.cgi?id=27451),
the linker no longer lets `__start_/__stop_` references retain them.

Place `__llvm_prf_vnodes` and `__llvm_prf_names` in `llvm.used` to make
them retained by the linker.

This patch changes most existing `UsedVars` cases to `CompilerUsedVars`
to reflect the ideal state - if the binary format properly supports
section based GC (dead stripping), `llvm.compiler.used` should be sufficient.

`__llvm_prf_vnodes` and `__llvm_prf_names` are switched to `UsedVars`
since we want them to be unconditionally retained by both compiler and linker.

Behaviors on other COFF/Mach-O are not affected.

Differential Revision: https://reviews.llvm.org/D97649
2021-03-01 13:43:23 -08:00
..
AggressiveInstCombine [Transforms] Use llvm::append_range (NFC) 2021-01-20 21:35:54 -08:00
CFGuard llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
Coroutines Add a nullptr check. 2021-02-25 12:01:11 -08:00
Hello
IPO Move EntryExitInstrumentation pass location 2021-03-01 10:08:10 -08:00
InstCombine [InstCombine] avoid infinite loop in demanded bits for select 2021-02-28 10:17:53 -05:00
Instrumentation [InstrProfiling] Place __llvm_prf_vnodes and __llvm_prf_names in llvm.used on ELF 2021-03-01 13:43:23 -08:00
ObjCARC [ObjC][ARC] Do not perform code motion on precise release calls 2021-02-15 17:39:37 -08:00
Scalar [llvm] Use set_is_subset (NFC) 2021-02-28 10:59:20 -08:00
Utils [LV] Generate RT checks up-front and remove them if required. 2021-03-01 10:48:04 +00:00
Vectorize [VPlan] Remove recipes from back to front. 2021-03-01 16:06:30 +00:00
CMakeLists.txt [NewPM][HelloWorld] Move HelloWorld to Utils 2021-02-03 12:59:40 -08:00