[PATCH] D27170: Abstract almost all DwarfDebug out of the classes in DIE.cpp.

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 30 11:38:45 PST 2016


aprantl added inline comments.


================
Comment at: lib/CodeGen/AsmPrinter/DwarfUnit.cpp:303
   Die.addValue(DIEValueAllocator, Attribute,
-               EntryCU == DieCU ? dwarf::DW_FORM_ref4 : dwarf::DW_FORM_ref_addr,
+               EntryCU == CU ? dwarf::DW_FORM_ref4 : dwarf::DW_FORM_ref_addr,
                Entry);
----------------
dblaikie wrote:
> 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)
I just did some numbers on a couple of projects by doing
```

dwarfdump -F WebKit.framework.dSYM | grep FORM_ref4 |wc -l

               WebKit     clang   medium-sized ObjC project
===========================================================
FORM_ref_addr 7231489  15483428
FORM_ref4      189099    555085    189189
-----------------------------------------------------------
Savings         ~700K       ~2M     ~700K

```

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.


https://reviews.llvm.org/D27170





More information about the llvm-commits mailing list