[PATCH] D25456: [InstrProf] Add support for dead_strip+live_support functionality

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 10 14:25:16 PDT 2021


vsk added a comment.

In D25456#2796732 <https://reviews.llvm.org/D25456#2796732>, @MaskRay wrote:

> In D25456#2794689 <https://reviews.llvm.org/D25456#2794689>, @vsk wrote:
>
>> If llvm stopped appending __profd_foo to llvm.compiler.used, there might not be anything left to prevent the optimizer from discarding it. The current scheme of having the linker ignore N_NO_DEAD_STRIP if S_ATTR_LIVE_SUPPORT is in effect seems like a neat way to solve the issue. Is there a tidy alternative?
>
> Currently `__profd_foo` is in llvm.used instead of llvm.compiler.used on Mach-O.
>
> D103372 <https://reviews.llvm.org/D103372> My thought (but I don't have a device to test) is that Mach-O can use `appendToCompilerUsed(*M, CompilerUsedVars);` as well.

That's a good point: adding __profd_X to llvm.compiler.used should prevent llvm's optimizer from deleting it. But is it sufficient to guarantee that linker (ld64/lld.macho) optimizations will not delete it?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D25456/new/

https://reviews.llvm.org/D25456



More information about the llvm-commits mailing list