Skip to content

Commit

Permalink
[PATCH-AVR] avr-rust/rust-legacy-fork#101 (D53106): topological sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
TimNN committed Oct 28, 2018
1 parent 71713c2 commit dea8c37
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions include/llvm/CodeGen/SelectionDAGNodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,12 @@ class SDNode : public FoldingSetNode, public ilist_node<SDNode> {
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 @@ -867,6 +873,14 @@ class SDNode : public FoldingSetNode, public ilist_node<SDNode> {
}
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 dea8c37

Please sign in to comment.