# HG changeset patch # User Thomas Wuerthinger # Date 1429712573 -7200 # Node ID bb63a1b5487cb91ff023b35fa4f776edc506314d # Parent 355ebfa2ba954f4f4c2828709ca26deec44582d0# Parent 5454085a08a7dbc7503b2afcad0da546a298f016 Merge. diff -r 5454085a08a7 -r bb63a1b5487c graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java Tue Apr 21 20:23:59 2015 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java Wed Apr 22 16:22:53 2015 +0200 @@ -313,8 +313,14 @@ } } FixedNode endNode = b.getEndNode(); + FixedNode fixedEndNode = null; + if (endNode instanceof ControlSplitNode || endNode instanceof AbstractEndNode) { + // Only if the end node is either a control split or an end node, we need to force it to + // be the last node in the schedule. + fixedEndNode = endNode; + } for (Node n : earliestSorting) { - if (n != endNode) { + if (n != fixedEndNode) { if (n instanceof FixedNode) { assert nodeMap.get(n) == b; checkWatchList(b, nodeMap, unprocessed, result, watchList, n); @@ -337,11 +343,11 @@ assert nodeMap.get(n) == b; assert !(n instanceof FixedNode); if (unprocessed.isMarked(n)) { - sortIntoList(n, b, result, nodeMap, unprocessed, endNode); + sortIntoList(n, b, result, nodeMap, unprocessed, fixedEndNode); } } - if (unprocessed.isMarked(endNode)) { + if (endNode != null && unprocessed.isMarked(endNode)) { sortIntoList(endNode, b, result, nodeMap, unprocessed, null); } @@ -679,7 +685,8 @@ inputEarliest = nodeToBlock.get(((ControlSplitNode) input).getPrimarySuccessor()); } else { assert inputEarliest.getSuccessorCount() == 1; - inputEarliest = inputEarliest.getSuccessors().get(0); + assert !(input instanceof AbstractEndNode); + // Keep regular inputEarliest } } if (earliest.getDominatorDepth() < inputEarliest.getDominatorDepth()) {