[PATCH] D58453: [DebugInfo][CGP] Limit placeDbgValues movement of dbg.value intrinsics

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 06:25:21 PST 2019


jmorse updated this revision to Diff 232112.
jmorse added a comment.

This revision splits out the WebAssembly work... however it turns out that that code might not be necessary at all. I tried to put together a test demonstrating what would go wrong without placeDbgValues, but can't replicate any problem. For example, in the following block of wasm mir:

  %0:i64 = ARGUMENT_i64 0, implicit $arguments
  %1:i64 = ARGUMENT_i64 1, implicit $arguments
  %2:i32 = ARGUMENT_i32 2, implicit $arguments
  %7:i32 = I32_WRAP_I64 %0:i64, implicit-def dead $arguments
  %4:i32 = ADD_I32 %2:i32, %7:i32, implicit-def dead $arguments
  %5:i32 = I32_WRAP_I64 %1:i64, implicit-def dead $arguments
  %6:i32 = ADD_I32 %4:i32, %5:i32, implicit-def dead $arguments
  DBG_VALUE %4:i32, $noreg, !10, !DIExpression(), debug-location !13; <unknown>:357:12 line no:357
  RETURN %6:i32, implicit-def dead $arguments

(Which, I think, adds some arguments together) the DBG_VALUE refers to a value several insts earlier, and wouldn't be picked up by collectDebugValues. Something due to the way the "stackifier" runs and rewrites instructions, means that the DBG_VALUE floats up to the nearest def of its vreg operand, and sticks there.

I can't say I really understand how wasm works, but it appears to be safe against DBG_VALUEs being placed over a wider region, at least for now. This does mean leaving collectDebugValues unchanged too, though.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58453/new/

https://reviews.llvm.org/D58453

Files:
  llvm/include/llvm/CodeGen/MachineInstr.h
  llvm/lib/CodeGen/CodeGenPrepare.cpp
  llvm/test/DebugInfo/COFF/register-variables.ll
  llvm/test/DebugInfo/NVPTX/debug-info.ll
  llvm/test/DebugInfo/X86/DW_AT_location-reference.ll
  llvm/test/DebugInfo/X86/PR37234.ll
  llvm/test/tools/llvm-locstats/locstats.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58453.232112.patch
Type: text/x-patch
Size: 9550 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191204/1e0382aa/attachment.bin>


More information about the llvm-commits mailing list