]> matita.cs.unibo.it Git - pkg-cerco/acc-trusted.git/blob - extracted/untrusted/spill.mli
Imported Upstream version 0.1
[pkg-cerco/acc-trusted.git] / extracted / untrusted / spill.mli
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     int
14
15 type coloring =
16     decision Untrusted_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: Untrusted_interference.graph
28   val verbose: bool
29
30 end) : sig
31
32   val coloring: coloring
33   val locals: int
34
35 end
36