From 450dd5169ebbfd8664d073b0d8baea201dae0ed2 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Sun, 13 Apr 2025 19:49:31 -0700 Subject: Cleanup recent phi xform Missing deps --- .../java/com/seaofnodes/simple/node/PhiNode.java | 77 ++++++++++++---------- 1 file changed, 42 insertions(+), 35 deletions(-) diff --git a/chapter21/src/main/java/com/seaofnodes/simple/node/PhiNode.java b/chapter21/src/main/java/com/seaofnodes/simple/node/PhiNode.java index f0bf1166..975492bf 100644 --- a/chapter21/src/main/java/com/seaofnodes/simple/node/PhiNode.java +++ b/chapter21/src/main/java/com/seaofnodes/simple/node/PhiNode.java @@ -81,39 +81,9 @@ public class PhiNode extends Node { return null; // Generic "pull down op" - Node op = in(1); - if( same_op() ) { - assert !(op instanceof CFGNode); - boolean solo=true; - for( int i=1; i 1 || in(i).in(0)!=null ) - { solo=false; break; } - if( solo ) { - Node cp = op.copy(); - cp._type = null; // Fresh type - cp.addDef(null); // No control - - for( int j=1; j 1 ) { // Too many users, but addDep in case lose users + for( Node out : op._outputs ) if( out!=null ) out.addDep(this); return false; + } + } return true; } + private Node drop_same_op() { + assert !(in(1) instanceof CFGNode); + Node op = in(1); + Node cp = op.copy(); + cp._type = null; // Fresh type + cp.addDef(null); // No control + + for( int j=1; j