[PATCH] D79571: [DebugInfo][DWARF] Emit a single location instead of a location list

Orlando Cazalet-Hyams via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 7 06:45:50 PDT 2020


Orlando created this revision.
Orlando added reviewers: jmorse, vsk, dstenb, aprantl.
Orlando added projects: debug-info, LLVM.
Herald added subscribers: llvm-commits, hiraditya.
Orlando added a reviewer: dblaikie.

for variables in nested scopes (including inlined functions) if there is a
single location which covers the entire scope if the scope is contained in a
single basic block, and add a test for this.

With this change there are still scenarios where we can, but do not, emit a
single location for a variable. Still, this change significantly reduces the
size of .debug_loc for a clang-3.4 build and reduces the size of the .debug_info
section slightly too.

  Compiler vs section size
  *----------------------------------------------* 
  |             | trunk     | patched   | change |
  |             | (bytes)   | (bytes)   | (%)    |
  |-------------|-----------|-----------|--------|
  | .debug_loc  | 152128993 | 104924892 | -31.03 |
  | .debug_info | 346249712 | 345249350 | -00.29 |
  | file size   | 621497992 | 573304448 | -07.75 |
  *----------------------------------------------* 

As @jmorse mentioned here [0], it would be nice to not have to linearly scan,
but I don't think that can be avoided right now.

[0]: https://reviews.llvm.org/D77639#1969189


https://reviews.llvm.org/D79571

Files:
  llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  llvm/test/DebugInfo/X86/single-location.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79571.262631.patch
Type: text/x-patch
Size: 5512 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200507/a7452033/attachment.bin>


More information about the llvm-commits mailing list