|
|||||||||||
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.ssa.LeaveSSA
public class LeaveSSA
This compiler phase translates out of SSA form.
SSA
,
SSAOptions
,
LTDominators
Nested Class Summary | |
---|---|
(package private) static class |
LeaveSSA.Copy
An instance of this class represents a pending copy instruction to be inserted. |
(package private) static class |
LeaveSSA.VariableStacks
This class provides an abstraction over stacks of names for registers. |
Field Summary | |
---|---|
private BranchOptimizations |
branchOpts
|
private static Constructor<CompilerPhase> |
constructor
Constructor for this compiler phase |
(package private) static boolean |
DEBUG
verbose debugging flag |
private HashSet<Register> |
globalRenamePhis
|
private HashSet<Instruction> |
globalRenameTable
|
(package private) Instruction |
guardPhis
|
private IR |
ir
The IR to manipulate |
private boolean |
splitSomeBlock
|
Fields inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase |
---|
container |
Constructor Summary | |
---|---|
LeaveSSA()
|
Method Summary | |
---|---|
Constructor<CompilerPhase> |
getClassConstructor()
Get a constructor object for this compiler phase |
String |
getName()
Return a string name for this phase. |
private Register |
guardFind(Register r)
find step of union/find for guard registers during unSSA |
private Register |
guardUnion(Register from,
Register to)
union step of union/find for guard registers during unSSA |
private void |
insertCopies(BasicBlock bb,
DominatorTree dom,
LiveAnalysis live)
Insert copy instructions into a basic block to safely translate out of SSA form. |
private static void |
normalizeSSA(IR ir)
Avoid potential lost copy and other associated problems by Sreedhar's naive translation from TSSA to CSSA. |
void |
perform(IR ir)
perform the main out-of-ssa transformation |
private void |
performRename(BasicBlock bb,
DominatorTree dom,
LeaveSSA.VariableStacks s)
substitute variables renamed in control parents |
(package private) static void |
removeAllPhis(IR ir)
Remove all phi instructions from the IR. |
private void |
scheduleCopies(BasicBlock bb,
LiveAnalysis live)
Record pending copy operations needed to insert at the end of a basic block. |
boolean |
shouldPerform(OptOptions options)
Is SSA form enabled for the HIR? |
void |
translateFromSSA(IR ir)
Main driver to translate an IR out of SSA form. |
private void |
unSSAGuards(IR ir)
Special treatment for guard registers: Remove guard-phis by evaluating operands into same register. |
private void |
unSSAGuardsDetermineReg(IR ir)
Determine target register for guard phi operands |
private void |
unSSAGuardsFinalize(IR ir)
Rename registers and delete Phis. |
private void |
unSSAGuardsInit(IR ir)
Initialization for removal of guard phis. |
private boolean |
usedBelowCopy(BasicBlock bb,
Register r)
|
Methods inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase |
---|
dumpIR, dumpIR, getCompilerPhaseConstructor, getCompilerPhaseConstructor, newExecution, performPhase, printingEnabled, reportAdditionalStats, setContainer, verify |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final boolean DEBUG
private IR ir
private final BranchOptimizations branchOpts
private boolean splitSomeBlock
private final HashSet<Instruction> globalRenameTable
private final HashSet<Register> globalRenamePhis
private static final Constructor<CompilerPhase> constructor
Instruction guardPhis
Constructor Detail |
---|
public LeaveSSA()
Method Detail |
---|
public final boolean shouldPerform(OptOptions options)
shouldPerform
in class CompilerPhase
options
- the compiler options for the compilation
public Constructor<CompilerPhase> getClassConstructor()
getClassConstructor
in class CompilerPhase
public final String getName()
getName
in class CompilerPhase
public final void perform(IR ir)
perform
in class CompilerPhase
ir
- the IR on which to apply the phaseprivate void performRename(BasicBlock bb, DominatorTree dom, LeaveSSA.VariableStacks s)
private boolean usedBelowCopy(BasicBlock bb, Register r)
private void scheduleCopies(BasicBlock bb, LiveAnalysis live)
TODO: this procedure is getting long and ugly. Rewrite or refactor it.
bb
- the basic block to processlive
- valid liveness information for the IRprivate void insertCopies(BasicBlock bb, DominatorTree dom, LiveAnalysis live)
bb
- the basic blockdom
- a valid dominator tree for the IRlive
- valid liveness information for the IRpublic void translateFromSSA(IR ir)
ir
- the IR in SSA formstatic void removeAllPhis(IR ir)
ir
- the governing IRprivate void unSSAGuards(IR ir)
private void unSSAGuardsInit(IR ir)
private void unSSAGuardsDetermineReg(IR ir)
private void unSSAGuardsFinalize(IR ir)
private Register guardUnion(Register from, Register to)
private Register guardFind(Register r)
private static void normalizeSSA(IR ir)
ir
- the IR to work upon
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |