comparison graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java @ 2789:aeccd2af4e9e

Fixes around critical edge split and placeholder removal after goto removal.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 25 May 2011 16:48:28 +0200
parents df4c5254c5cc
children d3fc4fe063bf
comparison
equal deleted inserted replaced
2788:df4c5254c5cc 2789:aeccd2af4e9e
251 TTY.println(stateAfter.toString()); 251 TTY.println(stateAfter.toString());
252 } 252 }
253 } 253 }
254 } 254 }
255 } 255 }
256 if (block.blockSuccessors().size() == 1 && !(block.getInstructions().get(block.getInstructions().size() - 1) instanceof BlockEnd)) { 256 if (block.blockSuccessors().size() == 1 && (block.getInstructions().size() == 0 || !(block.getInstructions().get(block.getInstructions().size() - 1) instanceof BlockEnd))) {
257 moveToPhi(); 257 moveToPhi();
258 block.lir().jump(block.blockSuccessors().get(0)); 258 block.lir().jump(block.blockSuccessors().get(0));
259 } 259 }
260 260
261 if (C1XOptions.TraceLIRGeneratorLevel >= 1) { 261 if (C1XOptions.TraceLIRGeneratorLevel >= 1) {
589 visitSwitchRanges(createLookupRanges(x), tag, getLIRBlock(x.defaultSuccessor())); 589 visitSwitchRanges(createLookupRanges(x), tag, getLIRBlock(x.defaultSuccessor()));
590 } 590 }
591 } 591 }
592 592
593 protected LIRBlock getLIRBlock(Instruction b) { 593 protected LIRBlock getLIRBlock(Instruction b) {
594 return ir.valueToBlock.get(b); 594 LIRBlock result = ir.valueToBlock.get(b);
595 if (result == null) {
596 TTY.println("instruction without lir block: " + b);
597 }
598 return result;
595 } 599 }
596 600
597 @Override 601 @Override
598 public void visitNullCheck(NullCheck x) { 602 public void visitNullCheck(NullCheck x) {
599 CiValue value = load(x.object()); 603 CiValue value = load(x.object());
1322 } 1326 }
1323 assert predIndex < sux.numberOfPreds(); 1327 assert predIndex < sux.numberOfPreds();
1324 1328
1325 PhiResolver resolver = new PhiResolver(this); 1329 PhiResolver resolver = new PhiResolver(this);
1326 for (Phi phi : phis) { 1330 for (Phi phi : phis) {
1327 if (!phi.isDeadPhi() && phi.valueCount() > predIndex) { 1331 if (!phi.isDeadPhi()) {
1328 Value curVal = phi.valueAt(predIndex); 1332 Value curVal = phi.valueAt(predIndex);
1329 if (curVal != null && curVal != phi) { 1333 if (curVal != null && curVal != phi) {
1330 if (curVal instanceof Phi) { 1334 if (curVal instanceof Phi) {
1331 operandForPhi((Phi) curVal); 1335 operandForPhi((Phi) curVal);
1332 } 1336 }