From: Craig Topper Date: Sun, 29 Nov 2015 04:37:11 +0000 (+0000) Subject: [SelectionDAG] Use std::any_of instead of a manually coded loop. NFC X-Git-Tag: android-x86-7.1-r4~40892 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=ce14a216e2f48b23284aa8726a171454c6db9573;p=android-x86%2Fexternal-llvm.git [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 --- 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.