private static final class RedundantBranchElimination.RBE extends CompilerPhase
| Modifier and Type | Field and Description |
|---|---|
private static boolean |
DEBUG |
container| Modifier | Constructor and Description |
|---|---|
private |
RBE() |
| Modifier and Type | Method and Description |
|---|---|
String |
getName() |
private BasicBlock |
getNotTakenBlock(Instruction s) |
CompilerPhase |
newExecution(IR ir)
Return this instance of this phase.
|
void |
perform(IR ir)
Transform to eliminate redundant branches passed on
GVNs and dominator information.
|
boolean |
printingEnabled(OptOptions options,
boolean before)
Returns true if the phase wants the IR dumped before and/or after it runs.
|
private void |
removeCondBranch(BasicBlock source,
Instruction cb,
IR ir,
Instruction di)
Remove cb from source, updating PHI nodes to maintain SSA form.
|
private void |
removeUnreachableCode(IR ir)
Remove unreachable code
|
private void |
takeCondBranch(BasicBlock source,
Instruction cb,
IR ir)
Transforms a conditional branch into a GOTO, updating PHI nodes
to maintain SSA form.
|
dumpIR, dumpIR, getClassConstructor, getCompilerPhaseConstructor, getCompilerPhaseConstructor, performPhase, reportAdditionalStats, setContainer, shouldPerform, verifyprivate static final boolean DEBUG
private RBE()
public String getName()
getName in class CompilerPhasepublic boolean printingEnabled(OptOptions options, boolean before)
CompilerPhaseprintingEnabled in class CompilerPhaseoptions - the compiler options for the compilationbefore - true when invoked before perform, false otherwise.public CompilerPhase newExecution(IR ir)
newExecution in class CompilerPhaseir - not usedpublic void perform(IR ir)
perform in class CompilerPhaseir - The IR on which to apply the phaseprivate void removeUnreachableCode(IR ir)
ir - the IR to optimizeprivate BasicBlock getNotTakenBlock(Instruction s)
s - an instruction instructionprivate void removeCondBranch(BasicBlock source, Instruction cb, IR ir, Instruction di)
source - basic block containing cbcb - conditional branch to removeir - containing IRdi - branch that dominates cbprivate void takeCondBranch(BasicBlock source, Instruction cb, IR ir)
source - the basic block that contains the branch instructioncb - the conditional branch to transformir - the governing IR, in SSA form