[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 72cc0c195ebcb24c4c838e61a487019a3e5e57e6..53d006c9d9fec6cb53bd2c82c47df56269d8ccb6 100644 (file)
@@ -11317,15 +11317,11 @@ bool DAGCombiner::MergeConsecutiveStores(StoreSDNode* St) {
         break;
     }
 
-    bool Alias = false;
     // 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.