[llvm-commits] [llvm] r49415 - in /llvm/trunk: lib/CodeGen/SimpleRegisterCoalescing.cpp test/CodeGen/X86/2008-04-08-CoalescerCrash.ll

Evan Cheng evan.cheng at apple.com
Tue Apr 8 18:30:15 PDT 2008


Author: evancheng
Date: Tue Apr  8 20:30:15 2008
New Revision: 49415

URL: http://llvm.org/viewvc/llvm-project?rev=49415&view=rev
Log:
Missed a hasInterval check.

Added:
    llvm/trunk/test/CodeGen/X86/2008-04-08-CoalescerCrash.ll
Modified:
    llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp

Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=49415&r1=49414&r2=49415&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original)
+++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Tue Apr  8 20:30:15 2008
@@ -1655,6 +1655,8 @@
   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);

Added: llvm/trunk/test/CodeGen/X86/2008-04-08-CoalescerCrash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-04-08-CoalescerCrash.ll?rev=49415&view=auto

==============================================================================
--- llvm/trunk/test/CodeGen/X86/2008-04-08-CoalescerCrash.ll (added)
+++ llvm/trunk/test/CodeGen/X86/2008-04-08-CoalescerCrash.ll Tue Apr  8 20:30:15 2008
@@ -0,0 +1,19 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx
+
+define i32 @t2() nounwind  {
+entry:
+	tail call void asm sideeffect "# top of block", "~{dirflag},~{fpsr},~{flags},~{di},~{si},~{dx},~{cx},~{ax}"( ) nounwind 
+	tail call void asm sideeffect ".file \224443946.c\22", "~{dirflag},~{fpsr},~{flags}"( ) nounwind 
+	tail call void asm sideeffect ".line 8", "~{dirflag},~{fpsr},~{flags}"( ) nounwind 
+	%tmp1 = tail call <2 x i32> asm sideeffect "movd $1, $0", "=={mm4},{bp},~{dirflag},~{fpsr},~{flags},~{memory}"( i32 undef ) nounwind 		; <<2 x i32>> [#uses=1]
+	tail call void asm sideeffect ".file \224443946.c\22", "~{dirflag},~{fpsr},~{flags}"( ) nounwind 
+	tail call void asm sideeffect ".line 9", "~{dirflag},~{fpsr},~{flags}"( ) nounwind 
+	%tmp3 = tail call i32 asm sideeffect "movd $1, $0", "=={bp},{mm3},~{dirflag},~{fpsr},~{flags},~{memory}"( <2 x i32> undef ) nounwind 		; <i32> [#uses=1]
+	tail call void asm sideeffect ".file \224443946.c\22", "~{dirflag},~{fpsr},~{flags}"( ) nounwind 
+	tail call void asm sideeffect ".line 10", "~{dirflag},~{fpsr},~{flags}"( ) nounwind 
+	tail call void asm sideeffect "movntq $0, 0($1,$2)", "{mm0},{di},{bp},~{dirflag},~{fpsr},~{flags},~{memory}"( <2 x i32> undef, i32 undef, i32 %tmp3 ) nounwind 
+	tail call void asm sideeffect ".file \224443946.c\22", "~{dirflag},~{fpsr},~{flags}"( ) nounwind 
+	tail call void asm sideeffect ".line 11", "~{dirflag},~{fpsr},~{flags}"( ) nounwind 
+	%tmp8 = tail call i32 asm sideeffect "movd $1, $0", "=={bp},{mm4},~{dirflag},~{fpsr},~{flags},~{memory}"( <2 x i32> %tmp1 ) nounwind 		; <i32> [#uses=0]
+	ret i32 undef
+}





More information about the llvm-commits mailing list