From: Chris Lattner Date: Sat, 13 Jan 2007 00:02:49 +0000 (+0000) Subject: fix a bug in a recent patch X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=c08b56f6a085f822e21bf3aa18a0554ed9ecd479;p=oota-llvm.git fix a bug in a recent patch git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33164 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/LoopUnswitch.cpp b/lib/Transforms/Scalar/LoopUnswitch.cpp index 80d4311ebcb..64ff68b6f73 100644 --- a/lib/Transforms/Scalar/LoopUnswitch.cpp +++ b/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.