From af21e9550e36e6b8f1e7cce84fe4c75af976cd6b Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Sun, 12 Aug 2007 01:26:19 +0000 Subject: [PATCH] No need to remove dead range from soon-to-be-dead live interval. Its val# may be out of whack. llvm-svn: 41024 --- llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp index 6870aff81662..e71b9d4c0f81 100644 --- a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp @@ -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.