diff options
author | Chris Lattner <sabre@nondot.org> | 2007-01-13 00:02:49 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-01-13 00:02:49 +0000 |
commit | c08b56f6a085f822e21bf3aa18a0554ed9ecd479 (patch) | |
tree | 2436053ab68b937706e07aea1303410e799bcd73 /lib/Transforms/Scalar/LoopUnswitch.cpp | |
parent | fbb7b69fc66adcaf121e1e586e7b9e0978f2c052 (diff) |
fix a bug in a recent patch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33164 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopUnswitch.cpp')
-rw-r--r-- | lib/Transforms/Scalar/LoopUnswitch.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/LoopUnswitch.cpp b/lib/Transforms/Scalar/LoopUnswitch.cpp index 80d4311ebc..64ff68b6f7 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<ConstantInt>(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. |