Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CertiCompil
CompCert-KVX
Commits
5500fccc
Commit
5500fccc
authored
Apr 13, 2021
by
Cyril SIX
Browse files
Adding overpredicts
parent
47eaaa23
Changes
1
Hide whitespace changes
Inline
Side-by-side
backend/Duplicateaux.ml
View file @
5500fccc
...
...
@@ -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_
mis
predict
s
|
None
,
Some
_
->
incr
stats_nb_
over
predict
|
Some
_
,
None
->
incr
stats_nb_missed_opportunities
|
Some
false
,
Some
false
->
incr
stats_nb_correct_predicts
|
Some
false
,
Some
true
->
incr
stats_nb_mispredicts
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment