Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 14b113df authored by Cyril SIX's avatar Cyril SIX
Browse files

Merge remote-tracking branch 'verimag/manuscript' into kvx-work

parents b4a41e2d 8b649e68
...@@ -48,13 +48,11 @@ let stats_nb_overpredict = ref 0 ...@@ -48,13 +48,11 @@ let stats_nb_overpredict = ref 0
let wrong_opcode = ref 0 let wrong_opcode = ref 0
let wrong_return = ref 0 let wrong_return = ref 0
let wrong_loop2 = ref 0 let wrong_loop2 = ref 0
let wrong_loop = ref 0
let wrong_call = ref 0 let wrong_call = ref 0
let right_opcode = ref 0 let right_opcode = ref 0
let right_return = ref 0 let right_return = ref 0
let right_loop2 = ref 0 let right_loop2 = ref 0
let right_loop = ref 0
let right_call = ref 0 let right_call = ref 0
let reset_stats () = begin let reset_stats () = begin
...@@ -66,12 +64,10 @@ let reset_stats () = begin ...@@ -66,12 +64,10 @@ let reset_stats () = begin
wrong_opcode := 0; wrong_opcode := 0;
wrong_return := 0; wrong_return := 0;
wrong_loop2 := 0; wrong_loop2 := 0;
wrong_loop := 0;
wrong_call := 0; wrong_call := 0;
right_opcode := 0; right_opcode := 0;
right_return := 0; right_return := 0;
right_loop2 := 0; right_loop2 := 0;
right_loop := 0;
right_call := 0; right_call := 0;
end end
...@@ -85,11 +81,11 @@ let write_stats_oc () = ...@@ -85,11 +81,11 @@ let write_stats_oc () =
match !stats_oc with match !stats_oc with
| None -> () | None -> ()
| Some oc -> begin | Some oc -> begin
Printf.fprintf oc "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n" !stats_nb_total Printf.fprintf oc "%d %d %d %d %d %d %d %d %d %d %d %d %d\n" !stats_nb_total
!stats_nb_correct_predicts !stats_nb_mispredicts !stats_nb_missed_opportunities !stats_nb_correct_predicts !stats_nb_mispredicts !stats_nb_missed_opportunities
!stats_nb_overpredict !stats_nb_overpredict
!wrong_opcode !wrong_return !wrong_loop2 !wrong_loop !wrong_call !wrong_opcode !wrong_return !wrong_loop2 !wrong_call
!right_opcode !right_return !right_loop2 !right_loop !right_call !right_opcode !right_return !right_loop2 !right_call
; ;
close_out oc close_out oc
end end
...@@ -417,7 +413,7 @@ let get_directions f code entrypoint = begin ...@@ -417,7 +413,7 @@ let get_directions f code entrypoint = begin
if stats_oc_recording () || not @@ has_some pred then if stats_oc_recording () || not @@ has_some pred then
(* debug "Analyzing %d.." (P.to_int n); *) (* debug "Analyzing %d.." (P.to_int n); *)
let heuristics = [ do_opcode_heuristic; let heuristics = [ do_opcode_heuristic;
do_return_heuristic; do_loop2_heuristic loop_info n; do_loop_heuristic; do_call_heuristic; do_return_heuristic; do_loop2_heuristic loop_info n; (* do_loop_heuristic; *) do_call_heuristic;
(* do_store_heuristic *) ] in (* do_store_heuristic *) ] in
let preferred = ref None in let preferred = ref None in
let current_heuristic = ref 0 in let current_heuristic = ref 0 in
...@@ -438,8 +434,7 @@ let get_directions f code entrypoint = begin ...@@ -438,8 +434,7 @@ let get_directions f code entrypoint = begin
| 0 -> incr wrong_opcode | 0 -> incr wrong_opcode
| 1 -> incr wrong_return | 1 -> incr wrong_return
| 2 -> incr wrong_loop2 | 2 -> incr wrong_loop2
| 3 -> incr wrong_loop | 3 -> incr wrong_call
| 4 -> incr wrong_call
| _ -> failwith "Shouldn't happen" | _ -> failwith "Shouldn't happen"
end end
| Some false, Some false | Some false, Some false
...@@ -448,8 +443,7 @@ let get_directions f code entrypoint = begin ...@@ -448,8 +443,7 @@ let get_directions f code entrypoint = begin
| 0 -> incr right_opcode | 0 -> incr right_opcode
| 1 -> incr right_return | 1 -> incr right_return
| 2 -> incr right_loop2 | 2 -> incr right_loop2
| 3 -> incr right_loop | 3 -> incr right_call
| 4 -> incr right_call
| _ -> failwith "Shouldn't happen" | _ -> failwith "Shouldn't happen"
end end
| _ -> () | _ -> ()
...@@ -1050,9 +1044,13 @@ let extract_upto_icond f code head = ...@@ -1050,9 +1044,13 @@ let extract_upto_icond f code head =
let rotate_inner_loop f code revmap iloop = let rotate_inner_loop f code revmap iloop =
let header = extract_upto_icond f code iloop.head in let header = extract_upto_icond f code iloop.head in
let limit = !Clflags.option_flooprotate in let limit = !Clflags.option_flooprotate in
if count_ignore_nops code header > limit then begin let nb_duplicated = count_ignore_nops code header in
if nb_duplicated > limit then begin
debug "Loop Rotate: too many nodes to duplicate (%d > %d)" (List.length header) limit; debug "Loop Rotate: too many nodes to duplicate (%d > %d)" (List.length header) limit;
(code, revmap) (code, revmap)
end else if nb_duplicated == count_ignore_nops code iloop.body then begin
debug "The conditional branch is already at the end! No need to rotate.";
(code, revmap)
end else end else
let (code2, revmap2, dupheader, fwmap) = clone code revmap header in let (code2, revmap2, dupheader, fwmap) = clone code revmap header in
let code' = ref code2 in let code' = ref code2 in
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment