diff options
| author | Cliff Click <cliffc@acm.org> | 2026-09-16 14:41:40 -0700 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2026-09-16 14:41:40 -0700 |
| commit | 8adb94d5405d2235e721590d365beab8a8bf7696 (patch) | |
| tree | 741a3395ad6ab71d8ac11cd84f9405f22f265cd2 /chapter25/src/main/java/com | |
| parent | b4514841e4c3ac621acdf6c195a67e3c71805051 (diff) | |
| download | Simple-8adb94d5405d2235e721590d365beab8a8bf7696.tar.gz Simple-8adb94d5405d2235e721590d365beab8a8bf7696.zip | |
up timeouts
add deps on dominance crawls
Diffstat (limited to 'chapter25/src/main/java/com')
4 files changed, 5 insertions, 4 deletions
diff --git a/chapter25/src/main/java/com/seaofnodes/simple/IterPeeps.java b/chapter25/src/main/java/com/seaofnodes/simple/IterPeeps.java index be8cc9ed..fda5af65 100644 --- a/chapter25/src/main/java/com/seaofnodes/simple/IterPeeps.java +++ b/chapter25/src/main/java/com/seaofnodes/simple/IterPeeps.java @@ -216,7 +216,7 @@ public class IterPeeps { } if( lca == null ) return null; if( !early.sameFun(lca) ) return null; - assert early.dominates(lca) : badSchedule(n,early,lca); + assert early.dominates(lca,null) : badSchedule(n,early,lca); return null; }); return bad == null; diff --git a/chapter25/src/main/java/com/seaofnodes/simple/node/CFGNode.java b/chapter25/src/main/java/com/seaofnodes/simple/node/CFGNode.java index cde88ffa..0ff74a2b 100644 --- a/chapter25/src/main/java/com/seaofnodes/simple/node/CFGNode.java +++ b/chapter25/src/main/java/com/seaofnodes/simple/node/CFGNode.java @@ -109,10 +109,11 @@ public abstract class CFGNode extends Node { } // True when this node dominates `sub` in the current idom tree. - public boolean dominates(CFGNode sub) { + public boolean dominates(CFGNode sub, Node dep) { for( CFGNode cfg=sub; cfg!=null; cfg=cfg.idom() ) if( cfg == this ) return true; + else if( dep != null ) dep.addDep(cfg); return false; } diff --git a/chapter25/src/main/java/com/seaofnodes/simple/node/PhiNode.java b/chapter25/src/main/java/com/seaofnodes/simple/node/PhiNode.java index 70f678cb..5ed4382f 100644 --- a/chapter25/src/main/java/com/seaofnodes/simple/node/PhiNode.java +++ b/chapter25/src/main/java/com/seaofnodes/simple/node/PhiNode.java @@ -152,7 +152,7 @@ public class PhiNode extends Node { n = guard.in(1); } CFGNode early = CFGNode.earlyCFG(n); - return tested!=null && (early==null || early.dominates(r)) ? n : null; + return tested!=null && (early==null || early.dominates(r,this)) ? n : null; } // Same op on all Phi paths; all ops have only the Phi as a use. diff --git a/chapter25/src/main/java/com/seaofnodes/simple/node/ScopeNode.java b/chapter25/src/main/java/com/seaofnodes/simple/node/ScopeNode.java index 57dcd66b..7fb84394 100644 --- a/chapter25/src/main/java/com/seaofnodes/simple/node/ScopeNode.java +++ b/chapter25/src/main/java/com/seaofnodes/simple/node/ScopeNode.java @@ -536,7 +536,7 @@ public class ScopeNode extends MemMergeNode { if( pred==null || pred.isDead() ) return; CFGNode early = CFGNode.earlyCFG(pred); - if( early != null && !early.dominates(ctrl) ) + if( early != null && !early.dominates(ctrl,null) ) return; // Short-circuit logic is represented by a Phi. For `a || b` being // false, or `a && b` being true, both individual operands have the |
