Debian Codegraph @

lib/mlrisc-lib/MLRISC/ra/ra-params.sig

raw
1 (* ra-params.sig --- machine parameter required for register allocation.
2 *
3 * Copyright 1996 AT&T Bell Laboratories
4 *
5 *)
6
7 signature RA_ARCH_PARAMS = sig
8
9 structure Liveness : LIVENESS
10 structure InsnProps : INSN_PROPERTIES
11 structure AsmEmitter : INSTRUCTION_EMITTER
12 structure I : INSTRUCTIONS
13
14 (* all modules work on the same instruction type *)
15 sharing Liveness.F.I = InsnProps.I = AsmEmitter.I = I
16
17 val firstPseudoR : int
18 val maxPseudoR : unit -> int
19 val numRegs : unit -> int
20 val regSet : I.C.cellset -> int list
21 val defUse : I.instruction -> (int list * int list)
22 end
23
24
25
26 signature RA_USER_PARAMS = sig
27
28 structure I : INSTRUCTIONS
29 structure B : BLOCK_NAMES
30
31 val nFreeRegs : int
32 val dedicated : int list (* dedicated registers *)
33 val getreg : {pref: int list, stamp:int, proh: int Array.array} -> int
34 val copyInstr : (int list * int list) * I.instruction -> I.instruction
35
36 val spill :
37 {instr : I.instruction, (* instruction where spill is to occur *)
38 reg: int, (* register to spill *)
39 regmap: int -> int, (* register map *)
40 id : B.name (* block name *)
41 }
42 ->
43 {code: I.instruction list, (* spill or reload code *)
44 proh: int list, (* regs prohibited from future spilling *)
45 instr: I.instruction option} (* possibly changed instruction *)
46
47 val reload :
48 {instr : I.instruction, (* instruction where spill is to occur *)
49 reg: int, (* register to spill *)
50 regmap: int -> int, (* register map *)
51 id : B.name (* block name *)
52 }
53 ->
54 {code: I.instruction list, (* spill or reload code *)
55 proh: int list} (* regs prohibited from future spilling *)
56
57 end
58
59
60
61 signature RA = sig
62 structure F : FLOWGRAPH
63 datatype mode = REGISTER_ALLOCATION | COPY_PROPAGATION
64
65 val ra: mode -> (int * int) list -> F.cluster -> F.cluster
66 end
67
68