comparison graal/GraalCompiler/src/com/sun/c1x/alloc/ControlFlowOptimizer.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 6d19b4f476db
children 7ed72769d51a
comparison
equal deleted inserted replaced
2673:98447ab8bd83 2674:6ab73784566a
136 if (block.checkBlockFlag(BlockBegin.BlockFlag.BackwardBranchTarget)) { 136 if (block.checkBlockFlag(BlockBegin.BlockFlag.BackwardBranchTarget)) {
137 newTarget.setBlockFlag(BlockBegin.BlockFlag.BackwardBranchTarget); 137 newTarget.setBlockFlag(BlockBegin.BlockFlag.BackwardBranchTarget);
138 } 138 }
139 139
140 // update the block references in any branching LIR instructions 140 // update the block references in any branching LIR instructions
141 for (BlockBegin pred : block.blockPredecessors()) { 141 for (BlockEnd pred : block.blockPredecessors()) {
142 for (LIRInstruction instr : pred.lir().instructionsList()) { 142 for (LIRInstruction instr : pred.begin().lir().instructionsList()) {
143 if (instr instanceof LIRBranch) { 143 if (instr instanceof LIRBranch) {
144 ((LIRBranch) instr).substitute(block, newTarget); 144 ((LIRBranch) instr).substitute(block, newTarget);
145 } else if (instr instanceof LIRTableSwitch) { 145 } else if (instr instanceof LIRTableSwitch) {
146 ((LIRTableSwitch) instr).substitute(block, newTarget); 146 ((LIRTableSwitch) instr).substitute(block, newTarget);
147 } 147 }
226 226
227 assert curLastOp instanceof LIROp1 : "return must be LIROp1"; 227 assert curLastOp instanceof LIROp1 : "return must be LIROp1";
228 CiValue returnOpr = ((LIROp1) curLastOp).operand(); 228 CiValue returnOpr = ((LIROp1) curLastOp).operand();
229 229
230 for (int j = block.numberOfPreds() - 1; j >= 0; j--) { 230 for (int j = block.numberOfPreds() - 1; j >= 0; j--) {
231 BlockBegin pred = block.predAt(j); 231 BlockBegin pred = block.predAt(j).begin();
232 List<LIRInstruction> predInstructions = pred.lir().instructionsList(); 232 List<LIRInstruction> predInstructions = pred.lir().instructionsList();
233 LIRInstruction predLastOp = predInstructions.get(predInstructions.size() - 1); 233 LIRInstruction predLastOp = predInstructions.get(predInstructions.size() - 1);
234 234
235 if (predLastOp.code == LIROpcode.Branch) { 235 if (predLastOp.code == LIROpcode.Branch) {
236 assert predLastOp instanceof LIRBranch : "branch must be LIRBranch"; 236 assert predLastOp instanceof LIRBranch : "branch must be LIRBranch";
261 261
262 for (BlockBegin sux : block.end().blockSuccessors()) { 262 for (BlockBegin sux : block.end().blockSuccessors()) {
263 assert code.contains(sux) : "missing successor from: " + block + "to: " + sux; 263 assert code.contains(sux) : "missing successor from: " + block + "to: " + sux;
264 } 264 }
265 265
266 for (BlockBegin pred : block.blockPredecessors()) { 266 for (BlockEnd pred : block.blockPredecessors()) {
267 assert code.contains(pred) : "missing predecessor from: " + block + "to: " + pred; 267 assert code.contains(pred.begin()) : "missing predecessor from: " + block + "to: " + pred.begin();
268 } 268 }
269 } 269 }
270 270
271 return true; 271 return true;
272 } 272 }