[PATCH] D14752: Metadata mapping for ThinLTO

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 17 11:32:52 PST 2015


tejohnson created this revision.
tejohnson added reviewers: dexonsmith, joker.eph.
tejohnson added subscribers: llvm-commits, davidxl.
Herald added a subscriber: joker.eph.

Maps metadata as a post-pass from each module when importing complete,
suturing up final metadata to the temporary metadata left on the imported
instructions.

This entails saving the mapping from bitcode value id to temporary
metadata in the importing pass, and from bitcode value id to final
metadata during the metadata linking postpass.

Also, to avoid needing to parse the module level metadata during
function importing, a new module-level record is added which holds the
number of module-level metadata values. This is required because
metadata value ids are assigned implicitly during parsing, and the
function-level metadata ids start after the module-level metadata ids.

Additionally, only map in needed DISubroutine metadata (imported functions
and other DISubroutine transitively needed by those). This is also
supported for LTO and llvm-link --only-needed (with associated tests).

http://reviews.llvm.org/D14752

Files:
  include/llvm/Bitcode/LLVMBitCodes.h
  include/llvm/IR/DebugInfoMetadata.h
  include/llvm/IR/GVMaterializer.h
  include/llvm/IR/Metadata.h
  include/llvm/IR/TrackingMDRef.h
  include/llvm/IRReader/IRReader.h
  include/llvm/Linker/Linker.h
  include/llvm/Transforms/Utils/ValueMapper.h
  lib/Bitcode/Reader/BitcodeReader.cpp
  lib/Bitcode/Writer/BitcodeWriter.cpp
  lib/Bitcode/Writer/ValueEnumerator.h
  lib/IR/Metadata.cpp
  lib/IRReader/IRReader.cpp
  lib/Linker/LinkModules.cpp
  lib/Transforms/Utils/ValueMapper.cpp
  test/Linker/Inputs/only-needed-debug-metadata.ll
  test/Linker/Inputs/thinlto_funcimport_debug.ll
  test/Linker/only-needed-debug-metadata.ll
  test/Linker/thinlto_funcimport_debug.ll
  test/tools/gold/X86/Inputs/linkonce-weak.ll
  test/tools/gold/X86/linkonce-weak.ll
  tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
  tools/llvm-link/llvm-link.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14752.40415.patch
Type: text/x-patch
Size: 67388 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151117/52bd620f/attachment-0001.bin>


More information about the llvm-commits mailing list