# HG changeset patch # User Gilles Duboscq # Date 1311760417 -7200 # Node ID e3d3fd5b638a7337415f2bf281390a1ebe4a06fa # Parent dcc79d5d0d82fd4159783cb8c69c57c97a9865c8 Canonicalize Negate(Negate(x)) for int/long remove incorrect canonicalization of FloatSub(0.0, x) to Negate(x) diff -r dcc79d5d0d82 -r e3d3fd5b638a ProblemsIdeas.txt --- a/ProblemsIdeas.txt Wed Jul 27 10:33:03 2011 +0200 +++ b/ProblemsIdeas.txt Wed Jul 27 11:53:37 2011 +0200 @@ -79,3 +79,7 @@ * Rematerialize only the nodes that were affected by GVN This will probably require something that tracks changes to the Graph, the cost of such a tracking should be evaluated + +* Hints on register pressure + + Sometimes we can make better decisions if we know the register pressure, it would be nice to have a way to know about it. Maybe we have register allocation on SSA we can somehow interact with it and try to lower the pressure in some areas on request? diff -r dcc79d5d0d82 -r e3d3fd5b638a graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/FloatSub.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/FloatSub.java Wed Jul 27 10:33:03 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/FloatSub.java Wed Jul 27 11:53:37 2011 +0200 @@ -92,20 +92,6 @@ } return new FloatAdd(kind, x, Constant.forDouble(-c, graph), sub.isStrictFP(), graph); } - } else if (x.isConstant()) { - // TODO (gd) check that Negate impl for floating point is really faster/better than 0.0 - x - if (kind == CiKind.Float) { - float c = x.asConstant().asFloat(); - if (c == 0.0f) { - return new Negate(y, graph); - } - } else { - assert kind == CiKind.Double; - double c = x.asConstant().asDouble(); - if (c == 0.0) { - return new Negate(y, graph); - } - } } return sub; } diff -r dcc79d5d0d82 -r e3d3fd5b638a graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/Negate.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/Negate.java Wed Jul 27 10:33:03 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/Negate.java Wed Jul 27 11:53:37 2011 +0200 @@ -35,9 +35,8 @@ public final class Negate extends FloatingNode { private static final NegateCanonicalizerOp CANONICALIZER = new NegateCanonicalizerOp(); - private static final int INPUT_COUNT = 2; + private static final int INPUT_COUNT = 1; private static final int INPUT_X = 0; - private static final int INPUT_Y = 1; private static final int SUCCESSOR_COUNT = 0; @@ -129,6 +128,9 @@ case Double: return Constant.forDouble(-x.asConstant().asDouble(), graph); } } + if (x instanceof Negate && x.kind == CiKind.Int || x.kind == CiKind.Long) { + return ((Negate) x).x(); + } return negate; } }