aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-profile.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-06-10 09:38:59 +0200
committerMartin Liska <marxin@gcc.gnu.org>2019-06-10 07:38:59 +0000
commit92d417175b9f7b41d5ebe3ceb723f808917ed964 (patch)
tree68db0aeb3fb07bf5bb068e205d5a3cb895a45a01 /gcc/ipa-profile.c
parentb076a52602320955ca7f4b8b54a5451f9f3c7658 (diff)
downloadgcc-92d417175b9f7b41d5ebe3ceb723f808917ed964.zip
gcc-92d417175b9f7b41d5ebe3ceb723f808917ed964.tar.gz
gcc-92d417175b9f7b41d5ebe3ceb723f808917ed964.tar.bz2
Implement N disk counters for single value and indirect call counters.
2019-06-10 Martin Liska <mliska@suse.cz> * gcov-io.h (GCOV_DISK_SINGLE_VALUES): New. (GCOV_SINGLE_VALUE_COUNTERS): Likewise. * ipa-profile.c (ipa_profile_generate_summary): Use get_most_common_single_value. * tree-profile.c (gimple_init_gcov_profiler): Instrument with __gcov_one_value_profiler_v2 and __gcov_indirect_call_profiler_v4. * value-prof.c (dump_histogram_value): Print all values for HIST_TYPE_SINGLE_VALUE. (stream_out_histogram_value): Update assert for N values. (stream_in_histogram_value): Set number of counters for HIST_TYPE_SINGLE_VALUE. (get_most_common_single_value): New. (gimple_divmod_fixed_value_transform): Use get_most_common_single_value. (gimple_ic_transform): Likewise. (gimple_stringops_transform): Likewise. (gimple_find_values_to_profile): Set number of counters for HIST_TYPE_SINGLE_VALUE. * value-prof.h (get_most_common_single_value): New. 2019-06-10 Martin Liska <mliska@suse.cz> * Makefile.in: Add __gcov_one_value_profiler_v2, __gcov_one_value_profiler_v2_atomic and __gcov_indirect_call_profiler_v4. * libgcov-merge.c (__gcov_merge_single): Change function signature. (merge_single_value_set): New. * libgcov-profiler.c (__gcov_one_value_profiler_body): Update functionality. (__gcov_one_value_profiler): Remove. (__gcov_one_value_profiler_v2): ... this. (__gcov_one_value_profiler_atomic): Rename to ... (__gcov_one_value_profiler_v2_atomic): this. (__gcov_indirect_call_profiler_v3): Rename to ... (__gcov_indirect_call_profiler_v4): ... this. * libgcov.h (__gcov_one_value_profiler): Remove. (__gcov_one_value_profiler_atomic): Remove. (__gcov_one_value_profiler_v2_atomic): New. (__gcov_indirect_call_profiler_v3): Remove. (__gcov_one_value_profiler_v2): New. (__gcov_indirect_call_profiler_v4): New. (gcov_get_counter_ignore_scaling): New function. From-SVN: r272106
Diffstat (limited to 'gcc/ipa-profile.c')
-rw-r--r--gcc/ipa-profile.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/ipa-profile.c b/gcc/ipa-profile.c
index de9563d..c80ea7a 100644
--- a/gcc/ipa-profile.c
+++ b/gcc/ipa-profile.c
@@ -191,17 +191,17 @@ ipa_profile_generate_summary (void)
takes away bad histograms. */
if (h)
{
- /* counter 0 is target, counter 1 is number of execution we called target,
- counter 2 is total number of executions. */
- if (h->hvalue.counters[2])
+ gcov_type val, count, all;
+ if (get_most_common_single_value (NULL, "indirect call",
+ h, &val, &count, &all))
{
struct cgraph_edge * e = node->get_edge (stmt);
if (e && !e->indirect_unknown_callee)
continue;
- e->indirect_info->common_target_id
- = h->hvalue.counters [0];
+
+ e->indirect_info->common_target_id = val;
e->indirect_info->common_target_probability
- = GCOV_COMPUTE_SCALE (h->hvalue.counters [1], h->hvalue.counters [2]);
+ = GCOV_COMPUTE_SCALE (count, all);
if (e->indirect_info->common_target_probability > REG_BR_PROB_BASE)
{
if (dump_file)