Mercurial > hg > graal-jvmci-8
diff graal/GraalCompiler/src/com/sun/c1x/graph/IR.java @ 2760:127db58b044e
One more step towards schedule.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Fri, 20 May 2011 16:56:58 +0200 |
parents | b72e6638b9e6 |
children | d3398b21faf9 |
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java Fri May 20 16:40:32 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java Fri May 20 16:56:58 2011 +0200 @@ -24,6 +24,7 @@ import java.util.*; +import com.oracle.graal.graph.*; import com.oracle.max.graal.schedule.*; import com.sun.c1x.*; import com.sun.c1x.debug.*; @@ -84,6 +85,25 @@ } Schedule schedule = new Schedule(this.compilation.graph); + List<Block> blocks = schedule.getBlocks(); + NodeMap<Block> nodeToBlock = schedule.getNodeToBlock(); + Map<Block, LIRBlock> map = new HashMap<Block, LIRBlock>(); + for (Block b : blocks) { + map.put(b, new LIRBlock(b.blockID())); + } + + for (Block b : blocks) { + for (Block succ : b.getSuccessors()) { + map.get(b).blockSuccessors().add(map.get(succ)); + } + + for (Block pred : b.getPredecessors()) { + map.get(b).blockPredecessors().add(map.get(pred)); + } + } + + // TODO(tw): Schedule nodes within a block. + valueToBlock = computeLinearScanOrder(); verifyAndPrint("After linear scan order");