Mercurial > hg > graal-jvmci-8
comparison graal/GraalCompiler/src/com/sun/c1x/graph/IR.java @ 2781:bda5972a40a5
remove unnecessary BlockBegin nodes in frontend
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Tue, 24 May 2011 15:31:52 +0200 |
parents | 398b8fa5dc81 |
children | 915456e4959e |
comparison
equal
deleted
inserted
replaced
2776:398b8fa5dc81 | 2781:bda5972a40a5 |
---|---|
127 | 127 |
128 Map<Value, LIRBlock> valueToBlock = new HashMap<Value, LIRBlock>(); | 128 Map<Value, LIRBlock> valueToBlock = new HashMap<Value, LIRBlock>(); |
129 | 129 |
130 if (orderedBlocks == null) { | 130 if (orderedBlocks == null) { |
131 CriticalEdgeFinder finder = new CriticalEdgeFinder(this); | 131 CriticalEdgeFinder finder = new CriticalEdgeFinder(this); |
132 getHIRStartBlock().iteratePreOrder(finder); | 132 ((BlockBegin) getHIRStartBlock()).iteratePreOrder(finder); |
133 finder.splitCriticalEdges(); | 133 finder.splitCriticalEdges(); |
134 ComputeLinearScanOrder computeLinearScanOrder = new ComputeLinearScanOrder(compilation.stats.blockCount, getHIRStartBlock()); | 134 ComputeLinearScanOrder computeLinearScanOrder = new ComputeLinearScanOrder(compilation.stats.blockCount, (BlockBegin) getHIRStartBlock()); |
135 List<BlockBegin> blocks = computeLinearScanOrder.linearScanOrder(); | 135 List<BlockBegin> blocks = computeLinearScanOrder.linearScanOrder(); |
136 orderedBlocks = new ArrayList<LIRBlock>(); | 136 orderedBlocks = new ArrayList<LIRBlock>(); |
137 | 137 |
138 int z = 0; | 138 int z = 0; |
139 for (BlockBegin bb : blocks) { | 139 for (BlockBegin bb : blocks) { |
185 private void print(boolean cfgOnly) { | 185 private void print(boolean cfgOnly) { |
186 if (!TTY.isSuppressed()) { | 186 if (!TTY.isSuppressed()) { |
187 TTY.println("IR for " + compilation.method); | 187 TTY.println("IR for " + compilation.method); |
188 final InstructionPrinter ip = new InstructionPrinter(TTY.out()); | 188 final InstructionPrinter ip = new InstructionPrinter(TTY.out()); |
189 final BlockPrinter bp = new BlockPrinter(this, ip, cfgOnly); | 189 final BlockPrinter bp = new BlockPrinter(this, ip, cfgOnly); |
190 getHIRStartBlock().iteratePreOrder(bp); | 190 ((BlockBegin) getHIRStartBlock()).iteratePreOrder(bp); |
191 } | 191 } |
192 } | 192 } |
193 | 193 |
194 /** | 194 /** |
195 * Verifies the IR and prints it out if the relevant options are set. | 195 * Verifies the IR and prints it out if the relevant options are set. |
285 */ | 285 */ |
286 public final int maxLocks() { | 286 public final int maxLocks() { |
287 return maxLocks; | 287 return maxLocks; |
288 } | 288 } |
289 | 289 |
290 public BlockBegin getHIRStartBlock() { | 290 public Instruction getHIRStartBlock() { |
291 return (BlockBegin) compilation.graph.start().successors().get(0); | 291 return (Instruction) compilation.graph.start().successors().get(0); |
292 } | 292 } |
293 } | 293 } |