[all-commits] [llvm/llvm-project] 5ca211: [InstrProfiling] Use ELF section groups for counte...

Petr Hosek via All-commits all-commits at lists.llvm.org
Sun Feb 21 16:13:43 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5ca21175e09fc7fb7dcaee9ebd6782d122a5688f
      https://github.com/llvm/llvm-project/commit/5ca21175e09fc7fb7dcaee9ebd6782d122a5688f
  Author: Petr Hosek <phosek at google.com>
  Date:   2021-02-21 (Sun, 21 Feb 2021)

  Changed paths:
    M compiler-rt/test/CMakeLists.txt
    M compiler-rt/test/profile/CMakeLists.txt
    A compiler-rt/test/profile/instrprof-gc-sections.c
    M llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
    M llvm/test/Instrumentation/InstrProfiling/icall.ll
    M llvm/test/Instrumentation/InstrProfiling/linkage.ll
    M llvm/test/Instrumentation/InstrProfiling/platform.ll
    M llvm/test/Transforms/PGOProfile/counter_promo.ll
    M llvm/test/Transforms/PGOProfile/counter_promo_mexits.ll

  Log Message:
  -----------
  [InstrProfiling] Use ELF section groups for counters, data and values

__start_/__stop_ references retain C identifier name sections such as
__llvm_prf_*. Putting these into a section group disables this logic.

The ELF section group semantics ensures that group members are retained
or discarded as a unit. When a function symbol is discarded, this allows
allows linker to discard counters, data and values associated with that
function symbol as well.

Note that `noduplicates` COMDAT is lowered to zero-flag section group in
ELF. We only set this for functions that aren't already in a COMDAT and
for those that don't have available_externally linkage since we already
use regular COMDAT groups for those.

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




More information about the All-commits mailing list