[all-commits] [llvm/llvm-project] c42e50: Reland "[pgo] Avoid introducing relocations by usi...

Paul Kirth via All-commits all-commits at lists.llvm.org
Mon Dec 19 10:46:13 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c42e50fede53bbcce79095e7c8115f26826c81ae
      https://github.com/llvm/llvm-project/commit/c42e50fede53bbcce79095e7c8115f26826c81ae
  Author: Paul Kirth <paulkirth at google.com>
  Date:   2022-12-19 (Mon, 19 Dec 2022)

  Changed paths:
    A compiler-rt/test/profile/Linux/instrprof-discarded-comdat.cpp
    M llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
    M llvm/test/Transforms/PGOProfile/comdat.ll
    A llvm/test/Transforms/PGOProfile/prof_avoid_relocs.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.

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




More information about the All-commits mailing list