[PATCH] D97585: [InstrProfiling] Use llvm.compiler.used instead of llvm.used for ELF
Reid Kleckner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 1 11:38:45 PST 2021
rnk added a comment.
Wait, are you telling me that `__profd/__profc` data can participate in linker GC, and that is not a problem? I have actually had to optimize the processing of `/INCLUDE:` directives for COFF (D78845 <https://reviews.llvm.org/D78845>), because I assumed that it was critical that `__profd` be treated as a GC root. But, on ELF, they were never GC roots, and coverage/PGO has worked just fine there. So, really, all along, llvm.used was only being used to block LLVM IPO transforms like globalopt, not to establish a GC root. And, as you point out, we don't get the GC root behavior for internal `__profd/__profc` globals, and coverage/PGO seems to work fine.
What about MachO? Should all platforms not treat __profd as a GC root?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97585/new/
https://reviews.llvm.org/D97585
More information about the llvm-commits
mailing list