[DebugInfo] Keep DBG_VALUE undef in LiveDebugVariables
authorMikael Holmen <mikael.holmen@ericsson.com>
Thu, 21 Jun 2018 07:02:46 +0000 (07:02 +0000)
committerMikael Holmen <mikael.holmen@ericsson.com>
Thu, 21 Jun 2018 07:02:46 +0000 (07:02 +0000)
commit57b33f6aac852d6f8d154d574b05b7689afc8e2b
tree727ba14af974501aee0c6922bc9fe7ec8c39f6bc
parent76df3d61a394d06549264b22e3015fcc52201a6f
[DebugInfo] Keep DBG_VALUE undef in LiveDebugVariables

Summary:
Fixes PR36579.

For cases where we had e.g.

 DBG_VALUE 42
 [...]
 DBG_VALUE undef

LiveDebugVariables would discard all undef DBG_VALUEs and then it would
look like the variable had the value 42 throughout the rest of the
function, which is incorrect.

With this patch we don't remove all undef DBG_VALUEs in LiveDebugVariables
so they will be kept after register allocation just like other DBG_VALUEs
which will yield more correct debug information.

Reviewers: aprantl

Reviewed By: aprantl

Subscribers: bjope, Ka-Ka, JDevlieghere, llvm-commits

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

llvm-svn: 335205
llvm/lib/CodeGen/LiveDebugVariables.cpp
llvm/test/DebugInfo/X86/live-debug-vars-discard-invalid.mir
llvm/test/DebugInfo/X86/live-debug-vars-keep-undef.ll [new file with mode: 0644]