# HG changeset patch # User Thomas Wuerthinger # Date 1363191298 -3600 # Node ID 0db1cb049a788f4b5b9e2ddb600e3671e68ab6f9 # Parent f5e26f69f1644397d0d8d5ef1647785b93277515 Remove usage of negate() in word type rewriter phase. diff -r f5e26f69f164 -r 0db1cb049a78 graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeRewriterPhase.java --- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeRewriterPhase.java Wed Mar 13 17:13:11 2013 +0100 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeRewriterPhase.java Wed Mar 13 17:14:58 2013 +0100 @@ -247,15 +247,17 @@ } else { comparison = new IntegerLessThanNode(a, b); } - ConditionalNode materialize = graph.unique(new ConditionalNode(graph.unique(comparison), ConstantNode.forInt(1, graph), ConstantNode.forInt(0, graph))); - ValueNode op; + ConstantNode trueValue = ConstantNode.forInt(1, graph); + ConstantNode falseValue = ConstantNode.forInt(0, graph); + if (condition.canonicalNegate()) { - op = (ValueNode) materialize.negate(); - } else { - op = materialize; + ConstantNode temp = trueValue; + trueValue = falseValue; + falseValue = temp; } - return op; + ConditionalNode materialize = graph.unique(new ConditionalNode(graph.unique(comparison), trueValue, falseValue)); + return materialize; } private static ValueNode readOp(StructuredGraph graph, ValueNode base, ValueNode offset, Invoke invoke, Kind readKind, Object locationIdentity) {