Mercurial > hg > truffle
comparison graal/GraalCompiler/src/com/sun/c1x/alloc/EdgeMoveOptimizer.java @ 2674:6ab73784566a
* BlockBegin.predecessors changed to List<BlockEnd>
* Node: add input/successor with given back edge index, allows for explicit ordering of predecessors/usages
* Graphviz: PDF output, option to omit FrameStates
* runscimark.sh: forward additional options to JVM
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Fri, 13 May 2011 15:18:41 +0200 |
parents | 16b9a8b5ad39 |
children | 7ed72769d51a |
comparison
equal
deleted
inserted
replaced
2673:98447ab8bd83 | 2674:6ab73784566a |
---|---|
110 /** | 110 /** |
111 * Moves the longest {@linkplain #same common} subsequence at the end all | 111 * Moves the longest {@linkplain #same common} subsequence at the end all |
112 * predecessors of {@code block} to the start of {@code block}. | 112 * predecessors of {@code block} to the start of {@code block}. |
113 */ | 113 */ |
114 private void optimizeMovesAtBlockEnd(BlockBegin block) { | 114 private void optimizeMovesAtBlockEnd(BlockBegin block) { |
115 if (block.isPredecessor(block)) { | 115 if (block.isPredecessor(block.end())) { |
116 // currently we can't handle this correctly. | 116 // currently we can't handle this correctly. |
117 return; | 117 return; |
118 } | 118 } |
119 | 119 |
120 // clear all internal data structures | 120 // clear all internal data structures |
124 assert numPreds > 1 : "do not call otherwise"; | 124 assert numPreds > 1 : "do not call otherwise"; |
125 assert !block.checkBlockFlag(BlockBegin.BlockFlag.ExceptionEntry) : "exception handlers not allowed"; | 125 assert !block.checkBlockFlag(BlockBegin.BlockFlag.ExceptionEntry) : "exception handlers not allowed"; |
126 | 126 |
127 // setup a list with the LIR instructions of all predecessors | 127 // setup a list with the LIR instructions of all predecessors |
128 for (int i = 0; i < numPreds; i++) { | 128 for (int i = 0; i < numPreds; i++) { |
129 BlockBegin pred = block.predAt(i); | 129 BlockBegin pred = block.predAt(i).begin(); |
130 List<LIRInstruction> predInstructions = pred.lir().instructionsList(); | 130 List<LIRInstruction> predInstructions = pred.lir().instructionsList(); |
131 | 131 |
132 if (pred.numberOfSux() != 1) { | 132 if (pred.numberOfSux() != 1) { |
133 // this can happen with switch-statements where multiple edges are between | 133 // this can happen with switch-statements where multiple edges are between |
134 // the same blocks. | 134 // the same blocks. |
229 if (sux.numberOfPreds() != 1) { | 229 if (sux.numberOfPreds() != 1) { |
230 // this can happen with switch-statements where multiple edges are between | 230 // this can happen with switch-statements where multiple edges are between |
231 // the same blocks. | 231 // the same blocks. |
232 return; | 232 return; |
233 } | 233 } |
234 assert sux.predAt(0) == block : "invalid control flow"; | 234 assert sux.predAt(0).begin() == block : "invalid control flow"; |
235 assert !sux.checkBlockFlag(BlockBegin.BlockFlag.ExceptionEntry) : "exception handlers not allowed"; | 235 assert !sux.checkBlockFlag(BlockBegin.BlockFlag.ExceptionEntry) : "exception handlers not allowed"; |
236 | 236 |
237 // ignore the label at the beginning of the block | 237 // ignore the label at the beginning of the block |
238 List<LIRInstruction> seq = suxInstructions.subList(1, suxInstructions.size()); | 238 List<LIRInstruction> seq = suxInstructions.subList(1, suxInstructions.size()); |
239 edgeInstructionSeqences.add(seq); | 239 edgeInstructionSeqences.add(seq); |