[PATCH] D14752: Metadata mapping for ThinLTO

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 19 09:13:43 PST 2015


As discussed with Mehdi on IRC, I am going to split this up a bit. The
first part is the new MODULE_CODE_METADATA_VALUES record, which just
went out in D14825. I will split out the metadata post-pass linking
mechanics and send as a follow-up next, and finally the part that
suppresses linking of unneeded SPs.

As mentioned in the description of D14825, I made a change to this
support when splitting it out to get more consistent assertion
checking of the record value with and without lazy metadata loading,
so that all regression tests that generate new bitcode essentially act
as tests.

On Tue, Nov 17, 2015 at 11:32 AM, Teresa Johnson <tejohnson at google.com> wrote:
> 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
>



-- 
Teresa Johnson | Software Engineer | tejohnson at google.com | 408-460-2413


More information about the llvm-commits mailing list