[InstrProfiling] Make __profd_ unconditionally private for ELF
authorFangrui Song <i@maskray.me>
Thu, 17 Jun 2021 21:16:54 +0000 (14:16 -0700)
committerFangrui Song <i@maskray.me>
Thu, 17 Jun 2021 21:16:54 +0000 (14:16 -0700)
commit76d0747e0807307780ba84cbd7e5c80b20c26bd7
tree252f69424625ba27c7be64086470334b19b0e303
parent99e95856fb785cb22d898e963a54e8d9a8459fc7
[InstrProfiling] Make __profd_ unconditionally private for ELF

For ELF, since all counters/data are in a section group (either `comdat any` or
`comdat noduplicates`), and the signature for `comdat any` is `__profc_`, the
D1003372 optimization prerequisite (linker GC cannot discard data variables
while the text section is retained) is always satisified, we can make __profd_
unconditionally private.

Reviewed By: davidxl, rnk

Differential Revision: https://reviews.llvm.org/D103717
llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
llvm/test/Transforms/PGOProfile/indirect_call_profile.ll