diff options
author | Cyril SIX <cyril.six@kalray.eu> | 2020-12-17 17:32:40 +0100 |
---|---|---|
committer | Cyril SIX <cyril.six@kalray.eu> | 2020-12-17 17:33:02 +0100 |
commit | 3ee2cd9ee1d4a7f0c3f55b881e79025a29f382e7 (patch) | |
tree | 9b61ac8c991d6c6a14f3cf7c06111827f8b8af45 /backend/Duplicateaux.ml | |
parent | 5cde069e26618913905f4a8b64701b93bece5038 (diff) | |
download | compcert-kvx-3ee2cd9ee1d4a7f0c3f55b881e79025a29f382e7.tar.gz compcert-kvx-3ee2cd9ee1d4a7f0c3f55b881e79025a29f382e7.zip |
Uniformizing a couple of debug print functions
Diffstat (limited to 'backend/Duplicateaux.ml')
-rw-r--r-- | backend/Duplicateaux.ml | 39 |
1 files changed, 1 insertions, 38 deletions
diff --git a/backend/Duplicateaux.ml b/backend/Duplicateaux.ml index 861df3cd..21078975 100644 --- a/backend/Duplicateaux.ml +++ b/backend/Duplicateaux.ml @@ -22,9 +22,8 @@ open RTL open Maps open Camlcoq +open DebugPrint -let debug_flag = LICMaux.debug_flag -let debug = LICMaux.debug let get_loop_headers = LICMaux.get_loop_headers let get_some = LICMaux.get_some let rtl_successors = LICMaux.rtl_successors @@ -87,8 +86,6 @@ end module PSet = Set.Make(PInt) -let print_intlist = LICMaux.print_intlist - let print_intset s = let seq = PSet.to_seq s in begin @@ -101,18 +98,6 @@ let print_intset s = end end -let ptree_printbool pt = - let elements = PTree.elements pt - in begin - if !debug_flag then begin - Printf.printf "["; - List.iter (fun (n, b) -> - if b then Printf.printf "%d, " (P.to_int n) else () - ) elements; - Printf.printf "]" - end - end - (* Looks ahead (until a branch) to see if a node further down verifies * the given predicate *) let rec look_ahead_gen (successors: RTL.instruction -> P.t list) code node is_loop_header predicate = @@ -215,16 +200,6 @@ type innerLoop = { let print_pset = LICMaux.pp_pset -let print_ptree printer pt = - let elements = PTree.elements pt in - begin - debug "[\n"; - List.iter (fun (n, elt) -> - debug "\t%d: %a\n" (P.to_int n) printer elt - ) elements; - debug "]\n" - end - let rtl_successors_pref = function | Itailcall _ | Ireturn _ -> [] | Icall(_,_,_,_,n) | Ibuiltin(_,_,_,n) | Inop n | Iop (_,_,_,n) @@ -554,8 +529,6 @@ let print_traces oc traces = Printf.fprintf oc "Traces: {%a}\n" f traces end -let print_code code = LICMaux.print_code code - (* Dumb (but linear) trace selection *) let select_traces_linear code entrypoint = let is_visited = ref (PTree.map (fun n i -> false) code) in @@ -770,14 +743,6 @@ let invert_iconds code = * cyclic dependencies between LICMaux and Duplicateaux *) - - -let print_option_pint oc o = - if !debug_flag then - match o with - | None -> Printf.fprintf oc "None" - | Some n -> Printf.fprintf oc "Some %d" (P.to_int n) - let print_inner_loop iloop = debug "{preds: %a, body: %a, head: %d, finals: %a, sb_final: %a}\n" print_intlist iloop.preds @@ -794,8 +759,6 @@ let rec print_inner_loops = function print_inner_loops iloops end -let print_pint oc i = if !debug_flag then Printf.fprintf oc "%d" (P.to_int i) else () - let cb_exit_node = function | Icond (_,_,n1,n2,p) -> begin match p with | Some true -> Some n2 |