mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-14 07:31:53 +00:00
Avoid creating a token factor node in trivially redundant cases. This
eliminates almost one node per block in common cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24254 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7c0104b525
commit
7436b57de3
@ -1234,7 +1234,18 @@ void SelectionDAGISel::BuildSelectionDAG(SelectionDAG &DAG, BasicBlock *LLVMBB,
|
||||
|
||||
// Turn all of the unordered chains into one factored node.
|
||||
if (!UnorderedChains.empty()) {
|
||||
UnorderedChains.push_back(SDL.getRoot());
|
||||
SDOperand Root = SDL.getRoot();
|
||||
if (Root.getOpcode() != ISD::EntryToken) {
|
||||
unsigned i = 0, e = UnorderedChains.size();
|
||||
for (; i != e; ++i) {
|
||||
assert(UnorderedChains[i].Val->getNumOperands() > 1);
|
||||
if (UnorderedChains[i].Val->getOperand(0) == Root)
|
||||
break; // Don't add the root if we already indirectly depend on it.
|
||||
}
|
||||
|
||||
if (i == e)
|
||||
UnorderedChains.push_back(Root);
|
||||
}
|
||||
DAG.setRoot(DAG.getNode(ISD::TokenFactor, MVT::Other, UnorderedChains));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user