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]

[PATCH] increase builtin_expert probability in loop exit test


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: patch_diff
Description: Binary data


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