# HG changeset patch # User Lukas Stadler # Date 1390384292 -3600 # Node ID 256bc461645e16fc4b93a102c21d8d42ba0386ba # Parent 1834ae0bc965fbad238f1d9b389c3d5368a7f3e0 split a negated guard with a ShortCircuitOr condition into two guards diff -r 1834ae0bc965 -r 256bc461645e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java Tue Jan 21 18:35:46 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java Wed Jan 22 10:51:32 2014 +0100 @@ -104,12 +104,16 @@ if (condition() instanceof LogicNegationNode) { LogicNegationNode negation = (LogicNegationNode) condition(); return graph().unique(new GuardNode(negation.getInput(), getGuard(), reason, action, !negated, speculation)); - } - if (condition() instanceof LogicConstantNode) { + } else if (condition() instanceof LogicConstantNode) { LogicConstantNode c = (LogicConstantNode) condition(); if (c.getValue() != negated) { return graph().start(); } + } else if (negated && condition() instanceof ShortCircuitOrNode) { + ShortCircuitOrNode or = (ShortCircuitOrNode) condition(); + GuardNode firstGuard = graph().unique(new GuardNode(or.getX(), getGuard(), reason, action, !or.isXNegated(), speculation)); + GuardNode secondGuard = graph().unique(new GuardNode(or.getY(), firstGuard, reason, action, or.isYNegated(), speculation)); + return secondGuard; } return this; }