[DebugInfo] LiveDebugValues: correctly discriminate kinds of variable locations
authorJeremy Morse <jeremy.morse.llvm@gmail.com>
Mon, 2 Sep 2019 12:28:36 +0000 (12:28 +0000)
committerJeremy Morse <jeremy.morse.llvm@gmail.com>
Mon, 2 Sep 2019 12:28:36 +0000 (12:28 +0000)
commita1318bfa1bef257a621be021e0ae0ba6fca59fd9
treeb31d489ce86953fc639d553ce647cbdf9f546c24
parent18deb6dd54dac9597e71aa1dbdf65366ff15ca80
[DebugInfo] LiveDebugValues: correctly discriminate kinds of variable locations

The missing line added by this patch ensures that only spilt variable
locations are candidates for being restored from the stack. Otherwise,
register or constant-value information can be interpreted as a spill
location, through a union.

The added regression test replicates a scenario where this occurs: the
stack load from [rsp] causes the register-location DBG_VALUE to be
"restored" to rsi, when it should be left alone. See PR43058 for details.

Un x-fail a test that was suffering from this from a previous patch.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370648 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/MachineInstr.h
lib/CodeGen/MachineCSE.cpp
lib/CodeGen/MachineInstr.cpp
test/DebugInfo/MIR/X86/machine-cse.mir [new file with mode: 0644]