This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Value profile based optimizations, part 1

> Jan Hubicka wrote:
> >Thinking about it more, it probably makes sense to define -fprofile-gen
> >as -fprofile-arcs + -fvalue-profile once the code comes in
> >(hmm, it perhaps ought to be -fprofile-values).
> >The -fprofile-use then can be -fbranch-probabilities
> >-fvalue-profile-transformations + whatever we invent later.
> >I will send patch for adding the two new options shortly.
> >Unforutnate is that current uses of
> >-fprofile-arcs/-fbranch-probabilities would need to be updated, but
> >there are very few of them to date.
> I think we should have the -fprofile-{gen,use} flags plus individual
> flags -- however we name them. I'm not sure if you're intending removing
> the individual flags. You're right we should name them all -fprofile-FOO
> with possibly gen/use pairs -- -fprofile-{gen,use}{,-branches,-values}.
> Although I'm nervous about renaming an existing option -- add an alias
> perhaps?
I think we can go without renaming the existing options.
At the moment we have -fprofile-arcs, we can add -fprofile-values
and -fprofile-gen (or -fprofile-generate as in GCC we usually don't do
shortcuts) to enable them both.
-fbranch-probabilities is somewhat missnamed, as it now does both branch
probabilities and profile based optimizations, but we can probably keep
it that way and add -fprofile-use that will imply it as well as other
profile based optimizations we are going to invent in the future.
That will make -fbranch-probabilities uninteresting to the majority of

There is another related problem - number of optimizations are
inaplicable for -O2 by default, but they can be when profile feedback is
available.  For instance loop unrolling with profile feedback brings
quite small code size growth relative to the speedups. (simply with
profile feedback compiler has enought information to decide sanely,
while without it it can not).
I am not sure wow we want to deal with this, but I would like some of
the options otherwise applicable only for -O3 to be enabled by default
at -O2 with profile feedback.  Does this sound sane?

> nathan
> -- 
> Nathan Sidwell    ::   ::     CodeSourcery LLC
>          The voices in my head said this was stupid too
>    ::

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]