[PATCH] D85018: [WIP][POC][DebugInfo] Support for DW_AT_start_scope for scoped variables

Sourabh Singh Tomar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 31 03:43:03 PDT 2020


SouraVX created this revision.
SouraVX added reviewers: vsk, aprantl, dblaikie, probinson, jini.susan.george, alok.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a reviewer: sscalpone.
Herald added a project: LLVM.
SouraVX requested review of this revision.
Herald added a subscriber: ormris.

This patch is POC for correctly capturing scope information for
reduced scope variables.

For more context please refer to llvm-dev discussion:
http://lists.llvm.org/pipermail/llvm-dev/2020-April/140962.html

Intent of this patch is to convey overall design/functionality,
seek feedback and converge.
There was an unfortunate delay between the patch and discussion,
Overall design was also discussed in above link(later).

Impact on debug-info statistics(collected from compiling trunk-clang
before and after this patch):

Before this patch:

  llvm-dwarfdump --show-section-sizes bin/clang
  file: bin/clang
  ----------------------------------------------------
  SECTION        SIZE (b)
  -------------  ---------
  .debug_info    900357322 (58.29%)
  .debug_loc        868784 (0.06%)
  .debug_ranges   33411008 (2.16%)
  .debug_abbrev    4227906 (0.27%)
  .debug_line    117115289 (7.58%)
  .debug_str     182932094 (11.84%)
  
   Total Size: 1238912403  (80.21%)
   Total File Size: 1544622040
  ----------------------------------------------------

After this patch:

  llvm-dwarfdump --show-section-sizes bin/clang
  ----------------------------------------------------
  file: bin/clang
  ----------------------------------------------------
  SECTION        SIZE (b)
  -------------  ---------
  .debug_info    902111430 (57.62%)
  .debug_loc      19768599 (1.26%)
  .debug_ranges   33412752 (2.13%)
  .debug_abbrev    4305427 (0.28%)
  .debug_line    117266710 (7.49%)
  .debug_str     182933982 (11.69%)
  
   Total Size: 1259798900  (80.47%)
   Total File Size: 1565509704
  ----------------------------------------------------


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D85018

Files:
  llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
  llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
  llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
  llvm/test/DebugInfo/X86/DW_AT_start_scope.ll
  llvm/test/DebugInfo/X86/op_deref.ll
  llvm/test/DebugInfo/dwarfdump-dataLocationExp.ll
  llvm/test/DebugInfo/dwarfdump-dataLocationVar.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85018.282178.patch
Type: text/x-patch
Size: 23756 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200731/780b741e/attachment.bin>


More information about the llvm-commits mailing list