<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 13, 2015 at 2:48 PM, Duncan P. N. Exon Smith <span dir="ltr"><<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Right now MC is optimized for emitting assembly, but as Rafael pointed<br>
out to me over IRC the optimized path should be emitting object files.<br>
<br>
This WIP patch moves MCSymbolData into MCSymbol.h and makes it a<br>
field inside MCSymbol.  This eliminates a pointer from MCSymbolData back<br>
to MCSymbol, the DenseMap<const MCSymbol *, MCSymbolData *> in<br>
MCAssembler, and converts the iplist in MCAssembler into a std::vector<br>
(along with some churn to pass around MCSymbols instead of<br>
MCSymbolData).  As a result, during object emission we save ~6 pointers<br>
per MCSymbol, eliminate lookup indirection between MCSymbol and<br>
MCSymbolData, and avoid allocation overhead for MCSymbolData.<br>
<br>
I've measured ~4% memory savings on `llc` with this patch (using the<br>
same -flto -g input as r236642 and r236629 before it), dropping memory<br>
usage from 1058 MB down to 1017 MB.<br>
<br>
Before I clean this up and commit it (obviously in more incremental<br>
patches (and I'll do the same cleanup for MCSection)), I wanted to<br>
confirm the direction.<br></blockquote><div><br>I've no real idea if it's the right direction - but I was certainly mystified by the various indirections here a while back (when implementing DWARF compression) & made some (failed) attempts to reconcile them.<br><br>You mentioned this is is a matter of optimizing for object output rather than asm output - do you have stats on how much this hurts asm output performance, then?<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div></div>