diff graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/TailDuplicationPhase.java @ 10533:2faa1e7ef4f3

enable TailDuplication for MergeNodes without stateAfter
author Lukas Stadler <lukas.stadler@jku.at>
date Wed, 26 Jun 2013 12:16:38 +0200
parents b5c87b5c6e9c
children 8d961f93725c
line wrap: on
line diff
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/TailDuplicationPhase.java	Tue Jun 25 23:05:52 2013 +0200
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/TailDuplicationPhase.java	Wed Jun 26 12:16:38 2013 +0200
@@ -50,10 +50,8 @@
     /*
      * Various metrics on the circumstances in which tail duplication was/wasn't performed.
      */
-    private static final DebugMetric metricDuplicationEnd = Debug.metric("DuplicationEnd");
-    private static final DebugMetric metricDuplicationEndPerformed = Debug.metric("DuplicationEndPerformed");
-    private static final DebugMetric metricDuplicationOther = Debug.metric("DuplicationOther");
-    private static final DebugMetric metricDuplicationOtherPerformed = Debug.metric("DuplicationOtherPerformed");
+    private static final DebugMetric metricDuplicationConsidered = Debug.metric("DuplicationConsidered");
+    private static final DebugMetric metricDuplicationPerformed = Debug.metric("DuplicationPerformed");
 
     /**
      * This interface is used by tail duplication to let clients decide if tail duplication should
@@ -171,20 +169,11 @@
             fixedCount++;
         }
         if (fixedCount > 1) {
-            if (fixed instanceof AbstractEndNode && !(((AbstractEndNode) fixed).merge() instanceof LoopBeginNode)) {
-                metricDuplicationEnd.increment();
-                if (decision.doTransform(merge, fixedCount)) {
-                    metricDuplicationEndPerformed.increment();
-                    new DuplicationOperation(merge, replacements).duplicate(phaseContext);
-                    return true;
-                }
-            } else if (merge.stateAfter() != null) {
-                metricDuplicationOther.increment();
-                if (decision.doTransform(merge, fixedCount)) {
-                    metricDuplicationOtherPerformed.increment();
-                    new DuplicationOperation(merge, replacements).duplicate(phaseContext);
-                    return true;
-                }
+            metricDuplicationConsidered.increment();
+            if (decision.doTransform(merge, fixedCount)) {
+                metricDuplicationPerformed.increment();
+                new DuplicationOperation(merge, replacements).duplicate(phaseContext);
+                return true;
             }
         }
         return false;