aboutsummaryrefslogtreecommitdiff
path: root/gcc/coverage.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2018-09-21 10:41:17 +0200
committerMartin Liska <marxin@gcc.gnu.org>2018-09-21 08:41:17 +0000
commit512cc0151207de4c7ff3a84f040f730fe0d52458 (patch)
treed3237cdec0d5acc77939322658f0dc8de1d5a5be /gcc/coverage.c
parent36ff254bf63f21dd8fc7a353c8b8f3aa08018654 (diff)
downloadgcc-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/coverage.c')
-rw-r--r--gcc/coverage.c59
1 files changed, 9 insertions, 50 deletions
diff --git a/gcc/coverage.c b/gcc/coverage.c
index bae6f5c..26cce2b 100644
--- a/gcc/coverage.c
+++ b/gcc/coverage.c
@@ -49,6 +49,7 @@ along with GCC; see the file COPYING3. If not see
#include "intl.h"
#include "params.h"
#include "auto-profile.h"
+#include "profile.h"
#include "gcov-io.c"
@@ -73,7 +74,6 @@ struct counts_entry : pointer_hash <counts_entry>
unsigned lineno_checksum;
unsigned cfg_checksum;
gcov_type *counts;
- gcov_summary summary;
/* hash_table support. */
static inline hashval_t hash (const counts_entry *);
@@ -185,8 +185,6 @@ static void
read_counts_file (void)
{
gcov_unsigned_t fn_ident = 0;
- gcov_summary summary;
- unsigned new_summary = 1;
gcov_unsigned_t tag;
int is_error = 0;
unsigned lineno_checksum = 0;
@@ -236,27 +234,12 @@ read_counts_file (void)
}
else
fn_ident = lineno_checksum = cfg_checksum = 0;
- new_summary = 1;
}
- else if (tag == GCOV_TAG_PROGRAM_SUMMARY)
+ else if (tag == GCOV_TAG_OBJECT_SUMMARY)
{
- struct gcov_summary sum;
-
- if (new_summary)
- memset (&summary, 0, sizeof (summary));
-
- gcov_read_summary (&sum);
- summary.runs += sum.runs;
- summary.sum_all += sum.sum_all;
- if (summary.run_max < sum.run_max)
- summary.run_max = sum.run_max;
- summary.sum_max += sum.sum_max;
- if (new_summary)
- memcpy (summary.histogram, sum.histogram,
- sizeof (gcov_bucket_type) * GCOV_HISTOGRAM_SIZE);
- else
- gcov_histogram_merge (summary.histogram, sum.histogram);
- new_summary = 0;
+ profile_info = XCNEW (gcov_summary);
+ profile_info->runs = gcov_read_unsigned ();
+ profile_info->sum_max = gcov_read_unsigned ();
}
else if (GCOV_TAG_IS_COUNTER (tag) && fn_ident)
{
@@ -276,9 +259,6 @@ read_counts_file (void)
entry->ctr = elt.ctr;
entry->lineno_checksum = lineno_checksum;
entry->cfg_checksum = cfg_checksum;
- if (elt.ctr == GCOV_COUNTER_ARCS)
- entry->summary = summary;
- entry->summary.num = n_counts;
entry->counts = XCNEWVEC (gcov_type, n_counts);
}
else if (entry->lineno_checksum != lineno_checksum
@@ -292,22 +272,6 @@ read_counts_file (void)
counts_hash = NULL;
break;
}
- else if (entry->summary.num != n_counts)
- {
- error ("Profile data for function %u is corrupted", fn_ident);
- error ("number of counters is %d instead of %d", entry->summary.num, n_counts);
- delete counts_hash;
- counts_hash = NULL;
- break;
- }
- else
- {
- entry->summary.runs += summary.runs;
- entry->summary.sum_all += summary.sum_all;
- if (entry->summary.run_max < summary.run_max)
- entry->summary.run_max = summary.run_max;
- entry->summary.sum_max += summary.sum_max;
- }
for (ix = 0; ix != n_counts; ix++)
entry->counts[ix] += gcov_read_counter ();
}
@@ -330,9 +294,8 @@ read_counts_file (void)
/* Returns the counters for a particular tag. */
gcov_type *
-get_coverage_counts (unsigned counter, unsigned expected,
- unsigned cfg_checksum, unsigned lineno_checksum,
- const gcov_summary **summary)
+get_coverage_counts (unsigned counter, unsigned cfg_checksum,
+ unsigned lineno_checksum)
{
counts_entry *entry, elt;
@@ -363,14 +326,13 @@ get_coverage_counts (unsigned counter, unsigned expected,
}
elt.ctr = counter;
entry = counts_hash->find (&elt);
- if (!entry || !entry->summary.num)
+ if (!entry)
/* The function was not emitted, or is weak and not chosen in the
final executable. Silently fail, because there's nothing we
can do about it. */
return NULL;
- if (entry->cfg_checksum != cfg_checksum
- || entry->summary.num != expected)
+ if (entry->cfg_checksum != cfg_checksum)
{
static int warned = 0;
bool warning_printed = false;
@@ -414,9 +376,6 @@ get_coverage_counts (unsigned counter, unsigned expected,
DECL_ASSEMBLER_NAME (current_function_decl));
}
- if (summary)
- *summary = &entry->summary;
-
return entry->counts;
}