| 1 |
(* |
| 2 |
* This signature describes DJ-graph and related algorithms. |
| 3 |
* |
| 4 |
* -- Allen |
| 5 |
*) |
| 6 |
|
| 7 |
signature DJ_GRAPH = |
| 8 |
sig |
| 9 |
|
| 10 |
structure Dom : DOMINATOR_TREE |
| 11 |
|
| 12 |
type ('n,'e,'g) dj_graph (* abstract type now! *) |
| 13 |
|
| 14 |
val DJ : ('n,'e,'g) Dom.dominator_tree -> ('n,'e,'g) dj_graph |
| 15 |
|
| 16 |
val DF : ('n,'e,'g) dj_graph -> Graph.node_id -> Graph.node_id list |
| 17 |
|
| 18 |
val IDFs : ('n,'e,'g) dj_graph -> |
| 19 |
Graph.node_id list -> Graph.node_id list (* DF^+(S) *) |
| 20 |
|
| 21 |
(* For constructing pruned SSA, we actually need to compute |
| 22 |
* DF^+(defs(v)) \intersect LiveIn(v) |
| 23 |
* for each variable v, i.e. only places where v is live. |
| 24 |
* The following function computes this with liveness incrementally. |
| 25 |
*) |
| 26 |
val LiveIDFs : ('n,'e,'g) dj_graph -> |
| 27 |
{defs : Graph.node_id list, (* blocks with definitions *) |
| 28 |
localLiveIn : Graph.node_id list (* blocks that are local live in *) |
| 29 |
} -> Graph.node_id list |
| 30 |
|
| 31 |
end |