Revert "Reland "[pgo] Avoid introducing relocations by using private alias""
authorHans Wennborg <hans@chromium.org>
Wed, 21 Dec 2022 14:21:04 +0000 (15:21 +0100)
committerHans Wennborg <hans@chromium.org>
Wed, 21 Dec 2022 14:29:00 +0000 (15:29 +0100)
commitfd0ca2c4e935cb2d8de95f016d7a08229af695da
treec7be5f5ac9a401600df5af6b98fdf5235e554e49
parenta80edb7fc96c1620b2b99d6e6a2c018eb021d083
Revert "Reland "[pgo] Avoid introducing relocations by using private alias""

This caused lld on mac to assert when building instrumented clang (or
instrumented code in general). See comment on the code review for
reproducer.

> 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.
>
> New compiler-rt tests are Linux only for now.
>
> Previous versions of this patch allowed the compiler to name the
> generated alias, but that would only be valid when the functions were
> local. Since the alias may be used across TUs we use a more
> deterministic naming convention, and add a `.local` suffix to the alias
> name just as we do for relative vtables aliases.
>
> Reviewed By: phosek
>
> Differential Revision: https://reviews.llvm.org/D137982

This reverts commit c42e50fede53bbcce79095e7c8115f26826c81ae.
compiler-rt/test/profile/Linux/instrprof-discarded-comdat.cpp [deleted file]
llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
llvm/test/Transforms/PGOProfile/comdat.ll
llvm/test/Transforms/PGOProfile/prof_avoid_relocs.ll [deleted file]