Project

General

Profile

« Previous | Next » 

Revision 574c671b

Added by Xavier Thirioux almost 2 years ago

1) log messages are now flushed. 2) very long computation times due to naive code to check for unused variables are now much shorter

View differences:

src/checks/liveness.ml
49 49
(* computes the cone of influence of a given [var] wrt a dependency graph [g].
50 50
*)
51 51
let cone_of_influence g var =
52
 (*Format.printf "coi: %s@." var;*)
52
  (*Format.printf "DEBUG coi: %s@." var;*)
53 53
 let frontier = ref (ISet.add var ISet.empty) in
54
 let explored = ref ISet.empty in
54 55
 let coi = ref ISet.empty in
55 56
 while not (ISet.is_empty !frontier)
56 57
 do
57 58
   let head = ISet.min_elt !frontier in
58
   (*Format.printf "head: %s@." head;*)
59
   (*Format.printf "DEBUG head: %s@." head;*)
59 60
   frontier := ISet.remove head !frontier;
61
   explored := ISet.add head !explored;
60 62
   if ExprDep.is_read_var head then coi := ISet.add (ExprDep.undo_read_var head) !coi;
61
   List.iter (fun s -> frontier := ISet.add s !frontier) (IdentDepGraph.succ g head);
63
   List.iter (fun s -> if not (ISet.mem s !explored) then frontier := ISet.add s !frontier) (IdentDepGraph.succ g head);
62 64
 done;
63 65
 !coi
64 66

  
src/scheduling.ml
121 121

  
122 122
let schedule_node n =
123 123
  (* let node_vars = get_node_vars n in *)
124
  Log.report ~level:5 (fun fmt -> Format.fprintf fmt "scheduling node %s@," n.node_id);
124 125
  let eq_equiv = eq_equiv (ExprDep.node_eq_equiv n) in
125 126

  
126 127
  let n', g = global_dependency n in

Also available in: Unified diff