On Mon, 2020-01-06 at 15:08 +0100, Martin Liška wrote:
> Hi.
>
> As Honza noticed in the PR, we are quite strict about TOP N
> counter invalidation due to multiple values that can't
> fit in a counter. We due it in order to have a reproducible
> builds. I guess we should do a compromise in between reproducibility
> and possible speed up. That's why I'm suggesting to invalidate
> a TOP N counter only if param_profile_topn_invalid_threshold percent
> of profile are missing.
>
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>
> Ready to be installed?
> Thanks,
> Martin
>
> gcc/ChangeLog:
>
> 2020-01-06 Martin Liska <mli...@suse.cz>
>
> PR tree-optimization/92924
> * params.opt (param_profile_topn_invalid_threshold):
> New parameter.
> * profile.c (sort_hist_values): Mark TOP N counter
> invalid only if significant amount of samples
> is missing.
>
> gcc/testsuite/ChangeLog:
>
> 2020-01-06 Martin Liska <mli...@suse.cz>
>
> PR tree-optimization/92924
> * gcc.dg/tree-prof/pr92924-2.c: New test.
> * gcc.dg/tree-prof/pr92924.c: New test.
>
> libgcc/ChangeLog:
>
> 2020-01-06 Martin Liska <mli...@suse.cz>
>
> PR tree-optimization/92924
> * libgcov-merge.c (merge_topn_values_set): Replace
> value with lowest count.
OK
jeff