public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Earnshaw <rearnsha@arm.com>
To: Jan Hubicka <hubicka@ucw.cz>
Cc: Xinliang David Li <davidxl@google.com>, Jan Hubicka <jh@suse.de>,
	 Richard Guenther <richard.guenther@gmail.com>,
	Mike Hommey <mhommey@mozilla.com>,
	"gcc@gcc.gnu.org" <gcc@gcc.gnu.org>,
	 "tglek@mozilla.com" <tglek@mozilla.com>,
	"dougkwan@google.com" <dougkwan@google.com>,
	 "jingyu@google.com" <jingyu@google.com>,
	"carrot@google.com" <carrot@google.com>,
	"jh@suse.cz" <jh@suse.cz>
Subject: Re: FDO and LTO on ARM
Date: Thu, 11 Aug 2011 13:51:00 -0000	[thread overview]
Message-ID: <4E43DE40.3030708@arm.com> (raw)
In-Reply-To: <20110808203539.GB10650@kam.mff.cuni.cz>

On 08/08/11 21:35, Jan Hubicka wrote:
>> 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...
> 

Slightly on a tangent, but I think there would even be a case for -O1s
-O2s and -O3s, with -Os==-O2s.  On this scale -O1s would be similar to
-O1 in opitimizations, but avoiding some code-expanding situations
(examples might include loop head duplication); -O2s would largely be
the same as today, except that very expensive code removal options would
not be applied, but -O3s would be aggressive size-based optimizations,
even at the expense of significant performance.

Once such a division is well defined, making LTO use the specified
categories should be easier.

R.

  reply	other threads:[~2011-08-11 13:51 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-05 19:49 Jan Hubicka
2011-08-05 21:34 ` Xinliang David Li
2011-08-05 22:25   ` Jan Hubicka
2011-08-08 20:03     ` Xinliang David Li
2011-08-08 20:36       ` Jan Hubicka
2011-08-11 13:51         ` Richard Earnshaw [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-08-04 14:05 Mike Hommey
2011-08-04 15:16 ` Richard Guenther
2011-08-04 16:38   ` Mike Hommey
2011-08-04 18:42     ` Jan Hubicka
2011-08-05  7:32       ` Richard Guenther
2011-08-05 14:40         ` Jan Hubicka
2011-08-05 17:39           ` Xinliang David Li
2011-08-05 17:50         ` Xinliang David Li
2011-08-08  9:26         ` Mike Hommey
2011-08-08 12:16           ` Mike Hommey
2011-08-04 17:02 ` Xinliang David Li
2011-08-04 17:16   ` Denis Chertykov
2011-08-04 18:51   ` Jan Hubicka
2011-08-08 12:21     ` Mike Hommey
2011-08-08 16:25       ` Jonathan Wakely
2011-08-09 12:57         ` Mike Hommey
2011-08-09 13:04           ` Jonathan Wakely
2011-08-09 23:35           ` Fu, Chao-Ying
2011-08-09 13:21         ` Mike Hommey
2011-08-09 17:40           ` Marc Glisse
2011-08-09 18:11       ` Mike Hommey
2011-08-11 14:22 ` Mike Hommey
2011-08-11 16:27   ` Xinliang David Li
2011-08-17 15:35     ` Mike Hommey
2011-08-17 17:22       ` Xinliang David Li
2011-08-17 17:33         ` Mike Hommey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E43DE40.3030708@arm.com \
    --to=rearnsha@arm.com \
    --cc=carrot@google.com \
    --cc=davidxl@google.com \
    --cc=dougkwan@google.com \
    --cc=gcc@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=jh@suse.cz \
    --cc=jh@suse.de \
    --cc=jingyu@google.com \
    --cc=mhommey@mozilla.com \
    --cc=richard.guenther@gmail.com \
    --cc=tglek@mozilla.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).