Line | |
---|
1 | (* Pasted from Pottier's PP compiler *) |
---|
2 | |
---|
3 | (** This module performs graph coloring with an unlimited number of |
---|
4 | colors and aggressive coalescing. It is used for assigning stack |
---|
5 | slots to the pseudo-registers that have been spilled by register |
---|
6 | allocation. *) |
---|
7 | |
---|
8 | (* A coloring is a partial function of graph vertices to stack |
---|
9 | slots. Vertices that are not in the domain of the coloring are |
---|
10 | waiting for a decision to be made. *) |
---|
11 | |
---|
12 | type decision = |
---|
13 | AST.immediate |
---|
14 | |
---|
15 | type coloring = |
---|
16 | decision Interference.Vertex.Map.t |
---|
17 | |
---|
18 | (* Here is the coloring algorithm. Out of an interference graph, it |
---|
19 | produces a coloring and reports how many colors (stack slots) were |
---|
20 | required. The graph is expected to contain interference and |
---|
21 | preferences edges between vertices only -- no hardware registers |
---|
22 | are involved. If the [verbose] flag is set, the algorithm prints |
---|
23 | information messages to the standard output channel. *) |
---|
24 | |
---|
25 | module Color (G : sig |
---|
26 | |
---|
27 | val graph: Interference.graph |
---|
28 | val verbose: bool |
---|
29 | |
---|
30 | end) : sig |
---|
31 | |
---|
32 | val coloring: coloring |
---|
33 | val locals: int |
---|
34 | |
---|
35 | end |
---|
36 | |
---|
Note: See
TracBrowser
for help on using the repository browser.