# HG changeset patch # User Doug Simon # Date 1351518293 -3600 # Node ID 5c1787a0be00733135efe91fa7c960150ad69712 # Parent a3eb814ea564d283c46abd7413749b10618610a6 removing intermediate materializations is disabled when the compare input to an if has more than one usage diff -r a3eb814ea564 -r 5c1787a0be00 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java Mon Oct 29 14:41:20 2012 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java Mon Oct 29 14:44:53 2012 +0100 @@ -224,6 +224,10 @@ } CompareNode compare = (CompareNode) condition(); + if (compare.usages().count() != 1) { + return false; + } + if (!(predecessor() instanceof MergeNode)) { return false; } @@ -287,6 +291,12 @@ connectEnds(trueEnds, phiValues, trueSuccessor, merge, tool); GraphUtil.killCFG(merge); + + assert !merge.isAlive() : merge; + assert !phi.isAlive() : phi; + assert !compare.isAlive() : compare; + assert !this.isAlive() : this; + return true; }