|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.compilers.opt.controlflow.BranchSimplifier
public abstract class BranchSimplifier
Simplify and canonicalize conditional branches with constant operands.
This module performs no analysis, it simply attempts to simplify any branching instructions of a basic block that have constant operands. The intent is that analysis modules can call this transformation engine, allowing us to share the simplification code among multiple analysis modules.
Constructor Summary | |
---|---|
BranchSimplifier()
|
Method Summary | |
---|---|
private static void |
insertTrueGuard(Instruction inst,
RegisterOperand guard)
|
(package private) static boolean |
processIfCmp(IR ir,
BasicBlock bb,
Instruction s)
Process IfCmp branch instruction |
(package private) static boolean |
processIfCmp2(IR ir,
BasicBlock bb,
Instruction s)
Process IfCmp2 branch instruction |
(package private) static boolean |
processInlineGuard(IR ir,
BasicBlock bb,
Instruction s)
Process InlineGuard branch instruction |
(package private) static boolean |
processLookupSwitch(IR ir,
BasicBlock bb,
Instruction s)
Process LookupSwitch branch instruction |
(package private) static boolean |
processTableSwitch(IR ir,
BasicBlock bb,
Instruction s)
Process TableSwitch branch instruction |
private static void |
removeBranchesAfterGotos(BasicBlock bb)
To maintain IR integrity, remove any branches that are after the first GOTO in the basic block. |
static boolean |
simplify(BasicBlock bb,
IR ir)
Given a basic block, attempt to simplify any conditional branch instructions with constant operands. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BranchSimplifier()
Method Detail |
---|
public static boolean simplify(BasicBlock bb, IR ir)
bb
- the basic block to simplify
true
if we do something, false
otherwise.static boolean processIfCmp(IR ir, BasicBlock bb, Instruction s)
static boolean processIfCmp2(IR ir, BasicBlock bb, Instruction s)
static boolean processLookupSwitch(IR ir, BasicBlock bb, Instruction s)
static boolean processTableSwitch(IR ir, BasicBlock bb, Instruction s)
static boolean processInlineGuard(IR ir, BasicBlock bb, Instruction s)
private static void removeBranchesAfterGotos(BasicBlock bb)
private static void insertTrueGuard(Instruction inst, RegisterOperand guard)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |