[llvm] 6e18003 - [llvm] Use llvm::any_of (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 22 10:42:30 PDT 2023


Author: Kazu Hirata
Date: 2023-10-22T10:42:18-07:00
New Revision: 6e18003a23aaa784b6961e4cc0c967c13fede461

URL: https://github.com/llvm/llvm-project/commit/6e18003a23aaa784b6961e4cc0c967c13fede461
DIFF: https://github.com/llvm/llvm-project/commit/6e18003a23aaa784b6961e4cc0c967c13fede461.diff

LOG: [llvm] Use llvm::any_of (NFC)

Added: 
    

Modified: 
    llvm/lib/DebugInfo/LogicalView/Core/LVCompare.cpp
    llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/DebugInfo/LogicalView/Core/LVCompare.cpp b/llvm/lib/DebugInfo/LogicalView/Core/LVCompare.cpp
index 65baf52ffb44fba..3ed0de14f93f07c 100644
--- a/llvm/lib/DebugInfo/LogicalView/Core/LVCompare.cpp
+++ b/llvm/lib/DebugInfo/LogicalView/Core/LVCompare.cpp
@@ -206,11 +206,10 @@ Error LVCompare::execute(LVReader *ReferenceReader, LVReader *TargetReader) {
               updateExpected(Reference);
             Reference->setIsInCompare();
             LVElement *CurrentTarget = nullptr;
-            if (std::any_of(Targets.begin(), Targets.end(),
-                            [&](auto Target) -> bool {
-                              CurrentTarget = Target;
-                              return Reference->equals(Target);
-                            })) {
+            if (llvm::any_of(Targets, [&](auto Target) -> bool {
+                  CurrentTarget = Target;
+                  return Reference->equals(Target);
+                })) {
               if (Pass == LVComparePass::Missing && Reference->getIsScope()) {
                 // If the elements being compared are scopes and are a match,
                 // they are recorded, to be used when creating the augmented

diff  --git a/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp b/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp
index 0f28074ea142bd9..c67a21c639fc029 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp
@@ -965,11 +965,10 @@ class MFMASmallGemmSingleWaveOpt final : public IGLPStrategy {
 
       // Does the VALU have a DS_WRITE successor that is the same as other
       // VALU already in the group. The V_PERMs will all share 1 DS_W succ
-      return std::any_of(Cache->begin(), Cache->end(), [&SU](SUnit *Elt) {
-        return std::any_of(SU->Succs.begin(), SU->Succs.end(),
-                           [&Elt](const SDep &ThisSucc) {
-                             return ThisSucc.getSUnit() == Elt;
-                           });
+      return llvm::any_of(*Cache, [&SU](SUnit *Elt) {
+        return llvm::any_of(SU->Succs, [&Elt](const SDep &ThisSucc) {
+          return ThisSucc.getSUnit() == Elt;
+        });
       });
     }
 
@@ -1088,10 +1087,9 @@ class MFMASmallGemmSingleWaveOpt final : public IGLPStrategy {
       auto DAG = SyncPipe[0].DAG;
       // Does the previous DS_WRITE share a V_PERM predecessor with this
       // VMEM_READ
-      return (
-          std::any_of(Cache->begin(), Cache->end(), [&SU, &DAG](SUnit *Elt) {
-            return DAG->IsReachable(const_cast<SUnit *>(SU), Elt);
-          }));
+      return llvm::any_of(*Cache, [&SU, &DAG](SUnit *Elt) {
+        return DAG->IsReachable(const_cast<SUnit *>(SU), Elt);
+      });
     }
     SharesPredWithPrevNthGroup(unsigned Distance, const SIInstrInfo *TII,
                                unsigned SGID, bool NeedsCache = false)


        


More information about the llvm-commits mailing list