This is an archive of the discontinued LLVM Phabricator instance.

Metadata mapping for ThinLTO
AbandonedPublic

Authored by tejohnson on Nov 17 2015, 11:32 AM.

Details

Summary

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

Diff Detail

Event Timeline

tejohnson updated this revision to Diff 40415.Nov 17 2015, 11:32 AM
tejohnson retitled this revision from to Metadata mapping for ThinLTO.
tejohnson updated this object.
tejohnson added reviewers: dexonsmith, mehdi_amini.
tejohnson added subscribers: llvm-commits, davidxl.

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.

tejohnson abandoned this revision.Dec 18 2015, 10:59 AM

Obsolete - this was split into 3 separate patches that have since gone in.