This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: __builtin_expect for indirect function calls
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Hans-Peter Nilsson <hp at bitrange dot com>
- Cc: trevor_smigiel at playstation dot sony dot com, gcc <gcc at gcc dot gnu dot org>, Russell_Olsen at playstation dot sony dot com
- Date: Wed, 26 Dec 2007 10:54:08 -0800
- Subject: Re: __builtin_expect for indirect function calls
- References: <20071218000552.GV3656@playstation.sony.com> <20071221220630.Y67443@dair.pair.com>
Hans-Peter Nilsson wrote:
> On Mon, 17 Dec 2007, trevor_smigiel@playstation.sony.com wrote:
>> When we can't hint the real target, we want to hint the most common
>> target. There are potentially clever ways for the compiler to do this
>> automatically, but I'm most interested in giving the user some way to do
>> it explicitly. One possiblity is to have something similar to
>> __builtin_expect, but for functions. For example, I propose:
>>
>> __builtin_expect_call (FP, PFP)
>
> Is there a hidden benefit? I mean, isn't this really
> expressable using builtin_expect as-is, at least when it comes
> to the syntax?
That was my first thought as well. Before we add __builtin_expect_call,
I think there needs to be a justification of why this can't be done with
__builtin_expect as-is.
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713