From 2730ada7a02e99f9a3088b74b1ff588255c40154 Mon Sep 17 00:00:00 2001 From: Teresa Johnson Date: Fri, 30 Nov 2012 16:47:04 +0000 Subject: Revised patch to ensure that histograms from the profile summary are streamed... Revised patch to ensure that histograms from the profile summary are streamed through the LTO files so that the working set can be computed for use in downstream optimizations. 2012-11-30 Teresa Johnson * lto-cgraph.c (output_profile_summary): Stream out sum_all and histogram. (input_profile_summary): Stream in sum_all and histogram. (merge_profile_summaries): Merge sum_all and histogram, and change to use RDIV. (input_symtab): Call compute_working_sets after merging summaries. * gcov-io.c (gcov_histo_index): Make extern for compiler. * gcov-io.h (gcov_histo_index): Ditto. * profile.c (compute_working_sets): Remove static keyword. * profile.h (compute_working_sets): Ditto. * Makefile.in (lto-cgraph.o): Depend on profile.h. From-SVN: r193999 --- gcc/gcov-io.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'gcc/gcov-io.c') diff --git a/gcc/gcov-io.c b/gcc/gcov-io.c index 109401c..f45c32c 100644 --- a/gcc/gcov-io.c +++ b/gcc/gcov-io.c @@ -622,11 +622,15 @@ gcov_time (void) } #endif /* IN_GCOV */ -#if IN_LIBGCOV || !IN_GCOV +#if !IN_GCOV /* Determine the index into histogram for VALUE. */ +#if IN_LIBGCOV static unsigned -gcov_histo_index(gcov_type value) +#else +GCOV_LINKAGE unsigned +#endif +gcov_histo_index (gcov_type value) { gcov_type_unsigned v = (gcov_type_unsigned)value; unsigned r = 0; @@ -664,8 +668,8 @@ gcov_histo_index(gcov_type value) its entry's original cumulative counter value when computing the new merged cum_value. */ -static void gcov_histogram_merge(gcov_bucket_type *tgt_histo, - gcov_bucket_type *src_histo) +static void gcov_histogram_merge (gcov_bucket_type *tgt_histo, + gcov_bucket_type *src_histo) { int src_i, tgt_i, tmp_i = 0; unsigned src_num, tgt_num, merge_num; @@ -801,4 +805,4 @@ static void gcov_histogram_merge(gcov_bucket_type *tgt_histo, /* Finally, copy the merged histogram into tgt_histo. */ memcpy(tgt_histo, tmp_histo, sizeof (gcov_bucket_type) * GCOV_HISTOGRAM_SIZE); } -#endif /* IN_LIBGCOV || !IN_GCOV */ +#endif /* !IN_GCOV */ -- cgit v1.1