public final class GlobalCSE extends CompilerPhase
Modifier and Type | Field and Description |
---|---|
private HashMap<Integer,Instruction> |
avail
Available expressions.
|
private static Constructor<CompilerPhase> |
constructor
Constructor for this compiler phase
|
private DominatorTree |
dominator
Cache of dominator tree that should be computed prior to this
phase
|
private IR |
ir
Cache of IR being processed by this phase
|
private GlobalValueNumberState |
valueNumbers
Cache of the value numbers from the IR
|
boolean |
verbose
Output debug messages
|
container
Constructor and Description |
---|
GlobalCSE()
Constructor
|
Modifier and Type | Method and Description |
---|---|
Constructor<CompilerPhase> |
getClassConstructor()
Get a constructor object for this compiler phase
|
String |
getName()
Returns the name of the phase
|
private RegisterOperand |
getResult(Instruction inst) |
private void |
globalCSE(BasicBlock b)
Recursively descend over all blocks dominated by b.
|
void |
perform(IR ir)
Perform the GlobalCSE compiler phase
|
private boolean |
shouldCSE(Instruction inst) |
boolean |
shouldPerform(OptOptions options)
Redefine shouldPerform so that none of the subphases will occur
unless we pass through this test.
|
dumpIR, dumpIR, getCompilerPhaseConstructor, getCompilerPhaseConstructor, newExecution, performPhase, printingEnabled, reportAdditionalStats, setContainer, verify
public boolean verbose
private GlobalValueNumberState valueNumbers
private DominatorTree dominator
private final HashMap<Integer,Instruction> avail
private static final Constructor<CompilerPhase> constructor
public GlobalCSE()
public boolean shouldPerform(OptOptions options)
shouldPerform
in class CompilerPhase
options
- the compiler options for the compilationpublic Constructor<CompilerPhase> getClassConstructor()
getClassConstructor
in class CompilerPhase
public String getName()
getName
in class CompilerPhase
public void perform(IR ir)
perform
in class CompilerPhase
ir
- the IR on which to apply the phaseprivate void globalCSE(BasicBlock b)
b
- the current block to processprivate RegisterOperand getResult(Instruction inst)
private boolean shouldCSE(Instruction inst)