summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-01-13 00:02:49 +0000
committerChris Lattner <sabre@nondot.org>2007-01-13 00:02:49 +0000
commitca82a908e3ace6093b04156711acd1edc523465f (patch)
treecf5ede64ef0e98605f138818975b13079a9c1366
parent15f159b00d958a61c1241913885c2b58179b5e88 (diff)
downloadbcm5719-llvm-ca82a908e3ace6093b04156711acd1edc523465f.tar.gz
bcm5719-llvm-ca82a908e3ace6093b04156711acd1edc523465f.zip
fix a bug in a recent patch
llvm-svn: 33164
-rw-r--r--llvm/lib/Transforms/Scalar/LoopUnswitch.cpp2
1 files changed, 1 insertions, 1 deletions
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<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.
OpenPOWER on IntegriCloud