[llvm] r300291 - Use transform instead of manual loop; NFC
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 13 18:33:13 PDT 2017
Author: sanjoy
Date: Thu Apr 13 20:33:13 2017
New Revision: 300291
URL: http://llvm.org/viewvc/llvm-project?rev=300291&view=rev
Log:
Use transform instead of manual loop; NFC
Modified:
llvm/trunk/lib/Analysis/ScalarEvolutionNormalization.cpp
Modified: llvm/trunk/lib/Analysis/ScalarEvolutionNormalization.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolutionNormalization.cpp?rev=300291&r1=300290&r2=300291&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolutionNormalization.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolutionNormalization.cpp Thu Apr 13 20:33:13 2017
@@ -110,11 +110,11 @@ TransformImpl(const SCEV *S, Instruction
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) {
More information about the llvm-commits
mailing list