Search in sources :

Example 11 with IR

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);
}
Also used : IR(org.jikesrvm.compilers.opt.ir.IR) Test(org.junit.Test)

Example 12 with IR

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);
}
Also used : IR(org.jikesrvm.compilers.opt.ir.IR) Test(org.junit.Test)

Example 13 with 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);
}
Also used : IR(org.jikesrvm.compilers.opt.ir.IR) Test(org.junit.Test)

Example 14 with IR

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);
}
Also used : MIRInfo(org.jikesrvm.compilers.opt.ir.MIRInfo) NormalMethod(org.jikesrvm.classloader.NormalMethod) IR(org.jikesrvm.compilers.opt.ir.IR) OptOptions(org.jikesrvm.compilers.opt.OptOptions)

Example 15 with IR

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));
}
Also used : MIRInfo(org.jikesrvm.compilers.opt.ir.MIRInfo) NormalMethod(org.jikesrvm.classloader.NormalMethod) IR(org.jikesrvm.compilers.opt.ir.IR) OptOptions(org.jikesrvm.compilers.opt.OptOptions) Test(org.junit.Test)

Aggregations

IR (org.jikesrvm.compilers.opt.ir.IR)15 Test (org.junit.Test)10 OptOptions (org.jikesrvm.compilers.opt.OptOptions)5 NormalMethod (org.jikesrvm.classloader.NormalMethod)3 BasicBlock (org.jikesrvm.compilers.opt.ir.BasicBlock)2 MIRInfo (org.jikesrvm.compilers.opt.ir.MIRInfo)2 OptimizingCompilerException (org.jikesrvm.compilers.opt.OptimizingCompilerException)1 Instruction (org.jikesrvm.compilers.opt.ir.Instruction)1 BitVector (org.jikesrvm.util.BitVector)1