public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ghassan Shobaki <gshobaki@ece.ucdavis.edu>
To: Jan Hubicka <hubicka@ucw.cz>
Cc: Vladimir Makarov <vmakarov@redhat.com>, Jan Hubicka <jh@suse.cz>,
	gcc-help@gcc.gnu.org, gcc@gnu.org
Subject: Re: Superblock Scheduling Alg in GCC
Date: Wed, 14 Apr 2004 17:40:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.58.0404140929240.3355@hawking.ece.ucdavis.edu> (raw)
In-Reply-To: <20040210202725.GJ1382@atrey.karlin.mff.cuni.cz>

Guys,

I have done some experiments on two different heuristics for superblock 
scheduling by comparing them with optimal scheduling. The two heuristics 
are simple critical path CP (priority is the CP from the last branch only) 
and weighted critical path WCP (priority is a weighted sum of critical pahts 
from all branches below an instruction, with the branch weight being the 
probability of exiting the superblock at that branch). On the simple 
machine model that I am using, I got the following results: 

fp2000 benchmark: CP is optimal on 72% of the superblocks and WCP is 
optimal on 84% of the superblocks

int2000 benchmark: CP is optimal on 83% of the superblocks and WCP is 
optimal on 94% of the superblocks

These numbers do not necessarily reflect actual run-time performance 
improvements, since they were collected in a standalone setup were 
superblock data dependence graphs were extracted from gcc and scheduled
separately for a simple machine model (dual issue in which one int and one 
fp instruction can issue in each cycle). However, these results 
do suggest that the WCP heuristic is significantly better than the simple CP.

The reference for the WCP heuristic is:
R. Bringmann, Compiler-Controlled Speculation, PHD thesis, Dept. of CS, 
UIUC, IL 1995. (where the technique is called Dependence Height and 
Speculative Yield DHASY).

However, you don't really need to go there since the heuristic itself is 
so simple and intuitive that my description above is almost sufficient. 
Let me know if you are interested and I'll give you the details and 
explain one particular subtility about it.

Regards

-Ghassan



On Tue, 10 Feb 2004, Jan Hubicka wrote:

> > Vladimir Makarov wrote:
> > 
> > >Ghassan Shobaki wrote:
> > >
> > >>Are there any documents describing the algorithm used in the 
> > >>superblock instruction scheduler?
> > >>
> > >I don't know one.
> > >
> > >>Does it use any (or a combination of) of published techniques such as 
> > >>critical path and speculative hedge and successive retirement ..etc? 
> > >>Or it just has its own algorithm?
> > >>
> > >>
> > >>
> > >It uses own algorithm which was grown from original haifa-scheduler.   
> > >Earlier it was one file which was divided.  Superblock scheduler uses 
> > >code of sched-deps.c and haifa-sched.c and directs them through a few 
> > >hooks.
> > >
> > >Generally speaking suberblock is believed to be a basic block to which 
> > >list scheduling is applied.  The superblock scheduler just checks that 
> > >the insn can be issued speculatively and prefer to issue more 
> > >frequently executed insns when the priority is the same (and now when 
> > >insn register weights are the same).  But calculation of insn 
> > >priorities does not take basic block frequencies (or belonging to 
> > >different basic blocks) into account.  So the algorithm is very simple.
> > >
> > >No more advanced approaches like heuristics based on critical path to 
> > >the last exit of superblock, dependence height and speculative yeild 
> > >(taking block excution probability into account when the insn priority 
> > >is calculated), sucessive retirment (preference of non-speculative 
> > >insn movement first), or speculative hedge aiming to achieve minimal 
> > >delay to all exits are used.
> > >
> > >So there are a lot of things to improve the code.  But it will be not 
> > >easy to add them because big part of code is used by the region based 
> > >scheduler too.
> > 
> > Sorry, I forgot too add that what I wrote is about extended basic block 
> > scheduler (file sched-ebb.c) which is used for Itanium as a default 
> > after the register allocation.  If you are intersting in Jan Hubicka's 
> > trace scheduler, I think that Jan's answer will be more competent.
> 
> I really didn't changed much in the algorithm.  All I was interested in
> was to make it work with CFG and plugged in the tail duplication pass.
> So your description is still valid.
> The code has little logic to avoid moving instructions too much up and
> adding some extra heuristics shall not be that dificult, but I didn't
> read the papers on topic very curefully :)
> 
> 
> Honza
> > 
> > Vlad
> > 
> 

  reply	other threads:[~2004-04-14 17:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-03  7:07 Superblock Instruction Scheduling " Ghassan Shobaki
2003-12-03 14:05 ` Vladimir N. Makarov
2003-12-04  0:13   ` Jan Hubicka
2003-12-04  1:30     ` Ghassan Shobaki
2003-12-04 10:49       ` Jan Hubicka
2003-12-04 17:40         ` Vladimir Makarov
2003-12-09 21:45     ` Ghassan Shobaki
2004-01-28  3:26     ` Superblock Instruction Scheduling in GCC 3.4 Ghassan Shobaki
2004-01-28 12:51       ` Jan Hubicka
2004-01-29 10:14         ` Ghassan Shobaki
2004-01-29 11:15           ` Jan Hubicka
2004-02-01 18:19             ` Ghassan Shobaki
2004-02-01 21:56               ` Jan Hubicka
2004-02-02  5:54                 ` Ghassan Shobaki
2004-02-10 18:58                 ` Superblock Scheduling Alg in GCC Ghassan Shobaki
2004-02-10 20:10                   ` Vladimir Makarov
2004-02-10 20:18                     ` Vladimir Makarov
2004-02-10 20:28                       ` Jan Hubicka
2004-04-14 17:40                         ` Ghassan Shobaki [this message]
2004-04-15  8:44                           ` Vladimir Makarov
2004-05-27 14:12                         ` Ghassan Shobaki

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=Pine.LNX.4.58.0404140929240.3355@hawking.ece.ucdavis.edu \
    --to=gshobaki@ece.ucdavis.edu \
    --cc=gcc-help@gcc.gnu.org \
    --cc=gcc@gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=jh@suse.cz \
    --cc=vmakarov@redhat.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).