[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)
commit0ca48de26c46281ae9fd15a042cc19cdf316bee6
treecb064e755f388456e0f3d29e66b9ef7e1fde6e64
parent4128dc4500693beb29e4f7cdf3f548c27bebbb9a
[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

llvm-svn: 373720
llvm/lib/CodeGen/LiveDebugValues.cpp
llvm/test/DebugInfo/MIR/X86/live-debug-values-bad-transfer.mir [new file with mode: 0644]