# HG changeset patch # User Thomas Wuerthinger # Date 1308233976 -7200 # Node ID a7a7e87ad23026f32697707f2564742c88cd16db # Parent bf14154d5b14280693c2ffe7e1454540471faf09 Moved some code in the scheduler to the right place. diff -r bf14154d5b14 -r a7a7e87ad230 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/schedule/IdentifyBlocksPhase.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/schedule/IdentifyBlocksPhase.java Thu Jun 16 16:09:39 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/schedule/IdentifyBlocksPhase.java Thu Jun 16 16:19:36 2011 +0200 @@ -122,11 +122,6 @@ for (Block block : blocks) { Node n = block.firstNode(); if (n instanceof Merge) { - for (Node usage : n.usages()) { - if (usage instanceof Phi || usage instanceof LoopCounter) { - nodeToBlock.set(usage, block); - } - } Merge m = (Merge) n; for (int i = 0; i < m.endCount(); ++i) { EndNode end = m.endAt(i); @@ -236,6 +231,16 @@ return prevBlock; } + if (n instanceof Phi) { + Block block = nodeToBlock.get(((Phi) n).merge()); + nodeToBlock.set(n, block); + } + + if (n instanceof LoopCounter) { + Block block = nodeToBlock.get(((LoopCounter) n).loopBegin()); + nodeToBlock.set(n, block); + } + Block block = null; for (Node succ : n.successors()) { block = getCommonDominator(block, assignLatestPossibleBlockToNode(succ));