changeset 5745:11ef22975bba

Delete unused LoopTransformPhase Add GraalOption for peeling
author Gilles Duboscq <duboscq@ssw.jku.at>
date Tue, 03 Jul 2012 14:45:05 +0200
parents 51cee50d1d11
children 17d2c3b72762
files graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalOptions.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/LoopTransformHighPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/LoopTransformPhase.java
diffstat 3 files changed, 12 insertions(+), 57 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalOptions.java	Tue Jul 03 13:02:24 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalOptions.java	Tue Jul 03 14:45:05 2012 +0200
@@ -98,11 +98,12 @@
     public static float   MinimumUsageProbability            = 0.95f;
 
     //loop transform settings TODO (gd) tune
-    public static float   MinimumPeelProbability             = 0.35f;
+    public static boolean LoopPeeling                        = true;
     public static boolean ReassociateInvariants              = true;
     public static boolean FullUnroll                         = true;
+    public static boolean LoopUnswitch                       = ____;
     public static int     FullUnrollMaxNodes                 = 150;
-    public static boolean LoopUnswitch                       = ____;
+    public static float   MinimumPeelProbability             = 0.35f;
     public static int     LoopUnswitchMaxIncrease            = 50;
     public static int     LoopUnswitchUncertaintyBoost       = 5;
 
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/LoopTransformHighPhase.java	Tue Jul 03 13:02:24 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/LoopTransformHighPhase.java	Tue Jul 03 14:45:05 2012 +0200
@@ -22,6 +22,7 @@
  */
 package com.oracle.graal.compiler.phases;
 
+import com.oracle.graal.compiler.*;
 import com.oracle.graal.compiler.loop.*;
 import com.oracle.graal.debug.*;
 import com.oracle.graal.nodes.*;
@@ -31,12 +32,14 @@
     @Override
     protected void run(StructuredGraph graph) {
         if (graph.hasLoops()) {
-            LoopsData data = new LoopsData(graph);
-            for (LoopEx loop : data.outterFirst()) {
-                if (LoopPolicies.shouldPeel(loop)) {
-                    Debug.log("Peeling %s", loop);
-                    LoopTransformations.peel(loop);
-                    Debug.dump(graph, "After peeling %s", loop);
+            if (GraalOptions.LoopPeeling) {
+                LoopsData data = new LoopsData(graph);
+                for (LoopEx loop : data.outterFirst()) {
+                    if (LoopPolicies.shouldPeel(loop)) {
+                        Debug.log("Peeling %s", loop);
+                        LoopTransformations.peel(loop);
+                        Debug.dump(graph, "After peeling %s", loop);
+                    }
                 }
             }
         }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/LoopTransformPhase.java	Tue Jul 03 13:02:24 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.phases;
-
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.compiler.loop.*;
-import com.oracle.graal.debug.*;
-import com.oracle.graal.nodes.*;
-
-public class LoopTransformPhase extends Phase {
-
-    @Override
-    protected void run(StructuredGraph graph) {
-        if (graph.hasLoops()) {
-            LoopsData data = new LoopsData(graph);
-            for (LoopEx loop : data.outterFirst()) {
-                double entryProbability = loop.loopBegin().forwardEnd().probability();
-                if (entryProbability > GraalOptions.MinimumPeelProbability
-                                && loop.size() + graph.getNodeCount() < GraalOptions.MaximumDesiredSize) {
-                    Debug.log("Peeling %s", loop);
-                    LoopTransformations.peel(loop);
-                    Debug.dump(graph, "After peeling %s", loop);
-                }
-            }
-        }
-    }
-
-
-}