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

Method kill

chapter21/src/main/java/com/seaofnodes/simple/node/Node.java:256–268  ·  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

254 nnn.addUse(n);
255 CODE.addAll(n._outputs);
256 }
257 kill();
258 }
259
260 // insert `this` immediately after `def` in the same basic block.
261 public void insertAfter( Node def ) {
262 CFGNode cfg = def.cfg0();
263 int i = cfg._outputs.find(def)+1;
264 if( cfg instanceof CallEndNode ) {
265 cfg = cfg.uctrl(); i=0;
266 } else if( def.in(0) instanceof MultiNode ) {
267 assert i==0;
268 i = cfg._outputs.find(def.in(0))+1;
269 }
270
271 while( cfg.out(i) instanceof PhiNode || cfg.out(i) instanceof CalleeSaveNode ) i++;

Callers 13

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
subsumeMethod · 0.95
deadCodeElimMethod · 0.95
widenMethod · 0.95
parseMethod · 0.45

Calls 8

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

Tested by

no test coverage detected