[llvm-commits] [llvm] r86278 - in /llvm/trunk: lib/Transforms/Scalar/JumpThreading.cpp test/Transforms/JumpThreading/crash.ll

Chris Lattner sabre at nondot.org
Fri Nov 6 11:21:48 PST 2009


Author: lattner
Date: Fri Nov  6 13:21:48 2009
New Revision: 86278

URL: http://llvm.org/viewvc/llvm-project?rev=86278&view=rev
Log:
Fix a problem discovered on self host.


Modified:
    llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp
    llvm/trunk/test/Transforms/JumpThreading/crash.ll

Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp?rev=86278&r1=86277&r2=86278&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Fri Nov  6 13:21:48 2009
@@ -267,7 +267,7 @@
     ConstantInt *CI = dyn_cast<ConstantInt>(V);
     Result.resize(TheFirstPHI->getNumIncomingValues());
     for (unsigned i = 0, e = Result.size(); i != e; ++i)
-      Result.push_back(std::make_pair(CI, TheFirstPHI->getIncomingBlock(i)));
+      Result[i] = std::make_pair(CI, TheFirstPHI->getIncomingBlock(i));
     return true;
   }
   

Modified: llvm/trunk/test/Transforms/JumpThreading/crash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/JumpThreading/crash.ll?rev=86278&r1=86277&r2=86278&view=diff

==============================================================================
--- llvm/trunk/test/Transforms/JumpThreading/crash.ll (original)
+++ llvm/trunk/test/Transforms/JumpThreading/crash.ll Fri Nov  6 13:21:48 2009
@@ -170,3 +170,25 @@
         ret i32 1
 }
 
+
+define fastcc void @test5(i1 %tmp, i32 %tmp1) nounwind ssp {
+entry:
+  br i1 %tmp, label %bb12, label %bb13
+
+
+bb12:                                            
+  br label %bb13
+
+bb13:                                            
+  %.lcssa31 = phi i32 [ undef, %bb12 ], [ %tmp1, %entry ]
+  %A = and i1 undef, undef
+  br i1 %A, label %bb15, label %bb61
+
+bb15:                                            
+  ret void
+
+
+bb61:                                            
+  ret void
+}
+





More information about the llvm-commits mailing list