changeset 5228:e0f17fb3e7d2

Do not split merges when they are used to anchor some values
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 11 Apr 2012 11:37:24 +0200
parents 6b1170c32a81
children ce6cb3a1eb44 333930100018
files graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/MergeNode.java
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/MergeNode.java	Wed Apr 11 10:37:25 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/MergeNode.java	Wed Apr 11 11:37:24 2012 +0200
@@ -28,7 +28,6 @@
 import com.oracle.graal.graph.*;
 import com.oracle.graal.graph.iterators.*;
 import com.oracle.graal.nodes.spi.*;
-import com.oracle.graal.util.*;
 
 /**
  * Denotes the merging of multiple control-flow paths.
@@ -143,6 +142,10 @@
             if (merge instanceof LoopBeginNode && !(origLoopEnd instanceof LoopEndNode)) {
                 return;
             }
+            // in order to move anchored values to the other merge we would need to check if the anchors are used by phis of the other merge
+            if (this.anchored().isNotEmpty()) {
+                return;
+            }
             for (PhiNode phi : phis()) {
                 for (Node usage : phi.usages().filter(isNotA(FrameState.class))) {
                     if (!merge.isPhiAtMerge(usage)) {
@@ -150,9 +153,7 @@
                     }
                 }
             }
-            FixedNode evacuateAnchoredTo = new ComputeImmediateDominator(this).compute();
-            Debug.log("Split %s into ends for %s. Evacuate to %s", this, merge, evacuateAnchoredTo);
-            this.prepareDelete(evacuateAnchoredTo);
+            Debug.log("Split %s into ends for %s.", this, merge);
             int numEnds = this.forwardEndCount();
             StructuredGraph graph = (StructuredGraph) graph();
             for (int i = 0; i < numEnds - 1; i++) {