From ce14a216e2f48b23284aa8726a171454c6db9573 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sun, 29 Nov 2015 04:37:11 +0000 Subject: [PATCH] [SelectionDAG] Use std::any_of instead of a manually coded loop. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254242 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 72cc0c195eb..53d006c9d9f 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -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. -- 2.34.1