fix a bug in a recent patch

llvm-svn: 33164
This commit is contained in:
Chris Lattner 2007-01-13 00:02:49 +00:00
parent 15f159b00d
commit ca82a908e3
1 changed files with 1 additions and 1 deletions

View File

@ -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.