# HG changeset patch # User Roland Schatz # Date 1374565539 -7200 # Node ID a0401b1f7cc4d9dbbed4232f5cbe9c554c19ff6e # Parent d7f8a08c37c22b914c3c9e18b7ade2facf845a1d Retry canonicalization after inferStamp. diff -r d7f8a08c37c2 -r a0401b1f7cc4 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/CanonicalizerPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/CanonicalizerPhase.java Mon Jul 22 13:33:21 2013 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/CanonicalizerPhase.java Tue Jul 23 09:45:39 2013 +0200 @@ -158,7 +158,10 @@ int mark = graph.getMark(); if (!tryKillUnused(node)) { if (!tryCanonicalize(node, graph)) { - tryInferStamp(node, graph); + if (tryInferStamp(node, graph)) { + // the improved stamp may enable additional canonicalization + tryCanonicalize(node, graph); + } } } @@ -296,7 +299,7 @@ * this method also checks if the stamp now describes a constant integer value, in which * case the node is replaced with a constant. */ - private void tryInferStamp(Node node, StructuredGraph graph) { + private boolean tryInferStamp(Node node, StructuredGraph graph) { if (node.isAlive() && node instanceof ValueNode) { ValueNode valueNode = (ValueNode) node; METRIC_INFER_STAMP_CALLED.increment(); @@ -310,9 +313,11 @@ for (Node usage : valueNode.usages()) { workList.addAgain(usage); } + return true; } } } + return false; } private final class Tool implements SimplifierTool {