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

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 9 15:40:58 PST 2016


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

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.


https://reviews.llvm.org/D27635

Files:
  include/llvm/Linker/IRMover.h
  lib/LTO/LTO.cpp
  lib/Linker/IRMover.cpp
  lib/Linker/LinkModules.cpp
  test/ThinLTO/X86/Inputs/debuginfo-cu-import.ll
  test/ThinLTO/X86/debuginfo-cu-import.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27635.80962.patch
Type: text/x-patch
Size: 12569 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161209/4345969e/attachment.bin>


More information about the llvm-commits mailing list