summaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/LoopCacheAnalysis.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2021-10-24 17:35:33 -0700
committerKazu Hirata <kazu@google.com>2021-10-24 17:35:33 -0700
commit4bd46501c394ce221d34b60155f48ebbf6b6897d (patch)
tree79000039fd89e30325195605fa9387416d82880f /llvm/lib/Analysis/LoopCacheAnalysis.cpp
parent19d3bc1e67b0b651e79bd31a1364c4c9dabdfdd3 (diff)
Use llvm::any_of and llvm::none_of (NFC)
Diffstat (limited to 'llvm/lib/Analysis/LoopCacheAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/LoopCacheAnalysis.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/LoopCacheAnalysis.cpp b/llvm/lib/Analysis/LoopCacheAnalysis.cpp
index b765ad0f8329..7b895d8a5dc2 100644
--- a/llvm/lib/Analysis/LoopCacheAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopCacheAnalysis.cpp
@@ -521,10 +521,9 @@ void CacheCost::calculateCacheFootprint() {
LLVM_DEBUG(dbgs() << "COMPUTING LOOP CACHE COSTS\n");
for (const Loop *L : Loops) {
- assert((std::find_if(LoopCosts.begin(), LoopCosts.end(),
- [L](const LoopCacheCostTy &LCC) {
- return LCC.first == L;
- }) == LoopCosts.end()) &&
+ assert(llvm::none_of(
+ LoopCosts,
+ [L](const LoopCacheCostTy &LCC) { return LCC.first == L; }) &&
"Should not add duplicate element");
CacheCostTy LoopCost = computeLoopCacheCost(*L, RefGroups);
LoopCosts.push_back(std::make_pair(L, LoopCost));