# HG changeset patch # User Tom Rodriguez # Date 1445714289 25200 # Node ID 39b9743b82741a10c1be9bfb921597f4b083bc0f # Parent 9fed99d7f32d1eaf459718d050ff12432cd735ab Move constants to the right in commutative nodes diff -r 9fed99d7f32d -r 39b9743b8274 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BinaryOpLogicNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BinaryOpLogicNode.java Sat Oct 24 00:49:18 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BinaryOpLogicNode.java Sat Oct 24 12:18:09 2015 -0700 @@ -75,7 +75,7 @@ @SuppressWarnings("deprecation") public LogicNode maybeCommuteInputs() { assert this instanceof BinaryCommutative; - if (x.getId() > y.getId()) { + if (x.isConstant() && !y.isConstant() || x.getId() > y.getId()) { ValueNode tmp = x; x = y; y = tmp;