Mercurial > hg > graal-compiler
diff graal/GraalCompiler/src/com/sun/c1x/graph/IR.java @ 2838:adc4b3ec0a8c
Deleted LIR critical edge splitter and replaced with GraalIR edge splitter using Anchor nodes (=> simpler).
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Tue, 31 May 2011 15:17:55 +0200 |
parents | c1c8a0291771 |
children | 633e66de40fe |
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java Tue May 31 13:42:01 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java Tue May 31 15:17:55 2011 +0200 @@ -90,7 +90,25 @@ // newGraph.addDuplicate(compilation.graph.getNodes(), replacement); // compilation.graph = newGraph; - Schedule schedule = new Schedule(this.compilation.graph); + Graph graph = compilation.graph; + + // Split critical edges. + List<Node> nodes = graph.getNodes(); + for (int i = 0; i < nodes.size(); ++i) { + Node n = nodes.get(i); + if (Schedule.trueSuccessorCount(n) > 1) { + for (int j = 0; j < n.successors().size(); ++j) { + Node succ = n.successors().get(j); + if (Schedule.truePredecessorCount(succ) > 1) { + Anchor a = new Anchor(null, graph); + a.successors().setAndClear(1, n, j); + n.successors().set(j, a); + } + } + } + } + + Schedule schedule = new Schedule(graph); List<Block> blocks = schedule.getBlocks(); List<LIRBlock> lirBlocks = new ArrayList<LIRBlock>(); Map<Block, LIRBlock> map = new HashMap<Block, LIRBlock>(); @@ -115,9 +133,6 @@ } } - CriticalEdgeFinder finder = new CriticalEdgeFinder(lirBlocks, compilation.graph); - finder.splitCriticalEdges(); - orderedBlocks = lirBlocks; valueToBlock = new HashMap<Node, LIRBlock>(); for (LIRBlock b : orderedBlocks) { @@ -129,14 +144,6 @@ assert startBlock != null; assert startBlock.blockPredecessors().size() == 0; -/* if (startBlock.blockPredecessors().size() > 0) { - LIRBlock oldStartBlock = startBlock; - startBlock = new LIRBlock(orderedBlocks.size()); - startBlock.blockSuccessors().add(oldStartBlock); - - orderedBlocks.add(startBlock); - }*/ - ComputeLinearScanOrder clso = new ComputeLinearScanOrder(lirBlocks.size(), startBlock); orderedBlocks = clso.linearScanOrder(); this.compilation.stats.loopCount = clso.numLoops();