https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112806

--- Comment #3 from Alexander Zaitsev <zamazan4ik at tut dot by> ---
> https://gcc.gnu.org/onlinedocs/gcc-13.2.0/gcc/Other-Builtins.html#index-fprofile-arcs-1

I already read this and still do not understand the actual behavior. If PGO
profiles show that the branch is "cold" but a user write for this branch via
__builtin_expect/[[likely]] that the branch is "hot" - what decision will be
made by the optimizer?

On the link above there is only "In general, you should prefer to use actual
profile feedback for this (-fprofile-arcs), as programmers are notoriously bad
at predicting how their programs actually perform.". But it does not specify
the actual behavior - it's just a recommendation to use PGO instead of manual
[[likely]] hints.

Reply via email to