This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: FDO and LTO on ARM
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Xinliang David Li <davidxl at google dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, Jan Hubicka <jh at suse dot de>, Richard Guenther <richard dot guenther at gmail dot com>, Mike Hommey <mhommey at mozilla dot com>, gcc at gcc dot gnu dot org, tglek at mozilla dot com, dougkwan at google dot com, jingyu at google dot com, carrot at google dot com, jh at suse dot cz
- Date: Mon, 8 Aug 2011 22:35:39 +0200
- Subject: Re: FDO and LTO on ARM
- References: <20110805214844.slo177f4bosowcko@imap.suse.de> <CAAkRFZJfqtEXDu2g8d2tOW6ya-ParJvgYxNAc5T6mqS-NXpcQQ@mail.gmail.com> <20110805222432.GA19660@atrey.karlin.mff.cuni.cz> <CAAkRFZ+GsLk=XwecHZafbLs+kM8xhM8Y3zaFH5y3YXpHNCYwmw@mail.gmail.com>
> On Fri, Aug 5, 2011 at 3:24 PM, Jan Hubicka <hubicka@ucw.cz> wrote:
> >> >
> >> > In a way I like the current scheme since it is simple and extending it
> >> > should IMO have some good reason. We could refine -Os behaviour without
> >> > changing current predicates to optimize for speed in
> >> > a) functions declared as "hot" by user and BBs in them that are not proved
> >> > cold.
> >> > b) based on profile feedback - i.e. we could have two thresholds, BBs with
> >> > very arge counts wil be probably hot, BBs in between will be maybe
> >> > hot/normal and BBs with low counts will be cold.
> >> > This would probably motivate introduction of probably_hot predicate that
> >> > summarize the above.
> >>
> >> Introducing a new 'probably_hot' will be very confusing -- unless you
> >> also rename 'maybe_hot', but this leads to finer grained control:
> >> very_hot, hot, normal, cold, unlikely which can be hard to use. ?The
> >> three state partition (not counting exec_once) seems ok, but
> >
> > OK, I also preffer to have fewer stages than more ;)
> >>
> >> 1) the unlikely state does not have controllable parameter
> >
> > Well, it is defined as something that is not likely to be executed, so the requirement
> > on count to be less than 1/(number_of_test_runs*2) is very natural and don't seem
> > to need to be tuned.
>
> Ok, so it is defined to be different from 'rarely-executed' case.
> However rarely-executed seems more general and can perhaps be used in
> place of unlikely case. If there are situation that applies only to
> 'unlikely', they can be split apart.
So you thing of having hot (as for optimize for speed), cold (as for optimize
for size) and rarely executed (as for optimize very heavily for size)?
(as a replacement of current hot=speed/cold=size scheme)
It may not be completely crazy - i.e. at least kernel people tends to call
for something that is like -Os but not doing extreme tradeoffs (like not
expanding simple division by constant sequences or doing similar things that
hurts performance a lot and usually save just small amount of code).
I however wonder how large portions of program can be safely characterized as
rarely executed that are not unlikely. I.e. my intuition would be that it is
relatively small portion of program since code tends to be either dead or used
resonably often.
BTW The original motivation for "unlikely" was the function splitting pass, so
the functions put into unlikely section are having good chance to be never
touched in program execution and thus never mapped in.
It is in fact the only place it seems to be used in till today...
Honza
>
> David