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

Method kill

chapter23/src/main/java/com/seaofnodes/simple/node/Node.java:258–270  ·  view source on GitHub ↗

Kill a Node with no uses , by setting all of its defs to null. This may recursively kill more Nodes, and is basically dead code elimination.

( )

Source from the content-addressed store, hash-verified

256 * code elimination.
257 */
258 public void kill( ) {
259 assert isUnused(); // Has no uses, so it is dead
260 unlock();
261 moveDepsToWorklist();
262 _type=null; // Flag as dead
263 while( nIns()>0 ) { // Set all inputs to null, recursively killing unused Nodes
264 Node old_def = _inputs.removeLast();
265 // Revisit neighbor because removed use
266 if( old_def != null && CODE.add(old_def).delUse(this) )
267 old_def.kill(); // If we removed the last use, the old def is now dead
268 }
269 assert isDead(); // Really dead now
270 }
271
272 // Preserve CFG use-ordering when killing
273 public void killOrdered() {

Callers 14

functionCallMethod · 0.95
iterateMethod · 0.95
drop_same_opMethod · 0.95
setDefMethod · 0.95
delDefMethod · 0.95
popUntilMethod · 0.95
killOrderedMethod · 0.95
unkillMethod · 0.95
isKillMethod · 0.95
subsumeMethod · 0.95
deadCodeElimMethod · 0.95
widenMethod · 0.95

Calls 8

isUnusedMethod · 0.95
unlockMethod · 0.95
moveDepsToWorklistMethod · 0.95
nInsMethod · 0.95
isDeadMethod · 0.95
removeLastMethod · 0.45
delUseMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected