Project

General

Profile

Revision b84a138e src/scheduling.ml

View differences:

src/scheduling.ml
47 47
  let succs_v = IdentDepGraph.succ g v in
48 48
  begin
49 49
    IdentDepGraph.remove_vertex g v;
50
    List.iter (fun v' -> if is_graph_root v' g then (if eq_equiv v v' then pending := ISet.add v' !pending else frontier := ISet.add v' !frontier)) succs_v;
50
    List.iter 
51
      (fun v' -> 
52
	if is_graph_root v' g then 
53
	  (if eq_equiv v v' then 
54
	      pending := ISet.add v' !pending 
55
	   else
56
	      frontier := ISet.add v' !frontier)
57
      ) succs_v;
51 58
  end
52 59

  
53 60
(* Chooses the next var to be sorted, taking priority into account.
......
106 113
	Hashtbl.find eq_equiv v1 = Hashtbl.find eq_equiv v2
107 114
      with Not_found -> false in
108 115
    let n', g = global_dependency n in
109
    Log.report ~level:5 (fun fmt -> Format.eprintf "dependency graph for node %s: %a" n'.node_id pp_dep_graph g);
116
    Log.report ~level:5 
117
      (fun fmt -> 
118
	Format.eprintf 
119
	  "dependency graph for node %s: %a" 
120
	  n'.node_id
121
	  pp_dep_graph g
122
      );
110 123
    let gg = IdentDepGraph.copy g in
111 124
    let sort = topological_sort eq_equiv g in
112 125

  
113 126
    let death = Liveness.death_table n gg sort in
114
    Log.report ~level:5 (fun fmt -> Format.eprintf "death table for node %s: %a" n'.node_id Liveness.pp_death_table death);
127
    Log.report ~level:5 
128
      (fun fmt -> 
129
	Format.eprintf 
130
	  "death table for node %s: %a" 
131
	  n'.node_id
132
	  Liveness.pp_death_table death
133
      );
115 134

  
116 135
    let disjoint = Disjunction.clock_disjoint_map (node_vars n) in
117
    Log.report ~level:5 (fun fmt -> Format.eprintf "clock disjoint map for node %s: %a" n'.node_id Disjunction.pp_disjoint_map disjoint);
136
    
137
    Log.report ~level:5 
138
      (fun fmt -> 
139
	Format.eprintf 
140
	  "clock disjoint map for node %s: %a" 
141
	  n'.node_id
142
	  Disjunction.pp_disjoint_map disjoint
143
      );
118 144

  
119 145
    let reuse = Liveness.reuse_policy n sort death in
120
    Log.report ~level:5 (fun fmt -> Format.eprintf "reuse policy for node %s: %a" n'.node_id Liveness.pp_reuse_policy reuse);
146
    Log.report ~level:5 
147
      (fun fmt -> 
148
	Format.eprintf 
149
	  "reuse policy for node %s: %a" 
150
	  n'.node_id
151
	  Liveness.pp_reuse_policy reuse
152
      );
121 153
 
122 154
    n', sort
123 155
(* let sorted = TopologicalDepGraph.fold (fun x res -> if ExprDep.is_instance_var x then res else x::res) g []*)

Also available in: Unified diff