[PATCH] D80186: [Inliner] Update !associated metadata during inlining

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 2 00:31:21 PDT 2020


phosek added a comment.

In D80186#2067298 <https://reviews.llvm.org/D80186#2067298>, @pcc wrote:

> Yeah. Thinking about it more, you may consider a different `!associated` scheme for the `__prof*_` globals.
>
> - `__profc_*` and `__profn_*` are associated with a dummy global (to allow the sections to be GC'd).
> - `__profd_*` is associated with the corresponding `__profc_*` section.
>
>   Now no special rules are required for inlining. `__profc_*` is kept alive via the references in the functions, `__profd_` is kept alive via `!associated` and `__profn_*` is kept alive by direct reference.


I tried that, but now we get an error `ld.lld: error: /tmp/instrprof-gc-sections-5f007f.o:(__llvm_prf_cnts): sh_link points to discarded section /tmp/instrprof-gc-sections-5f007f.o:(__llvm_prf_dummy)` because the dummy global was discarded which creates a broken `sh_link`.


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

https://reviews.llvm.org/D80186





More information about the llvm-commits mailing list