[llvm] r254242 - [SelectionDAG] Use std::any_of instead of a manually coded loop. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 28 20:37:11 PST 2015


Author: ctopper
Date: Sat Nov 28 22:37:11 2015
New Revision: 254242

URL: http://llvm.org/viewvc/llvm-project?rev=254242&view=rev
Log:
[SelectionDAG] Use std::any_of instead of a manually coded loop. NFC

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=254242&r1=254241&r2=254242&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sat Nov 28 22:37:11 2015
@@ -11317,15 +11317,11 @@ bool DAGCombiner::MergeConsecutiveStores
         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.




More information about the llvm-commits mailing list