Mercurial > hg > truffle
diff graal/GraalCompiler/src/com/sun/c1x/alloc/LinearScan.java @ 2708:4272b7af2d17
merge
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Wed, 18 May 2011 18:40:58 +0200 |
parents | 7ed72769d51a 42450f536d24 |
children | c1ce2a53d6c3 |
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/alloc/LinearScan.java Wed May 18 18:09:20 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/alloc/LinearScan.java Wed May 18 18:40:58 2011 +0200 @@ -563,7 +563,7 @@ for (int i = 0; i < numBlocks; i++) { BlockBegin block = blockAt(i); - block.setFirstLirInstructionId(opId); + block.lirBlock.setFirstLirInstructionId(opId); List<LIRInstruction> instructions = block.lir().instructionsList(); int numInst = instructions.size(); @@ -578,7 +578,7 @@ index++; opId += 2; // numbering of lirOps by two } - block.setLastLirInstructionId(opId - 2); + block.lirBlock.setLastLirInstructionId((opId - 2)); } assert index == numInstructions : "must match"; assert (index << 1) == opId : "must match: " + (index << 1); @@ -1159,8 +1159,8 @@ for (int i = blockCount() - 1; i >= 0; i--) { BlockBegin block = blockAt(i); List<LIRInstruction> instructions = block.lir().instructionsList(); - final int blockFrom = block.firstLirInstructionId(); - int blockTo = block.lastLirInstructionId(); + final int blockFrom = block.lirBlock.firstLirInstructionId(); + int blockTo = block.lirBlock.lastLirInstructionId(); assert blockFrom == instructions.get(0).id; assert blockTo == instructions.get(instructions.size() - 1).id; @@ -1512,14 +1512,14 @@ assert operand.isVariable() : "register number out of bounds"; assert intervalFor(operand) != null : "no interval found"; - return splitChildAtOpId(intervalFor(operand), block.firstLirInstructionId(), LIRInstruction.OperandMode.Output); + return splitChildAtOpId(intervalFor(operand), block.lirBlock.firstLirInstructionId(), LIRInstruction.OperandMode.Output); } Interval intervalAtBlockEnd(BlockBegin block, CiValue operand) { assert operand.isVariable() : "register number out of bounds"; assert intervalFor(operand) != null : "no interval found"; - return splitChildAtOpId(intervalFor(operand), block.lastLirInstructionId() + 1, LIRInstruction.OperandMode.Output); + return splitChildAtOpId(intervalFor(operand), block.lirBlock.lastLirInstructionId() + 1, LIRInstruction.OperandMode.Output); } Interval intervalAtOpId(CiValue operand, int opId) { @@ -1728,7 +1728,7 @@ if (opId != -1) { if (C1XOptions.DetailedAsserts) { BlockBegin block = blockForId(opId); - if (block.numberOfSux() <= 1 && opId == block.lastLirInstructionId()) { + if (block.numberOfSux() <= 1 && opId == block.lirBlock.lastLirInstructionId()) { // check if spill moves could have been appended at the end of this block, but // before the branch instruction. So the split child information for this branch would // be incorrect. @@ -1848,7 +1848,7 @@ if (operand.isVariable()) { OperandMode mode = OperandMode.Input; BlockBegin block = blockForId(opId); - if (block.numberOfSux() == 1 && opId == block.lastLirInstructionId()) { + if (block.numberOfSux() == 1 && opId == block.lirBlock.lastLirInstructionId()) { // generating debug information for the last instruction of a block. // if this instruction is a branch, spill moves are inserted before this branch // and so the wrong operand would be returned (spill moves at block boundaries are not @@ -1857,7 +1857,7 @@ final LIRInstruction instr = block.lir().instructionsList().get(block.lir().instructionsList().size() - 1); if (instr instanceof LIRBranch) { if (block.lirBlock.liveOut.get(operandNumber(operand))) { - opId = block.suxAt(0).firstLirInstructionId(); + opId = block.suxAt(0).lirBlock.firstLirInstructionId(); mode = OperandMode.Output; } } @@ -2083,12 +2083,7 @@ } printLir("After register number assignment", true); - EdgeMoveOptimizer.optimize(ir.linearScanOrder()); - if (C1XOptions.OptControlFlow) { - ControlFlowOptimizer.optimize(ir); - } - printLir("After control flow optimization", false); } @@ -2108,7 +2103,7 @@ TTY.println("--- Basic Blocks ---"); for (i = 0; i < blockCount(); i++) { BlockBegin block = blockAt(i); - TTY.print("B%d [%d, %d, %d, %d] ", block.blockID, block.firstLirInstructionId(), block.lastLirInstructionId(), block.loopIndex(), block.loopDepth()); + TTY.print("B%d [%d, %d, %d, %d] ", block.blockID, block.lirBlock.firstLirInstructionId(), block.lirBlock.lastLirInstructionId(), block.loopIndex(), block.loopDepth()); } TTY.println(); TTY.println();