use of org.jikesrvm.compilers.opt.ir.IR in project JikesRVM by JikesRVM.
the class SplitBasicBlockTest method worksCorrectlyForALimitOfOneInstructionPerBlock.
@Test(timeout = 1000)
public void worksCorrectlyForALimitOfOneInstructionPerBlock() {
int maxInstPerBlock = 1;
IR ir = createIRWithEmptyCFG(maxInstPerBlock);
int nodeNumberBefore = ir.cfg.numberOfNodes();
addNumberOfInstructionsToBlock(ir, 1);
splitPhase.perform(ir);
int nodeNumberAfter = ir.cfg.numberOfNodes();
assertThat(nodeNumberAfter, is(nodeNumberBefore));
assertThatInstructionCountForEachBlockIsAtMost(ir, maxInstPerBlock);
}
use of org.jikesrvm.compilers.opt.ir.IR in project JikesRVM by JikesRVM.
the class SplitBasicBlockTest method doesNotThrowExceptionsOnCFGWithoutInstructions.
@Test
public void doesNotThrowExceptionsOnCFGWithoutInstructions() {
int maxInstPerBlock = 0;
IR ir = createIRWithEmptyCFG(maxInstPerBlock);
splitPhase.perform(ir);
}
use of org.jikesrvm.compilers.opt.ir.IR in project JikesRVM by JikesRVM.
the class SplitBasicBlockTest method doesNotAddInstructionsToEmptyCFG.
@Test
public void doesNotAddInstructionsToEmptyCFG() {
int maxInstPerBlock = 0;
IR ir = createIRWithEmptyCFG(maxInstPerBlock);
splitPhase.perform(ir);
assertThatInstructionCountForEachBlockIsAtMost(ir, maxInstPerBlock);
}
use of org.jikesrvm.compilers.opt.ir.IR in project JikesRVM by JikesRVM.
the class ActiveSetTest method createActiveSetFromRegisterAllocatorState.
private ActiveSet createActiveSetFromRegisterAllocatorState(RegisterAllocatorState state) throws Exception {
NormalMethod nm = TestingTools.getNormalMethod(MethodsForTests.class, "emptyStaticMethodWithoutAnnotations");
OptOptions opts = new OptOptions();
IR ir = new IR(nm, null, opts);
ir.MIRInfo = new MIRInfo(ir);
ir.MIRInfo.regAllocState = state;
SpillLocationManager spillLocManager = new SpillLocationManager(ir);
this.spillLocations = spillLocManager;
return new ActiveSet(ir, spillLocManager, null);
}
use of org.jikesrvm.compilers.opt.ir.IR in project JikesRVM by JikesRVM.
the class ActiveSetTest method findAvailableRegisterIgnoresInfrequentIntervalsWhenDesired.
@Test
public void findAvailableRegisterIgnoresInfrequentIntervalsWhenDesired() throws Exception {
NormalMethod nm = TestingTools.getNormalMethod(MethodsForTests.class, "emptyStaticMethodWithoutAnnotations");
OptOptions opts = new OptOptions();
opts.FREQ_FOCUS_EFFORT = true;
IR ir = new IR(nm, null, opts);
ir.MIRInfo = new MIRInfo(ir);
SpillLocationManager spillLocManager = new SpillLocationManager(ir);
this.spillLocations = spillLocManager;
ActiveSet active = new ActiveSet(ir, spillLocManager, null);
CompoundInterval infrequentCode = new CompoundInterval(null);
assertNull(active.findAvailableRegister(infrequentCode));
}
Aggregations