This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH AutoFDO/2]Treat ZERO as common profile probability/count
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: "Bin.Cheng" <amker dot cheng at gmail dot com>
- Cc: bin dot cheng at linux dot alibaba dot com, Richard Guenther <richard dot guenther at gmail dot com>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 7 Dec 2018 17:57:06 +0100
- Subject: Re: [PATCH AutoFDO/2]Treat ZERO as common profile probability/count
- References: <7f153787-f390-4661-92aa-06d47cefbbf5.bin.cheng@linux.alibaba.com> <CAFiYyc0Dj7y4fe8Jj9JGZp3xh0h=vEbohs7kccO5RsXe5u4GNg@mail.gmail.com> <20181105141206.4ncu3s2v2jxv6o54@kam.mff.cuni.cz> <b84df5c4-d0ee-4264-8d46-302129394140.bin.cheng@linux.alibaba.com> <CAHFci28CQB3KK+Yp7gb8BR61UaGhAJJ-R1yzZPHxitczvgEB3w@mail.gmail.com> <20181128162042.4vlsfxv643alnq57@kam.mff.cuni.cz> <CAHFci2_R0TUyFmOgiKbQEzCyUNO_rhhcJBiohd5e-drDiX34Kw@mail.gmail.com> <CAHFci2_=TFhPXFU48Y=xe1R6vVcv7neBkiC4+8AKMCgyrJb4Gw@mail.gmail.com>
> Hi Honza,
> I have committed the typo fix as revision 266885.
> Also I followed your suggestion (IIUC) by calling
> profile_count::adjust_for_ipa_scaling for zero den in function
> update_profiling_info. It works and does make more sense than
> changing the global zero check logic.
> Patch tested as before, is it ok?
Thanks, patch is OK.
What is situation with AutoFDO now? It would be very nice to get it
fixed for the release :)
Honza
>
> Thanks,
> bin
>
> diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
> index 4471bae11c7..5074ef63da1 100644
> --- a/gcc/ipa-cp.c
> +++ b/gcc/ipa-cp.c
> @@ -3715,9 +3715,11 @@ update_profiling_info (struct cgraph_node *orig_node,
> new_sum = orig_node_count.combine_with_ipa_count (new_sum);
> orig_node->count = remainder;
>
> + profile_count::adjust_for_ipa_scaling (&new_sum, &orig_node_count);
> for (cs = new_node->callees; cs; cs = cs->next_callee)
> cs->count = cs->count.apply_scale (new_sum, orig_node_count);
>
> + profile_count::adjust_for_ipa_scaling (&remainder, &orig_node_count);
> for (cs = orig_node->callees; cs; cs = cs->next_callee)
> cs->count = cs->count.apply_scale (remainder, orig_node_count);
>
> 2018-12-07 Bin Cheng <bin.cheng@linux.alibaba.com>
>
> * ipa-cp.c (update_profiling_info): Call adjust_for_ipa_scaling for
> zero profile count.