# HG changeset patch # User Lukas Stadler # Date 1372241798 -7200 # Node ID 2faa1e7ef4f397b36d1e9d248502aceea89629f5 # Parent 1194e94f9c16f8a8c592094ac31ead45d56a1183 enable TailDuplication for MergeNodes without stateAfter diff -r 1194e94f9c16 -r 2faa1e7ef4f3 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/TailDuplicationPhase.java --- 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;