summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 53e8b2ee5b5..ef307400d97 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -2396,13 +2396,15 @@ HandleMergeInputChains(SmallVectorImpl<SDNode*> &ChainNodesMatched,
return;
if (V->getOpcode() == ISD::EntryToken)
return;
+ if (!Visited.insert(V.getNode()).second)
+ return;
// Newly selected nodes (-1) are always added directly.
if (V->getNodeId() == -1)
InputChains.push_back(V);
else if (V->getOpcode() == ISD::TokenFactor) {
for (int i = 0, e = V->getNumOperands(); i != e; ++i)
AddChains(V->getOperand(i));
- } else if (!Visited.count(V.getNode()))
+ } else
InputChains.push_back(V);
};
OpenPOWER on IntegriCloud