This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] increase builtin_expert probability in loop exit test


Attached is the patchset 2. It takes the max to two hitrates then does
the incremental.


On Fri, Oct 11, 2013 at 2:01 PM, Rong Xu <xur@google.com> wrote:
> Hi,
>
> An earlier patch (r203167) changed the default probability for
> builtin_expect to 90%.
> It does not work properly for the following case:
>    while (__builin_expect (expr, 1)) { ....}
>
> W/o builtin_expect, the exit probability is 9% while w/
> builtin_expect, the exit probability is 10%.
> It seems to be wrong as we should estimate this loop has more
> iterations than w/o the annotation.
>
> This attached patch bump the probability for this particular case.
>
> Tested with bootstrap.
>
> Thanks,
>
> -Rong

Attachment: patch2.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]