mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-13 09:33:50 +00:00
Fix a bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37751 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
df82c93f2a
commit
0d7d3656f3
@ -519,8 +519,11 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
|
|||||||
DOUT << "INDVARS: New CanIV: " << *IndVar;
|
DOUT << "INDVARS: New CanIV: " << *IndVar;
|
||||||
|
|
||||||
if (!isa<SCEVCouldNotCompute>(IterationCount)) {
|
if (!isa<SCEVCouldNotCompute>(IterationCount)) {
|
||||||
if (IterationCount->getType() != LargestType)
|
if (IterationCount->getType()->getPrimitiveSizeInBits() <
|
||||||
|
LargestType->getPrimitiveSizeInBits())
|
||||||
IterationCount = SCEVZeroExtendExpr::get(IterationCount, LargestType);
|
IterationCount = SCEVZeroExtendExpr::get(IterationCount, LargestType);
|
||||||
|
else if (IterationCount->getType() != LargestType)
|
||||||
|
IterationCount = SCEVTruncateExpr::get(IterationCount, LargestType);
|
||||||
if (Instruction *DI = LinearFunctionTestReplace(L, IterationCount,Rewriter))
|
if (Instruction *DI = LinearFunctionTestReplace(L, IterationCount,Rewriter))
|
||||||
DeadInsts.insert(DI);
|
DeadInsts.insert(DI);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user