[llvm] 291d8ab - [llvm] Use llvm::find_if (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 20 00:03:25 PDT 2023
Author: Kazu Hirata
Date: 2023-10-20T00:03:19-07:00
New Revision: 291d8ab3ed1ec0c7f1ed024f0a97fca07b6d7b2a
URL: https://github.com/llvm/llvm-project/commit/291d8ab3ed1ec0c7f1ed024f0a97fca07b6d7b2a
DIFF: https://github.com/llvm/llvm-project/commit/291d8ab3ed1ec0c7f1ed024f0a97fca07b6d7b2a.diff
LOG: [llvm] Use llvm::find_if (NFC)
Added:
Modified:
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
index f8f1e6d6c9097cc..a7d8e11461733fc 100644
--- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
@@ -12831,7 +12831,7 @@ static void placeSources(ByteProvider<SDValue> &Src0,
return IterElt.first == *BPP.first.Src;
};
- auto Match = std::find_if(Srcs.begin(), Srcs.end(), MatchesFirst);
+ auto Match = llvm::find_if(Srcs, MatchesFirst);
if (Match != Srcs.end()) {
Match->second = addPermMasks(FirstMask, Match->second);
FirstGroup = I;
@@ -12844,7 +12844,7 @@ static void placeSources(ByteProvider<SDValue> &Src0,
auto MatchesSecond = [&BPP](std::pair<SDValue, unsigned> IterElt) {
return IterElt.first == *BPP.second.Src;
};
- auto Match = std::find_if(Srcs.begin(), Srcs.end(), MatchesSecond);
+ auto Match = llvm::find_if(Srcs, MatchesSecond);
if (Match != Srcs.end()) {
Match->second = addPermMasks(SecondMask, Match->second);
} else
diff --git a/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp b/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
index e99dd6483a2b2ae..3ab21ad26d85e6f 100644
--- a/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
+++ b/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
@@ -793,11 +793,10 @@ CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::ContextNode::
template <typename DerivedCCG, typename FuncTy, typename CallTy>
void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::ContextNode::
eraseCalleeEdge(const ContextEdge *Edge) {
- auto EI =
- std::find_if(CalleeEdges.begin(), CalleeEdges.end(),
- [Edge](const std::shared_ptr<ContextEdge> &CalleeEdge) {
- return CalleeEdge.get() == Edge;
- });
+ auto EI = llvm::find_if(
+ CalleeEdges, [Edge](const std::shared_ptr<ContextEdge> &CalleeEdge) {
+ return CalleeEdge.get() == Edge;
+ });
assert(EI != CalleeEdges.end());
CalleeEdges.erase(EI);
}
@@ -805,11 +804,10 @@ void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::ContextNode::
template <typename DerivedCCG, typename FuncTy, typename CallTy>
void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::ContextNode::
eraseCallerEdge(const ContextEdge *Edge) {
- auto EI =
- std::find_if(CallerEdges.begin(), CallerEdges.end(),
- [Edge](const std::shared_ptr<ContextEdge> &CallerEdge) {
- return CallerEdge.get() == Edge;
- });
+ auto EI = llvm::find_if(
+ CallerEdges, [Edge](const std::shared_ptr<ContextEdge> &CallerEdge) {
+ return CallerEdge.get() == Edge;
+ });
assert(EI != CallerEdges.end());
CallerEdges.erase(EI);
}
More information about the llvm-commits
mailing list