On Sat, Jun 2, 2012 at 6:06 PM, Jan Hubicka <hubi...@ucw.cz> wrote:
>> On Sat, Jun 2, 2012 at 2:36 AM, Jan Hubicka <hubi...@ucw.cz> wrote:
>> >> Hi,
>> >>
>> >> This patch adds 4 flags to enable user to type in a list of name
>> >> patterns. Compiler will match the function name with the given
>> >> patterns, and add "hot", "cold", "likely_hot", "likely_cold"
>> >> attributes to function declaration. The static branch prediction
>> >> checks if a basic block contains call to a annotated function, and set
>> >> the branch probability accordingly.
>> >>
>> >> Bootstrapped and passed gcc testsuites.
>> >>
>> >> Ok for google branches?
>> >
>> > Just out of curiosity, what is main advantage of this over annotating your 
>> > source?
>> >
>>
>> This is to avoid too much annotation at source level. Some
>> applications have good per application knowledge of library functions
>> (that are compiled and statically linked in). Another example of its
>> -- coarse grain (function level) profile data collected from data
>> center can be used to guide branch prediction/estimation.
>
> Well, perhaps the feature would be more useful with command line option 
> allowing
> to add an attribute instead of having special case command line options for 
> individual
> cases.

Hi, Honza, I'm not sure what you mean by "command line option allowing
to add an attribution". But this seems what this patch does: it adds
attributes to functions with specified name patterns.

>  I guess the problem would be also solvable with header included after
> the library adding the attributes to the declarations
>
> typeof (printf) printf __attribute__ ((cold));

Do you mean that for each specific application, we extract a common
header file to include all function annotations, and all source files
will include this header file?

Thanks,
Dehao

>
> Honza
>>
>> thanks,
>>
>> David
>> > Honza

Reply via email to