diff options
author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-11-29 23:40:53 +0000 |
---|---|---|
committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-11-29 23:40:53 +0000 |
commit | 3b827c7028442ac36d9c0a70775e7c397712e4c1 (patch) | |
tree | 85ce4328477275d7900cbfc15f70d03934e13965 /llvm/lib/Analysis/ScalarEvolution.cpp | |
parent | fbde7aa13ab0c80e0aef12b5cdae1622b298b222 (diff) | |
download | bcm5719-llvm-3b827c7028442ac36d9c0a70775e7c397712e4c1.tar.gz bcm5719-llvm-3b827c7028442ac36d9c0a70775e7c397712e4c1.zip |
[SCEV] Use range version of all_of; NFC
llvm-svn: 254275
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 7173b8075d8..6562acd09ff 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -1960,8 +1960,7 @@ StrengthenNoWrapFlags(ScalarEvolution *SE, SCEVTypes Type, auto IsKnownNonNegative = std::bind(std::mem_fn(&ScalarEvolution::isKnownNonNegative), SE, _1); - if (SignOrUnsignWrap == SCEV::FlagNSW && - std::all_of(Ops.begin(), Ops.end(), IsKnownNonNegative)) + if (SignOrUnsignWrap == SCEV::FlagNSW && all_of(Ops, IsKnownNonNegative)) Flags = ScalarEvolution::setFlags(Flags, (SCEV::NoWrapFlags)SignOrUnsignMask); @@ -2888,9 +2887,8 @@ ScalarEvolution::getAddRecExpr(SmallVectorImpl<const SCEV *> &Operands, // AddRecs require their operands be loop-invariant with respect to their // loops. Don't perform this transformation if it would break this // requirement. - bool AllInvariant = - std::all_of(Operands.begin(), Operands.end(), - [&](const SCEV *Op) { return isLoopInvariant(Op, L); }); + bool AllInvariant = all_of( + Operands, [&](const SCEV *Op) { return isLoopInvariant(Op, L); }); if (AllInvariant) { // Create a recurrence for the outer loop with the same step size. @@ -2901,9 +2899,9 @@ ScalarEvolution::getAddRecExpr(SmallVectorImpl<const SCEV *> &Operands, maskFlags(Flags, SCEV::FlagNW | NestedAR->getNoWrapFlags()); NestedOperands[0] = getAddRecExpr(Operands, L, OuterFlags); - AllInvariant = std::all_of( - NestedOperands.begin(), NestedOperands.end(), - [&](const SCEV *Op) { return isLoopInvariant(Op, NestedLoop); }); + AllInvariant = all_of(NestedOperands, [&](const SCEV *Op) { + return isLoopInvariant(Op, NestedLoop); + }); if (AllInvariant) { // Ok, both add recurrences are valid after the transformation. @@ -9673,8 +9671,8 @@ SCEVUnionPredicate::SCEVUnionPredicate() : SCEVPredicate(FoldingSetNodeIDRef(nullptr, 0), P_Union) {} bool SCEVUnionPredicate::isAlwaysTrue() const { - return std::all_of(Preds.begin(), Preds.end(), - [](const SCEVPredicate *I) { return I->isAlwaysTrue(); }); + return all_of(Preds, + [](const SCEVPredicate *I) { return I->isAlwaysTrue(); }); } ArrayRef<const SCEVPredicate *> @@ -9687,9 +9685,8 @@ SCEVUnionPredicate::getPredicatesForExpr(const SCEV *Expr) { bool SCEVUnionPredicate::implies(const SCEVPredicate *N) const { if (const auto *Set = dyn_cast<const SCEVUnionPredicate>(N)) - return std::all_of( - Set->Preds.begin(), Set->Preds.end(), - [this](const SCEVPredicate *I) { return this->implies(I); }); + return all_of(Set->Preds, + [this](const SCEVPredicate *I) { return this->implies(I); }); auto ScevPredsIt = SCEVToPreds.find(N->getExpr()); if (ScevPredsIt == SCEVToPreds.end()) |