# HG changeset patch # User Gilles Duboscq # Date 1334137044 -7200 # Node ID e0f17fb3e7d24bf37ec8820a701b8c8d265ef74b # Parent 6b1170c32a8136deb73e43e732ee92f5046ec390 Do not split merges when they are used to anchor some values diff -r 6b1170c32a81 -r e0f17fb3e7d2 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/MergeNode.java --- 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++) {