changeset 2886:c3b8968233fa

Removed counting of deleted nodes for each phase.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 08 Jun 2011 12:10:57 +0200
parents 971b7dcf64dc
children 0e10a9bce78e
files graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graph/IR.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/DeadCodeEliminationPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java
diffstat 3 files changed, 8 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graph/IR.java	Wed Jun 08 12:07:49 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graph/IR.java	Wed Jun 08 12:10:57 2011 +0200
@@ -73,7 +73,13 @@
             C1XTimers.HIR_CREATE.start();
         }
 
-        buildGraph();
+        new GraphBuilderPhase(compilation, compilation.method, false).apply(compilation.graph);
+        new DuplicationPhase().apply(compilation.graph);
+        new DeadCodeEliminationPhase().apply(compilation.graph);
+
+        if (C1XOptions.Inline) {
+            new InliningPhase(compilation, this).apply(compilation.graph);
+        }
 
         if (C1XOptions.PrintTimers) {
             C1XTimers.HIR_CREATE.stop();
@@ -140,33 +146,6 @@
         }
     }
 
-    private void buildGraph() {
-        // Graph builder must set the startBlock and the osrEntryBlock
-        new GraphBuilderPhase(compilation, compilation.method, false).apply(compilation.graph);
-
-//        CompilerGraph duplicate = new CompilerGraph();
-//        Map<Node, Node> replacements = new HashMap<Node, Node>();
-//        replacements.put(compilation.graph.start(), duplicate.start());
-//        duplicate.addDuplicate(compilation.graph.getNodes(), replacements);
-//        compilation.graph = duplicate;
-
-        new DuplicationPhase().apply(compilation.graph);
-
-        DeadCodeEliminationPhase dce = new DeadCodeEliminationPhase();
-        dce.apply(compilation.graph);
-        if (dce.deletedNodeCount > 0) {
-            verifyAndPrint("After dead code elimination");
-        }
-
-        if (C1XOptions.Inline) {
-            new InliningPhase(compilation, this).apply(compilation.graph);
-        }
-
-        if (C1XOptions.PrintCompilation) {
-            TTY.print(String.format("%3d blocks | ", compilation.stats.blockCount));
-        }
-    }
-
     /**
      * Gets the linear scan ordering of blocks as a list.
      * @return the blocks in linear scan order
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/DeadCodeEliminationPhase.java	Wed Jun 08 12:07:49 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/DeadCodeEliminationPhase.java	Wed Jun 08 12:10:57 2011 +0200
@@ -34,8 +34,6 @@
     private NodeWorklist worklist;
     private Graph graph;
 
-    public int deletedNodeCount;
-
     @Override
     protected void run(Graph graph) {
         this.graph = graph;
@@ -56,7 +54,7 @@
         new PhiSimplifier(graph);
 
         if (C1XOptions.TraceDeadCodeElimination) {
-            System.out.printf("dead code elimination: deleted %d nodes\n", deletedNodeCount);
+            System.out.printf("dead code elimination finished\n");
         }
     }
 
@@ -94,7 +92,6 @@
         for (Node node : graph.getNodes()) {
             if (node != Node.Null && !worklist.isMarked(node) && isCFG(node)) {
                 node.delete();
-                deletedNodeCount++;
             }
         }
     }
@@ -126,7 +123,6 @@
         for (Node node : graph.getNodes()) {
             if (node != Node.Null && !worklist.isMarked(node) && !isCFG(node)) {
                 node.delete();
-                deletedNodeCount++;
             }
         }
     }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java	Wed Jun 08 12:07:49 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java	Wed Jun 08 12:10:57 2011 +0200
@@ -100,9 +100,6 @@
             }
             DeadCodeEliminationPhase dce = new DeadCodeEliminationPhase();
             dce.apply(graph);
-            if (dce.deletedNodeCount > 0) {
-                ir.verifyAndPrint("After dead code elimination");
-            }
             ir.verifyAndPrint("After inlining iteration");
 
             if (inliningSize > C1XOptions.MaximumInstructionCount) {