No need to remove dead range from soon-to-be-dead live interval. Its val# may be...
authorEvan Cheng <evan.cheng@apple.com>
Sun, 12 Aug 2007 01:26:19 +0000 (01:26 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Sun, 12 Aug 2007 01:26:19 +0000 (01:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41024 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SimpleRegisterCoalescing.cpp

index 6870aff8166221fa02e25736a25fade8b1691e84..e71b9d4c0f810a14fef17831c6bdba1e36fcf017 100644 (file)
@@ -316,9 +316,9 @@ bool SimpleRegisterCoalescing::JoinCopy(MachineInstr *CopyMI,
     }
 
     if (isShorten || isDead) {
-      // Shorten the live interval.
-      LiveInterval &LiveInInt = (repSrcReg == DstInt.reg) ? DstInt : SrcInt;
-      LiveInInt.removeRange(RemoveStart, RemoveEnd);
+      // Shorten the destination live interval.
+      if (repSrcReg == DstInt.reg)
+        DstInt.removeRange(RemoveStart, RemoveEnd);
     }
   } else {
     // Coalescing failed.