20 |
exception CTRL_DEF of int |
exception CTRL_DEF of int |
21 |
exception CTRL_USE of int |
exception CTRL_USE of int |
22 |
|
|
23 |
|
(* |
24 |
|
* These annotations specifies definitions and uses * for a pseudo instruction. |
25 |
|
*) |
26 |
|
exception DEFUSER of int list * int list |
27 |
|
exception DEFUSEF of int list * int list |
28 |
|
exception DEFUSECC of int list * int list |
29 |
|
|
30 |
|
exception REGINFO of int -> string |
31 |
|
|
32 |
|
exception NO_OPTIMIZATION |
33 |
|
exception CALLGC |
34 |
|
|
35 |
fun toString(BRANCH_PROB b) = "branch("^Int.toString b^"%)" |
fun toString(BRANCH_PROB b) = "branch("^Int.toString b^"%)" |
36 |
| toString(EXECUTION_FREQ r) = "freq("^Real.toString r^")" |
| toString(EXECUTION_FREQ r) = "freq("^Real.toString r^")" |
37 |
| toString(COMMENT s) = s |
| toString(COMMENT s) = s |
38 |
| toString(CTRL_DEF x) = "ctrl-def "^Int.toString x |
| toString(CTRL_DEF x) = "ctrl-def "^Int.toString x |
39 |
| toString(CTRL_USE x) = "ctrl-use "^Int.toString x |
| toString(CTRL_USE x) = "ctrl-use "^Int.toString x |
40 |
|
| toString(DEFUSER x) = "reg "^defUse x |
41 |
|
| toString(DEFUSEF x) = "freg "^defUse x |
42 |
|
| toString(DEFUSECC x) = "ccreg "^defUse x |
43 |
| toString a = raise a |
| toString a = raise a |
44 |
|
|
45 |
|
and defUse(d,u) = |
46 |
|
let fun list l = |
47 |
|
String.concat(foldr (fn (r,l) => Int.toString r::" "::l) [] l) |
48 |
|
in "defs="^list d^" uses="^list u end |
49 |
|
|
50 |
val _ = Annotations.attachPrettyPrinter toString |
val _ = Annotations.attachPrettyPrinter toString |
51 |
|
|
52 |
end |
end |