summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegisterCoalescer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/RegisterCoalescer.cpp')
-rw-r--r--llvm/lib/CodeGen/RegisterCoalescer.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp
index 771d50e7f40..2c1bc6df37e 100644
--- a/llvm/lib/CodeGen/RegisterCoalescer.cpp
+++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp
@@ -1910,6 +1910,13 @@ bool RegisterCoalescer::joinCopy(MachineInstr *CopyMI, bool &Again) {
}
LI.removeEmptySubRanges();
}
+
+ // CP.getSrcReg()'s live interval has been merged into CP.getDstReg's live
+ // interval. Since CP.getSrcReg() is in ToBeUpdated set and its live interval
+ // is not up-to-date, need to update the merged live interval here.
+ if (ToBeUpdated.count(CP.getSrcReg()))
+ ShrinkMainRange = true;
+
if (ShrinkMainRange) {
LiveInterval &LI = LIS->getInterval(CP.getDstReg());
shrinkToUses(&LI);
OpenPOWER on IntegriCloud