summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp')
-rw-r--r--llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
index 3f124c00406..acbc911d6ac 100644
--- a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
+++ b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
@@ -1655,6 +1655,8 @@ SimpleRegisterCoalescing::TurnCopyIntoImpDef(MachineBasicBlock::iterator &I,
LiveInterval &SrcInt = li_->getInterval(SrcReg);
if (!SrcInt.empty())
return false;
+ if (!li_->hasInterval(DstReg))
+ return false;
LiveInterval &DstInt = li_->getInterval(DstReg);
LiveInterval::iterator DstLR = DstInt.FindLiveRangeContaining(CopyIdx);
DstInt.removeValNo(DstLR->valno);
OpenPOWER on IntegriCloud