Reland "[pgo] Avoid introducing relocations by using private alias"
authorPaul Kirth <paulkirth@google.com>
Fri, 9 Dec 2022 00:28:37 +0000 (00:28 +0000)
committerPaul Kirth <paulkirth@google.com>
Fri, 9 Dec 2022 01:28:24 +0000 (01:28 +0000)
commite89e8dcfad364d23515de25ac87d26dfe25badbb
tree58270718a414bf1b09c85c3a6d20cb354a82040a
parent279cc3384e4082aefbea4d1a3762f16547f7a799
Reland "[pgo] Avoid introducing relocations by using private alias"

In many cases, we can use an alias to avoid a symbolic relocations,
instead of using the public, interposable symbol. When the instrumented
function is in a COMDAT, we can use a hidden alias, and still avoid
references to discarded sections.

This version makes the new runtime test a Linux only test.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D137982
compiler-rt/test/profile/Linux/instrprof-discarded-comdat.cpp [new file with mode: 0644]
llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
llvm/test/Transforms/PGOProfile/comdat.ll
llvm/test/Transforms/PGOProfile/prof_avoid_relocs.ll [new file with mode: 0644]