|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.compilers.opt.instrsched.Scheduler
final class Scheduler
This a simple list-based instruction scheduler.
TODO:
Nested Class Summary | |
---|---|
private static class |
Scheduler.InstructionBucket
A class representing sorted list of instructions. |
Field Summary | |
---|---|
private BasicBlock |
bb
Current basic block. |
private DepGraph |
dg
Dependence graph for current basic block. |
private DepGraphNode[] |
i2gn
Mapping from Instruction to DepGraphNode. |
private IR |
ir
Current IR. |
private int |
phase
Current phase (prepass/postpass). |
static String[] |
PhaseName
Names of various scheduling phases. |
static int |
POSTPASS
A constant signifying post-pass scheduling phase. |
static int |
PREPASS
A constant signifying pre-pass scheduling phase. |
private static boolean |
PRINT_CRITICAL_PATH_LENGTH
Should we print the length of the critical path for each basic block? |
private static int |
VERBOSE
Debugging level. |
Constructor Summary | |
---|---|
Scheduler(int phase)
Initialize scheduler for a given phase. |
Method Summary | |
---|---|
private void |
computeCriticalPath(DepGraphNode n,
int depth)
Perform DFS to compute critical path for all instructions. |
private int |
computeEarliestTime(Instruction i)
Compute earliest scheduling time for an instruction. |
private static void |
debug(int depth,
String s)
Output debugging information with indentation. |
private static void |
debug(String s)
Output debugging information. |
private DepGraphNode |
getGraphNode(Instruction i)
Return corresponding graph node for instruction. |
(package private) void |
perform(IR _ir)
For each basic block, build the dependence graph and perform instruction scheduling. |
private boolean |
printDepgraph(OptOptions options)
Should we print the dependence graph? |
private void |
scheduleBasicBlock()
Schedule a basic block. |
private void |
setGraphNode(Instruction i,
DepGraphNode n)
Set corresponding graph node for instruction. |
private boolean |
sortBasicBlock(int maxtime)
Sort basic block by Scheduled Time. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int VERBOSE
private static final boolean PRINT_CRITICAL_PATH_LENGTH
public static final int PREPASS
public static final int POSTPASS
WARNING: POSTPASS INSTRUCTION SCHEDULING (AFTER REGISTER ALLOCATION) Cannot be done safely due to failure to update GCMapping information.
public static final String[] PhaseName
private final int phase
private IR ir
private BasicBlock bb
private DepGraph dg
private DepGraphNode[] i2gn
Constructor Detail |
---|
Scheduler(int phase)
phase
- the scheduling phaseMethod Detail |
---|
private boolean printDepgraph(OptOptions options)
options
- the options object
void perform(IR _ir)
_ir
- the IR in questionprivate static void debug(String s)
s
- string to printprivate static void debug(int depth, String s)
depth
- level of indentings
- string to printprivate void setGraphNode(Instruction i, DepGraphNode n)
i
- given instructionn
- dependence graph node for instructionprivate DepGraphNode getGraphNode(Instruction i)
i
- given instructionprivate void computeCriticalPath(DepGraphNode n, int depth)
n
- start nodedepth
- current DFS depthprivate int computeEarliestTime(Instruction i)
i
- given instructionprivate boolean sortBasicBlock(int maxtime)
maxtime
- the maximum scheduled timeprivate void scheduleBasicBlock()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |