diff options
author | Fangrui Song <i@maskray.me> | 2023-06-17 15:40:19 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2023-06-17 15:40:20 -0700 |
commit | 2cb8d5ca3ad01c71b6481bd09779b4e82ccf8196 (patch) | |
tree | b993b9438fec17709f6528bfe73e0af7127ff802 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 8411bdb0acde8569c9bfcd08401fa587f7dea834 (diff) | |
download | llvm-2cb8d5ca3ad01c71b6481bd09779b4e82ccf8196.zip llvm-2cb8d5ca3ad01c71b6481bd09779b4e82ccf8196.tar.gz llvm-2cb8d5ca3ad01c71b6481bd09779b4e82ccf8196.tar.bz2 |
[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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions