Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
vouillon committed Sep 22, 2024
1 parent 1a65dd0 commit e2652fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler/lib/code.ml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ end = struct

let to_string ?origin i = Var_printer.to_string printer ?origin i

let print f x = Format.fprintf f "v%d" x
let print f x = Format.fprintf f "v%d_%s" x (to_string x)

(* Format.fprintf f "%s" (to_string x) *)

Expand Down
6 changes: 5 additions & 1 deletion compiler/lib/global_deadcode.ml
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ module Print = struct
| Top -> "top"
| Dead -> "dead"

(*
let print_uses uses =
Format.eprintf "Usages:\n";
Var.Tbl.iter
Expand All @@ -448,6 +449,7 @@ module Print = struct
Var.Tbl.iter
(fun v l -> Format.eprintf "%a: %s\n" Var.print v (live_to_string l))
live_vars
*)

let print_live_tbl live_table =
Format.eprintf "Liveness with dependencies:\n";
Expand Down Expand Up @@ -482,14 +484,16 @@ let f p ~deadcode_sentinal global_info =
then (
Format.eprintf "Before Zeroing:\n";
Code.Print.program (fun _ _ -> "") p;
(*
Print.print_liveness live_vars;
Print.print_uses uses;
*)
Print.print_live_tbl live_table);
(* Zero out dead fields *)
let p = zero p deadcode_sentinal live_table in
if debug ()
then (
Format.printf "After Zeroing:\n";
Format.eprintf "After Zeroing:\n";
Code.Print.program (fun _ _ -> "") p);
if times () then Format.eprintf " deadcode dgraph.: %a@." Timer.print t;
p

0 comments on commit e2652fa

Please sign in to comment.