[LiveDebugValues] Terminate open ranges on DBG_VALUE $noreg
authorJeremy Morse <jeremy.morse@sony.com>
Thu, 16 Apr 2020 09:24:47 +0000 (10:24 +0100)
committerJeremy Morse <jeremy.morse@sony.com>
Thu, 16 Apr 2020 09:26:47 +0000 (10:26 +0100)
commitc8d6fa5134ae66f3fb8e0b8caac5de4f737c8bef
tree5114ad7031338f68f33d14219a22c287f9b8eb97
parent7b9c6c16c33deb52e7081f94ad51e3910ca592c9
[LiveDebugValues] Terminate open ranges on DBG_VALUE $noreg

In D68209, LiveDebugValues::transferDebugValue had a call to
OpenRanges.erase shifted, and by accident this led to a code path where
DBG_VALUEs of $noreg would not have their open range terminated, allowing
variable locations to extend past blocks where they were terminated.

This patch correctly terminates the open range, if present, when such a
DBG_VAUE is encountered, and adds a test for this behaviour.

Differential Revision: https://reviews.llvm.org/D78218
llvm/lib/CodeGen/LiveDebugValues.cpp
llvm/test/DebugInfo/MIR/X86/livedebugvalues_loop_terminated.mir [new file with mode: 0644]