<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Nov 30, 2016 at 11:38 AM Adrian Prantl via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">aprantl added inline comments.<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
================<br class="gmail_msg">
Comment at: lib/CodeGen/AsmPrinter/DwarfUnit.cpp:303<br class="gmail_msg">
   Die.addValue(DIEValueAllocator, Attribute,<br class="gmail_msg">
-               EntryCU == DieCU ? dwarf::DW_FORM_ref4 : dwarf::DW_FORM_ref_addr,<br class="gmail_msg">
+               EntryCU == CU ? dwarf::DW_FORM_ref4 : dwarf::DW_FORM_ref_addr,<br class="gmail_msg">
                Entry);<br class="gmail_msg">
----------------<br class="gmail_msg">
dblaikie wrote:<br class="gmail_msg">
> Hey Adrian - did you happen to run size numbers on whether this is important? What would happen if we just always used ref_addr when we enabled cross-unit referencing? (wondering if the complexity is worth the benefit - 4 bytes per unit reference isn't nothing, for sure - just wondering how much it is in the end)<br class="gmail_msg">
I just did some numbers on a couple of projects by doing<br class="gmail_msg">
```<br class="gmail_msg">
<br class="gmail_msg">
dwarfdump -F WebKit.framework.dSYM | grep FORM_ref4 |wc -l<br class="gmail_msg">
<br class="gmail_msg">
               WebKit     clang   medium-sized ObjC project<br class="gmail_msg">
===========================================================<br class="gmail_msg">
FORM_ref_addr 7231489  15483428<br class="gmail_msg">
FORM_ref4      189099    555085    189189<br class="gmail_msg">
-----------------------------------------------------------<br class="gmail_msg">
Savings         ~700K       ~2M     ~700K<br class="gmail_msg"></blockquote><div><br></div><div>What's that as a % of the total bytes? (total bytes of the dSYM I guess)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="gmail_msg">
```<br class="gmail_msg">
<br class="gmail_msg">
It's not much in the grand scheme of things, but also not entirely negligible.  Since .dSYM bundles are made to be stored indefinitely I think we should keep every optimization that makes them smaller.<br class="gmail_msg"></blockquote><div><br></div><div>Fair enough - figured it was worth asking - might be worth putting a note in the code about roughly the % this is worth/why we do it.<br><br>- Dave</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="gmail_msg">
<br class="gmail_msg">
<a href="https://reviews.llvm.org/D27170" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D27170</a><br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
</blockquote></div></div>