Skip to content

Commit

Permalink
avr-rust/rust-legacy-fork#101 (D53106): topological sorting
Browse files Browse the repository at this point in the history
(cherry picked from commit 626f49c)
  • Loading branch information
TimNN authored and Lazarus535 committed Oct 2, 2019
1 parent 8adf9bd commit ba813f7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions llvm/include/llvm/CodeGen/SelectionDAGNodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,12 @@ END_TWO_BYTE_PACK()
SmallVectorImpl<const SDNode *> &Worklist,
unsigned int MaxSteps = 0,
bool TopologicalPrune = false) {
// NOTE(TimNN): I'm not confident that the in-progress D53106 actually
// handles the topological ordering correctly, so I'm disabling
// this performance optimization until the upstream patch has
// been accepted.
TopologicalPrune = false;

SmallVector<const SDNode *, 8> DeferredNodes;
if (Visited.count(N))
return true;
Expand Down Expand Up @@ -901,6 +907,14 @@ END_TWO_BYTE_PACK()
}
for (const SDValue &OpV : M->op_values()) {
SDNode *Op = OpV.getNode();
// If we are adding a glued node, its glued user should be considered a
// predecessor as well to prevent a node merge causing a non-immediate
// use of a glue operand. Walk down all unvisited glue users.
while (auto *GN = Op->getGluedUser()) {
if ((GN == M) || Visited.count(GN))
break;
Op = GN;
}
if (Visited.insert(Op).second)
Worklist.push_back(Op);
if (Op == N)
Expand Down

0 comments on commit ba813f7

Please sign in to comment.