aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2021-03-03 11:32:24 -0800
committerFangrui Song <i@maskray.me>2021-03-03 11:32:24 -0800
commita84f4fc0dfcd0c0d249c3071f9bc5de0c56b6cca (patch)
tree8e6b6e034e4e1df11f6cdb0c3b194d3ea561bd02 /llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
parent75df61e93d22c5225469142bf79592bce4ffb3de (diff)
downloadllvm-a84f4fc0dfcd0c0d249c3071f9bc5de0c56b6cca.zip
llvm-a84f4fc0dfcd0c0d249c3071f9bc5de0c56b6cca.tar.gz
llvm-a84f4fc0dfcd0c0d249c3071f9bc5de0c56b6cca.tar.bz2
[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` (LLD 13 (D96914); GNU ld 2.37 https://sourceware.org/bugzilla/show_bug.cgi?id=27451), the linker does not let `__start_/__stop_` references retain their sections. 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 COFF/Mach-O are not affected. Reviewed By: davidxl Differential Revision: https://reviews.llvm.org/D97649
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp')
0 files changed, 0 insertions, 0 deletions