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

Method addDep

chapter11/src/main/java/com/seaofnodes/simple/node/Node.java:460–470  ·  view source on GitHub ↗

Add a node to the list of 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

458 * being added must benefit from this node being peepholed.
459 */
460 Node addDep( Node dep ) {
461 // Running peepholes during the big assert cannot have side effects
462 // like adding dependencies.
463 if( IterPeeps.midAssert() ) return this;
464 if( _deps==null ) _deps = new ArrayList<>();
465 if( Utils.find(_deps ,dep) != -1 ) return this; // Already on list
466 if( Utils.find(_inputs,dep) != -1 ) return this; // No need for deps on immediate neighbors
467 if( Utils.find(_outputs,dep)!= -1 ) return this;
468 _deps.add(dep);
469 return this;
470 }
471
472 // Move the dependents onto a worklist, and clear for future dependents.
473 public void moveDepsToWorklist( ) {

Callers 10

profitMethod · 0.95
computeMethod · 0.45
idealizeMethod · 0.45
singleUniqueInputMethod · 0.45
allConsMethod · 0.45
checkNoUseBeyondMethod · 0.45
allConsMethod · 0.45
idealizeMethod · 0.45
idealizeMethod · 0.45
idealizeMethod · 0.45

Calls 3

midAssertMethod · 0.95
findMethod · 0.95
addMethod · 0.45

Tested by

no test coverage detected