MCPcopy Create free account
hub / github.com/SeaOfNodes/Simple / addDep

Method addDep

chapter09/src/main/java/com/seaofnodes/simple/node/Node.java:485–495  ·  view source on GitHub ↗

Add a node to the list o dependencies. Only add it if its not an input or output of this node, that is, it is at least one step away. The node being added must benefit from this node being peepholed.

( Node dep )

Source from the content-addressed store, hash-verified

483 // Swap inputs without letting either input go dead during the swap.
484 Node swap12() {
485 unlock(); // Hash is order dependent
486 Node tmp = in(1);
487 _inputs.set(1,in(2));
488 _inputs.set(2,tmp);
489 return this;
490 }
491
492 /**
493 * Does this node contain all constants?
494 * Ignores in(0), as is usually control.
495 * In an input is not a constant, we add dep as
496 * a dependency to it, because dep can make progress
497 * if the input becomes a constant later.
498 * It is sufficient for one of the non-const

Callers 6

idealizeMethod · 0.95
computeMethod · 0.45
singleUniqueInputMethod · 0.45
allConsMethod · 0.45
allConsMethod · 0.45
idealizeMethod · 0.45

Calls 3

midAssertMethod · 0.95
findMethod · 0.95
addMethod · 0.45

Tested by

no test coverage detected