mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 07:34:33 +00:00
fix a bug in a recent patch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33164 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fbb7b69fc6
commit
c08b56f6a0
@ -486,7 +486,7 @@ static void EmitPreheaderBranchOnCondition(Value *LIC, Constant *Val,
|
|||||||
// Insert a conditional branch on LIC to the two preheaders. The original
|
// 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.
|
// code is the true version and the new code is the false version.
|
||||||
Value *BranchVal = LIC;
|
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);
|
BranchVal = new ICmpInst(ICmpInst::ICMP_EQ, LIC, Val, "tmp", InsertPt);
|
||||||
else if (Val != ConstantInt::getTrue())
|
else if (Val != ConstantInt::getTrue())
|
||||||
// We want to enter the new loop when the condition is true.
|
// We want to enter the new loop when the condition is true.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user