|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.compilers.opt.driver.CompilerPhase org.jikesrvm.compilers.opt.Simple
public final class Simple
Simple flow-insensitive optimizations.
Except for the "CompilerPhase" methods, all fields and methods in this class are declared static.
Field Summary | |
---|---|
private BranchOptimizations |
branchOpts
|
private static Constructor<CompilerPhase> |
constructor
Constructor for this compiler phase |
private boolean |
foldBranches
Fold conditional branches with constant operands? |
private boolean |
foldChecks
Attempt to eliminate bounds and cast checks? |
private int |
level
At what optimization level should this phase be run? |
private boolean |
sortRegisters
Sort registers used by commutative operators |
private boolean |
typeProp
Perform type propagation? |
Fields inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase |
---|
container |
Constructor Summary | |
---|---|
Simple(int level,
boolean typeProp,
boolean foldChecks,
boolean foldBranches,
boolean sortRegisters)
The constructor is used to specify what pieces of Simple will be enabled for this instance. |
Method Summary | |
---|---|
(package private) static void |
arrayPropagation(IR ir)
Perform flow-insensitive propagation to eliminate bounds checks and arraylength for arrays with static lengths. |
static void |
copyPropagation(IR ir)
Perform flow-insensitive copy and constant propagation using register list information. |
(package private) static void |
eliminateDeadInstructions(IR ir)
Simple conservative dead code elimination. |
static void |
eliminateDeadInstructions(IR ir,
boolean preserveImplicitSSA)
Simple conservative dead code elimination. |
(package private) static Operand |
equivalentValforPHI(Instruction phi)
Try to find an operand that is equivalent to the result of a given phi instruction. |
(package private) void |
foldConstants(IR ir)
Perform constant folding. |
Constructor<CompilerPhase> |
getClassConstructor()
Get a constructor object for this compiler phase |
String |
getName()
|
void |
perform(IR ir)
Main driver for the simple optimizations |
boolean |
printingEnabled(OptOptions options,
boolean before)
Returns true if the phase wants the IR dumped before and/or after it runs. |
boolean |
shouldPerform(OptOptions options)
This method determines if the phase should be run, based on the Options object it is passed. |
(package private) void |
simplifyConstantBranches(IR ir)
Simplify branches whose operands are constants. |
private static void |
sortCommutativeRegisterUses(IR ir)
Sort commutative use operands so that those defined most are on the lhs |
(package private) static void |
typePropagation(IR ir)
Perform flow-insensitive type propagation using register list information. |
Methods inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase |
---|
dumpIR, dumpIR, getCompilerPhaseConstructor, getCompilerPhaseConstructor, newExecution, 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 BranchOptimizations branchOpts
private final int level
private final boolean typeProp
private final boolean foldChecks
private final boolean foldBranches
private final boolean sortRegisters
private static final Constructor<CompilerPhase> constructor
Constructor Detail |
---|
public Simple(int level, boolean typeProp, boolean foldChecks, boolean foldBranches, boolean sortRegisters)
level
- at what optimization level should the phase be enabled?typeProp
- should type propagation be peformed?foldChecks
- should we attempt to eliminate boundscheck?foldBranches
- should we attempt to constant fold conditionalsortRegisters
- should we sort use operands?
branches?Method Detail |
---|
public boolean shouldPerform(OptOptions options)
CompilerPhase
shouldPerform
in class CompilerPhase
options
- the compiler options for the compilation
public String getName()
getName
in class CompilerPhase
public boolean printingEnabled(OptOptions options, boolean before)
CompilerPhase
printingEnabled
in class CompilerPhase
options
- the compiler options for the compilationbefore
- true when invoked before perform, false otherwise.
public Constructor<CompilerPhase> getClassConstructor()
getClassConstructor
in class CompilerPhase
public void perform(IR ir)
perform
in class CompilerPhase
ir
- the IR to optimizeprivate static void sortCommutativeRegisterUses(IR ir)
ir
- the IR to work onpublic static void copyPropagation(IR ir)
ir
- the IR in questionstatic Operand equivalentValforPHI(Instruction phi)
phi
- the instruction to be simplified
static void typePropagation(IR ir)
Kept separate from copyPropagation loop to enable clients more flexibility.
ir
- the IR in questionstatic void arrayPropagation(IR ir)
Note: this function incrementally maintains the register list.
ir
- the IR in questionstatic void eliminateDeadInstructions(IR ir)
Note: this function incrementally maintains the register list.
ir
- the IR to optimizepublic static void eliminateDeadInstructions(IR ir, boolean preserveImplicitSSA)
Note: this function incrementally maintains the register list.
ir
- IR to optimizepreserveImplicitSSA
- if this is true, do not eliminate dead
instructions that have implicit operands for heap array SSA formvoid foldConstants(IR ir)
ir
- the IR to optimizevoid simplifyConstantBranches(IR ir)
NOTE: This pass ensures that the register list is still valid after it is done.
ir
- the IR to optimize
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |