[PATCH] D154638: Emit a .debug_addr section with dsymutil

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 19 13:42:48 PDT 2023


avl added inline comments.


================
Comment at: llvm/lib/DWARFLinker/DWARFLinker.cpp:1398
+
+  assert((AttrSpec.Form == dwarf::DW_FORM_addrx) ||
+         (AttrSpec.Form == dwarf::DW_FORM_addrx1 &&
----------------
aprantl wrote:
> avl wrote:
> > aprantl wrote:
> > > This is the first time I'm reading through the patch, so I might be missing something: Since the address pool is growing as we are processing multiple object files, shouldn't we dynamically decide on the FORM based on the value of `AddrIndex`? Or is this happening elsewhere already?
> > the generated .debug_addr is local for compile unit. The number of addresses usually should not be increased for single compile unit. So we can use original form which was enough to keep source addresses.
> > 
> Ah I see. So, sorting the addresses by frequency and merging them into a global address pool would be a future optimization.
yep. I assume that the idea of that optimization is to save space. So that most used addresses has smaller index and it would be possible to use smaller fixed sized form. 

It would be interesting to measure how that optimization affects abbreviations. It should increase numbers of abbreviations and size of some DIEs(since every DIE has abbreviation number in the beggining)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154638/new/

https://reviews.llvm.org/D154638



More information about the llvm-commits mailing list