]> granicus.if.org Git - llvm/commit
[DebugInfo] LiveDebugValues: defer DBG_VALUE creation during analysis
authorJeremy Morse <jeremy.morse.llvm@gmail.com>
Fri, 4 Oct 2019 09:38:05 +0000 (09:38 +0000)
committerJeremy Morse <jeremy.morse.llvm@gmail.com>
Fri, 4 Oct 2019 09:38:05 +0000 (09:38 +0000)
commit31d7aa485d6924a822f137c23377ff0a8306aa80
tree8674c6c43a0315eaa86d1af07e6b2511bc97fcac
parent1b7dd0a628c258b637a15fdbb4a28b74e4320b84
[DebugInfo] LiveDebugValues: defer DBG_VALUE creation during analysis

When transfering variable locations from one place to another,
LiveDebugValues immediately creates a DBG_VALUE representing that
transfer. This causes trouble if the variable location should
subsequently be invalidated by a loop back-edge, such as in the added
test case: the transfer DBG_VALUE from a now-invalid location is used
as proof that the variable location is correct. This is effectively a
self-fulfilling prophesy.

To avoid this, defer the insertion of transfer DBG_VALUEs until after
analysis has completed. Some of those transfers are still sketchy, but
we don't propagate them into other blocks now.

Differential Revision: https://reviews.llvm.org/D67393

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373720 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/LiveDebugValues.cpp
test/DebugInfo/MIR/X86/live-debug-values-bad-transfer.mir [new file with mode: 0644]