From ca82a908e3ace6093b04156711acd1edc523465f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 13 Jan 2007 00:02:49 +0000 Subject: fix a bug in a recent patch llvm-svn: 33164 --- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp index 80d4311ebcb..64ff68b6f73 100644 --- a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp +++ b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp @@ -486,7 +486,7 @@ static void EmitPreheaderBranchOnCondition(Value *LIC, Constant *Val, // Insert a conditional branch on LIC to the two preheaders. The original // code is the true version and the new code is the false version. Value *BranchVal = LIC; - if (Val->getType() != Type::Int1Ty) + if (Val->getType() != Type::Int1Ty || !isa(Val)) BranchVal = new ICmpInst(ICmpInst::ICMP_EQ, LIC, Val, "tmp", InsertPt); else if (Val != ConstantInt::getTrue()) // We want to enter the new loop when the condition is true. -- cgit v1.2.3