aboutsummaryrefslogtreecommitdiff
path: root/gcc/value-prof.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-07-03 14:42:23 +0200
committerMartin Liska <marxin@gcc.gnu.org>2019-07-03 12:42:23 +0000
commit596341c741a4a746497a1da8322fce0ad625e26b (patch)
tree2161db916022c10dfedcbf3106d2e14523a81620 /gcc/value-prof.c
parent1b309ca5edddd6bf8051993876df5f123394bc79 (diff)
downloadgcc-596341c741a4a746497a1da8322fce0ad625e26b.zip
gcc-596341c741a4a746497a1da8322fce0ad625e26b.tar.gz
gcc-596341c741a4a746497a1da8322fce0ad625e26b.tar.bz2
Rename SINGE_VALUE to TOPN_VALUES counters.
2019-07-03 Martin Liska <mliska@suse.cz> * gcov-counter.def (GCOV_COUNTER_V_SINGLE): Remove. (GCOV_COUNTER_V_TOPN): New. (GCOV_COUNTER_V_INDIR): Use _topn. * gcov-io.h (GCOV_DISK_SINGLE_VALUES): Remove. (GCOV_TOPN_VALUES): New. (GCOV_SINGLE_VALUE_COUNTERS): Remove. (GCOV_TOPN_VALUES_COUNTERS): New. * profile.c (instrument_values): Use HIST_TYPE_TOPN_VALUES. * tree-profile.c: (gimple_init_gcov_profiler): Rename variables from one_value to topn_values. (gimple_gen_one_value_profiler): Remove. (gimple_gen_topn_values_profiler): New function. * value-prof.c (dump_histogram_value): Use TOPN_VALUES names instead of SINGLE_VALUE. (stream_out_histogram_value): Likewise. (stream_in_histogram_value): Likewise. (get_most_common_single_value): Likewise. (gimple_divmod_fixed_value_transform): Likewise. (gimple_stringops_transform): Likewise. (gimple_divmod_values_to_profile): Likewise. (gimple_stringops_values_to_profile): Likewise. (gimple_find_values_to_profile): Likewise. * value-prof.h (enum hist_type): Rename to TOPN. (gimple_gen_one_value_profiler): Remove. (gimple_gen_topn_values_profiler): New. 2019-07-03 Martin Liska <mliska@suse.cz> * Makefile.in: Use topn_values instead of one_value names. * libgcov-merge.c (__gcov_merge_single): Move to ... (__gcov_merge_topn): ... this. (merge_single_value_set): Move to ... (merge_topn_values_set): ... this. * libgcov-profiler.c (__gcov_one_value_profiler_body): Move to ... (__gcov_topn_values_profiler_body): ... this. (__gcov_one_value_profiler_v2): Move to ... (__gcov_topn_values_profiler): ... this. (__gcov_one_value_profiler_v2_atomic): Move to ... (__gcov_topn_values_profiler_atomic): ... this. (__gcov_indirect_call_profiler_v4): Remove. * libgcov-util.c (__gcov_single_counter_op): Move to ... (__gcov_topn_counter_op): ... this. * libgcov.h (L_gcov_merge_single): Remove. (L_gcov_merge_topn): New. (__gcov_merge_single): Remove. (__gcov_merge_topn): New. (__gcov_one_value_profiler_v2): Move to .. (__gcov_topn_values_profiler): ... this. (__gcov_one_value_profiler_v2_atomic): Move to ... (__gcov_topn_values_profiler_atomic): ... this. From-SVN: r273005
Diffstat (limited to 'gcc/value-prof.c')
-rw-r--r--gcc/value-prof.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index 7289a69..66c4bba 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -257,23 +257,23 @@ dump_histogram_value (FILE *dump_file, histogram_value hist)
(int64_t) hist->hvalue.counters[0]);
break;
- case HIST_TYPE_SINGLE_VALUE:
+ case HIST_TYPE_TOPN_VALUES:
case HIST_TYPE_INDIR_CALL:
if (hist->hvalue.counters)
{
fprintf (dump_file,
- (hist->type == HIST_TYPE_SINGLE_VALUE
- ? "Single value counter " : "Indirect call counter"));
+ (hist->type == HIST_TYPE_TOPN_VALUES
+ ? "Top N value counter " : "Indirect call counter"));
if (hist->hvalue.counters)
{
fprintf (dump_file, "all: %" PRId64 ", values: ",
(int64_t) hist->hvalue.counters[0]);
- for (unsigned i = 0; i < GCOV_DISK_SINGLE_VALUES; i++)
+ for (unsigned i = 0; i < GCOV_TOPN_VALUES; i++)
{
fprintf (dump_file, "[%" PRId64 ":%" PRId64 "]",
(int64_t) hist->hvalue.counters[2 * i + 1],
(int64_t) hist->hvalue.counters[2 * i + 2]);
- if (i != GCOV_DISK_SINGLE_VALUES - 1)
+ if (i != GCOV_TOPN_VALUES - 1)
fprintf (dump_file, ", ");
}
fprintf (dump_file, ".\n");
@@ -331,7 +331,7 @@ stream_out_histogram_value (struct output_block *ob, histogram_value hist)
/* When user uses an unsigned type with a big value, constant converted
to gcov_type (a signed type) can be negative. */
gcov_type value = hist->hvalue.counters[i];
- if (hist->type == HIST_TYPE_SINGLE_VALUE && i > 0)
+ if (hist->type == HIST_TYPE_TOPN_VALUES && i > 0)
;
else
gcc_assert (value >= 0);
@@ -374,9 +374,9 @@ stream_in_histogram_value (struct lto_input_block *ib, gimple *stmt)
ncounters = 2;
break;
- case HIST_TYPE_SINGLE_VALUE:
+ case HIST_TYPE_TOPN_VALUES:
case HIST_TYPE_INDIR_CALL:
- ncounters = GCOV_SINGLE_VALUE_COUNTERS;
+ ncounters = GCOV_TOPN_VALUES_COUNTERS;
break;
case HIST_TYPE_IOR:
@@ -713,7 +713,7 @@ gimple_divmod_fixed_value (gassign *stmt, tree value, profile_probability prob,
return tmp2;
}
-/* Return most common value of SINGLE_VALUE histogram. If
+/* Return most common value of TOPN_VALUE histogram. If
there's a unique value, return true and set VALUE and COUNT
arguments. */
@@ -731,7 +731,7 @@ get_most_common_single_value (gimple *stmt, const char *counter_type,
gcov_type read_all = hist->hvalue.counters[0];
- for (unsigned i = 0; i < GCOV_DISK_SINGLE_VALUES; i++)
+ for (unsigned i = 0; i < GCOV_TOPN_VALUES; i++)
{
gcov_type v = hist->hvalue.counters[2 * i + 1];
gcov_type c = hist->hvalue.counters[2 * i + 2];
@@ -780,7 +780,7 @@ gimple_divmod_fixed_value_transform (gimple_stmt_iterator *si)
return false;
histogram = gimple_histogram_value_of_type (cfun, stmt,
- HIST_TYPE_SINGLE_VALUE);
+ HIST_TYPE_TOPN_VALUES);
if (!histogram)
return false;
@@ -1654,7 +1654,7 @@ gimple_stringops_transform (gimple_stmt_iterator *gsi)
return false;
histogram = gimple_histogram_value_of_type (cfun, stmt,
- HIST_TYPE_SINGLE_VALUE);
+ HIST_TYPE_TOPN_VALUES);
if (!histogram)
return false;
@@ -1808,7 +1808,7 @@ gimple_divmod_values_to_profile (gimple *stmt, histogram_values *values)
/* Check for the case where the divisor is the same value most
of the time. */
values->quick_push (gimple_alloc_histogram_value (cfun,
- HIST_TYPE_SINGLE_VALUE,
+ HIST_TYPE_TOPN_VALUES,
stmt, divisor));
/* For mod, check whether it is not often a noop (or replaceable by
@@ -1887,7 +1887,7 @@ gimple_stringops_values_to_profile (gimple *gs, histogram_values *values)
if (TREE_CODE (blck_size) != INTEGER_CST)
{
values->safe_push (gimple_alloc_histogram_value (cfun,
- HIST_TYPE_SINGLE_VALUE,
+ HIST_TYPE_TOPN_VALUES,
stmt, blck_size));
values->safe_push (gimple_alloc_histogram_value (cfun, HIST_TYPE_AVERAGE,
stmt, blck_size));
@@ -1936,12 +1936,9 @@ gimple_find_values_to_profile (histogram_values *values)
hist->n_counters = 2;
break;
- case HIST_TYPE_SINGLE_VALUE:
- hist->n_counters = GCOV_SINGLE_VALUE_COUNTERS;
- break;
-
+ case HIST_TYPE_TOPN_VALUES:
case HIST_TYPE_INDIR_CALL:
- hist->n_counters = GCOV_SINGLE_VALUE_COUNTERS;
+ hist->n_counters = GCOV_TOPN_VALUES_COUNTERS;
break;
case HIST_TYPE_TIME_PROFILE: