aboutsummaryrefslogtreecommitdiff
path: root/gcc/predict.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2018-01-19 13:03:24 +0100
committerMartin Liska <marxin@gcc.gnu.org>2018-01-19 12:03:24 +0000
commitd1b9a5724b8a05d2d2d51b3e5d13cc785326c74f (patch)
treed863029ec8847f8c570a3e805a923100689efd40 /gcc/predict.c
parent09a7858b2c53eccf28f780f5f3e4f2764f440eb1 (diff)
downloadgcc-d1b9a5724b8a05d2d2d51b3e5d13cc785326c74f.zip
gcc-d1b9a5724b8a05d2d2d51b3e5d13cc785326c74f.tar.gz
gcc-d1b9a5724b8a05d2d2d51b3e5d13cc785326c74f.tar.bz2
Fix usage of analyze_brprob.py script.
2018-01-19 Martin Liska <mliska@suse.cz> * analyze_brprob.py: Support new format that can be easily parsed. Add new column to report. 2018-01-19 Martin Liska <mliska@suse.cz> * predict.c (dump_prediction): Add new format for analyze_brprob.py script which is enabled with -details suboption. * profile-count.h (precise_p): New function. From-SVN: r256886
Diffstat (limited to 'gcc/predict.c')
-rw-r--r--gcc/predict.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/predict.c b/gcc/predict.c
index 4c1e448..fdf5d82 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -747,6 +747,19 @@ dump_prediction (FILE *file, enum br_predictor predictor, int probability,
}
fprintf (file, "\n");
+
+ /* Print output that be easily read by analyze_brprob.py script. We are
+ interested only in counts that are read from GCDA files. */
+ if (dump_file && (dump_flags & TDF_DETAILS)
+ && bb->count.precise_p ()
+ && reason == REASON_NONE)
+ {
+ gcc_assert (e->count ().precise_p ());
+ fprintf (file, ";;heuristics;%s;%" PRId64 ";%" PRId64 ";%.1f;\n",
+ predictor_info[predictor].name,
+ bb->count.to_gcov_type (), e->count ().to_gcov_type (),
+ probability * 100.0 / REG_BR_PROB_BASE);
+ }
}
/* Return true if STMT is known to be unlikely executed. */