From 7f3577f5285957c1aa48823ce6c691f8c212b219 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 5 Jun 2018 10:13:31 +0200 Subject: Simplify gcov_histogram as it's used only for ARCS counters. 2018-06-05 Martin Liska * auto-profile.c (read_autofdo_file): Do not use gcov_ctr_summary struct. (afdo_callsite_hot_enough_for_early_inline): Likewise. * coverage.c (struct counts_entry): Likewise. (read_counts_file): Read just single summary entry. (get_coverage_counts): Use gcov_summary struct. * coverage.h (get_coverage_counts): Likewise. * gcov-dump.c (dump_working_sets): Likewise. (tag_summary): Dump just single summary. * gcov-io.c (gcov_write_summary): Write just histogram summary. (gcov_read_summary): Read just single summary. (compute_working_sets): Use gcov_summary struct. * gcov-io.h (GCOV_TAG_SUMMARY_LENGTH): Remove usage of GCOV_COUNTERS_SUMMABLE. (GCOV_COUNTERS_SUMMABLE): Remove. (GCOV_FIRST_VALUE_COUNTER): Replace with GCOV_COUNTER_V_INTERVAL. (struct gcov_ctr_summary): Remove. (struct gcov_summary): Directly use fields of former gcov_ctr_summary. (compute_working_sets): Use gcov_summary struct. * gcov.c (read_count_file): Do not use ctrs fields. * lto-cgraph.c (merge_profile_summaries): Use gcov_summary struct. * lto-streamer.h (struct GTY): Make profile_info gcov_summary struct. * profile.c: Likewise. * profile.h: Likewise. 2018-06-05 Martin Liska * libgcov-driver.c (gcov_compute_histogram): Remove usage of gcov_ctr_summary. (compute_summary): Do it just for a single summary. (merge_one_data): Likewise. (merge_summary): Simplify as we read just single summary. (dump_one_gcov): Pass proper argument. * libgcov-util.c (compute_one_gcov): Simplify as we have just single summary. (gcov_info_count_all_cold): Likewise. (calculate_overlap): Likewise. From-SVN: r261189 --- gcc/auto-profile.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'gcc/auto-profile.c') diff --git a/gcc/auto-profile.c b/gcc/auto-profile.c index e794496..197fa10 100644 --- a/gcc/auto-profile.c +++ b/gcc/auto-profile.c @@ -318,8 +318,8 @@ static string_table *afdo_string_table; /* Store the AutoFDO source profile. */ static autofdo_source_profile *afdo_source_profile; -/* gcov_ctr_summary structure to store the profile_info. */ -static struct gcov_ctr_summary *afdo_profile_info; +/* gcov_summary structure to store the profile_info. */ +static gcov_summary *afdo_profile_info; /* Helper functions. */ @@ -1682,8 +1682,7 @@ read_autofdo_file (void) if (auto_profile_file == NULL) auto_profile_file = DEFAULT_AUTO_PROFILE_FILE; - autofdo::afdo_profile_info = (struct gcov_ctr_summary *)xcalloc ( - 1, sizeof (struct gcov_ctr_summary)); + autofdo::afdo_profile_info = XNEW (gcov_summary); autofdo::afdo_profile_info->runs = 1; autofdo::afdo_profile_info->sum_max = 0; autofdo::afdo_profile_info->sum_all = 0; @@ -1713,7 +1712,7 @@ afdo_callsite_hot_enough_for_early_inline (struct cgraph_edge *edge) if (count > 0) { bool is_hot; - const struct gcov_ctr_summary *saved_profile_info = profile_info; + const gcov_summary *saved_profile_info = profile_info; /* At early inline stage, profile_info is not set yet. We need to temporarily set it to afdo_profile_info to calculate hotness. */ profile_info = autofdo::afdo_profile_info; -- cgit v1.1