public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrey Belevantsev <abel@ispras.ru>
To: Mark Mitchell <mark@codesourcery.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	  Jim Wilson <wilson@tuliptree.org>,
	 Vladimir Makarov <vmakarov@redhat.com>
Subject: Re: [RFC] Selective scheduling pass
Date: Wed, 04 Jun 2008 20:50:00 -0000	[thread overview]
Message-ID: <4846FFFF.8020402@ispras.ru> (raw)
In-Reply-To: <4846C8F2.2080508@codesourcery.com>

Mark Mitchell wrote:
> That's a very good result.  Congratulations! 
Thank you!

> I know that this scheduler is aimed at CPUs like the ones you mention 
> above.  However, would it function correctly on other CPUs with more 
> "traditional" characteristics, like older ARM, MIPS, or x86 cores?  And, 
> would it be reasonably possible to tune it for those CPUs as well?
When a target doesn't do anything "fancy" in scheduler hooks, everything 
should just work (modulo bugs, of course; we've tried only ppc64 and 
x86-64).  In case a target saves some information describing scheduler's 
state, simple hooks manipulating this data should be implemented, like 
we did for the rs6000 port.

> As with the IRA allocator, I'd like to avoid having multiple schedulers 
> in GCC.  (I know we've done that for a while, but I still think it's 
> undesirable.)  So, I'd like to see if we can get this to work well 
> across all of the Primary and Secondary CPUs, and then just make it "the 
> GCC scheduler" rather than an optional thing enabled at some 
> optimization levels on some CPUs.
This is our goal as well, and I think it can be done incrementally.  We 
are now working on the ppc performance.  Then we need to tune the 
scheduler so that for traditional targets it is no worse in performance 
and the slowdown is reasonable, e.g. with disabling pipelining and 
decreasing the scheduling window.  The last thing to do is to speed up 
the implementation so that for scheduling-eager targets with pipelining 
enabled the slowdown will be acceptable for -O2.

Note that the selective scheduler does not subsume SMS, but complements 
it, because SMS does better job for countable loops, but cannot handle 
loops with control flow and with unknown number of iterations.  So in 
any case there will be two schedulers.

> Do you think that's feasible?  Or do you think that there are inherent 
> aspects of the algorithm that mean that we need to have this new 
> scheduler for one class of CPUs and the old scheduler for the other 
> class?  Is there any way to make the new scheduler do a reasonable job 
> with the existing descriptions in GCC, so that port maintainers can tune 
> later, or is a level of effort like that for Itanium require
The ia64 backend is very complex, and we put a lot of efforts in tuning 
it by itself -- you can see it in my other mail about target changes. 
So I think that tuning for other targets will be simpler.  The cell 
results I mentioned in the mail were received from a guy who did the 
tuning internally in Samsung, and AFAIR he didn't mentioned any 
target-independent changes he had to do, but basically he just made it 
working.

>> Compile time slowdown measured with --enable-checking=assert is quite 
>> significant -- about 12% on spec int and about 18% on spec fp and 
>> cc1-i-files collection.  For this reason, we have enabled selective 
>> scheduler by default at -O3 on ia64 and disabled by default on other 
>> targets.
> 
> Do you understand what's causing the compile-time slowdown?
The part that takes most time is the update of availability sets, as 
this is the central part of the algorithm.  Renaming is quite expensive 
too, but we have tackled this limiting it only to several insns with the 
largest priority.  To make the updates faster, you need to build the 
data dependence graph and to keep it up to date while scheduling. 
Unfortunately, we didn't manage to do this during this project.  The 
first step towards this goal will be to make the dependence graph 
classify the dependencies built on control/data, lhs/rhs, 
register/memory etc.  Then we can invent the mechanism of updating the 
graph, which would not be trivial -- e.g. when an insn gets renamed, we 
have introduced a register-register copy which can generate completely 
new register dependencies that cannot be devised from existing ones. 
Such a project is likely to make it to trunk on the next release cycle, 
and that would correspond to the last step of the incremental approach 
outlined above.

Yours, Andrey

  reply	other threads:[~2008-06-04 20:50 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-03 14:24 Andrey Belevantsev
2008-06-03 14:26 ` Selective scheduling pass - middle end changes [1/1] Andrey Belevantsev
2008-06-11  1:04   ` Ian Lance Taylor
2008-06-11 13:40     ` Andrey Belevantsev
2008-06-11 14:30       ` Ian Lance Taylor
2008-06-27 13:10         ` Andrey Belevantsev
2008-06-30 16:16           ` Ian Lance Taylor
2008-07-08 14:54             ` Andrey Belevantsev
2008-07-08 15:29               ` Ian Lance Taylor
2008-08-22 15:55     ` Andrey Belevantsev
2008-06-03 14:27 ` Selective scheduling pass - scheduler changes [2/3] Andrey Belevantsev
2008-06-03 22:03   ` Vladimir Makarov
2008-08-22 15:52     ` Andrey Belevantsev
2008-06-03 14:28 ` Selective scheduling pass - target changes (ia64 & rs6000) [3/3] Andrey Belevantsev
2008-08-22 16:04   ` Andrey Belevantsev
2008-08-29 13:41     ` [Ping] [GWP/ia64/rs6000 maintainer needed] " Andrey Belevantsev
2008-08-29 15:01       ` Mark Mitchell
2008-09-25 22:39     ` sje
2008-09-26 14:57       ` Andrey Belevantsev
2008-10-03 22:22         ` Steve Ellcey
2008-10-06 17:26           ` Andrey Belevantsev
2008-06-03 22:03 ` [RFC] Selective scheduling pass Vladimir Makarov
2008-06-04 16:55 ` Mark Mitchell
2008-06-04 20:50   ` Andrey Belevantsev [this message]
2008-06-05  3:45 ` Seongbae Park (박성배, 朴成培)
2008-06-05 13:49   ` Andrey Belevantsev
2008-06-05  6:44 Steven Bosscher
2008-06-05 18:29 ` Andrey Belevantsev
2008-06-05 23:38   ` Steven Bosscher

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=4846FFFF.8020402@ispras.ru \
    --to=abel@ispras.ru \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mark@codesourcery.com \
    --cc=vmakarov@redhat.com \
    --cc=wilson@tuliptree.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).