comparison graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/GraphBuilderPhase.java @ 3091:bee93b329be2

merge
author Lukas Stadler <lukas.stadler@jku.at>
date Tue, 28 Jun 2011 19:22:42 +0200
parents 05b8a7787aaf d5218b246554
children 2fb14099d069 d9fa4309f89e
comparison
equal deleted inserted replaced
3090:536528f48708 3091:bee93b329be2
199 iterateAllBlocks(); 199 iterateAllBlocks();
200 200
201 List<Loop> loops = LoopUtil.computeLoops(graph); 201 List<Loop> loops = LoopUtil.computeLoops(graph);
202 NodeBitMap loopExits = graph.createNodeBitMap(); 202 NodeBitMap loopExits = graph.createNodeBitMap();
203 for (Loop loop : loops) { 203 for (Loop loop : loops) {
204 loopExits.markAll(loop.exist()); 204 loopExits.setUnion(loop.exits());
205 } 205 }
206 206
207 // remove Placeholders 207 // remove Placeholders
208 for (Node n : graph.getNodes()) { 208 for (Node n : graph.getNodes()) {
209 if (n instanceof Placeholder && !loopExits.isMarked(n)) { 209 if (n instanceof Placeholder && !loopExits.isMarked(n)) {
1165 } 1165 }
1166 1166
1167 if (block.firstInstruction == null) { 1167 if (block.firstInstruction == null) {
1168 if (block.isLoopHeader) { 1168 if (block.isLoopHeader) {
1169 LoopBegin loopBegin = new LoopBegin(graph); 1169 LoopBegin loopBegin = new LoopBegin(graph);
1170 loopBegin.addEnd(new EndNode(graph));
1170 LoopEnd loopEnd = new LoopEnd(graph); 1171 LoopEnd loopEnd = new LoopEnd(graph);
1171 loopEnd.setLoopBegin(loopBegin); 1172 loopEnd.setLoopBegin(loopBegin);
1172 Placeholder pBegin = new Placeholder(graph); 1173 Placeholder pBegin = new Placeholder(graph);
1173 pBegin.setNext(loopBegin.forwardEdge()); 1174 pBegin.setNext(loopBegin.forwardEdge());
1174 Placeholder pEnd = new Placeholder(graph); 1175 Placeholder pEnd = new Placeholder(graph);