# HG changeset patch # User Bernhard Urban # Date 1380705381 -7200 # Node ID 3d97040060d4db982a077923169062157244159a # Parent fbcde297f87a545607dd16c5a9b8d998dd3b8d83 SchedulePhase: bail out with SchedulingError if scheduled block is not dominated by earliest diff -r fbcde297f87a -r 3d97040060d4 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 Wed Oct 02 11:16:21 2013 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java Wed Oct 02 11:16:21 2013 +0200 @@ -486,10 +486,11 @@ throw new SchedulingError("%s should already have been placed in a block", node); } + Block earliestBlock = earliestBlock(node); Block block; switch (strategy) { case EARLIEST: - block = earliestBlock(node); + block = earliestBlock; break; case LATEST: case LATEST_OUT_OF_LOOPS: @@ -498,23 +499,19 @@ } else { block = latestBlock(node, strategy); if (block == null) { - block = earliestBlock(node); + block = earliestBlock; } else if (strategy == SchedulingStrategy.LATEST_OUT_OF_LOOPS && !(node instanceof VirtualObjectNode)) { // schedule at the latest position possible in the outermost loop possible - Block earliestBlock = earliestBlock(node); - Block before = block; block = scheduleOutOfLoops(node, block, earliestBlock); - if (!earliestBlock.dominates(block)) { - throw new SchedulingError("%s: Graph cannot be scheduled : inconsistent for %s, %d usages, (%s needs to dominate %s (before %s))", node.graph(), node, - node.usages().count(), earliestBlock, block, before); - } } } break; default: throw new GraalInternalError("unknown scheduling strategy"); } - assert earliestBlock(node).dominates(block) : "node " + node + " in block " + block + " is not dominated by earliest " + earliestBlock(node); + if (!earliestBlock.dominates(block)) { + throw new SchedulingError("%s: Graph cannot be scheduled : inconsistent for %s, %d usages, (%s needs to dominate %s)", node.graph(), node, node.usages().count(), earliestBlock, block); + } cfg.getNodeToBlock().set(node, block); blockToNodesMap.get(block).add(node); }