[PATCH] D27635: [ThinLTO] Import only necessary DICompileUnit fields

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 9 16:16:44 PST 2016


On Fri, Dec 9, 2016 at 3:50 PM, Adrian Prantl <aprantl at apple.com> wrote:

>
> > On Dec 9, 2016, at 3:40 PM, Teresa Johnson via Phabricator <
> reviews at reviews.llvm.org> wrote:
> >
> > tejohnson created this revision.
> > tejohnson added reviewers: mehdi_amini, dexonsmith, dblaikie, aprantl.
> > tejohnson added a subscriber: llvm-commits.
> >
> > As discussed on mailing list, for ThinLTO importing we don't need
> > to import all the fields of the DICompileUnit. Don't import enums,
> > macros, retained types lists. Also only import local scoped imported
> > entities. Since we don't currently import any global variables,
> > we also don't need to import the list of global variables (added an
> > assert to verify none are being imported).
>
> Just to be sure I understand the reasoning: We are not importing the list
> of global variables when importing a CU for the purpose of ThinLTO-inling
> and there will be no regression in debug info quality, because we will
> still emit the debug info for the global variables listed in said CU when
> we compile the one .o file where that CU came from.
>

Right. And I have an assert there to verify that we aren't importing any.
In the future we may change this, and would need to put any that were
imported onto the imported CU. Thanks, Teresa


> -- adrian
>
> >
> > This is being done by pre-populating the value map entries to map
> > the unneeded metadata to nullptr. For the imported entities, we can
> > simply replace the source module's list with a new list containing
> > only those needed imported entities. This is done in the IRLinker
> > constructor so that value mapping automatically does the desired
> > mapping.
>
>


-- 
Teresa Johnson |  Software Engineer |  tejohnson at google.com |  408-460-2413
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161209/7e083dc1/attachment.html>


More information about the llvm-commits mailing list