summaryrefslogtreecommitdiff
path: root/chapter15
diff options
context:
space:
mode:
Diffstat (limited to 'chapter15')
-rw-r--r--chapter15/src/main/java/com/seaofnodes/simple/node/RegionNode.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/chapter15/src/main/java/com/seaofnodes/simple/node/RegionNode.java b/chapter15/src/main/java/com/seaofnodes/simple/node/RegionNode.java
index 0c7cd1e4..bd05ce01 100644
--- a/chapter15/src/main/java/com/seaofnodes/simple/node/RegionNode.java
+++ b/chapter15/src/main/java/com/seaofnodes/simple/node/RegionNode.java
@@ -66,14 +66,13 @@ public class RegionNode extends CFGNode {
// If a CFG diamond with no merging, delete: "if( pred ) {} else {};"
if( !hasPhi() && // No Phi users, just a control user
- in(1) instanceof ProjNode p1 &&
- in(2) instanceof ProjNode p2 &&
+ in(1) instanceof CProjNode p1 &&
+ in(2) instanceof CProjNode p2 &&
p1.in(0)==p2.in(0) &&
p1.in(0) instanceof IfNode iff )
return iff.ctrl();
-
// Look for direct uses of a guarded expression, and replace with the guard result.
if( !(idom() instanceof StartNode) && // Dead or dying
!(this instanceof LoopNode) ) {