|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--harpoon.Analysis.Instr.RegAlloc | +--harpoon.Analysis.Instr.AppelRegAllocClasses | +--harpoon.Analysis.Instr.AppelRegAlloc | +--harpoon.Analysis.Instr.AppelRegAllocStd
Nested Class Summary |
Nested classes inherited from class harpoon.Analysis.Instr.RegAlloc |
RegAlloc.Factory, RegAlloc.IntermediateCode, RegAlloc.IntermediateCodeFactory, RegAlloc.RestoreProxy, RegAlloc.SpillLoad, RegAlloc.SpillProxy, RegAlloc.SpillStore |
Field Summary |
Fields inherited from class harpoon.Analysis.Instr.AppelRegAlloc |
CHECK_INV, dontSpillTheseDefs, 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 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 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 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 |
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. |
Methods inherited from class harpoon.Analysis.Instr.AppelRegAlloc |
allNodes, appelLoopBody, checkDisjointInv, checkFreezeWorklistInv, checkInv, checkpointState, checkPrecolored, checkSimplifyWorklistInv, checkSpillWorklistInv, coalesce, coalesce, colorToReg, def, defCN, defCT, enableMoves, enableMoves, firstStm, freeze, generateRegAssignment, getAlias, getDerivation, getNode, lastStm, liveOut, makeWorklist, minimum, moveRelated, nodesIter, pred, resetState, rewriteProgram, simplify, spillStats, stateString, 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 |
Constructor Detail |
public AppelRegAllocStd(Code code)
Method Detail |
protected void initializeSets()
initializeSets
in class AppelRegAlloc
protected List nodesFor(harpoon.Analysis.Instr.AppelRegAllocClasses.Web web)
AppelRegAlloc
w
.
Abstract because variants of the algorithm map Webs to Nodes
in different ways.
nodesFor
in class AppelRegAlloc
protected harpoon.Analysis.Instr.AppelRegAllocClasses.Node makePrecolored(Temp t)
makePrecolored
in class AppelRegAlloc
protected void makeInitial(Temp t)
AppelRegAlloc
t
in the interference graph.
Abstract because variants of the algorithm map Temps
to nodes differently.
makeInitial
in class AppelRegAlloc
protected void checkDegreeInv()
AppelRegAlloc
u isIn (simplifyWorklist \/ freezeWorklist \/ spillWorklist ) ==> degree(u) = | adjList(u) /\ ( precolored \/ simplifyWorklist \/ freezeWorklist \/ spillWorklist ) |
checkDegreeInv
in class AppelRegAlloc
protected 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 AppelRegAlloc
protected void assignColors()
AppelRegAlloc
assignColors
in class AppelRegAlloc
protected void performFinalAssignment(Temp[] regs)
AppelRegAlloc
performFinalAssignment
in class AppelRegAlloc
regs
- (regs[i] == n.web.temp) ==> (n in precolored && n.color = i).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |