changeset 3132:20058d88555b

Adjusted inlining decision (depend on max node size instead of max codeSize).
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Fri, 01 Jul 2011 20:11:51 +0200
parents 5c696a58e692
children 5aeb62416609
files graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalOptions.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/EscapeAnalysisPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/GraphBuilderPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java
diffstat 4 files changed, 8 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalOptions.java	Fri Jul 01 19:39:29 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalOptions.java	Fri Jul 01 20:11:51 2011 +0200
@@ -44,7 +44,7 @@
     public static boolean Intrinsify                         = true;
     public static boolean CacheGraphs                        = ____;
     public static boolean InlineWithTypeCheck                = ____;
-    public static int     MaximumInstructionCount            = 37000;
+    public static int     MaximumInstructionCount            = 3000;
     public static float   MaximumInlineRatio                 = 0.90f;
     public static int     MaximumInlineSize                  = 35;
     public static int     MaximumFreqInlineSize              = 200;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/EscapeAnalysisPhase.java	Fri Jul 01 19:39:29 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/EscapeAnalysisPhase.java	Fri Jul 01 20:11:51 2011 +0200
@@ -334,6 +334,12 @@
                         }
                         break;
                     }
+                    if (!GraalOptions.Inline) {
+                        break;
+                    }
+                    if (GraalOptions.TraceEscapeAnalysis || GraalOptions.PrintEscapeAnalysis) {
+                        TTY.println("Trying inlining to get a non-escaping object for %d", node.id());
+                    }
                     new InliningPhase(compilation, ir, invokes).apply(graph);
                     new DeadCodeEliminationPhase().apply(graph);
                     exits.clear();
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/GraphBuilderPhase.java	Fri Jul 01 19:39:29 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/GraphBuilderPhase.java	Fri Jul 01 20:11:51 2011 +0200
@@ -1146,13 +1146,7 @@
         assert x.predecessors().size() == 0 : "instruction should not have been appended yet";
         assert lastInstr.next() == null : "cannot append instruction to instruction which isn't end (" + lastInstr + "->" + lastInstr.next() + ")";
         lastInstr.setNext(x);
-
         lastInstr = x;
-        if (++stats.nodeCount >= GraalOptions.MaximumInstructionCount) {
-            // bailout if we've exceeded the maximum inlining size
-            throw new CiBailout("Method and/or inlining is too large");
-        }
-
         return x;
     }
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java	Fri Jul 01 19:39:29 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java	Fri Jul 01 20:11:51 2011 +0200
@@ -78,8 +78,7 @@
                 if (!invoke.isDeleted()) {
                     RiMethod code = inlineInvoke(invoke, iterations, ratio);
                     if (code != null) {
-                        inliningSize += code.codeSize();
-                        if (inliningSize > GraalOptions.MaximumInstructionCount) {
+                        if (graph.getNodeCount() > GraalOptions.MaximumInstructionCount) {
                             break;
                         }
 
@@ -94,12 +93,6 @@
                     }
                 }
             }
-            if (inliningSize > GraalOptions.MaximumInstructionCount) {
-                if (GraalOptions.TraceInlining) {
-                    TTY.println("inlining stopped: MaximumInstructionCount reached");
-                }
-                break;
-            }
             if (newInvokes.isEmpty()) {
                 break;
             }