Mercurial > hg > truffle
comparison graal/GraalCompiler/src/com/sun/c1x/debug/IdealGraphPrinter.java @ 2810:6fb5a1bf819f
Hide back edges from the output.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Mon, 30 May 2011 15:03:04 +0200 |
parents | b003ea36fa12 |
children | 878bbf7dbf31 |
comparison
equal
deleted
inserted
replaced
2809:b003ea36fa12 | 2810:6fb5a1bf819f |
---|---|
26 import java.util.*; | 26 import java.util.*; |
27 import java.util.Map.Entry; | 27 import java.util.Map.Entry; |
28 | 28 |
29 import com.oracle.graal.graph.*; | 29 import com.oracle.graal.graph.*; |
30 import com.oracle.max.graal.schedule.*; | 30 import com.oracle.max.graal.schedule.*; |
31 import com.sun.c1x.ir.*; | |
31 | 32 |
32 /** | 33 /** |
33 * Generates a representation of {@link Graph Graphs} that can be visualized and inspected with the <a | 34 * Generates a representation of {@link Graph Graphs} that can be visualized and inspected with the <a |
34 * href="http://kenai.com/projects/igv">Ideal Graph Visualizer</a>. | 35 * href="http://kenai.com/projects/igv">Ideal Graph Visualizer</a>. |
35 */ | 36 */ |
197 | 198 |
198 private void printBlock(Block block) { | 199 private void printBlock(Block block) { |
199 stream.printf(" <block name='%d'>%n", block.blockID()); | 200 stream.printf(" <block name='%d'>%n", block.blockID()); |
200 stream.printf(" <successors>%n"); | 201 stream.printf(" <successors>%n"); |
201 for (Block sux : block.getSuccessors()) { | 202 for (Block sux : block.getSuccessors()) { |
202 stream.printf(" <successor name='%d'/>%n", sux.blockID()); | 203 if (sux.firstNode() instanceof LoopBegin && block.lastNode() instanceof LoopEnd) { |
204 // Skip back edges. | |
205 } else { | |
206 stream.printf(" <successor name='%d'/>%n", sux.blockID()); | |
207 } | |
203 } | 208 } |
204 stream.printf(" </successors>%n"); | 209 stream.printf(" </successors>%n"); |
205 stream.printf(" <nodes>%n"); | 210 stream.printf(" <nodes>%n"); |
206 for (Node node : block.getInstructions()) { | 211 for (Node node : block.getInstructions()) { |
207 stream.printf(" <node id='%d'/>%n", node.id()); | 212 stream.printf(" <node id='%d'/>%n", node.id()); |