This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] alternative hirate for builtin_expert
- From: Rong Xu <xur at google dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, David Li <davidxl at google dot com>
- Date: Wed, 2 Oct 2013 11:42:03 -0700
- Subject: Re: [PATCH] alternative hirate for builtin_expert
- Authentication-results: sourceware.org; auth=none
- References: <CAF1bQ=TH5+Qfd1MsAUDBJj+F-zizymTTGh7HxyuXUbaPqd-mng at mail dot gmail dot com> <CAF1bQ=Q_eiCz8AYkU-c=Xu7quQ0vy8eP=pi9QZt+QOF4vicnsg at mail dot gmail dot com> <20131002160827 dot GB7181 at kam dot mff dot cuni dot cz>
On Wed, Oct 2, 2013 at 9:08 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
>> > Hi,
>> >
>> >
>> >
>> > Current default probability for builtin_expect is 0.9996.
>> > This makes the freq of unlikely bb very low (4), which
>> > suppresses the inlining of any calls within those bb.
>> >
>> > We used FDO data to measure the branch probably for
>> > the branch annotated with builtin_expert.
>> > For google internal benchmarks, the weight average
>> > (the profile count value as the weight) is 0.9081.
>> >
>> > Linux kernel is another program that is heavily annotated
>> > with builtin-expert. We measured its weight average as 0.8717,
>> > using google search as the workload.
>> >
>> > This patch sets the alternate hirate probability for builtin_expert
>> > to 90%. With the alternate hirate, we measured performance
>> > improvement for google benchmarks and Linux kernel.
>> >
>> > An earlier discussion is
>> > https://mail.google.com/mail/u/0/?pli=1#label/gcc-paches/1415c5910054630b
>> >
>> > This new patch is for the trunk and addresses Honza's comments.
>> >
>> > Honza: this new probability is off by default. When we backport to google
>> > branch we will make it the default. Let me know if you want to do the same
>> > here.
>
> I do not like much the binary parameter for builtin-expect-probability-relaxed.
>
> I would just add bulitin-expect-probability taking value in percents and then
> make predict.c to use it. Just use predict_edge instead of predict_edge_def
> and document hitrate value as unused in predict.def.
Thanks for the suggestion. This is much cleaner than to use binary parameter.
Just want to make sure I understand it correctly about the orginal hitrate:
you want to retire the hitrate in PRED_BUILTIN_EXPECT and always use
the one specified in the biniltin-expect-probability parameter.
Should I use 90% as the default? It's hard to fit current value 0.9996
in percent form.
-Rong
>
> OK with that change.
>
> Honza