diff options
author | Nirav Dave <niravd@google.com> | 2018-02-07 17:12:34 +0000 |
---|---|---|
committer | Nirav Dave <niravd@google.com> | 2018-02-07 17:12:34 +0000 |
commit | efed656873be88d303d1702a100b4304db490026 (patch) | |
tree | 9729d0dd6a98b9603402c7a69eb20cc49e3aedf9 /llvm/lib/CodeGen | |
parent | d7e17c232fb7ee57e5fbbe073b351d65560823cc (diff) | |
download | bcm5719-llvm-efed656873be88d303d1702a100b4304db490026.tar.gz bcm5719-llvm-efed656873be88d303d1702a100b4304db490026.zip |
[SelectionDAG] More Aggressibly prune nodes in AddChains. NFCI.
Travel all chains paths to first non-tokenfactor node can be
exponential work. Add simple redundency check to avoid this.
Fixes PR36264.
llvm-svn: 324491
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 4 |
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); }; |