diff options
| author | Cliff Click <cliffc@acm.org> | 2025-10-11 11:48:49 -0700 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2025-10-11 11:48:49 -0700 |
| commit | 1426384fc7d0e9947e38ad6d523a5e53c324d710 (patch) | |
| tree | a50e0d2ce32b0471c3e7b558bd5b4c09d8e47263 /chapter24/src/main | |
| parent | d0d2dc9c1265fbf82e1d11a4726683dd42bbdf06 (diff) | |
| download | Simple-1426384fc7d0e9947e38ad6d523a5e53c324d710.tar.gz Simple-1426384fc7d0e9947e38ad6d523a5e53c324d710.zip | |
Missing dep
Diffstat (limited to 'chapter24/src/main')
| -rw-r--r-- | chapter24/src/main/java/com/seaofnodes/simple/node/IfNode.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/chapter24/src/main/java/com/seaofnodes/simple/node/IfNode.java b/chapter24/src/main/java/com/seaofnodes/simple/node/IfNode.java index 25d21c98..5d751602 100644 --- a/chapter24/src/main/java/com/seaofnodes/simple/node/IfNode.java +++ b/chapter24/src/main/java/com/seaofnodes/simple/node/IfNode.java @@ -58,11 +58,15 @@ public class IfNode extends CFGNode implements MultiNode { // Hunt up the immediate dominator tree. If we find an identical if // test on either the true or false branch, that side wins. if( !pred()._type.isHighOrConst() ) - for( CFGNode dom = idom(), prior=this; dom!=null; prior = dom, dom = dom.idom() ) + for( CFGNode dom = idom(), prior=this; dom!=null; prior = dom, dom = dom.idom() ) { if( addDep(dom) instanceof IfNode iff && addDep(iff.pred())==pred() && prior instanceof CProjNode prj ) { setDef(1,con( prj._idx==0 ? 1 : 0 )); return this; } + if( dom instanceof RegionNode r ) + for( Node c : r._inputs ) + if( c!= null ) addDep(c); // If region loses input, idom changes + } return null; } |
