[llvm] r339688 - [DAG] Avoid redundant chain transversal in store merge cycle check. NFCI.
Nirav Dave via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 14 09:20:43 PDT 2018
Author: niravd
Date: Tue Aug 14 09:20:43 2018
New Revision: 339688
URL: http://llvm.org/viewvc/llvm-project?rev=339688&view=rev
Log:
[DAG] Avoid redundant chain transversal in store merge cycle check. NFCI.
Patch by Henric Karlsson.
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=339688&r1=339687&r2=339688&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Tue Aug 14 09:20:43 2018
@@ -13971,11 +13971,12 @@ bool DAGCombiner::checkMergeStoreCandida
Worklist.push_back(RootNode);
while (!Worklist.empty()) {
auto N = Worklist.pop_back_val();
+ if (!Visited.insert(N).second)
+ continue; // Already present in Visited.
if (N->getOpcode() == ISD::TokenFactor) {
for (SDValue Op : N->ops())
Worklist.push_back(Op.getNode());
}
- Visited.insert(N);
}
// Don't count pruning nodes towards max.
More information about the llvm-commits
mailing list