[PATCH] D65368: [DebugInfo] LiveDebugValues: Don't drop fragment information when restoring spills

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 06:44:30 PDT 2019


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

This update demonstrates one of the alternatives -- pointing the VarLoc object's DBG_VALUE at the unspilt DBG_VALUE allows the spill-restore code to access the correct expression upon restore. This requires slightly more logic when propagating locations, as we can't just blindly clone DBG_VALUEs any more.

I've added a new test function ('h') to check that complex expressions are preserved, which they are. However: it looks like the spiller is getting the spilt expression wrong anyway, as the spilt location DBG_VALUE is:

  DBG_VALUE $rsp, 0, !123,  DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_plus_uconst, 1)

both with and without patching. I believe it's missing a DW_OP_deref in the middle, between the plus-part and the stack-offset part.

IMO: this shows spill/restore of complex expressions is all-round broken right now, and the best solution is probably to not spill them at all (Diff 4, numbered 213638 on this review).


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

https://reviews.llvm.org/D65368

Files:
  lib/CodeGen/LiveDebugValues.cpp
  test/DebugInfo/MIR/X86/live-debug-values-restore.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65368.214823.patch
Type: text/x-patch
Size: 19684 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190813/5d4d5f77/attachment.bin>


More information about the llvm-commits mailing list