Added dependency from a read to a linear read
This got lost along the way when porting memalloc to the new branch
This commit is contained in:
parent
53043b403c
commit
caa43f163f
|
@ -162,6 +162,22 @@ struct
|
||||||
let memory_vars ({ eq_lhs = _; eq_rhs = e } as eq) = match e.e_desc with
|
let memory_vars ({ eq_lhs = _; eq_rhs = e } as eq) = match e.e_desc with
|
||||||
| Efby(_, _) -> def [] eq
|
| Efby(_, _) -> def [] eq
|
||||||
| _ -> []
|
| _ -> []
|
||||||
|
|
||||||
|
let linear_read e =
|
||||||
|
let extvalue funs acc w = match w.w_desc with
|
||||||
|
| Wvar x ->
|
||||||
|
let w, acc = Mls_mapfold.extvalue funs acc w in
|
||||||
|
let acc =
|
||||||
|
(match w.w_linearity with
|
||||||
|
| Linearity.Lat _ -> add x acc
|
||||||
|
| _ -> acc)
|
||||||
|
in
|
||||||
|
w, acc
|
||||||
|
| _ -> Mls_mapfold.extvalue funs acc w
|
||||||
|
in
|
||||||
|
let funs = { Mls_mapfold.defaults with extvalue = extvalue } in
|
||||||
|
let _, acc = Mls_mapfold.exp_it funs [] e in
|
||||||
|
acc
|
||||||
end
|
end
|
||||||
|
|
||||||
(* Assumes normal form, all fby are solo rhs *)
|
(* Assumes normal form, all fby are solo rhs *)
|
||||||
|
@ -182,6 +198,7 @@ module DataFlowDep = Dep.Make
|
||||||
(struct
|
(struct
|
||||||
type equation = eq
|
type equation = eq
|
||||||
let read eq = Vars.read true eq
|
let read eq = Vars.read true eq
|
||||||
|
let linear_read eq = Vars.linear_read eq.eq_rhs
|
||||||
let def = Vars.def
|
let def = Vars.def
|
||||||
let antidep = Vars.antidep
|
let antidep = Vars.antidep
|
||||||
end)
|
end)
|
||||||
|
@ -191,6 +208,7 @@ module AllDep = Dep.Make
|
||||||
(struct
|
(struct
|
||||||
type equation = eq
|
type equation = eq
|
||||||
let read eq = Vars.read false eq
|
let read eq = Vars.read false eq
|
||||||
|
let linear_read eq = Vars.linear_read eq.eq_rhs
|
||||||
let def = Vars.def
|
let def = Vars.def
|
||||||
let antidep _ = false
|
let antidep _ = false
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -15,6 +15,7 @@ module type READ =
|
||||||
sig
|
sig
|
||||||
type equation
|
type equation
|
||||||
val read: equation -> ident list
|
val read: equation -> ident list
|
||||||
|
val linear_read : equation -> ident list
|
||||||
val def: ident list -> equation -> ident list
|
val def: ident list -> equation -> ident list
|
||||||
val antidep: equation -> bool
|
val antidep: equation -> bool
|
||||||
end
|
end
|
||||||
|
@ -44,6 +45,7 @@ struct
|
||||||
let node_env = nametograph_env g (Read.def [] eq) node_env in
|
let node_env = nametograph_env g (Read.def [] eq) node_env in
|
||||||
let n_to_graph = nametograph g (Read.def [] eq)
|
let n_to_graph = nametograph g (Read.def [] eq)
|
||||||
(Read.antidep eq) n_to_graph in
|
(Read.antidep eq) n_to_graph in
|
||||||
|
let n_to_graph = nametograph g (Read.linear_read eq) true n_to_graph in
|
||||||
init_graph eqs (g :: g_list) n_to_graph node_env
|
init_graph eqs (g :: g_list) n_to_graph node_env
|
||||||
in
|
in
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue