diff graal/GraalCompiler/src/com/sun/c1x/gen/PhiSimplifier.java @ 2758:0c5791bc90fb

More on scheduling.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Fri, 20 May 2011 16:31:31 +0200
parents 0fe79e7435c3
children 99912abb3ff7
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/gen/PhiSimplifier.java	Fri May 20 14:52:25 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/gen/PhiSimplifier.java	Fri May 20 16:31:31 2011 +0200
@@ -25,45 +25,21 @@
 import com.oracle.graal.graph.*;
 import com.sun.c1x.graph.*;
 import com.sun.c1x.ir.*;
-import com.sun.c1x.value.*;
 
 /**
  * The {@code PhiSimplifier} class is a helper class that can reduce phi instructions.
- *
- * @author Ben L. Titzer
  */
-public final class PhiSimplifier implements BlockClosure {
-
-    final IR ir;
+public final class PhiSimplifier {
 
     public PhiSimplifier(IR ir) {
-        this.ir = ir;
-        //ir.getHIRStartBlock().iterateAnyOrder(this, false);
-
         for (Node n : ir.compilation.graph.getNodes()) {
             if (n instanceof Phi) {
-                simplify((Phi)n);
+                simplify((Phi) n);
             }
         }
-
-
-    }
-
-    /**
-     * This method is called for each block and processes any phi statements in the block.
-     * @param block the block to apply the simplification to
-     */
-    public void apply(BlockBegin block) {
-        FrameState state = block.stateBefore();
-        for (int i = 0; i < state.stackSize(); i++) {
-            simplify(state.stackAt(i));
-        }
-        for (int i = 0; i < state.localsSize(); i++) {
-            simplify(state.localAt(i));
-        }
     }
 
-    Value simplify(Value x) {
+    private Value simplify(Value x) {
         if (x == null || !(x instanceof Phi)) {
             return x;
         }