Debian Codegraph @

lib/mlrisc-lib/MLRISC/ir-archive/ssa.sig

raw
1 (*
2 * This generic module is used for computing static single assignment form.
3 * Actually only the renaming and iterated dominance frontiers computation
4 * is implemented here.
5 *
6 * -- Allen
7 *)
8 signature STATIC_SINGLE_ASSIGNMENT_FORM =
9 sig
10
11 structure Dom : DOMINATOR_TREE
12
13 type var = int
14 type phi = var * var * var list (* orig def/def/uses *)
15 type renamer = {defs : var list, uses: var list} ->
16 {defs : var list, uses: var list}
17 type copy = {dst : var list, src: var list} -> unit
18
19 (*
20 * Given a set of definitions for each block,
21 * Compute the set of phi nodes.
22 *)
23 val compute_ssa :
24 ('n,'e,'g) Dom.dominator_tree ->
25 { max_var : var,
26 defs : 'n Graph.node -> var list,
27 is_live : var * int -> bool,
28 rename_var : var -> var,
29 rename_stmt : {rename:renamer,copy:copy} -> 'n Graph.node -> unit,
30 insert_phi : {block : 'n Graph.node,
31 in_edges : 'e Graph.edge list,
32 phis : phi list
33 } -> unit
34 } -> unit
35 end
36