This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Compiler speed (vanilla vs. LTO, PGO and LTO+PGO)
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: Markus Trippelsdorf <markus at trippelsdorf dot de>, Richard Biener <richard dot guenther at gmail dot com>, gcc_mailinglist at abwesend dot de, gcc-help at gcc dot gnu dot org, gcc at gcc dot gnu dot org, tejohnson at google dot com
- Date: Fri, 29 Mar 2013 00:35:17 +0100
- Subject: Re: Compiler speed (vanilla vs. LTO, PGO and LTO+PGO)
- References: <trinity-46d93944-181a-4a69-836d-b1cd693c2d5c-1364154786327 at msvc024> <20130325070650 dot GA12504 at x4> <20130325125652 dot GB12504 at x4> <CAFiYyc0aYmpHewjRmHKRQARjKVb9ZHEhmqyYgJ5ewgO5Wjj4kQ at mail dot gmail dot com> <20130325132442 dot GD12504 at x4> <CAFiYyc2W2gkKqX9t7X09yXxsyeXL1uDugRjEweDE0y_u5VwnOg at mail dot gmail dot com> <20130325153423 dot GE12504 at x4> <20130326111326 dot GA26758 at atrey dot karlin dot mff dot cuni dot cz>
> Interesting, I was able to get faste LTO+PGO compile times than non-LTO,PGO.
> I however did testng only on combine.c compliation, so not very scientific.
>
> There are some cases FDO information is not streamed well in all cases. I will
> post patch for that later today. Perhaps it will make situation bit better.
Hi,
there is overflow in the histogram merging code truncating all gcov counters
that do not fit in integer. Fixed by the following patch I applied to mainline
as obvious. It may make the LTO binaries noticeably smaller (we will see on
the next run of regular SPEC testers).
Honza
Index: ChangeLog
===================================================================
--- ChangeLog (revision 197205)
+++ ChangeLog (working copy)
@@ -1,5 +1,9 @@
2013-03-28 Jan Hubicka <jh@suse.cz>
+ * lto-cgraph.c (merge_profile_summaries): Fix overflows.
+
+2013-03-28 Jan Hubicka <jh@suse.cz>
+
* data-streamer-in.c (streamer_read_gcov_count): New function.
* gimple-streamer-out.c: Include value-prof.h.
(output_gimple_stmt): Output histogram.
Index: lto-cgraph.c
===================================================================
--- lto-cgraph.c (revision 197205)
+++ lto-cgraph.c (working copy)
@@ -1362,8 +1362,8 @@ merge_profile_summaries (struct lto_file
{
/* Scale up the min value as we did the corresponding sum_all
above. Use that to find the new histogram index. */
- int scaled_min = RDIV (saved_profile_info->histogram[h_ix].min_value
- * saved_scale, REG_BR_PROB_BASE);
+ gcov_type scaled_min = RDIV (saved_profile_info->histogram[h_ix].min_value
+ * saved_scale, REG_BR_PROB_BASE);
/* The new index may be shared with another scaled histogram entry,
so we need to account for a non-zero histogram entry at new_ix. */
unsigned new_ix = gcov_histo_index (scaled_min);