[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
Sun Aug 4 10:18:28 PDT 2019


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

Revise patch to not spill variable locations with complex (non-empty non-fragment) expressions, as we currently can't recover the original expression on restore.

Vedant wrote:

> Thanks for working on this. Do I understand correctly that the fragment expression introduced in the restorer may not be accurate when the spilled value has a complex description?

That's correct,

> If so, my two cents is that it’d be preferable to either:
> 
> a) Entirely drop the dbg_value/location for complex fragments during a spill (as a safer crash mitigation), or

That sounds a lot safer, done with this update,

> b) Find some way to teach the restorer how to build correct descriptions for fragments (at first glance it seemed like this would be as simple as stripping off the offset applied in the spiller, but I’m probably missing something)

I think that would work within LiveDebugValues, but we can also get spill locations from LiveDebugVariables too, as well as stack-locations created in LowerDbgDeclare [0] that aren't actually spills but might present themselves identically. I'm currently building an argument that DIExpressions signal too much information "in-band" as it were, there's also D64595 <https://reviews.llvm.org/D64595> where digging through the insides of a DIExpression might be appropriate.

~

NB: I'm out-of-office and will be away from SVN credentials for a while, if this is approved, would the approver please commit it too. I can probably file the ticket for merging this into the llvm-9 branch, but it'd be great if that was handled as well.

[0] https://github.com/llvm/llvm-project/blob/44b16bd4a5b20ce8b4e9ef56836123a2038f3670/llvm/lib/Transforms/Utils/Local.cpp#L1427


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

https://reviews.llvm.org/D65368

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65368.213253.patch
Type: text/x-patch
Size: 8240 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190804/cc874e1d/attachment.bin>


More information about the llvm-commits mailing list