[all-commits] [llvm/llvm-project] 39b3c4: [InstrProfiling] Use !associated metadata for coun...

Petr Hosek via All-commits all-commits at lists.llvm.org
Mon Jun 8 13:36:35 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 39b3c41b65302a969fa5507402976a255a07c158
      https://github.com/llvm/llvm-project/commit/39b3c41b65302a969fa5507402976a255a07c158
  Author: Petr Hosek <phosek at google.com>
  Date:   2020-06-08 (Mon, 08 Jun 2020)

  Changed paths:
    M compiler-rt/lib/profile/InstrProfilingPlatformLinux.c
    A compiler-rt/test/profile/instrprof-gc-sections.c
    M llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
    A llvm/test/Instrumentation/InstrProfiling/associated.ll
    M llvm/test/Transforms/PGOProfile/counter_promo.ll
    M llvm/test/Transforms/PGOProfile/counter_promo_mexits.ll

  Log Message:
  -----------
  [InstrProfiling] Use !associated metadata for counters, data and values

The !associated metadata may be attached to a global object declaration
with a single argument that references another global object. This
metadata prevents discarding of the global object in linker GC unless
the referenced object is also discarded.

Furthermore, when a function symbol is discarded by the linker, setting
up !associated metadata allows linker to discard counters, data and
values associated with that function symbol. This is not possible today
because there's metadata to guide the linker. This approach is also used
by other instrumentations like sanitizers.

Note that !associated metadata is only supported by ELF, it does not have
any effect on non-ELF targets.

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




More information about the All-commits mailing list