diff options
-rw-r--r-- | llvm/include/llvm/CodeGen/SelectionDAGNodes.h | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 6 |
2 files changed, 2 insertions, 6 deletions
diff --git a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h index ab25b8a7b2c..a2bead3c6ab 100644 --- a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h @@ -820,7 +820,7 @@ public: if (Found) return true; if (MaxSteps != 0 && Visited.size() >= MaxSteps) - return false; + return true; } return false; } diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index ba06f6266ed..d0e2f918278 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -13102,14 +13102,10 @@ bool DAGCombiner::checkMergeStoreCandidatesForDependencies( Worklist.push_back(n->getOperand(j).getNode()); } // Search through DAG. We can stop early if we find a store node. - for (unsigned i = 0; i < NumStores; ++i) { + for (unsigned i = 0; i < NumStores; ++i) if (SDNode::hasPredecessorHelper(StoreNodes[i].MemNode, Visited, Worklist, Max)) return false; - // Check if we ended early, failing conservatively if so. - if (Visited.size() >= Max) - return false; - } return true; } |