[PATCH] D52862: DwarfDebug: Pick next location in case of missing location at block begin

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 3 22:23:12 PDT 2018


MatzeB created this revision.
MatzeB added reviewers: aprantl, dblaikie, vsk, labath, probinson.
Herald added subscribers: atanasyan, jrtc27, JDevlieghere, sdardis, mcrosier, jholewinski.
Herald added a reviewer: javed.absar.
MatzeB added a comment.

Comparing two test-suite builds gives me:

  Tests: 1010
  Metric: size
  
  Program                                         base   changes diff
  
  SingleSour...itTests/SignlessTypes/cast-bug    4600   4608     0.2%
  SingleSour...tTests/ms_struct_pack_layout-1    4632   4640     0.2%
  SingleSour...tTests/2010-05-24-BitfieldTest    4632   4640     0.2%
  SingleSour...ion-C-2003-06-16-VolatileError    4720   4728     0.2%
  SingleSour...egression-C-pointer_arithmetic    4864   4872     0.2%
  SingleSour...ression/C/Regression-C-PR10189    5552   5560     0.1%
  MultiSourc...enchmarks/VersaBench/dbms/dbms    50456  50504    0.1%
  SingleSour...nitTests/2006-12-01-float_varg    8800   8808     0.1%
  SingleSour...nitTests/2003-10-13-SwitchTest    8800   8808     0.1%
  SingleSour...tTests/2007-04-10-BitfieldTest    8808   8816     0.1%
  SingleSour...ession-C-2008-01-07-LongDouble    8832   8840     0.1%
  SingleSour...s/Shootout/Shootout-nestedloop    8840   8848     0.1%
  SingleSour.../2004-06-20-StaticBitfieldInit    8880   8888     0.1%
  SingleSour...sion-C-2004-03-15-IndirectGoto    8888   8896     0.1%
  SingleSour...UnitTests/2002-08-02-CastTest2    8896   8904     0.1%
                 base       changes         diff
  count  1.010000e+03  1.010000e+03  1010.000000
  mean   1.773759e+05  1.773819e+05  0.000102
  std    8.762489e+05  8.762656e+05  0.000246
  min    4.600000e+03  4.608000e+03  0.000000
  25%    1.456500e+04  1.456500e+04  0.000000
  50%    6.281800e+04  6.283400e+04  0.000000
  75%    9.593600e+04  9.593600e+04  0.000023
  max    1.585930e+07  1.585930e+07  0.001739



> 0.1% smaller files on average.
================================


Context: Compiler generated instructions do not have a debug location
assigned to them. However emitting 0-line records for all of them bloats
the line tables for very little benefit so we usually avoid doing that.

Not emitting anything will lead to the previous debug location getting
applied to the locationless instructions. This is not desirable for
block begin and after labels. Previously we would emit simply emit
line-0 records in this case, this patch changes the behavior to do a
forward search for a debug location in these cases before emitting a
line-0 record to further reduce line table bloat.

Inspired by the discussion in https://reviews.llvm.org/D52125


Repository:
  rL LLVM

https://reviews.llvm.org/D52862

Files:
  lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  test/DebugInfo/AArch64/line-header.ll
  test/DebugInfo/ARM/single-constant-use-preserves-dbgloc.ll
  test/DebugInfo/Mips/delay-slot.ll
  test/DebugInfo/NVPTX/debug-info.ll
  test/DebugInfo/X86/dwarf-no-source-loc.ll
  test/DebugInfo/X86/dwarf-no-source-loc.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52862.168227.patch
Type: text/x-patch
Size: 10866 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181004/228e728a/attachment.bin>


More information about the llvm-commits mailing list