Re: Kernel GCC Optimizations

From: Joao Seabra (seabra@aac.uc.pt)
Date: Sun Dec 22 2002 - 08:23:08 EST


On Sat, 21 Dec 2002, Zack Weinberg wrote:

>
> > > So, let's make it -O6 per default for 2.7.x/3.1.x?
> >
> > A higher -O setting does not necessarily mean better performance -
> > loop unrolling is one compiler optimisation that I *think* is
> > performed by GCC at high -O settings, and that *often* causes code to
> > be slower.
>
> In all official releases of GCC, -Ox, x >= 4, has exactly the same
> effect as -O3. This is unlikely to change anytime soon.
>
> -O3 enables exactly two optimizations relative to -O2:
> -finline-functions and -frename-registers. This may or may not change
> in the future. It does *not* enable loop unrolling. -finline-functions
> is almost always a major performance loss, because it makes the code
> huge and blows out the I-cache. I'm not familiar with the performance
> effects of -frename-registers; it might be worth experimenting with
> just that switch.
>

 Why do I see all the time using >O3 when in the gcc man/docs they say the
max Ox is 3 and above that it is assumed that is O3?
 -finline-functions makes a difference in C++ 8) but the number of inline
functions can be defined with finline-limit.Could you be more specific
about the major performance loss?

 Rename registers from the gcc 3.2 man:
"Attempt to avoid false dependencies in scheduled code by making
          use of registers left over after register allocation. This
          optimization will most benefit processors with lots of
          registers. It can, however, make debugging impossible, since
          variables will no longer stay in a "home register"."

 Making debugging impossible could be a problem in the kernel apart from
the performance :)

 Best Regards,

 Joao Seabra

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Dec 23 2002 - 22:00:30 EST