[all-commits] [llvm/llvm-project] 97ba5c: [InstrProfiling] Use !associated metadata for coun...
Petr Hosek via All-commits
all-commits at lists.llvm.org
Tue Feb 2 23:20:18 PST 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 97ba5cde52664200819446c1a18de28faf2ed1c6
https://github.com/llvm/llvm-project/commit/97ba5cde52664200819446c1a18de28faf2ed1c6
Author: Petr Hosek <phosek at google.com>
Date: 2021-02-02 (Tue, 02 Feb 2021)
Changed paths:
M clang/lib/CodeGen/BackendUtil.cpp
M compiler-rt/test/CMakeLists.txt
M compiler-rt/test/profile/CMakeLists.txt
A compiler-rt/test/profile/instrprof-gc-sections.c
M llvm/include/llvm/Transforms/Instrumentation.h
M llvm/include/llvm/Transforms/Instrumentation/InstrProfiling.h
M llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
M llvm/test/Instrumentation/InstrProfiling/icall.ll
M llvm/test/Instrumentation/InstrProfiling/linkage.ll
A llvm/test/Transforms/PGOProfile/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
C identifier name input sections such as __llvm_prf_* are GC roots so
they cannot be discarded. In LLD, the SHF_LINK_ORDER flag overrides the
C identifier name semantics.
The !associated metadata may be attached to a global object declaration
with a single argument that references another global object, and it
gets lowered to SHF_LINK_ORDER flag. 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.
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