From faa4091abca9e160f31a52fa2cfc6fb9b0824cd2 Mon Sep 17 00:00:00 2001 From: sandra Date: Sun, 11 Nov 2018 18:39:10 +0000 Subject: [PATCH] 2018-11-11 Sandra Loosemore PR c/26366 gcc/ * doc/extend.texi (Other Builtins): Document probability associated with __builtin_expect. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@266017 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/doc/extend.texi | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 67a6b80c0a44d..4a8293fa47c8f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-11-11 Sandra Loosemore + + PR c/26366 + * doc/extend.texi (Other Builtins): Document probability associated + with __builtin_expect. + 2018-11-11 Uros Bizjak PR target/87928 diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 5ce506907d7de..022d0e0c121e3 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -12121,6 +12121,12 @@ if (__builtin_expect (ptr != NULL, 1)) @noindent when testing pointer or floating-point values. + +For the purposes of branch prediction optimizations, the probability that +a @code{__builtin_expect} expression is true is controlled by GCC's +@code{builtin-expect-probability} parameter, which defaults to 90%. +You can also use @code{__builtin_expect_with_probability} to explicitly +assign a probability value to individual expressions. @end deftypefn @deftypefn {Built-in Function} long __builtin_expect_with_probability