aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyril SIX <cyril.six@kalray.eu>2021-04-13 16:09:55 +0200
committerCyril SIX <cyril.six@kalray.eu>2021-04-13 16:09:55 +0200
commit5500fccca01d097f70a5cc708daf07395626fd6b (patch)
tree76c740c016621e2d22b6be18375d09d60b663ba6
parent47eaaa2360337ed2b518f276a616529895da63e8 (diff)
downloadcompcert-kvx-5500fccca01d097f70a5cc708daf07395626fd6b.tar.gz
compcert-kvx-5500fccca01d097f70a5cc708daf07395626fd6b.zip
Adding overpredicts
-rw-r--r--backend/Duplicateaux.ml9
1 files changed, 6 insertions, 3 deletions
diff --git a/backend/Duplicateaux.ml b/backend/Duplicateaux.ml
index 62805d5b..c8690d46 100644
--- a/backend/Duplicateaux.ml
+++ b/backend/Duplicateaux.ml
@@ -37,16 +37,19 @@ let set_stats_oc () =
let stats_nb_total = ref 0
(* we predicted the same thing as the profiling *)
let stats_nb_correct_predicts = ref 0
-(* we predicted something (say Some true), but the profiling predicted the opposite (say Some false, or None) *)
+(* we predicted something (say Some true), but the profiling predicted the opposite (say Some false) *)
let stats_nb_mispredicts = ref 0
(* we did not predict anything (None) even though the profiling did predict something *)
let stats_nb_missed_opportunities = ref 0
+(* we predicted something (say Some true) but the profiling preferred not to predict anything (None) *)
+let stats_nb_overpredict = ref 0
let reset_stats () = begin
stats_nb_total := 0;
stats_nb_correct_predicts := 0;
stats_nb_mispredicts := 0;
stats_nb_missed_opportunities := 0;
+ stats_nb_overpredict := 0;
end
let incr theref = theref := !theref + 1
@@ -59,7 +62,7 @@ let write_stats_oc () =
match !stats_oc with
| None -> ()
| Some oc -> begin
- Printf.fprintf oc "%d %d %d %d\n" !stats_nb_total !stats_nb_correct_predicts !stats_nb_mispredicts !stats_nb_missed_opportunities;
+ Printf.fprintf oc "%d %d %d %d %d\n" !stats_nb_total !stats_nb_correct_predicts !stats_nb_mispredicts !stats_nb_missed_opportunities !stats_nb_overpredict;
close_out oc
end
@@ -470,7 +473,7 @@ let update_direction direction = function
incr stats_nb_total;
match pred, direction with
| None, None -> incr stats_nb_correct_predicts
- | None, Some _ -> incr stats_nb_mispredicts
+ | None, Some _ -> incr stats_nb_overpredict
| Some _, None -> incr stats_nb_missed_opportunities
| Some false, Some false -> incr stats_nb_correct_predicts
| Some false, Some true -> incr stats_nb_mispredicts