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

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 9 15:50:13 PST 2016


> 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.

-- 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.



More information about the llvm-commits mailing list