# HG changeset patch # User Thomas Wuerthinger # Date 1306532332 -7200 # Node ID f35c6f8f0f5dec16538c8c50741384f8bafcfdd3 # Parent c3f64b66fc78b81fb2bb1a42f98416f51a8336cf Fixed two regressions due to the flexible scheduling. diff -r c3f64b66fc78 -r f35c6f8f0f5d graal/GraalCompiler/src/com/oracle/max/graal/schedule/Schedule.java --- a/graal/GraalCompiler/src/com/oracle/max/graal/schedule/Schedule.java Fri May 27 19:57:56 2011 +0200 +++ b/graal/GraalCompiler/src/com/oracle/max/graal/schedule/Schedule.java Fri May 27 23:38:52 2011 +0200 @@ -95,7 +95,7 @@ return false; } - if (n instanceof LoopBegin) { + if (n instanceof LoopBegin || n instanceof LoopEnd) { // a LoopBegin is always a merge assignBlock(n); blockBeginNodes.add(n); @@ -221,14 +221,12 @@ if (prevBlock != null) { return prevBlock; } - TTY.println("handling " + n); Block block = null; for (Node succ : n.successors()) { block = getCommonDominator(block, assignLatestPossibleBlockToNode(succ)); } for (Node usage : n.usages()) { - TTY.println("usaged at: " + usage.id() + ", " + nodeToBlock.get(usage)); if (usage instanceof Phi) { Phi phi = (Phi) usage; Merge merge = phi.block(); @@ -244,7 +242,6 @@ } } - TTY.println("assigning block " + block + " to node " + n); nodeToBlock.set(n, block); if (block != null) { block.getInstructions().add(n); @@ -273,7 +270,9 @@ List instructions = b.getInstructions(); List sortedInstructions = new ArrayList(); assert !map.isMarked(b.firstNode()) && nodeToBlock.get(b.firstNode()) == b; - addToSorting(b, b.firstNode(), sortedInstructions, map); + if (b.firstNode() != b.lastNode()) { + addToSorting(b, b.firstNode(), sortedInstructions, map); + } for (Node i : instructions) { addToSorting(b, i, sortedInstructions, map); } @@ -281,10 +280,10 @@ //assert b.firstNode() == sortedInstructions.get(0) : b.firstNode(); // assert b.lastNode() == sortedInstructions.get(sortedInstructions.size() - 1); b.setInstructions(sortedInstructions); - TTY.println("Block " + b); - for (Node n : sortedInstructions) { - TTY.println("Node: " + n); - } +// TTY.println("Block " + b); +// for (Node n : sortedInstructions) { +// TTY.println("Node: " + n); +// } } private void addToSorting(Block b, Node i, List sortedInstructions, NodeBitMap map) { diff -r c3f64b66fc78 -r f35c6f8f0f5d graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java --- a/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java Fri May 27 19:57:56 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java Fri May 27 23:38:52 2011 +0200 @@ -1291,7 +1291,7 @@ private List getPhis(LIRBlock block) { if (block.getInstructions().size() > 0) { - Node i = block.getInstructions().get(0); + Node i = block.firstInstruction(); if (i instanceof Merge) { List result = new ArrayList(); for (Node n : i.usages()) {