<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 8, 2015 at 12:19 PM, Pete Cooper <span dir="ltr"><<a href="mailto:peter_cooper@apple.com" target="_blank">peter_cooper@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all<br>
<br>
Recent work by Rafael and Duncan has greatly reduced the number of MCSymbol’s which are actually named.  In particular, temporary symbols typically don’t need names.  On the verify_uselist_order test case for example, only around 50,000 symbols have names out of 700,000 total symbols.<br>
<br>
This patch moves the storage for the Name* itself to be allocated prior to the MCSymbol. </blockquote><div><br>Any particular reason it goes before rather than after? (I know some of our data structures put things after)<br><br>There's no need to reinterpret_cast to MCSymbol when you just want a void* in operator new. <br><br>The alignment of the allocation might be interesting - given that it needs to be aligned as much as a pointer, not just MCSymbol (I assume MCSymbol is at least as aligned as a pointer right now, so you probably get this for free/correct without explicitly accounting for it)<br><br>The extra indirection hidden behind NameTy is a bit confusing (especially since you have pointers to it - so it's pointers on pointers). <br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> This is similar to how User allocates Use’s in a custom new/delete.<br>
<br>
Given that a symbol is currently 48 bytes on MachO, this reduces it by 16% on the typical case.  I have other patches coming which will get us to 24-bytes which is on average half the current amount.<br>
<br>
Cheers,<br>
Pete<br>
<br>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div></div>