<p dir="ltr">For now we should just not be lazy. A very big future task is making lazy loading work so that we don't even read metadata we don't need.</p>
<p dir="ltr">Cheers,<br>
Rafael</p>
<div class="gmail_quote">On Mar 9, 2016 9:33 AM, "Teresa Johnson" <<a href="mailto:tejohnson@google.com">tejohnson@google.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">tejohnson added a subscriber: tejohnson.<br>
tejohnson added a comment.<br>
<br>
With lazy metadata loading something needs to call materializeMetadata before the IRMover is invoked. Not sure there is an advantage to delaying it in this case, but see the suggestion below for where that could be done.<br>
<br>
Rafael, should the IRLinker just always invoke materializeMetadata on the module (if shouldLinkMetadata() is true, which will avoid doing that if we plan to do post-pass metadata linking for ThinLTO)? I'm already invoking materializeMetadata when we detect we are in the postpass md linking. Probably could just move that outside the IsMetadataLinkingPostpass guard in IRMover.cpp. I can send a patch right now to do that, I don't know how to test lld but Sean can give it a try.<br>
<br>
<br>
================<br>
Comment at: ELF/SymbolTable.cpp:147<br>
@@ -146,3 +146,3 @@<br>
   }<br>
   Mover.move(std::move(M), Keep, [](GlobalValue &, IRMover::ValueAdder) {});<br>
 }<br>
----------------<br>
Call M->materializeMetadata() above here as an alternative.<br>
<br>
<br>
<a href="http://reviews.llvm.org/D17982" rel="noreferrer" target="_blank">http://reviews.llvm.org/D17982</a><br>
<br>
<br>
<br>
</blockquote></div>