From f6d4a0f5d1ca54a825e09df5ede5912fd0a14836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Pasteur?= Date: Fri, 18 Jun 2010 12:02:39 +0200 Subject: [PATCH] Ported schedule --- minils/minils.ml | 8 ++------ minils/transformations/schedule.ml | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/minils/minils.ml b/minils/minils.ml index 9fcba45..4094621 100644 --- a/minils/minils.ml +++ b/minils/minils.ml @@ -208,6 +208,7 @@ struct let rec read is_left acc e = let acc = match e.e_desc with + | Evar n -> add n acc | Emerge(x, c_e_list) -> let acc = add x acc in List.fold_left (fun acc (_, e) -> read is_left acc e) acc c_e_list @@ -292,15 +293,13 @@ struct | _ -> [] end -(* + (* data-flow dependences. pre-dependences are discarded *) module DataFlowDep = Make (struct type equation = eq let read eq = Vars.read true eq let def = Vars.def - let linear_read eq = Vars.linear_use [] eq.eq_rhs - let mem_reset = Vars.mem_reset let antidep = Vars.antidep end) @@ -309,10 +308,7 @@ module AllDep = Make (struct type equation = eq let read eq = Vars.read false eq - let linear_read eq = Vars.linear_use [] eq.eq_rhs - let mem_reset = Vars.mem_reset let def = Vars.def let antidep eq = false end) -*) diff --git a/minils/transformations/schedule.ml b/minils/transformations/schedule.ml index ad5537b..281e2ac 100644 --- a/minils/transformations/schedule.ml +++ b/minils/transformations/schedule.ml @@ -46,32 +46,32 @@ let schedule eq_list = let rec recook = function | [] -> [] | node :: node_list -> node >> (recook node_list) - + and (>>) node node_list = try insert node node_list with - Not_found -> node :: node_list + Not_found -> node :: node_list and insert node = function | [] -> raise Not_found | node1 :: node_list -> - if linked node node1 then raise Not_found - else - try - node1 :: (insert node node_list) - with - | Not_found -> - if join (containt node) (containt node1) - then node :: node1 :: node_list - else raise Not_found in + if linked node node1 then raise Not_found + else + try + node1 :: (insert node node_list) + with + | Not_found -> + if join (containt node) (containt node1) + then node :: node1 :: node_list + else raise Not_found in let node_list, _ = DataFlowDep.build eq_list in let node_list = recook (topological node_list) in let node_list = List.rev node_list in let node_list = recook node_list in let node_list = List.rev node_list in - List.map containt node_list + List.map containt node_list let schedule_contract ({ c_eq = eqs } as c) = let eqs = schedule eqs in