Questions about the Function Specific Optimization project.

Doug Kwan (關振德)
Thu Jan 29 02:20:00 GMT 2009

Hi Andrew,

2009/1/28 Andrew Pinski <>:
> On Wed, Jan 28, 2009 at 4:51 PM, Doug Kwan (關振德) <> wrote:
>> Is that a good idea and would people be interested in something like that?
> External annotations make it harder when dealing with bug reports
> unless the outputted preprocessed source includes them.

gcc already supports profile-guided optimization.  The external
annotations I am talking about are similar to profiling data.  Yes, we
will need to submit annotations in bug reports but aren't we doing the
same for PGO related issues?

> Why can't you
> use different defines for different functions and then include the
> specific header on the command line?

Because different applications may want to optimize a souce file
differently.  Even an application may be optimized differently over
time.  During tuning, the annotation files may be changed very
frequently.  I would like to avoid changing the source as much as

Another reason why I want to seperate the annotations from source code
is that we may want to process these annotations mechanically.  For
example, we obviously do not want to do this optimization in all
functions due to increase in binary size.  We many try something like
processing the profiling data, indentify the hot functions (e.g., top
1%) and generate the initial annotations and then manually fine-tuning
the annotations.


More information about the Gcc-patches mailing list