[all-commits] [llvm/llvm-project] f2916b: Reland [pgo] Avoid introducing relocations by usin...

Paul Kirth via All-commits all-commits at lists.llvm.org
Wed Jan 25 14:19:36 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f2916becc572047915f537c9abc2b04562c4bdb8
      https://github.com/llvm/llvm-project/commit/f2916becc572047915f537c9abc2b04562c4bdb8
  Author: Paul Kirth <paulkirth at google.com>
  Date:   2023-01-25 (Wed, 25 Jan 2023)

  Changed paths:
    A compiler-rt/test/profile/instrprof-discarded-comdat.cpp
    M llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
    M llvm/test/Transforms/PGOProfile/comdat.ll
    A llvm/test/Transforms/PGOProfile/profdata_priv_alias.ll

  Log Message:
  -----------
  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.

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.

https://reviews.llvm.org/rG20894a478da224bdd69c91a22a5175b28bc08ed9
removed an incorrect assertion on Mach-O which caused assertion failures in LLD.

We prevent duplicate symbols under ThinLTO + PGO + CFI by disabling
alias generation when the target function has MD_type metadata used in
CFI.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D137982




More information about the All-commits mailing list