[test] Improve PGO tests
Revert "[InstrProfiling] Place __llvm_prf_vnodes and __llvm_prf_names in llvm.used on ELF"This reverts commit 04c3040f417683e7c31b3ee3381a3263106f48c5.Breaks instrprof-value-merge.c in bootstrap b
Revert "[InstrProfiling] Place __llvm_prf_vnodes and __llvm_prf_names in llvm.used on ELF"This reverts commit 04c3040f417683e7c31b3ee3381a3263106f48c5.Breaks instrprof-value-merge.c in bootstrap builds.
show more ...
[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 notreferenced via relocation in the translation
[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 notreferenced 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 makethem retained by the linker.This patch changes most existing `UsedVars` cases to `CompilerUsedVars`to reflect the ideal state - if the binary format properly supportssection 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