This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Superblock Instruction Scheduling in GCC 3.4
- From: Ghassan Shobaki <gshobaki at ece dot ucdavis dot edu>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, gcc-help at gcc dot gnu dot org, "Vladimir N. Makarov" <vmakarov at redhat dot com>, gcc at gnu dot org
- Date: Sun, 1 Feb 2004 21:52:40 -0800 (PST)
- Subject: Re: Superblock Instruction Scheduling in GCC 3.4
- References: <Pine.GHP.4.58.0312022125060.26397@dante.ece.ucdavis.edu><3FCDEE2C.19E04DE3@redhat.com> <20031204000558.GD23084@atrey.karlin.mff.cuni.cz><Pine.GHP.4.58.0401271638150.25927@dante.ece.ucdavis.edu><20040128122317.GI8094@kam.mff.cuni.cz> <Pine.GHP.4.58.0401282211460.5040@dante.ece.ucdavis.edu><20040129101203.GB30883@atrey.karlin.mff.cuni.cz><Pine.GHP.4.58.0402010953470.22447@dante.ece.ucdavis.edu><20040201215520.GI30324@kam.mff.cuni.cz>
That explains the results the I am getting. Things make sense to me now.
Thank you very much!
-Ghassan
On Sun, 1 Feb 2004, Jan Hubicka wrote:
> >
> > Eventually, I will be doing profile-based experiments. However, at this
> > point I am interested in static probabilities because it is an easier option
> > that will allow me to get some initial results more quickly.
> > Now, my question is: when I used the f-branch-probablities switch without
> > doing profiling first, gcc still accepted it and generated some
> > superblocks. Were these invalid superblocks or what?
>
> With -fbranch-probabilities and no profile, GCC will assume that all the
> blocks were never executed and conclude that they are cold. This limits
> several algorithms to more or less optimize for size rather than speed.
> So if you want traces based on static predictions, you should be using
> -fguess-branch-probability (default by -O2) and not
> -fbranch-probabilities.
>
> Honza
> >
> > Thanks
> >
> > -Ghassan
> >
> >
> > On Thu, 29 Jan 2004, Jan Hubicka wrote:
> >
> > > >
> > > > Ok, I have just verified that gcc DOES accept the -fsched2-use-tracer and
> > > > invoke the ebb scheduler as expected. However, it does not set the
> > > > flag_branch_probabilities automatically. It only sets it when I
> > > > explicitly use the -fbranch-probabilities command-line switch. Here are
> > > > the two cases that I have tried:
> > > >
> > > > g++ -O3 -fsched2-use-traces
> > > > Generates ~151K superblocks on my benchmark suite with lots of large
> > > > superblocks that include 10 basic blocks or more
> > > >
> > > > g++ -O3 -fsched2-use-traces -fbranch-probabilities
> > > > Generates only ~123K superblocks on my benchmark suite with the vast
> > > > majority of superblocks consisting of less than 10 basic blocks
> > >
> > > -fbranch-probabilities can be accpeted only when program has been
> > > earlier profiled. GCC does have logic for statically guessing the
> > > branch outcomes when these are not available
> > > (-fguess-branch-probability) so the superblocks can be built, just they
> > > are inferrior to those built with feedback available.
> > > >
> > > > So, the question is: Why did the compiler generate more superblocks
> > > > when branch probabilities were not computed? Do the superblocks generated
> > > > in that case make any sense?
> > > > And the bottom line question for me is: which setting should I use in my
> > > > research on superblocks?
> > >
> > > It is always better to use the profile, so I would recommend you
> > > -fbranch-probabilities unless you are interested in experiments with
> > > static prediction algorithms.
> > >
> > > Honza
> > >
>