[PATCH] D36300: WIP: DebugInfo: Use base address and offset pairs in debug_loc.dwo to reduce required relocations

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 3 19:39:01 PDT 2017


dblaikie created this revision.

This isn't quite finished, but a prototype that reduces the number of
debug_addr relocs in a large internal optimized binary by 40% substantially
reducing total object file size, which would be nice.

1. Needs testing (updating existing test cases, maybe adding more - could check

about the number of relocations, etc)

2. Needs work either way once determined if a debug location address range

could start at the very beginning of a function (then a range might be shorter
using startx_length than base_address+offset_pair)

3. Maybe it's simpler to have two separate implementations rather than

generalizing the debug_ranges handling (especially if there's currently no
debug_loc generated for global variables (or no other way a variable could have
live ranges in more than one section))

4. Comments

5. Should DwarfDebug use MCStreamer directly for the ULEB label difference

(that's what it's doing in this version) or should it use an
AsmPrinter/MCStreamer API to match the non-ULEB label difference (I've
prototyped the MCStreamer/AsmPrinter APIs in this change - though they're not
wired up to DwarfDebug - just to show the rough scale of the code, mostly it's
just copy/pasted from the non-ULEB label difference codepath)

Oh, and Paul: This'll probably come in handy/can be reused for the rnglist
support (& generalized further for all the DWARF5 forms for use in loclist -
though I imagine we'll still only need to generate a subset of the forms -
maybe still only these 2 or 3 depending on what's being proritized (object
size, executable size, number of relocations)


https://reviews.llvm.org/D36300

Files:
  include/llvm/CodeGen/AsmPrinter.h
  include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h
  include/llvm/MC/MCObjectStreamer.h
  include/llvm/MC/MCStreamer.h
  lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  lib/CodeGen/AsmPrinter/DwarfDebug.h
  lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
  lib/MC/MCObjectStreamer.cpp
  lib/MC/MCStreamer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36300.109675.patch
Type: text/x-patch
Size: 16334 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170804/c2f8d27e/attachment.bin>


More information about the llvm-commits mailing list