[SelectionDAG] Use std::any_of instead of a manually coded loop. NFC
authorCraig Topper <craig.topper@gmail.com>
Sun, 29 Nov 2015 04:37:11 +0000 (04:37 +0000)
committerCraig Topper <craig.topper@gmail.com>
Sun, 29 Nov 2015 04:37:11 +0000 (04:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254242 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index 72cc0c1..53d006c 100644 (file)
@@ -11317,15 +11317,11 @@ bool DAGCombiner::MergeConsecutiveStores(StoreSDNode* St) {
         break;
     }
 
         break;
     }
 
-    bool Alias = false;
     // Check if this store interferes with any of the loads that we found.
     // Check if this store interferes with any of the loads that we found.
-    for (unsigned ld = 0, lde = AliasLoadNodes.size(); ld < lde; ++ld)
-      if (isAlias(AliasLoadNodes[ld], StoreNodes[i].MemNode)) {
-        Alias = true;
-        break;
-      }
-    // We found a load that alias with this store. Stop the sequence.
-    if (Alias)
+    // If we find a load that alias with this store. Stop the sequence.
+    if (std::any_of(AliasLoadNodes.begin(), AliasLoadNodes.end(),
+                    std::bind(std::mem_fn(&DAGCombiner::isAlias), this,
+                              std::placeholders::_1, StoreNodes[i].MemNode)))
       break;
 
     // Mark this node as useful.
       break;
 
     // Mark this node as useful.