[llvm] 6ed2cb4 - Revert "[llvm] Use llvm::is_contained (NFC)"
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 28 18:52:58 PDT 2022
Author: Kazu Hirata
Date: 2022-08-28T18:52:49-07:00
New Revision: 6ed2cb4ad59bc999bd0c3519167439fde3758eea
URL: https://github.com/llvm/llvm-project/commit/6ed2cb4ad59bc999bd0c3519167439fde3758eea
DIFF: https://github.com/llvm/llvm-project/commit/6ed2cb4ad59bc999bd0c3519167439fde3758eea.diff
LOG: Revert "[llvm] Use llvm::is_contained (NFC)"
This reverts commit ebf574f59a80ca00e234eee0b047e5f0df99587d.
This patch seems to cause build failures on Windows.
Added:
Modified:
llvm/lib/Analysis/LoopCacheAnalysis.cpp
llvm/lib/Support/ThreadPool.cpp
llvm/lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/LoopCacheAnalysis.cpp b/llvm/lib/Analysis/LoopCacheAnalysis.cpp
index 2e7e7d33512e..85f2dad86711 100644
--- a/llvm/lib/Analysis/LoopCacheAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopCacheAnalysis.cpp
@@ -600,7 +600,9 @@ void CacheCost::calculateCacheFootprint() {
LLVM_DEBUG(dbgs() << "COMPUTING LOOP CACHE COSTS\n");
for (const Loop *L : Loops) {
- assert(!llvm::is_contained(llvm::make_first_range(LoopCosts), L) &&
+ 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));
diff --git a/llvm/lib/Support/ThreadPool.cpp b/llvm/lib/Support/ThreadPool.cpp
index d0bda927c20b..31461e31c65c 100644
--- a/llvm/lib/Support/ThreadPool.cpp
+++ b/llvm/lib/Support/ThreadPool.cpp
@@ -136,7 +136,8 @@ bool ThreadPool::workCompletedUnlocked(ThreadPoolTaskGroup *Group) const {
if (Group == nullptr)
return !ActiveThreads && Tasks.empty();
return ActiveGroups.count(Group) == 0 &&
- !llvm::is_contained(llvm::make_second_range(Tasks), Group);
+ !llvm::any_of(Tasks,
+ [Group](const auto &T) { return T.second == Group; });
}
void ThreadPool::wait() {
diff --git a/llvm/lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp b/llvm/lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp
index 497434a85b64..4f8a61a77097 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp
@@ -276,7 +276,10 @@ bool AMDGPURewriteOutArguments::runOnFunction(Function &F) {
Value *ReplVal = Store.second->getValueOperand();
auto &ValVec = Replacements[Store.first];
- if (llvm::is_contained(llvm::make_first_range(ValVec), OutArg)) {
+ if (llvm::any_of(ValVec,
+ [OutArg](const std::pair<Argument *, Value *> &Entry) {
+ return Entry.first == OutArg;
+ })) {
LLVM_DEBUG(dbgs()
<< "Saw multiple out arg stores" << *OutArg << '\n');
// It is possible to see stores to the same argument multiple times,
More information about the llvm-commits
mailing list