From c7db66d4961dd4340a386043593f153a4af38dc6 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Wed, 10 Dec 2014 01:12:23 +0000 Subject: [PATCH] LiveRangeEdit: Adapt eliminateDeadDef() to subregister liveness. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223882 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/LiveRangeEdit.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/LiveRangeEdit.cpp b/lib/CodeGen/LiveRangeEdit.cpp index a0fb712d118..634e93de69d 100644 --- a/lib/CodeGen/LiveRangeEdit.cpp +++ b/lib/CodeGen/LiveRangeEdit.cpp @@ -286,8 +286,16 @@ void LiveRangeEdit::eliminateDeadDef(MachineInstr *MI, ToShrinkSet &ToShrink) { if (TheDelegate) TheDelegate->LRE_WillShrinkVirtReg(LI.reg); LI.removeValNo(VNI); - if (LI.empty()) + if (LI.empty()) { RegsToErase.push_back(Reg); + } else { + // Also remove the value in subranges. + for (LiveInterval::subrange_iterator S = LI.subrange_begin(), + SE = LI.subrange_end(); S != SE; ++S) { + if (VNInfo *SVNI = S->getVNInfoAt(Idx)) + S->removeValNo(SVNI); + } + } } } } -- 2.34.1