Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /MLRISC/trunk/ra/ra.sig
ViewVC logotype

Annotation of /MLRISC/trunk/ra/ra.sig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2126 - (view) (download) (as text)

1 : monnier 467 (*
2 :     * The interface to the new register allocator.
3 :     *
4 :     * -- Allen
5 :     *)
6 :     signature RA =
7 :     sig
8 :    
9 :     structure I : INSTRUCTIONS
10 :     structure C : CELLS
11 :     structure F : RA_FLOWGRAPH
12 : leunga 744 sharing F.I = I
13 :     sharing I.C = C
14 : george 889 structure CB : CELLS_BASIS = CellsBasis
15 : monnier 467
16 : george 889 type getreg = { pref : CB.cell_id list,
17 : monnier 467 stamp : int,
18 :     proh : int Array.array
19 : george 889 } -> CB.cell_id
20 : monnier 467
21 : monnier 498 type mode = word
22 :    
23 : leunga 744 datatype spillLoc = datatype RAGraph.spillLoc
24 :    
25 : monnier 467 (*
26 : george 545 * Optimizations/options:
27 :     * Or them together
28 : monnier 498 *)
29 : george 545 val NO_OPTIMIZATION : mode
30 :     val DEAD_COPY_ELIM : mode
31 :     val BIASED_SELECTION : mode
32 :     val SPILL_COLORING : mode
33 :     val SPILL_COALESCING : mode
34 :     val SPILL_PROPAGATION : mode
35 :     val HAS_PARALLEL_COPIES : mode
36 :     (* The above MUST be used when spill coloring is used and
37 :     * you have parallel copies in the program. Otherwise, phathom
38 :     * problems involving copy temporaries may appear.
39 :     *)
40 : monnier 498
41 :     (*
42 : monnier 467 * Perform register allocation.
43 :     *
44 :     * spillProh is a list of register ranges (inclusive) that cannot be spilled.
45 :     *
46 :     *)
47 : monnier 498 type raClient =
48 : george 889 { cellkind : CB.cellkind, (* kind of register *)
49 :     spillProh : CB.cell list, (* don't spill these *)
50 :     memRegs : CB.cell list, (* memory registers *)
51 : monnier 498 K : int, (* number of colors *)
52 : george 823 dedicated : int -> bool, (* dedicated registers *)
53 : monnier 498 getreg : getreg, (* how to find a color *)
54 :     copyInstr : F.Spill.copyInstr, (* how to make a copy *)
55 :     spill : F.Spill.spill, (* spill callback *)
56 :     spillSrc : F.Spill.spillSrc, (* spill callback *)
57 :     spillCopyTmp : F.Spill.spillCopyTmp, (* spill callback *)
58 :     reload : F.Spill.reload, (* reload callback *)
59 :     reloadDst : F.Spill.reloadDst, (* reload callback *)
60 :     renameSrc : F.Spill.renameSrc, (* rename callback *)
61 :     mode : mode (* mode *)
62 :     }
63 : monnier 467
64 : monnier 498 val ra : raClient list -> F.flowgraph -> F.flowgraph
65 :    
66 : monnier 467 end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0