[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
Thu Oct 4 11:20:54 PDT 2018


MatzeB added a comment.

In https://reviews.llvm.org/D52862#1255543, @vsk wrote:

> In https://reviews.llvm.org/D52862#1255533, @MatzeB wrote:
>
> > In https://reviews.llvm.org/D52862#1255529, @vsk wrote:
> >
> > > The core idea and test updates look good to me. I'm curious about the size changes: are you just measuring the size of executables, or of .o's? If it's the former, on Darwin, any size change resulting from this patch might indicate bugs.
> >
> >
> > I measured executable sizes.
>
>
> Ah, ok. Well, we know we have more work to do to eliminate codegen differences with/without debug info. We're planning on discussing this at the debug info BoF. (It's not a blocker for this patch.)


The actual instructions are exactly the same, at least in the couple examples I picked.

> 
> 
>> I tried some flags of `llvm-size` or `llvm-dwarfdump` but could not figure out how to measure the size of the line tables directly...
> 
> You can look at the .dSYMs or .o's if you have those around:
>  $ size -m main.dSYM/Contents/Resources/DWARF/main | grep debug_line
> 
>   	Section __debug_line: 60

There are no .dSYM files around, should there be? Example compilation of 1 of the benchmarks:

  $ /var/tmp/locbase/bin/clang -DNDEBUG  -save-temps=obj   -O0 -g -isysroot /Volumes/XCode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk   -w -Werror=date-time -MD -MT SingleSource/Benchmarks/Misc/CMakeFiles/pi.dir/pi.c.o -MF SingleSource/Benchmarks/Misc/CMakeFiles/pi.dir/pi.c.o.d -o SingleSource/Benchmarks/Misc/CMakeFiles/pi.dir/pi.c.o   -c /Users/mbraun/dev/test-suite/SingleSource/Benchmarks/Misc/pi.c
  $ /var/tmp/locbase/bin/clang -save-temps=obj   -O0 -g -isysroot /Volumes/XCode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names  SingleSource/Benchmarks/Misc/CMakeFiles/pi.dir/pi.c.o  -o SingleSource/Benchmarks/Misc/pi  -Wl,-no_pie -lm



================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1317
+static const DebugLoc &
+findNextDebugLoc(MachineBasicBlock::const_iterator MBBI,
+                 MachineBasicBlock::const_iterator MBBE) {
----------------
vsk wrote:
> Why not use MachineBasicBlock::findDebugLoc?
As far as I can tell `findDebugLoc` will only give you the DebugLoc of the next non-DEBUG_VALUE instruction. This here will work better if there are mutliple instructions without DebugLoc in sequence.


Repository:
  rL LLVM

https://reviews.llvm.org/D52862





More information about the llvm-commits mailing list