[PATCH] D16424: [ThinLTO] Do metadata linking during batch function importing

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 16:02:22 PST 2016


tejohnson added a comment.

In http://reviews.llvm.org/D16424#332826, @joker.eph wrote:

> What I have in mind is to `rememberAndSkipMetadata()` when parsing the module. But embedded the implementation in `BitcodeReaderMetadataList` so that whenever we call `getValueFwdRef` we don't create a placeholder (if the ID is one of the module-level constant) but parse the metadata on-demand. I should be able to craft something quickly.


Note that the metadata value ids are assigned implicitly based on the order of the metadata records. Will you only parse the needed records, skipping the intermediate ones, while counting metadata value ids that would be assigned by skipped MD records that assign values (all but METADATA_NAME)? You'd need to go back and parse the skipped records on backwards references within the metadata. Otherwise, you'd have to parse all MD records up through the ones needed for the imported function (presumably leading to overhead from saving them, unless you can remove the ones that weren't actually needed by the imported function - but then they may need to be reparsed later for a different imported function).

In the meantime, should we put this patch in, since it is a simple change and should improve your situation give the current bulk importing? Most of this is needed regardless of whether you are able to parse just the needed metadata.


http://reviews.llvm.org/D16424





More information about the llvm-commits mailing list