mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 16:17:17 +00:00
Revert r110916. This patch is buggy because the code inside the
inner loop doesn't update all the variables in the outer loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112665 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1589,7 +1589,6 @@ const SCEV *ScalarEvolution::getAddExpr(SmallVectorImpl<const SCEV *> &Ops,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check this multiply against other multiplies being added together.
|
// Check this multiply against other multiplies being added together.
|
||||||
bool AnyFold = false;
|
|
||||||
for (unsigned OtherMulIdx = Idx+1;
|
for (unsigned OtherMulIdx = Idx+1;
|
||||||
OtherMulIdx < Ops.size() && isa<SCEVMulExpr>(Ops[OtherMulIdx]);
|
OtherMulIdx < Ops.size() && isa<SCEVMulExpr>(Ops[OtherMulIdx]);
|
||||||
++OtherMulIdx) {
|
++OtherMulIdx) {
|
||||||
@@ -1617,14 +1616,12 @@ const SCEV *ScalarEvolution::getAddExpr(SmallVectorImpl<const SCEV *> &Ops,
|
|||||||
const SCEV *InnerMulSum = getAddExpr(InnerMul1,InnerMul2);
|
const SCEV *InnerMulSum = getAddExpr(InnerMul1,InnerMul2);
|
||||||
const SCEV *OuterMul = getMulExpr(MulOpSCEV, InnerMulSum);
|
const SCEV *OuterMul = getMulExpr(MulOpSCEV, InnerMulSum);
|
||||||
if (Ops.size() == 2) return OuterMul;
|
if (Ops.size() == 2) return OuterMul;
|
||||||
Ops[Idx] = OuterMul;
|
Ops.erase(Ops.begin()+Idx);
|
||||||
Ops.erase(Ops.begin()+OtherMulIdx);
|
Ops.erase(Ops.begin()+OtherMulIdx-1);
|
||||||
OtherMulIdx = Idx;
|
Ops.push_back(OuterMul);
|
||||||
AnyFold = true;
|
return getAddExpr(Ops);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (AnyFold)
|
|
||||||
return getAddExpr(Ops);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user