# HG changeset patch # User Lukas Stadler # Date 1341845043 -7200 # Node ID fa6ed51ac1984f48d5e3f17086164fef6ee21ed8 # Parent 506e762811450cc721fb116ec8cba9e4915208e8 more aggressive tail duplication diff -r 506e76281145 -r fa6ed51ac198 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalOptions.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalOptions.java Sat Jul 07 12:53:00 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalOptions.java Mon Jul 09 16:44:03 2012 +0200 @@ -71,7 +71,8 @@ public static int ForcedInlineEscapeWeight = 10; public static boolean PrintEscapeAnalysis = ____; - public static double TailDuplicationProbability = 0.5; + public static double TailDuplicationProbability = 0.2; + public static int TailDuplicationTrivialSize = 6; // absolute probability analysis public static boolean ProbabilityAnalysis = true; diff -r 506e76281145 -r fa6ed51ac198 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/TailDuplicationPhase.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/TailDuplicationPhase.java Sat Jul 07 12:53:00 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/TailDuplicationPhase.java Mon Jul 09 16:44:03 2012 +0200 @@ -74,6 +74,9 @@ public static final TailDuplicationDecision DEFAULT_DECISION = new TailDuplicationDecision() { public boolean doTransform(MergeNode merge, int fixedNodeCount) { + if (fixedNodeCount < GraalOptions.TailDuplicationTrivialSize) { + return true; + } HashSet improvements = new HashSet<>(); for (PhiNode phi : merge.phis()) { Stamp phiStamp = phi.stamp(); @@ -157,13 +160,13 @@ if (fixed instanceof EndNode && !(((EndNode) fixed).merge() instanceof LoopBeginNode)) { metricDuplicationEnd.increment(); if (decision.doTransform(merge, fixedCount)) { - metricDuplicationEndPerformed.add(fixedCount); + metricDuplicationEndPerformed.increment(); new DuplicationOperation(merge, replacements).duplicate(); } } else if (merge.stateAfter() != null) { metricDuplicationOther.increment(); if (decision.doTransform(merge, fixedCount)) { - metricDuplicationOtherPerformed.add(fixedCount); + metricDuplicationOtherPerformed.increment(); new DuplicationOperation(merge, replacements).duplicate(); } } diff -r 506e76281145 -r fa6ed51ac198 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/InliningUtil.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/InliningUtil.java Sat Jul 07 12:53:00 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/InliningUtil.java Mon Jul 09 16:44:03 2012 +0200 @@ -367,7 +367,7 @@ } if (GraalOptions.OptTailDuplication) { /* - * We might want to perform tail duplication at the merge after a type switch, is there are invokes that would + * We might want to perform tail duplication at the merge after a type switch, if there are invokes that would * benefit from the improvement in type information. */ FixedNode current = returnMerge;