[all-commits] [llvm/llvm-project] 2cb8d5: [Pseudo Probe] Do not place functions in nodedupli...

Fangrui Song via All-commits all-commits at lists.llvm.org
Sat Jun 17 15:40:33 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2cb8d5ca3ad01c71b6481bd09779b4e82ccf8196
      https://github.com/llvm/llvm-project/commit/2cb8d5ca3ad01c71b6481bd09779b4e82ccf8196
  Author: Fangrui Song <i at maskray.me>
  Date:   2023-06-17 (Sat, 17 Jun 2023)

  Changed paths:
    M llvm/lib/Transforms/IPO/SampleProfileProbe.cpp
    M llvm/test/Transforms/SampleProfile/pseudo-probe-emit.ll

  Log Message:
  -----------
  [Pseudo Probe] Do not place functions in nodeduplicate COMDATs

For a function not in an IR COMDAT, currently we place it into a nodeduplicate IR
COMDAT so that its text section and its associated .pseudo_probe section will be
in the same section group, which can be retained or discarded by the linker as a
unit. However, the section group wastes space.

After D153189 uses SHF_LINK_ORDER to ensure a .pseudo_probe section will be
discarded when its associated text section is discarded, we can remove the
nodeduplicate IR change.

In the following example, the .pseudo_probe associated with .text.f is discarded as expected.
```
clang -c -ffunction-sections -fpseudo-probe-for-profiling -xc =(printf 'void _start(){} void f(){}') -o a.o
ld.lld --gc-sections --print-gc-sections a.o
```

Reviewed By: hoy

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




More information about the All-commits mailing list