Use transform instead of manual loop; NFC

llvm-svn: 300291
This commit is contained in:
Sanjoy Das 2017-04-14 01:33:13 +00:00
parent 82c2175793
commit 62f4b6bece
1 changed files with 5 additions and 5 deletions

View File

@ -110,11 +110,11 @@ TransformImpl(const SCEV *S, Instruction *User, Value *OperandValToReplace) {
const Loop *L = AR->getLoop();
// The addrec conceptually uses its operands at loop entry.
Instruction *LUser = &L->getHeader()->front();
// Transform each operand.
for (SCEVNAryExpr::op_iterator I = AR->op_begin(), E = AR->op_end();
I != E; ++I) {
Operands.push_back(TransformSubExpr(*I, LUser, nullptr));
}
transform(
AR->operands(), std::back_inserter(Operands),
[&](const SCEV *Op) { return TransformSubExpr(Op, LUser, nullptr); });
// Conservatively use AnyWrap until/unless we need FlagNW.
const SCEV *Result = SE.getAddRecExpr(Operands, L, SCEV::FlagAnyWrap);
switch (Kind) {