This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Expression templates (ET) and optimizer for C++


Hi Olaf,

thanks for reporting your experience with compiling C++ code with expression
templates using my patch
http://gcc.gnu.org/ml/gcc/2001-08/msg01206.html

I wonder what happens there, because you report that in the end a lot of
small static inline functions do not get inlined.

First question: Is this with version 1 or 2 of my patch?
If it's with v1, then I fail to understand, because increasing the
-finline-limit-parameter then definitely should help.
So, I assume, it's with v2.

In that case, I got some ideas:
* We might increase the min size that I determind to be 130 (13 tree tokens)
  to a slightly larger value (say 150) and seee whether this makes those
  small functions always inlineable
* We may cut off this too early as well with max_inline_recursive * 64
  and should double or quadruple it
* We may decrease the slope of our function that is throttling inlining more
  and more from 1/16 to 1/64 and see what happens. This way, we probably
  still keep compilation resources within limits while not giving up so
  early with our inling efforts.

Can you try those two changes? Just change the min_inline resp. the 
max_curr in gcc/cp/optimize.c: inlinable_function_p () accordingly.

Did you compile with -finline-functions aka -O3? 
Please also check without then. 
-O2 always yields better results, if the author of the code did use
the inline keyword at all the appropriate places and I suspect Todd did.

Another question: Did you compare against 2.95.3, 3.0 and 3.0.1?
I'd like to be sure to not introduce regressions ...

Note that 2.96/97 do just do recursive inlining without limitations. Want
some little test code to have your compiler trigger OOM of your machine?

I'd be happy to get some results from you so we can tune the inlining
heuristics somewhat more.

Regards,
-- 
Kurt Garloff                   <kurt@garloff.de>         [Eindhoven, NL]
Physics: Plasma simulations  <K.Garloff@Phys.TUE.NL>  [TU Eindhoven, NL]
Linux: SCSI, Security          <garloff@suse.de>    [SuSE Nuernberg, DE]
 (See mail header or public key servers for PGP2 and GPG public keys.)

PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]