|
|||||||||||
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.LocalCSE
public class LocalCSE
Perform local common-subexpression elimination for a factored basic block.
Nested Class Summary | |
---|---|
private static class |
LocalCSE.AvailableExpression
A tuple to record an Available Expression |
protected static class |
LocalCSE.AvExCache
Implements a cache of Available Expressions |
Field Summary | |
---|---|
private static Constructor<CompilerPhase> |
constructor
Constructor for this compiler phase |
private boolean |
isHIR
|
Fields inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase |
---|
container |
Constructor Summary | |
---|---|
LocalCSE(boolean isHIR)
Constructor |
Method Summary | |
---|---|
private void |
checkHelper(IR ir,
LocalCSE.AvExCache cache,
Instruction inst)
Process a check instruction |
private void |
expressionHelper(IR ir,
LocalCSE.AvExCache cache,
Instruction inst)
Process a unary or binary expression. |
Constructor<CompilerPhase> |
getClassConstructor()
Get a constructor object for this compiler phase |
private static Operator |
getMoveOp(RegisterOperand r)
|
String |
getName()
|
private boolean |
isCheck(Instruction inst)
Is the given instruction a check instruction? |
private boolean |
isExpression(Instruction inst)
Does the instruction compute some expression? |
static boolean |
isLoadInstruction(Instruction s)
Is a given instruction a CSE-able load? |
static boolean |
isStoreInstruction(Instruction s)
Is a given instruction a CSE-able store? |
private static boolean |
isSynchronizing(Instruction inst)
Is this a synchronizing instruction? |
private boolean |
isTypeCheck(Instruction inst)
|
private void |
loadHelper(IR ir,
LocalCSE.AvExCache cache,
Instruction inst)
Process a load instruction |
private void |
optimizeBasicBlockHIR(IR ir,
BasicBlock bb)
Perform Local CSE for a basic block in HIR. |
private void |
optimizeBasicBlockLIR(IR ir,
BasicBlock bb)
Perform Local CSE for a basic block in LIR. |
void |
perform(IR ir)
Perform Local CSE for a method. |
void |
reportAdditionalStats()
Called when printing a measure compilation report to enable a phase to report additional phase-specific statistics. |
boolean |
shouldPerform(OptOptions options)
This method determines if the phase should be run, based on the Options object it is passed. |
private void |
storeHelper(LocalCSE.AvExCache cache,
Instruction inst)
Process a store instruction |
private static void |
typeCheckHelper(IR ir,
LocalCSE.AvExCache cache,
Instruction inst)
Process a type check instruction |
Methods inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase |
---|
dumpIR, dumpIR, getCompilerPhaseConstructor, getCompilerPhaseConstructor, newExecution, performPhase, printingEnabled, setContainer, verify |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final boolean isHIR
private static final Constructor<CompilerPhase> constructor
Constructor Detail |
---|
public LocalCSE(boolean isHIR)
Method Detail |
---|
public Constructor<CompilerPhase> getClassConstructor()
getClassConstructor
in class CompilerPhase
public final void reportAdditionalStats()
CompilerPhase
reportAdditionalStats
in class CompilerPhase
public final boolean shouldPerform(OptOptions options)
CompilerPhase
shouldPerform
in class CompilerPhase
options
- the compiler options for the compilation
public final String getName()
getName
in class CompilerPhase
public final void perform(IR ir)
perform
in class CompilerPhase
ir
- the IR to optimizeprivate void optimizeBasicBlockHIR(IR ir, BasicBlock bb)
ir
- the method's irbb
- the basic blockprivate void optimizeBasicBlockLIR(IR ir, BasicBlock bb)
ir
- the method's irbb
- the basic blockpublic static boolean isLoadInstruction(Instruction s)
public static boolean isStoreInstruction(Instruction s)
private boolean isExpression(Instruction inst)
inst
- the instruction in question
private boolean isCheck(Instruction inst)
inst
- the instruction in question
private boolean isTypeCheck(Instruction inst)
private void loadHelper(IR ir, LocalCSE.AvExCache cache, Instruction inst)
ir
- the containing IR object.cache
- the cache of available expressionsinst
- the instruction begin processedprivate void storeHelper(LocalCSE.AvExCache cache, Instruction inst)
cache
- the cache of available expressionsinst
- the instruction begin processedprivate void expressionHelper(IR ir, LocalCSE.AvExCache cache, Instruction inst)
ir
- the containing IR objectcache
- the cache of available expressionsinst
- the instruction begin processedprivate void checkHelper(IR ir, LocalCSE.AvExCache cache, Instruction inst)
cache
- the cache of available expressionsinst
- the instruction begin processedprivate static void typeCheckHelper(IR ir, LocalCSE.AvExCache cache, Instruction inst)
ir
- Unusedcache
- The cache of available expressions.inst
- The instruction being processedprivate static Operator getMoveOp(RegisterOperand r)
private static boolean isSynchronizing(Instruction inst)
inst
- the instruction in question
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |