From 5500fccca01d097f70a5cc708daf07395626fd6b Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Tue, 13 Apr 2021 16:09:55 +0200 Subject: Adding overpredicts --- backend/Duplicateaux.ml | 9 ++++++--- 1 file 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 -- cgit