mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-01 17:29:33 +00:00
Check for the short-circuiting condition before performing
the potentially expensive erase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73359 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4dfad29547
commit
7f7c4366ca
@ -1012,8 +1012,8 @@ SCEVHandle ScalarEvolution::getAddExpr(SmallVectorImpl<SCEVHandle> &Ops) {
|
|||||||
// We found two constants, fold them together!
|
// We found two constants, fold them together!
|
||||||
Ops[0] = getConstant(LHSC->getValue()->getValue() +
|
Ops[0] = getConstant(LHSC->getValue()->getValue() +
|
||||||
RHSC->getValue()->getValue());
|
RHSC->getValue()->getValue());
|
||||||
|
if (Ops.size() == 2) return Ops[0];
|
||||||
Ops.erase(Ops.begin()+1); // Erase the folded element
|
Ops.erase(Ops.begin()+1); // Erase the folded element
|
||||||
if (Ops.size() == 1) return Ops[0];
|
|
||||||
LHSC = cast<SCEVConstant>(Ops[0]);
|
LHSC = cast<SCEVConstant>(Ops[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user