summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/CodeMetrics.cpp3
-rw-r--r--llvm/lib/Analysis/GlobalsModRef.cpp12
-rw-r--r--llvm/lib/Analysis/InstructionSimplify.cpp8
-rw-r--r--llvm/lib/Analysis/LazyCallGraph.cpp3
-rw-r--r--llvm/lib/Analysis/LoopInfo.cpp11
-rw-r--r--llvm/lib/Analysis/ModuleSummaryAnalysis.cpp6
-rw-r--r--llvm/lib/Analysis/ScalarEvolutionExpander.cpp5
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp5
8 files changed, 23 insertions, 30 deletions
diff --git a/llvm/lib/Analysis/CodeMetrics.cpp b/llvm/lib/Analysis/CodeMetrics.cpp
index 576dca4b42c..8e795030aaf 100644
--- a/llvm/lib/Analysis/CodeMetrics.cpp
+++ b/llvm/lib/Analysis/CodeMetrics.cpp
@@ -45,8 +45,7 @@ static void completeEphemeralValues(SmallVector<const Value *, 16> &WorkSet,
continue;
// If all uses of this value are ephemeral, then so is this value.
- if (!std::all_of(V->user_begin(), V->user_end(),
- [&](const User *U) { return EphValues.count(U); }))
+ if (!all_of(V->users(), [&](const User *U) { return EphValues.count(U); }))
continue;
EphValues.insert(V);
diff --git a/llvm/lib/Analysis/GlobalsModRef.cpp b/llvm/lib/Analysis/GlobalsModRef.cpp
index a7cf134960e..8289e585d27 100644
--- a/llvm/lib/Analysis/GlobalsModRef.cpp
+++ b/llvm/lib/Analysis/GlobalsModRef.cpp
@@ -857,22 +857,22 @@ ModRefInfo GlobalsAAResult::getModRefInfoForArgument(ImmutableCallSite CS,
if (CS.doesNotAccessMemory())
return MRI_NoModRef;
ModRefInfo ConservativeResult = CS.onlyReadsMemory() ? MRI_Ref : MRI_ModRef;
-
+
// Iterate through all the arguments to the called function. If any argument
// is based on GV, return the conservative result.
for (auto &A : CS.args()) {
SmallVector<Value*, 4> Objects;
GetUnderlyingObjects(A, Objects, DL);
-
+
// All objects must be identified.
- if (!std::all_of(Objects.begin(), Objects.end(), isIdentifiedObject) &&
+ if (!all_of(Objects, isIdentifiedObject) &&
// Try ::alias to see if all objects are known not to alias GV.
- !std::all_of(Objects.begin(), Objects.end(), [&](Value *V) {
+ !all_of(Objects, [&](Value *V) {
return this->alias(MemoryLocation(V), MemoryLocation(GV)) == NoAlias;
- }))
+ }))
return ConservativeResult;
- if (std::find(Objects.begin(), Objects.end(), GV) != Objects.end())
+ if (is_contained(Objects, GV))
return ConservativeResult;
}
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp
index e6aed6d6816..95273a78897 100644
--- a/llvm/lib/Analysis/InstructionSimplify.cpp
+++ b/llvm/lib/Analysis/InstructionSimplify.cpp
@@ -2104,8 +2104,8 @@ computePointerICmp(const DataLayout &DL, const TargetLibraryInfo *TLI,
GetUnderlyingObjects(RHS, RHSUObjs, DL);
// Is the set of underlying objects all noalias calls?
- auto IsNAC = [](SmallVectorImpl<Value *> &Objects) {
- return std::all_of(Objects.begin(), Objects.end(), isNoAliasCall);
+ auto IsNAC = [](ArrayRef<Value *> Objects) {
+ return all_of(Objects, isNoAliasCall);
};
// Is the set of underlying objects all things which must be disjoint from
@@ -2114,8 +2114,8 @@ computePointerICmp(const DataLayout &DL, const TargetLibraryInfo *TLI,
// live with the compared-to allocation). For globals, we exclude symbols
// that might be resolve lazily to symbols in another dynamically-loaded
// library (and, thus, could be malloc'ed by the implementation).
- auto IsAllocDisjoint = [](SmallVectorImpl<Value *> &Objects) {
- return std::all_of(Objects.begin(), Objects.end(), [](Value *V) {
+ auto IsAllocDisjoint = [](ArrayRef<Value *> Objects) {
+ return all_of(Objects, [](Value *V) {
if (const AllocaInst *AI = dyn_cast<AllocaInst>(V))
return AI->getParent() && AI->getFunction() && AI->isStaticAlloca();
if (const GlobalValue *GV = dyn_cast<GlobalValue>(V))
diff --git a/llvm/lib/Analysis/LazyCallGraph.cpp b/llvm/lib/Analysis/LazyCallGraph.cpp
index acff8529b15..404b8312546 100644
--- a/llvm/lib/Analysis/LazyCallGraph.cpp
+++ b/llvm/lib/Analysis/LazyCallGraph.cpp
@@ -1207,8 +1207,7 @@ LazyCallGraph::RefSCC::removeInternalRefEdge(Node &SourceN, Node &TargetN) {
if (!Result.empty())
assert(!IsLeaf && "This SCC cannot be a leaf as we have split out new "
"SCCs by removing this edge.");
- if (!std::any_of(G->LeafRefSCCs.begin(), G->LeafRefSCCs.end(),
- [&](RefSCC *C) { return C == this; }))
+ if (none_of(G->LeafRefSCCs, [&](RefSCC *C) { return C == this; }))
assert(!IsLeaf && "This SCC cannot be a leaf as it already had child "
"SCCs before we removed this edge.");
#endif
diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp
index 9a8789cfe55..9d2e38e19da 100644
--- a/llvm/lib/Analysis/LoopInfo.cpp
+++ b/llvm/lib/Analysis/LoopInfo.cpp
@@ -177,9 +177,8 @@ bool Loop::isRecursivelyLCSSAForm(DominatorTree &DT) const {
if (!isLCSSAForm(DT))
return false;
- return std::all_of(begin(), end(), [&](const Loop *L) {
- return L->isRecursivelyLCSSAForm(DT);
- });
+ return all_of(*this,
+ [&](const Loop *L) { return L->isRecursivelyLCSSAForm(DT); });
}
bool Loop::isLoopSimplifyForm() const {
@@ -366,8 +365,7 @@ Loop::getUniqueExitBlocks(SmallVectorImpl<BasicBlock *> &ExitBlocks) const {
// In case of multiple edges from current block to exit block, collect
// only one edge in ExitBlocks. Use switchExitBlocks to keep track of
// duplicate edges.
- if (std::find(SwitchExitBlocks.begin(), SwitchExitBlocks.end(), Successor)
- == SwitchExitBlocks.end()) {
+ if (!is_contained(SwitchExitBlocks, Successor)) {
SwitchExitBlocks.push_back(Successor);
ExitBlocks.push_back(Successor);
}
@@ -536,8 +534,7 @@ Loop *UnloopUpdater::getNearestLoop(BasicBlock *BB, Loop *BBLoop) {
assert(Subloop && "subloop is not an ancestor of the original loop");
}
// Get the current nearest parent of the Subloop exits, initially Unloop.
- NearLoop =
- SubloopParents.insert(std::make_pair(Subloop, &Unloop)).first->second;
+ NearLoop = SubloopParents.insert({Subloop, &Unloop}).first->second;
}
succ_iterator I = succ_begin(BB), E = succ_end(BB);
diff --git a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
index c9ac2bdb794..e457f1c00f4 100644
--- a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
+++ b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
@@ -232,13 +232,13 @@ bool llvm::moduleCanBeRenamedForThinLTO(const Module &M) {
SmallPtrSet<GlobalValue *, 8> Used;
collectUsedGlobalVariables(M, Used, /*CompilerUsed*/ false);
bool LocalIsUsed =
- llvm::any_of(Used, [](GlobalValue *V) { return V->hasLocalLinkage(); });
+ any_of(Used, [](GlobalValue *V) { return V->hasLocalLinkage(); });
if (!LocalIsUsed)
return true;
// Walk all the instructions in the module and find if one is inline ASM
- auto HasInlineAsm = llvm::any_of(M, [](const Function &F) {
- return llvm::any_of(instructions(F), [](const Instruction &I) {
+ auto HasInlineAsm = any_of(M, [](const Function &F) {
+ return any_of(instructions(F), [](const Instruction &I) {
const CallInst *CallI = dyn_cast<CallInst>(&I);
if (!CallI)
return false;
diff --git a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
index 83c803df14b..8959645574b 100644
--- a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
+++ b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
@@ -549,9 +549,8 @@ Value *SCEVExpander::expandAddToGEP(const SCEV *const *op_begin,
while (const Loop *L = SE.LI.getLoopFor(Builder.GetInsertBlock())) {
if (!L->isLoopInvariant(V)) break;
- bool AnyIndexNotLoopInvariant =
- std::any_of(GepIndices.begin(), GepIndices.end(),
- [L](Value *Op) { return !L->isLoopInvariant(Op); });
+ bool AnyIndexNotLoopInvariant = any_of(
+ GepIndices, [L](Value *Op) { return !L->isLoopInvariant(Op); });
if (AnyIndexNotLoopInvariant)
break;
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index c4403c69d20..ac7dabec450 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -406,7 +406,7 @@ static bool isEphemeralValueOf(Instruction *I, const Value *E) {
// The instruction defining an assumption's condition itself is always
// considered ephemeral to that assumption (even if it has other
// non-ephemeral users). See r246696's test case for an example.
- if (std::find(I->op_begin(), I->op_end(), E) != I->op_end())
+ if (is_contained(I->operands(), E))
return true;
while (!WorkSet.empty()) {
@@ -415,8 +415,7 @@ static bool isEphemeralValueOf(Instruction *I, const Value *E) {
continue;
// If all uses of this value are ephemeral, then so is this value.
- if (std::all_of(V->user_begin(), V->user_end(),
- [&](const User *U) { return EphValues.count(U); })) {
+ if (all_of(V->users(), [&](const User *U) { return EphValues.count(U); })) {
if (V == E)
return true;
OpenPOWER on IntegriCloud