[PATCH] D152595: [PseudoProbe] Disgard probes for dead functions.
Hongtao Yu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 13 09:19:54 PDT 2023
hoy added a comment.
In D152595#4416048 <https://reviews.llvm.org/D152595#4416048>, @wenlei wrote:
>> Currently probes are emitted along with the binary code for functions and the linker is responsible for removing dead code. For probes, the linker can also remove them with the implementation
>
> why do we still have probe for dead functions with this current implementation though?
The current implementation doesn't place pseudo probes in the same comdat group with the text section, so a probe section won't be removed when the corresponding text section is dead removed by the linker. This is what D146853 <https://reviews.llvm.org/D146853> is supposed to fix.
Dead probes can be completed removed by the thinLTO backend only. The only ones survive are for the functions removed by the native linker.
>> Very little.
>
> How much in terms .pseudo_probe section size?
Less than 1% savings when I enabled D146853 <https://reviews.llvm.org/D146853>.
>> I'm switching to the implementation D152546 <https://reviews.llvm.org/D152546>: [Pseudo Probe] Placing .pseudoprobe section in a comdat group, which doesn't enable the linker to remove dead probes but has other benefits.
>
> It looks the trade off with the new implementation is that, we would allow ICF for probe section, but would also disable REF when its associated code is being removed?
Right, there is no connection between probes and code with the new implementation. It has a benefit of fully deduplicating probes even for static functions injected by the compiler which does not have unique linkage name.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152595/new/
https://reviews.llvm.org/D152595
More information about the llvm-commits
mailing list