|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectharpoon.Analysis.Instr.RegAlloc
harpoon.Analysis.Instr.AppelRegAlloc
harpoon.Analysis.Instr.AppelRegAllocStd
public class AppelRegAllocStd
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class harpoon.Analysis.Instr.RegAlloc |
|---|
RegAlloc.Factory, RegAlloc.IntermediateCode, RegAlloc.IntermediateCodeFactory, RegAlloc.RestoreProxy, RegAlloc.SpillLoad, RegAlloc.SpillProxy, RegAlloc.SpillStore |
| Field Summary | |
|---|---|
static boolean |
CHECK_INV
|
protected HashSet |
dontSpillTheseDefs
|
| Fields inherited from class harpoon.Analysis.Instr.AppelRegAlloc |
|---|
PRINT_CLEANING_INFO, PRINT_DEPTH_TO_SPILL_INFO, PRINT_HEURISTIC_INFO |
| Fields inherited from class harpoon.Analysis.Instr.RegAlloc |
|---|
bbFact, checked, code, DEBUG, frame, GLOBAL, LOCAL, TIME |
| Constructor Summary | |
|---|---|
AppelRegAllocStd(Code code)
|
|
| Method Summary | |
|---|---|
protected void |
addEdge(harpoon.Analysis.Instr.AppelRegAllocClasses.Node u,
harpoon.Analysis.Instr.AppelRegAllocClasses.Node v)
Introduces an edge between u and v in both the interference graph and in the neighbor lists for u and v. |
protected Iterator |
allNodes()
|
protected void |
assignColors()
Gives the nodes a legal color assignment. |
protected void |
buildInterferenceGraph()
Builds the interference graph for the code. |
protected void |
checkDegreeInv()
Checks degree invariant documented in Tiger book; abstract because a variant of the algorithm breaks it on purpose. |
protected void |
checkpointState()
Saves the current state of this for later
retrieval using resetState(). |
protected boolean |
conservative(harpoon.Analysis.Instr.AppelRegAllocClasses.Node u,
harpoon.Analysis.Instr.AppelRegAllocClasses.Node v)
conservative coalescing heuristic due to Preston Briggs. |
protected void |
decrementDegree(harpoon.Analysis.Instr.AppelRegAllocClasses.Node m,
harpoon.Analysis.Instr.AppelRegAllocClasses.Node n)
Updates m to account for n being removed from the interference graph. |
protected harpoon.Analysis.Instr.AppelRegAllocClasses.Node |
getNode(int i)
|
protected void |
initializeSets()
|
protected void |
makeInitial(Temp t)
Creates node(s) for t in the interference graph. |
protected harpoon.Analysis.Instr.AppelRegAllocClasses.Node |
makePrecolored(Temp t)
|
protected List<harpoon.Analysis.Instr.AppelRegAllocClasses.Node> |
nodesFor(harpoon.Analysis.Instr.AppelRegAllocClasses.Web web)
Returns a List of Node mapped to by w. |
protected void |
performFinalAssignment(Temp[] regs)
Gives each Instr in the code a register assignment. |
protected void |
resetState()
Restores the state of this to the state it was in
on the last call to checkpointState(). |
protected String |
stateString()
|
| Methods inherited from class harpoon.Analysis.Instr.AppelRegAlloc |
|---|
appelLoopBody, checkDisjointInv, checkFreezeWorklistInv, checkInv, checkPrecolored, checkSimplifyWorklistInv, checkSpillWorklistInv, coalesce, coalesce, colorToReg, def, defCN, defCT, enableMoves, enableMoves, firstStm, freeze, generateRegAssignment, getAlias, getDerivation, lastStm, liveOut, makeWorklist, minimum, moveRelated, nodesIter, pred, rewriteProgram, simplify, spillStats, tempCtoNodes, useCN, useCT, usedef, webFor, webToRegAssignment |
| Methods inherited from class harpoon.Analysis.Instr.RegAlloc |
|---|
abstractSpillFactory, abstractSpillFactory, allRegs, back, codeFactory, codeFactory, computeBasicBlocks, concreteSpillFactory, expand, fixupSpillCode, getBack, getGrapherFor, getUseDeferFor, hasRegister, isRegister, lastUse, reachableInstrs, replace, resolveOutstandingTemps, rfi |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final boolean CHECK_INV
protected HashSet dontSpillTheseDefs
| Constructor Detail |
|---|
public AppelRegAllocStd(Code code)
| Method Detail |
|---|
protected void initializeSets()
initializeSets in class AppelRegAllocprotected List<harpoon.Analysis.Instr.AppelRegAllocClasses.Node> nodesFor(harpoon.Analysis.Instr.AppelRegAllocClasses.Web web)
AppelRegAllocw.
Abstract because variants of the algorithm map Webs to Nodes
in different ways.
nodesFor in class AppelRegAllocprotected harpoon.Analysis.Instr.AppelRegAllocClasses.Node makePrecolored(Temp t)
makePrecolored in class AppelRegAllocprotected void makeInitial(Temp t)
AppelRegAlloct in the interference graph.
Abstract because variants of the algorithm map Temps
to nodes differently.
makeInitial in class AppelRegAllocprotected void checkDegreeInv()
AppelRegAlloc
u isIn (simplifyWorklist \/ freezeWorklist \/ spillWorklist ) ==>
degree(u) = | adjList(u) /\ ( precolored \/ simplifyWorklist \/
freezeWorklist \/ spillWorklist ) |
checkDegreeInv in class AppelRegAllocprotected void buildInterferenceGraph()
AppelRegAlloc
forall b : blocks in program
let live = liveOut(b)
forall I : instructions(b) in reverse order
if isMoveInstruction(I) then
live <- live \ use(I)
forall n : def(I) \/ use(I)
moveList[n] <- moveList[n] \/ I
worklistMoves <- worklistMoves \/ { I }
live <- live \/ def(I)
forall d : def(I)
forall l : live
AddEdge(l, d)
live <- use(I) \/ ( live \ def(I) )
buildInterferenceGraph in class AppelRegAlloc
protected void addEdge(harpoon.Analysis.Instr.AppelRegAllocClasses.Node u,
harpoon.Analysis.Instr.AppelRegAllocClasses.Node v)
AppelRegAlloc
addEdge in class AppelRegAlloc
protected void decrementDegree(harpoon.Analysis.Instr.AppelRegAllocClasses.Node m,
harpoon.Analysis.Instr.AppelRegAllocClasses.Node n)
AppelRegAlloc
decrementDegree in class AppelRegAlloc
protected boolean conservative(harpoon.Analysis.Instr.AppelRegAllocClasses.Node u,
harpoon.Analysis.Instr.AppelRegAllocClasses.Node v)
AppelRegAlloc
conservative in class AppelRegAllocprotected void assignColors()
AppelRegAlloc
assignColors in class AppelRegAllocprotected void performFinalAssignment(Temp[] regs)
AppelRegAlloc
performFinalAssignment in class AppelRegAllocregs - (regs[i] == n.web.temp) ==> (n in precolored && n.color = i).protected void checkpointState()
this for later
retrieval using resetState().
Note that this only carries Node and
Move state; additional state added by subclasses
will not be checkpointed unless this method and reset state
are overridden.
protected void resetState()
this to the state it was in
on the last call to checkpointState().
protected String stateString()
protected harpoon.Analysis.Instr.AppelRegAllocClasses.Node getNode(int i)
protected Iterator allNodes()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||