changeset 10856:a0401b1f7cc4

Retry canonicalization after inferStamp.
author Roland Schatz <roland.schatz@oracle.com>
date Tue, 23 Jul 2013 09:45:39 +0200
parents d7f8a08c37c2
children 94cf5df0727f
files graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/CanonicalizerPhase.java
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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 {