<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 8, 2015, at 1:11 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Jun 8, 2015 at 12:19 PM, Pete Cooper <span dir="ltr" class=""><<a href="mailto:peter_cooper@apple.com" target="_blank" class="">peter_cooper@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all<br class="">
<br class="">
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 class="">
<br class="">
This patch moves the storage for the Name* itself to be allocated prior to the MCSymbol. </blockquote><div class=""><br class="">Any particular reason it goes before rather than after? (I know some of our data structures put things after)<br class=""></div></div></div></div></div></blockquote>There’s a couple of subclasses of MCSymbol - MCSymbolCOFF and MCSymbolELF - so i thought it would be tricker to put it after those.<br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class="">There's no need to reinterpret_cast to MCSymbol when you just want a void* in operator new. <br class=""></div></div></div></div></div></blockquote>Good catch.  Thanks.  I’ll fix that.<br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class="">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 class=""></div></div></div></div></div></blockquote>Thats true.  There are currently pointers in there, but good to be explicit about it.  I’ll fix that too.<br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class="">The extra indirection hidden behind NameTy is a bit confusing (especially since you have pointers to it - so it's pointers on pointers). <br class=""></div></div></div></div></div></blockquote>Yeah, I see what you mean.  I’ll move the * out of NameTy.</div><div><br class=""></div><div>Thanks for the comments.  I’ll send out an updated patch shortly.</div><div><br class=""></div><div>Cheers,</div><div>Pete<br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""> </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 class="">
<br class="">
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 class="">
<br class="">
Cheers,<br class="">
Pete<br class="">
<br class="">
<br class="">_______________________________________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@cs.uiuc.edu" class="">llvm-commits@cs.uiuc.edu</a><br class="">
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br class="">
<br class=""></blockquote></div><br class=""></div></div>
</div></blockquote></div><br class=""></body></html>