changeset 13842:a02441dcf05f

Do control flow optimizations independent of register allocation.
author Roland Schatz <roland.schatz@oracle.com>
date Fri, 31 Jan 2014 11:35:38 +0100
parents 72c48280c1d0
children f5f81bc9c9f0
files graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java
diffstat 2 files changed, 12 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java	Fri Jan 31 11:34:56 2014 +0100
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java	Fri Jan 31 11:35:38 2014 +0100
@@ -276,6 +276,17 @@
         } catch (Throwable e) {
             throw Debug.handle(e);
         }
+
+        try (Scope s = Debug.scope("ControlFlowOptimizations")) {
+            EdgeMoveOptimizer.optimize(lir);
+            ControlFlowOptimizer.optimize(lir);
+            RedundantMoveElimination.optimize(lir, frameMap, lirGen.getGraph().method());
+            NullCheckOptimizer.optimize(lir, target.implicitNullCheckLimit);
+
+            Debug.dump(lir, "After control flow optimization");
+        } catch (Throwable e) {
+            throw Debug.handle(e);
+        }
         return lirGen;
     }
 
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java	Fri Jan 31 11:34:56 2014 +0100
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java	Fri Jan 31 11:35:38 2014 +0100
@@ -1887,16 +1887,7 @@
             throw Debug.handle(e);
         }
 
-        try (Scope s = Debug.scope("ControlFlowOptimizations")) {
-            printLir("After register number assignment", true);
-            EdgeMoveOptimizer.optimize(ir);
-            ControlFlowOptimizer.optimize(ir);
-            RedundantMoveElimination.optimize(ir, frameMap, gen.getGraph().method());
-            NullCheckOptimizer.optimize(ir, target.implicitNullCheckLimit);
-            printLir("After control flow optimization", false);
-        } catch (Throwable e) {
-            throw Debug.handle(e);
-        }
+        printLir("After register number assignment", true);
 
         indent.outdent();
     }