aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SimpleRegisterCoalescing.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/SimpleRegisterCoalescing.cpp')
-rw-r--r--lib/CodeGen/SimpleRegisterCoalescing.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp
index 3d8618f6c4..b714bac86a 100644
--- a/lib/CodeGen/SimpleRegisterCoalescing.cpp
+++ b/lib/CodeGen/SimpleRegisterCoalescing.cpp
@@ -369,6 +369,9 @@ bool SimpleRegisterCoalescing::JoinCopy(MachineInstr *CopyMI,
// If the intervals were swapped by Join, swap them back so that the register
// mapping (in the r2i map) is correct.
if (Swapped) SrcInt.swap(DstInt);
+
+ // repSrcReg is guarateed to be the register whose live interval that is
+ // being merged.
li_->removeInterval(repSrcReg);
r2rMap_[repSrcReg] = repDstReg;