mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-10 18:11:19 +00:00
[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
This commit is contained in:
parent
d7e17c232f
commit
efed656873
@ -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);
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user