__attribute__((leafify))
Richard Guenther
rguenth@tat.physik.uni-tuebingen.de
Tue Jun 3 21:19:00 GMT 2003
Hi!
I'd like to push the issue around __attribute__((leafify)) a little. This
new attribute is due to performance requirements in scientific C++ codes.
With my personal application I get around 30% performance increase if used
on the math kernel functions.
So why is gcc bad at compiling math kernels? Because of missed inlining
oportunities we miss CSE/GCSE and loop optimizer oportunities. This is
bad. So we have a lot of knobs to tune for the inliner - but they affect
the whole program (which cannot be torn apart into pices for a lot of
uses of C++) and so slow down compilation a lot and increase binary size.
Also they dont manage to get the full performance.
There is precedence in at least one other compiler, namely the NEC SX4/5/6
C++ compiler that supports a "#pragma inline complete" with similar
semantics as proposed.
So what is this __attribute__((leafify))? Its a way to tell gcc to make
the marked function a leaf of the cfg, i.e. to inline every call made in
this function ignoring all inlining limits. A patch for mainline was
posted at
http://gcc.gnu.org/ml/gcc-patches/2003-05/msg01662.html
Comments sofar were solely (sorry, if I missed one) on the naming of the
attribute, not about its usefulness, its fitting into the existing
noinline and always_inline set or about the chance of acceptance into
either 3.4 or 3.3.1.
Comments?
Thanks, Richard.
More information about the Gcc
mailing list