diff options
author | Martin Liska <mliska@suse.cz> | 2018-09-21 10:41:17 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2018-09-21 08:41:17 +0000 |
commit | 512cc0151207de4c7ff3a84f040f730fe0d52458 (patch) | |
tree | d3237cdec0d5acc77939322658f0dc8de1d5a5be /gcc/profile.c | |
parent | 36ff254bf63f21dd8fc7a353c8b8f3aa08018654 (diff) | |
download | gcc-512cc0151207de4c7ff3a84f040f730fe0d52458.zip gcc-512cc0151207de4c7ff3a84f040f730fe0d52458.tar.gz gcc-512cc0151207de4c7ff3a84f040f730fe0d52458.tar.bz2 |
Remove arc profile histogram in non-LTO mode.
2018-09-21 Martin Liska <mliska@suse.cz>
* auto-profile.c (autofdo_source_profile::read): Do not
set sum_all.
(read_profile): Do not add working sets.
(read_autofdo_file): Remove sum_all.
(afdo_callsite_hot_enough_for_early_inline): Remove const
qualifier.
* coverage.c (struct counts_entry): Remove gcov_summary.
(read_counts_file): Read new GCOV_TAG_OBJECT_SUMMARY,
do not support GCOV_TAG_PROGRAM_SUMMARY.
(get_coverage_counts): Remove summary and expected
arguments.
* coverage.h (get_coverage_counts): Likewise.
* doc/gcov-dump.texi: Remove -w option.
* gcov-dump.c (dump_working_sets): Remove.
(main): Do not support '-w' option.
(print_usage): Likewise.
(tag_summary): Likewise.
* gcov-io.c (gcov_write_summary): Do not dump
histogram.
(gcov_read_summary): Likewise.
(gcov_histo_index): Remove.
(gcov_histogram_merge): Likewise.
(compute_working_sets): Likewise.
* gcov-io.h (GCOV_TAG_OBJECT_SUMMARY): Mark
it not obsolete.
(GCOV_TAG_PROGRAM_SUMMARY): Mark it obsolete.
(GCOV_TAG_SUMMARY_LENGTH): Adjust.
(GCOV_HISTOGRAM_SIZE): Remove.
(GCOV_HISTOGRAM_BITVECTOR_SIZE): Likewise.
(struct gcov_summary): Simplify rapidly just
to runs and sum_max fields.
(gcov_histo_index): Remove.
(NUM_GCOV_WORKING_SETS): Likewise.
(compute_working_sets): Likewise.
* gcov-tool.c (print_overlap_usage_message): Remove
trailing empty line.
* gcov.c (read_count_file): Read GCOV_TAG_OBJECT_SUMMARY.
(output_lines): Remove program related line.
* ipa-profile.c (ipa_profile): Do not consider GCOV histogram.
* lto-cgraph.c (output_profile_summary): Do not stream GCOV
histogram.
(input_profile_summary): Do not read it.
(merge_profile_summaries): And do not merge it.
(input_symtab): Do not call removed function.
* modulo-sched.c (sms_schedule): Do not print sum_max.
* params.def (HOT_BB_COUNT_FRACTION): Reincarnate param that was
removed when histogram method was invented.
(HOT_BB_COUNT_WS_PERMILLE): Mention that it's used only in LTO
mode.
* postreload-gcse.c (eliminate_partially_redundant_load): Fix
GCOV coding style.
* predict.c (get_hot_bb_threshold): Use HOT_BB_COUNT_FRACTION
and dump selected value.
* profile.c (add_working_set): Remove.
(get_working_sets): Likewise.
(find_working_set): Likewise.
(get_exec_counts): Do not work with working sets.
(read_profile_edge_counts): Do not inform as sum_max is removed.
(compute_branch_probabilities): Likewise.
(compute_value_histograms): Remove argument for call of
get_coverage_counts.
* profile.h: Do not make gcov_summary const.
2018-09-21 Martin Liska <mliska@suse.cz>
* libgcov-driver.c (crc32_unsigned): Remove.
(gcov_histogram_insert): Likewise.
(gcov_compute_histogram): Likewise.
(compute_summary): Simplify rapidly.
(merge_one_data): Do not handle PROGRAM_SUMMARY tag.
(merge_summary): Rapidly simplify.
(dump_one_gcov): Ignore gcov_summary.
(gcov_do_dump): Do not handle program summary, it's not
used.
* libgcov-util.c (tag_summary): Remove.
(read_gcda_finalize): Fix coding style.
(read_gcda_file): Initialize curr_object_summary.
(compute_summary): Remove.
(calculate_overlap): Remove settings of run_max.
From-SVN: r264462
Diffstat (limited to 'gcc/profile.c')
-rw-r--r-- | gcc/profile.c | 116 |
1 files changed, 7 insertions, 109 deletions
diff --git a/gcc/profile.c b/gcc/profile.c index cb51e0d..2130319 100644 --- a/gcc/profile.c +++ b/gcc/profile.c @@ -84,11 +84,7 @@ struct bb_profile_info { /* Counter summary from the last set of coverage counts read. */ -const gcov_summary *profile_info; - -/* Counter working set information computed from the current counter - summary. Not initialized unless profile_info summary is non-NULL. */ -static gcov_working_set_t gcov_working_sets[NUM_GCOV_WORKING_SETS]; +gcov_summary *profile_info; /* Collect statistics on the performance of this pass for the entire source file. */ @@ -103,14 +99,6 @@ static int total_num_times_called; static int total_hist_br_prob[20]; static int total_num_branches; -/* Helper function to update gcov_working_sets. */ - -void add_working_set (gcov_working_set_t *set) { - int i = 0; - for (; i < NUM_GCOV_WORKING_SETS; i++) - gcov_working_sets[i] = set[i]; -} - /* Forward declarations. */ static void find_spanning_tree (struct edge_list *); @@ -207,60 +195,6 @@ instrument_values (histogram_values values) } -/* Fill the working set information into the profile_info structure. */ - -void -get_working_sets (void) -{ - unsigned ws_ix, pctinc, pct; - gcov_working_set_t *ws_info; - - if (!profile_info) - return; - - compute_working_sets (profile_info, gcov_working_sets); - - if (dump_file) - { - fprintf (dump_file, "Counter working sets:\n"); - /* Multiply the percentage by 100 to avoid float. */ - pctinc = 100 * 100 / NUM_GCOV_WORKING_SETS; - for (ws_ix = 0, pct = pctinc; ws_ix < NUM_GCOV_WORKING_SETS; - ws_ix++, pct += pctinc) - { - if (ws_ix == NUM_GCOV_WORKING_SETS - 1) - pct = 9990; - ws_info = &gcov_working_sets[ws_ix]; - /* Print out the percentage using int arithmatic to avoid float. */ - fprintf (dump_file, "\t\t%u.%02u%%: num counts=%u, min counter=" - "%" PRId64 "\n", - pct / 100, pct - (pct / 100 * 100), - ws_info->num_counters, - (int64_t)ws_info->min_counter); - } - } -} - -/* Given a the desired percentage of the full profile (sum_all from the - summary), multiplied by 10 to avoid float in PCT_TIMES_10, returns - the corresponding working set information. If an exact match for - the percentage isn't found, the closest value is used. */ - -gcov_working_set_t * -find_working_set (unsigned pct_times_10) -{ - unsigned i; - if (!profile_info) - return NULL; - gcc_assert (pct_times_10 <= 1000); - if (pct_times_10 >= 999) - return &gcov_working_sets[NUM_GCOV_WORKING_SETS - 1]; - i = pct_times_10 * NUM_GCOV_WORKING_SETS / 1000; - if (!i) - return &gcov_working_sets[0]; - return &gcov_working_sets[i - 1]; -} - /* Computes hybrid profile for all matching entries in da_file. CFG_CHECKSUM is the precomputed checksum for the CFG. */ @@ -283,21 +217,14 @@ get_exec_counts (unsigned cfg_checksum, unsigned lineno_checksum) num_edges++; } - counts = get_coverage_counts (GCOV_COUNTER_ARCS, num_edges, cfg_checksum, - lineno_checksum, &profile_info); + counts = get_coverage_counts (GCOV_COUNTER_ARCS, cfg_checksum, + lineno_checksum); if (!counts) return NULL; - get_working_sets (); - - if (dump_file && profile_info) - fprintf (dump_file, "Merged %u profiles with maximal count %u.\n", - profile_info->runs, (unsigned) profile_info->sum_max); - return counts; } - static bool is_edge_inconsistent (vec<edge, va_gc> *edges) { @@ -439,29 +366,7 @@ read_profile_edge_counts (gcov_type *exec_counts) { num_edges++; if (exec_counts) - { - edge_gcov_count (e) = exec_counts[exec_counts_pos++]; - if (edge_gcov_count (e) > profile_info->sum_max) - { - if (flag_profile_correction) - { - static bool informed = 0; - if (dump_enabled_p () && !informed) - { - dump_location_t loc - = dump_location_t::from_location_t - (input_location); - dump_printf_loc (MSG_NOTE, loc, - "corrupted profile info: edge count" - " exceeds maximal count\n"); - } - informed = 1; - } - else - error ("corrupted profile info: edge from %i to %i exceeds maximal count", - bb->index, e->dest->index); - } - } + edge_gcov_count (e) = exec_counts[exec_counts_pos++]; else edge_gcov_count (e) = 0; @@ -511,12 +416,6 @@ compute_branch_probabilities (unsigned cfg_checksum, unsigned lineno_checksum) bb_gcov_counts.safe_grow_cleared (last_basic_block_for_fn (cfun)); edge_gcov_counts = new hash_map<edge,gcov_type>; - if (profile_info->sum_all < profile_info->sum_max) - { - error ("corrupted profile info: sum_all is smaller than sum_max"); - exec_counts = NULL; - } - /* Attach extra info block to each bb. */ alloc_aux_for_blocks (sizeof (struct bb_profile_info)); FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR_FOR_FN (cfun), NULL, next_bb) @@ -871,10 +770,9 @@ compute_value_histograms (histogram_values values, unsigned cfg_checksum, continue; } - histogram_counts[t] = - get_coverage_counts (COUNTER_FOR_HIST_TYPE (t), - n_histogram_counters[t], cfg_checksum, - lineno_checksum, NULL); + histogram_counts[t] = get_coverage_counts (COUNTER_FOR_HIST_TYPE (t), + cfg_checksum, + lineno_checksum); if (histogram_counts[t]) any = 1; act_count[t] = histogram_counts[t]; |