aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveDebugValues.cpp
diff options
context:
space:
mode:
authorTom Weaver <Tom.Weaver@Sony.com>2020-01-24 16:29:05 +0000
committerTom Weaver <Tom.Weaver@Sony.com>2020-01-24 16:29:05 +0000
commitf5147765ba170b4809dc72d34359be3355d48de8 (patch)
treec9f0bd55359cde44cb6a5cf9316ecd9505e9e89b /llvm/lib/CodeGen/LiveDebugValues.cpp
parent1484d0f12addf0d8aa08831adb63b8f56b8bd0f6 (diff)
downloadllvm-f5147765ba170b4809dc72d34359be3355d48de8.zip
llvm-f5147765ba170b4809dc72d34359be3355d48de8.tar.gz
llvm-f5147765ba170b4809dc72d34359be3355d48de8.tar.bz2
[DebugInfo][LiveDebugValues] Teach Live Debug Values About Meta Instructions
Previously LiveDebugValues pass would consider meta instructions that 'fiddle' with liveness of registers as register definitions when transfering register defs. This would mean that, for example, a KILL instruction would cause LiveDebugValues to terminate the range of an earlier DBG_VALUE instruction resulting in the none propogation of said DBG_VALUE instructions into later blocks. This patch adds the check and a helpful comment, fixes a test that previously tested for the broken behaviour by coincidence and adds a test specifically for this. reviewers: vsk, dstenb, djtodoro Differential Revision: https://reviews.llvm.org/D73210
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugValues.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveDebugValues.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugValues.cpp b/llvm/lib/CodeGen/LiveDebugValues.cpp
index 2226c10..6acaf409 100644
--- a/llvm/lib/CodeGen/LiveDebugValues.cpp
+++ b/llvm/lib/CodeGen/LiveDebugValues.cpp
@@ -922,6 +922,12 @@ void LiveDebugValues::insertTransferDebugPair(
void LiveDebugValues::transferRegisterDef(
MachineInstr &MI, OpenRangesSet &OpenRanges, VarLocMap &VarLocIDs,
TransferMap &Transfers) {
+
+ // Meta Instructions do not affect the debug liveness of any register they
+ // define.
+ if (MI.isMetaInstruction())
+ return;
+
MachineFunction *MF = MI.getMF();
const TargetLowering *TLI = MF->getSubtarget().getTargetLowering();
unsigned SP = TLI->getStackPointerRegisterToSaveRestore();