mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
Simplify this code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106254 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
597ec8ed51
commit
27ed6a41ce
@ -1747,17 +1747,9 @@ const SCEV *ScalarEvolution::getMulExpr(SmallVectorImpl<const SCEV *> &Ops,
|
||||
// NLI * LI * {Start,+,Step} --> NLI * {LI*Start,+,LI*Step}
|
||||
SmallVector<const SCEV *, 4> NewOps;
|
||||
NewOps.reserve(AddRec->getNumOperands());
|
||||
if (LIOps.size() == 1) {
|
||||
const SCEV *Scale = LIOps[0];
|
||||
for (unsigned i = 0, e = AddRec->getNumOperands(); i != e; ++i)
|
||||
NewOps.push_back(getMulExpr(Scale, AddRec->getOperand(i)));
|
||||
} else {
|
||||
for (unsigned i = 0, e = AddRec->getNumOperands(); i != e; ++i) {
|
||||
SmallVector<const SCEV *, 4> MulOps(LIOps.begin(), LIOps.end());
|
||||
MulOps.push_back(AddRec->getOperand(i));
|
||||
NewOps.push_back(getMulExpr(MulOps));
|
||||
}
|
||||
}
|
||||
const SCEV *Scale = getMulExpr(LIOps);
|
||||
for (unsigned i = 0, e = AddRec->getNumOperands(); i != e; ++i)
|
||||
NewOps.push_back(getMulExpr(Scale, AddRec->getOperand(i)));
|
||||
|
||||
// It's tempting to propagate the NSW flag here, but nsw multiplication
|
||||
// is not associative so this isn't necessarily safe.
|
||||
|
Loading…
Reference in New Issue
Block a user