Reland "[pgo] Avoid introducing relocations by using private alias""
authorPaul Kirth <paulkirth@google.com>
Fri, 2 Dec 2022 00:21:20 +0000 (00:21 +0000)
committerPaul Kirth <paulkirth@google.com>
Thu, 8 Dec 2022 17:37:17 +0000 (17:37 +0000)
commit071c39df8632561b599f7b1debd81b3cf6b5b396
tree81ba1040b3bab2e0e1a5b60a508688bc3debaad4
parent4f7e5d22060e8a89237ffb93c3e7be6e92fee8fe
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.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D137982
compiler-rt/test/profile/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]