[PATCH] D111317: [DebugInfo][InstrRef] Track instructions that write-to-stack after having a spill fused into them

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 23 06:03:30 PDT 2021


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

Update for Stephens nits -- but also to rebase on top of the the track-subregisters-on-the-stack patch, D112133 <https://reviews.llvm.org/D112133>. That exposes an interesting circumstance, which probably wants a little more review.

Now that there are more "indexes" within a spill slot that we can refer to, if we have:

  INC32m $rsp, 1, $noreg, 4, [...]debug-instr-number 1 :: (store (s32) into %stack.0)
  DBG_INSTR_REF 1, 1000000

Where the DBG_INSTR_REF refers to the memory operand of the INC32m: which stack index should this refer to?  It could be 8/16/32/64 bits large. This is not a pointless question, because if the value is loaded off the stack, we need to try and follow it in the correct register.

Happily we can look at the memory operand on the INC32m and determine it's size; that then tells us which index on the stack the DBG_INSTR_REF should refer to, which is what I've added in this revision, in findLocationForMemOperand.


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

https://reviews.llvm.org/D111317

Files:
  llvm/include/llvm/CodeGen/MachineFunction.h
  llvm/lib/CodeGen/InlineSpiller.cpp
  llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
  llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
  llvm/lib/CodeGen/MachineFunction.cpp
  llvm/test/DebugInfo/MIR/InstrRef/memory-operand-folding-tieddef.mir
  llvm/test/DebugInfo/MIR/InstrRef/memory-operand-folding.mir
  llvm/test/DebugInfo/MIR/InstrRef/memory-operand-tracking.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111317.381731.patch
Type: text/x-patch
Size: 31064 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211023/ba136dfd/attachment.bin>


More information about the llvm-commits mailing list