Search in sources :

Example 1 with DF_Solution

use of org.jikesrvm.compilers.opt.dfsolver.DF_Solution in project JikesRVM by JikesRVM.

the class IndexPropagation method perform.

/**
 * Perform the analysis.
 * <p> Pre-condition: The IR is in Array SSA form and global value numbers
 *    have been computed.
 *
 * @param ir the IR to optimize
 */
@Override
public void perform(IR ir) {
    if (ir.desiredSSAOptions.getAbort())
        return;
    IndexPropagationSystem system = new IndexPropagationSystem(ir);
    if (DEBUG) {
        System.out.print("Solving...");
    }
    system.solve();
    if (DEBUG) {
        System.out.println("done");
    }
    DF_Solution solution = system.getSolution();
    if (DEBUG) {
        System.out.println("Index Propagation Solution: " + solution);
    }
    ir.HIRInfo.indexPropagationSolution = solution;
}
Also used : DF_Solution(org.jikesrvm.compilers.opt.dfsolver.DF_Solution)

Example 2 with DF_Solution

use of org.jikesrvm.compilers.opt.dfsolver.DF_Solution in project JikesRVM by JikesRVM.

the class Dominators method computeApproxDominators.

/**
 * Calculate the "approximate" dominators for an IR i.e., the
 * dominators in the factored CFG rather than the normal CFG.
 * <p> (No exception is thrown if the input IR has handler blocks.)
 *
 * @param ir the IR in question
 */
public void computeApproxDominators(IR ir) {
    DominatorSystem system = new DominatorSystem(ir);
    if (DEBUG) {
        System.out.print("Solving...");
    }
    if (DEBUG) {
        System.out.println(system);
    }
    system.solve();
    if (DEBUG) {
        System.out.println("done");
    }
    DF_Solution solution = system.getSolution();
    if (DEBUG) {
        System.out.println("Dominator Solution :" + solution);
    }
    if (DEBUG) {
        System.out.print("Updating blocks ...");
    }
    updateBlocks(solution);
    if (DEBUG) {
        System.out.println("done.");
    }
    if (ir.options.PRINT_DOMINATORS) {
        printDominators(ir);
    }
}
Also used : DF_Solution(org.jikesrvm.compilers.opt.dfsolver.DF_Solution)

Example 3 with DF_Solution

use of org.jikesrvm.compilers.opt.dfsolver.DF_Solution in project JikesRVM by JikesRVM.

the class Dominators method perform.

/**
 * Calculate the dominators for an IR.
 *
 * @param ir the IR in question
 */
public void perform(IR ir) {
    if (ir.hasReachableExceptionHandlers()) {
        throw new OperationNotImplementedException("IR with exception handlers");
    }
    DominatorSystem system = new DominatorSystem(ir);
    if (DEBUG) {
        System.out.print("Solving...");
    }
    if (DEBUG) {
        System.out.println(system);
    }
    system.solve();
    if (DEBUG) {
        System.out.println("done");
    }
    DF_Solution solution = system.getSolution();
    if (DEBUG) {
        System.out.println("Dominator Solution :" + solution);
    }
    if (DEBUG) {
        System.out.print("Updating blocks ...");
    }
    updateBlocks(solution);
    if (DEBUG) {
        System.out.println("done.");
    }
    if (ir.options.PRINT_DOMINATORS) {
        printDominators(ir);
    }
}
Also used : DF_Solution(org.jikesrvm.compilers.opt.dfsolver.DF_Solution) OperationNotImplementedException(org.jikesrvm.compilers.opt.OperationNotImplementedException)

Example 4 with DF_Solution

use of org.jikesrvm.compilers.opt.dfsolver.DF_Solution in project JikesRVM by JikesRVM.

the class Dominators method computeApproxPostdominators.

/**
 * Calculate the postdominators for an IR.
 *
 * @param ir the IR in question
 */
public void computeApproxPostdominators(IR ir) {
    Dominators.COMPUTE_POST_DOMINATORS = true;
    DominatorSystem system = new DominatorSystem(ir);
    if (DEBUG) {
        System.out.print("Solving...");
    }
    if (DEBUG) {
        System.out.println(system);
    }
    system.solve();
    if (DEBUG) {
        System.out.println("done");
    }
    DF_Solution solution = system.getSolution();
    if (DEBUG) {
        System.out.println("Postdominator Solution :" + solution);
    }
    if (DEBUG) {
        System.out.print("Updating blocks ...");
    }
    updateBlocks(solution);
    if (DEBUG) {
        System.out.println("done.");
    }
    if (ir.options.PRINT_DOMINATORS) {
        printDominators(ir);
    }
    Dominators.COMPUTE_POST_DOMINATORS = false;
}
Also used : DF_Solution(org.jikesrvm.compilers.opt.dfsolver.DF_Solution)

Aggregations

DF_Solution (org.jikesrvm.compilers.opt.dfsolver.DF_Solution)4 OperationNotImplementedException (org.jikesrvm.compilers.opt.OperationNotImplementedException)1