Project

General

Profile

Revision e8c0f452 src/scheduling.ml

View differences:

src/scheduling.ml
98 98
    !sorted
99 99
  end
100 100

  
101
(* Removes global constants from [node] schedule [sch] *)
102
let remove_consts node sch =
103
  let filter v = 
104
       List.exists (fun vdecl -> vdecl.var_id = v) node.node_locals
105
    || List.exists (fun vdecl -> vdecl.var_id = v) node.node_outputs in
106
  List.filter filter sch
101 107

  
102
let schedule_node n  =
108
let schedule_node n =
103 109
  try
104 110
    let eq_equiv = ExprDep.node_eq_equiv n in
105 111
    let eq_equiv v1 v2 =
......
109 115
    let n', g = global_dependency n in
110 116
    Log.report ~level:5 (fun fmt -> Format.eprintf "dependency graph for node %s: %a" n'.node_id pp_dep_graph g);
111 117
    let gg = IdentDepGraph.copy g in
112
    let sort = topological_sort eq_equiv g in
118
    let sort = remove_consts n (topological_sort eq_equiv g) in
113 119

  
114 120
    let death = Liveness.death_table n gg sort in
115 121
    Log.report ~level:5 (fun fmt -> Format.eprintf "death table for node %s: %a" n'.node_id Liveness.pp_death_table death);
116
(*
122

  
117 123
    let reuse = Liveness.reuse_policy n sort death in
118 124
    Log.report ~level:5 (fun fmt -> Format.eprintf "reuse policy for node %s: %a" n'.node_id Liveness.pp_reuse_policy reuse);
119
*)
125
 
120 126
    n', sort
121 127
(* let sorted = TopologicalDepGraph.fold (fun x res -> if ExprDep.is_instance_var x then res else x::res) g []*)
122 128
  with (Causality.Cycle v) as exc ->

Also available in: Unified diff