|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jikesrvm.compilers.opt.driver.CompilerPhase
org.jikesrvm.compilers.opt.controlflow.BranchOptimizationDriver
public abstract class BranchOptimizationDriver
IR level independent driver for simple peephole optimizations of branches.
| Field Summary | |
|---|---|
private int |
level
Optimization level at which phase should be performed. |
private boolean |
simplify
Optimization level at which phase should be performed. |
| Fields inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase |
|---|
container |
| Constructor Summary | |
|---|---|
BranchOptimizationDriver(int level)
|
|
BranchOptimizationDriver(int level,
boolean simplify)
|
|
| Method Summary | |
|---|---|
protected boolean |
applyPeepholeBranchOpts(IR ir)
This pass performs peephole branch optimizations. |
private static boolean |
applySimplify(IR ir)
Perform branch simplifications. |
protected Instruction |
firstLabelFollowing(Instruction s)
Given an instruction s, return the first LABEL instruction following s. |
protected Instruction |
firstRealInstructionFollowing(Instruction s)
Given an instruction s, return the first real (non-label) instruction following s |
String |
getName()
|
protected void |
maximizeBasicBlocks(IR ir)
Merge adjacent basic blocks |
CompilerPhase |
newExecution(IR ir)
This phase contains no per-compilation instance fields. |
protected abstract boolean |
optimizeBranchInstruction(IR ir,
Instruction s,
BasicBlock bb)
This method actually does the work of attempting to peephole optimize a branch instruction. |
void |
perform(IR ir)
Perform peephole branch optimizations. |
void |
perform(IR ir,
boolean renumber)
|
boolean |
printingEnabled(OptOptions options,
boolean before)
Returns true if the phase wants the IR dumped before and/or after it runs. |
protected boolean |
removeUnreachableCode(IR ir)
Remove unreachable code |
boolean |
shouldPerform(OptOptions options)
Interface |
| Methods inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase |
|---|
dumpIR, dumpIR, getClassConstructor, getCompilerPhaseConstructor, getCompilerPhaseConstructor, performPhase, reportAdditionalStats, setContainer, verify |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final int level
private final boolean simplify
| Constructor Detail |
|---|
BranchOptimizationDriver(int level,
boolean simplify)
level - the minimum optimization level at which the branch
optimizations should be performed.simplify - perform simplification prior to optimization?BranchOptimizationDriver(int level)
level - the minimum optimization level at which the branch
optimizations should be performed.| Method Detail |
|---|
public final boolean shouldPerform(OptOptions options)
shouldPerform in class CompilerPhaseoptions - the compiler options for the compilation
public final String getName()
getName in class CompilerPhase
public final boolean printingEnabled(OptOptions options,
boolean before)
CompilerPhase
printingEnabled in class CompilerPhaseoptions - the compiler options for the compilationbefore - true when invoked before perform, false otherwise.
public final CompilerPhase newExecution(IR ir)
newExecution in class CompilerPhaseir - the IR that is about to be passed to performPhase
public final void perform(IR ir)
perform in class CompilerPhaseir - the IR to optimize
public final void perform(IR ir,
boolean renumber)
private static boolean applySimplify(IR ir)
ir - the IR to optimize
protected boolean applyPeepholeBranchOpts(IR ir)
ir - the IR to optimize
protected abstract boolean optimizeBranchInstruction(IR ir,
Instruction s,
BasicBlock bb)
ir - the containing IRs - the branch instruction to optimizebb - the containing basic block
protected final boolean removeUnreachableCode(IR ir)
ir - the IR to optimize
protected final void maximizeBasicBlocks(IR ir)
ir - the IR to optimizeprotected final Instruction firstLabelFollowing(Instruction s)
protected final Instruction firstRealInstructionFollowing(Instruction s)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||