Re: Superblock Instruction Scheduling in GCC 3.4

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
> > >
>

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux