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

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 14:25:14 PST 2016


tejohnson added inline comments.

================
Comment at: lib/Transforms/IPO/FunctionImport.cpp:308
@@ +307,3 @@
+    // If modules were created with lazy metadata loading, materialize it
+    // now, before linking it (otherwise this will be a noop).
+    SrcModule->materializeMetadata();
----------------
joker.eph wrote:
> Not at the same scale: my point is to materialize only the metatadata referenced by the function being materialized, so it is not the same as materializing *all* the metadata: if we import one function from a module we would be able to materialize only the needed metadata.
Oh I see. I thought you were suggesting that I move this call to materializeMetadata into the materialize() call for a function.

What you are suggesting would be interesting, but right now isn't supported as metadata materialization involves parsing all of the module level metadata. Presumably with the approach you are describing it would need to be parsed for each function materialized and somehow only the records of interest would be recorded? The metadata is correlated to references by the index into the MetadataList, which is populated while parsing. You won't even know which metadata values you need until you parse the function, at which point you have already created the forward references. Sorry if I am missing something.


http://reviews.llvm.org/D16424





More information about the llvm-commits mailing list