Reduce --param large-function-insns

Jan Hubicka jh@suse.cz
Tue Jan 13 01:33:00 GMT 2004


Hi,
as discussed in separate thread, setting large-function-insns parameter to
lower values has very positive effect on C++ compilation times.  The reason is
twofold: we avoid some quadratic behaviour of the compiler and it also
relatively effectivly cuts size of resunting binary.  Of course this is
the case of disabling inlining too, but the idea is that this way one
won't get many regressions.  The limit ensure that functions larger than
specified amount of insns won't grow more than twice by inlining in
belief that bloating bloated functions too much by inlining is not best
idea.

Andreas tested the flag for SPEC and I also did some testing on POOMA and the
scores seems to be just positive.  For SPEC I actually get better values with
large-function-insns=500 than with set to 10000, but that is probably just
random change (it comes from perl).

I propose this, rather conservative decrease of the limit.
I also tested linux kernel and after the other inlining change I sent,
there are just 4 functions hitting this limit, all of the pretty
bloated.

Honza

Size of binaries:
 164.gzip: Base: 62604 bytes
 164.gzip: Peak: 62604 bytes
 175.vpr: Base: 167322 bytes
 175.vpr: Peak: 167322 bytes
 176.gcc: Base: 1605961 bytes
 176.gcc: Peak: 1605193 bytes
 181.mcf: Base: 25525 bytes
 181.mcf: Peak: 25525 bytes
 186.crafty: Base: 224346 bytes
 186.crafty: Peak: 224346 bytes
 197.parser: Base: 143568 bytes
 197.parser: Peak: 143568 bytes
 252.eon: Base: 635177 bytes
 252.eon: Peak: 635177 bytes
 253.perlbmk: Base: 666949 bytes
 253.perlbmk: Peak: 666949 bytes
 254.gap: Base: 542358 bytes
 254.gap: Peak: 542358 bytes
 255.vortex: Base: 683474 bytes
 255.vortex: Peak: 683410 bytes
 256.bzip2: Base: 53888 bytes
 256.bzip2: Peak: 53888 bytes
 300.twolf: Base: 221391 bytes
 300.twolf: Peak: 221391 bytes
 =============================
 Total: Base: 5032563 bytes
 Total: Peak: 5031731 bytes

Compile times for benchmarks:
164.gzip base: 3 s
175.vpr base: 6 s
176.gcc base: 66 s
181.mcf base: 1 s
186.crafty base: 11 s
197.parser base: 5 s
252.eon base: 156 s
253.perlbmk base: 32 s
254.gap base: 23 s
255.vortex base: 22 s
256.bzip2 base: 2 s
300.twolf base: 13 s
164.gzip peak: 3 s
175.vpr peak: 6 s
176.gcc peak: 66 s
181.mcf peak: 1 s
186.crafty peak: 11 s
197.parser peak: 5 s
252.eon peak: 154 s
253.perlbmk peak: 32 s
254.gap peak: 23 s
255.vortex peak: 21 s
256.bzip2 peak: 1 s
300.twolf peak: 13 s
======================================
Total time for base compilation: 340 s
Total time for peak compilation: 336 s

GCC was configured as: configure --enable-threads=posix --enable-languages="c,c++,f77" --disable-multilib
GCC bootstrap times for 'make -j1 bootstrap && make install':
Base compiler: 1690 s
Peak compiler: 1679 s
   164.gzip          1400  179             781*     1400  178             787*
   175.vpr           1400  189             742*     1400  187             748*
   176.gcc           1100  113             977*     1100  112             979*
   181.mcf           1800  439             410*     1800  440             409*
   186.crafty        1000  71.8          1394*     1000  72.0          1390*
   197.parser        1800  323             557*     1800  323             558*
   252.eon                                   X                             X
   253.perlbmk       1800  182             991*     1800  181             993*
   254.gap           1100  144             762*     1100  144             763*
   255.vortex        1900  156            1218*     1900  157            1214*
   256.bzip2         1500  192             783*     1500  192             782*
   300.twolf         3000  368             814*     3000  370             811*
   Est. SPECint_base2000                  815
   Est. SPECint2000                                                     816
2004-01-13  Jan Hubicka  <jh@suse.cz>
	* params.def (large-function-insns): Set to 3000.
	* doc/invoke.texi (large-function-insns): Update documentation
Index: params.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/params.def,v
retrieving revision 1.33
diff -c -3 -p -r1.33 params.def
*** params.def	12 Jan 2004 09:44:13 -0000	1.33
--- params.def	13 Jan 2004 01:23:18 -0000
*************** DEFPARAM(PARAM_MAX_PENDING_LIST_LENGTH,
*** 110,116 ****
  DEFPARAM(PARAM_LARGE_FUNCTION_INSNS,
  	 "large-function-insns",
  	 "The size of function body to be considered large",
! 	 10000)
  DEFPARAM(PARAM_LARGE_FUNCTION_GROWTH,
  	 "large-function-growth",
  	 "Maximal growth due to inlining of large function (in percent)",
--- 110,116 ----
  DEFPARAM(PARAM_LARGE_FUNCTION_INSNS,
  	 "large-function-insns",
  	 "The size of function body to be considered large",
! 	 3000)
  DEFPARAM(PARAM_LARGE_FUNCTION_GROWTH,
  	 "large-function-growth",
  	 "Maximal growth due to inlining of large function (in percent)",
Index: doc/invoke.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/invoke.texi,v
retrieving revision 1.389
diff -c -3 -p -r1.389 invoke.texi
*** doc/invoke.texi	12 Jan 2004 09:44:16 -0000	1.389
--- doc/invoke.texi	13 Jan 2004 01:23:19 -0000
*************** limit inlining is constrained by @option
*** 4723,4729 ****
  This parameter is useful primarily to avoid extreme compilation time caused by non-linear
  algorithms used by the backend.
  This parameter is ignored when @option{-funit-at-a-time} is not used.
! The default value is 30000.
  
  @item large-function-growth
  Specifies maximal growth of large functtion caused by inlining in percents.
--- 4723,4729 ----
  This parameter is useful primarily to avoid extreme compilation time caused by non-linear
  algorithms used by the backend.
  This parameter is ignored when @option{-funit-at-a-time} is not used.
! The default value is 3000.
  
  @item large-function-growth
  Specifies maximal growth of large functtion caused by inlining in percents.



More information about the Gcc-patches mailing list