[PATCH] D43207: [Utils] Salvage the debug info of DCE'ed 'xor' instructions

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 12 16:55:02 PST 2018


vsk added a comment.

I extended this patch to salvage debug values from mul/sdiv/srem, shl/lhsr/ashr, and sub instructions (in addition to xor instructions). Next, I prepared dsyms for stage2 builds of clang (`-O3 -g`). Here are the results:

  pre-patch
  ---------
  
  Segment __DWARF: 814804992
          Section __debug_line: 36805639     (35.10 MB)
          Section __debug_pubnames: 8291810
          Section __debug_pubtypes: 62606366
          Section __debug_ranges: 43286544
          Section __debug_loc: 122491744     (116.81 MB)
          Section __debug_aranges: 986672
          Section __debug_info: 379630571    (362.04 MB)
          Section __debug_abbrev: 10685
          Section __debug_str: 106914677
          Section __apple_names: 35657500
          Section __apple_namespac: 50616
          Section __apple_types: 18069091
          Section __apple_objc: 36
          total 814801951
  
  {"version":"1","file":"pre-patches-clang.dSYM/Contents/Resources/DWARF/clang-7.0","format":"Mach-O 64-bit x86-64","source functions":309766,"inlined functions":3351149,"unique source variables":1981705,"source variables":403779101,"variables with location":4127221,"scope bytes total":522119469,"scope bytes covered":305284275}
  
  post-patch
  ----------
  
  Salvaging dbg.values from:
  mul/sdiv/srem, shl/lhsr/ashr, sub, xor
  
  Segment __DWARF: 814891008
          Section __debug_line: 36806878     (35.10 MB, +0%)
          Section __debug_pubnames: 8291810
          Section __debug_pubtypes: 62606366
          Section __debug_ranges: 43287504
          Section __debug_loc: 122557034     (116.88 MB, +0.06%)
          Section __debug_aranges: 986672
          Section __debug_info: 379647347    (362.06 MB, +0%)
          Section __debug_abbrev: 10685
          Section __debug_str: 106914677
          Section __apple_names: 35658692
          Section __apple_namespac: 50616
          Section __apple_types: 18069091
          Section __apple_objc: 36
          total 814887408
  
  {"version":"1","file":"post-patches-clang.dSYM/Contents/Resources/DWARF/clang-7.0","format":"Mach-O 64-bit x86-64","source functions":309766,"inlined functions":3351298,"unique source variables":1982115,"source variables":403824889,"variables with location":4128581,"scope bytes total":522201413,"scope bytes covered":305416207}

There is a modest increase of the debug_loc section, which indicates that users will notice a small increase in the number of available debug values, without seeing too much binary size bloat.

I also included statistics from dwarfdump: post-patch, we have 410 additional unique source variables available.


https://reviews.llvm.org/D43207





More information about the llvm-commits mailing list