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

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 3 01:03:16 PDT 2020


phosek added a comment.

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

> In D80186#2068055 <https://reviews.llvm.org/D80186#2068055>, @phosek wrote:
>
> > 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`.
>
>
> Hmm. Maybe instead of making the sections sh_link to a dummy global, make them sh_link to themselves. There was a proposal for sh_link=0 to mean what we want here (D72904 <https://reviews.llvm.org/D72904>) but I believe that sh_link=self should have the same semantics.


Thanks, that seems to work!


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

https://reviews.llvm.org/D80186





More information about the llvm-commits mailing list