org.jikesrvm.compilers.opt.regalloc
Class CoalesceGraph
java.lang.Object
org.jikesrvm.compilers.opt.util.SpaceEffGraph
org.jikesrvm.compilers.opt.regalloc.CoalesceGraph
- All Implemented Interfaces:
- Graph, TopSortInterface
class CoalesceGraph
- extends SpaceEffGraph
This class represents a graph, where
- the nodes are registers
- the edge weights represent affinities between registers.
This graph is used to drive coalescing during register allocation.
Implementation: this is meant to be an undirected graph. By
convention, we enforce that the register with the lower number is the
source of an edge.
| Methods inherited from class org.jikesrvm.compilers.opt.util.SpaceEffGraph |
addGraphEdge, addGraphEdge, addGraphNode, addRootNode, addTopSortNode, allocateNodeNumber, buildRevTopSort, buildTopSort, clearDFS, compactNodeNumbering, enumerateNodes, firstNode, initTopSort, isTopSorted, lastNode, numberOfNodes, printDepthFirst, removeGraphNode, resetTopSorted, rootNodes, setFirstNode, setLastNode, setNumberOfNodes, setTopSorted, startNode, topSort, topSortOrder, toString |
nodeMap
final HashMap<Register,CoalesceGraph.Node> nodeMap
- Mapping register -> Node
CoalesceGraph
CoalesceGraph()
findOrCreateNode
private CoalesceGraph.Node findOrCreateNode(Register r)
- find or create a node in the graph corresponding to a register.
findNode
CoalesceGraph.Node findNode(Register r)
- Find the node corresponding to a regsiter.
findOrCreateEdge
private CoalesceGraph.Edge findOrCreateEdge(CoalesceGraph.Node src,
CoalesceGraph.Node dest)
- find or create an edge in the graph
addAffinity
void addAffinity(int w,
Register r1,
Register r2)
- Add an affinity of weight w between registers r1 and r2