public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Steven Bosscher <stevenb.gcc@gmail.com>
To: Ian Bolton <bolton@icerasemi.com>
Cc: gcc@gcc.gnu.org
Subject: Re: Understanding Scheduling
Date: Fri, 19 Mar 2010 16:48:00 -0000	[thread overview]
Message-ID: <571f6b511003190943r65c1bde8kd0b136fa08504d9a@mail.gmail.com> (raw)
In-Reply-To: <4D60B0700D1DB54A8C0C6E9BE69163700E08F38E@EXCHANGEVS.IceraSemi.local>

On Fri, Mar 19, 2010 at 5:09 PM, Ian Bolton <bolton@icerasemi.com> wrote:
> Anyway, the reason I mention interblock-scheduling is that I see it
> doing seemingly intelligent moves, but then the later BB-reorder pass
> is juggling blocks around such that we end up with extra code inside
> hot loops!  I assume this is because the scheduler and BB-reorderer
> are largely ignorant of each other, and so good intentions on the
> part of the former can be scuppered by the latter.
>
> I was wondering if anyone else has witnessed this madness on their
> architecture?  Maybe it is a bug with BB-reorder?  Or maybe it should
> only be enabled when function profiling information (e.g. gcov) is
> available?  Or maybe it is not a high-priority thing for anyone to
> think about because no one uses interblock-scheduling?

It's probably a bug in BB-reorder if you end up with extra code in hot
loops. BB-reorder can do funny things sometimes, especially if the
branch probabilities are estimated. But that seems unlikely in this
case because loops are of course taken into account in the estimation.
You could check that in the RTL dumps.

Enabling BB-reorder only if profile info is available, is not the
right way to go. The compiler really doesn't place blocks in sane
places without it -- and it shouldn't have to, either. For example if
you split an edge at some point, the last thing you want to worry
about, is where the new basic block is going to end up.

There are actually a few bugs in Bugzilla about BB-reorder, FWIW.

Ciao!
Steven

  parent reply	other threads:[~2010-03-19 16:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-19 16:12 Ian Bolton
2010-03-19 16:34 ` Alexander Monakov
2010-03-19 16:43   ` Ian Bolton
2010-03-19 16:41 ` Vladimir N. Makarov
2010-03-19 17:02   ` Ian Bolton
2010-03-19 17:13     ` Vladimir N. Makarov
2010-03-19 20:58     ` Jeff Law
2010-03-19 16:48 ` Steven Bosscher [this message]
2010-03-22 17:49   ` Ian Bolton
2010-03-23 12:55     ` Dave Hudson
2010-03-23 18:24       ` BB reorder forced off for -Os Ian Bolton
2010-03-23 20:01         ` Paul Koning
2010-03-23 21:10           ` Joe Buck
2010-03-23 22:55         ` Steven Bosscher
2010-03-24 18:37           ` Dave Hudson
2010-03-30 13:06             ` Ian Bolton
2010-04-08 17:55               ` Making BB Reorder Smarter " Ian Bolton

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=571f6b511003190943r65c1bde8kd0b136fa08504d9a@mail.gmail.com \
    --to=stevenb.gcc@gmail.com \
    --cc=bolton@icerasemi.com \
    --cc=gcc@gcc.gnu.org \
    /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).