This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

GCC inline parameters (PR 10160 testcase)


I believe that we are about to ship 3.3 with a set of inline parameter
defaults that are way too agressive.  These can cause huge increases
in compilation time and memory over that with a more conservative
set of parameters.

This has been discussed before and Mark made some improvements.
However, PR 10160 hasn't been resolved and the problem with the
default inline parameter set remains.

For example, I see the following building xforms/Dialogs.C from
lyx-1.3.1 on hppa2.0-hp-hpux11.11:

		Current Inline Parameters	Patched Parameters
Compilation Time		~ 5 hours	       ~ 2 minutes
Max Resident Size		 ~ 650 MB		   ~ 60 MB
Stripped lyx Executable	          ~ 10 MB		    ~ 7 MB

On the PA, branches within functions become much less efficient when
the code size exceeds ~ 240KB.

The enclosed patch for 3.3 has been tested on hppa2.0-hp-hpux11.11 with
no regressions.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

2003-05-02  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	* params.def (PARAM_MAX_INLINE_INSNS_SINGLE,
	PARAM_MAX_INLINE_INSNS_AUTO): Default to 150.
	(PARAM_MAX_INLINE_INSNS): Default to 300.
	(PARAM_MIN_INLINE_INSNS): Default to 100.
	* doc/invoke.texi (max-inline-insns-single, max-inline-insns-auto,
	max-inline-insns, min-inline-insns): Update documentation.

Index: params.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/params.def,v
retrieving revision 1.18.2.3
diff -u -3 -p -r1.18.2.3 params.def
--- params.def	29 Apr 2003 14:31:46 -0000	1.18.2.3
+++ params.def	2 May 2003 15:31:19 -0000
@@ -39,7 +39,7 @@ Software Foundation, 59 Temple Place - S
    of a function counted in internal gcc instructions (not in
    real machine instructions) that is eligible for inlining
    by the tree inliner.
-   The default value is 300.
+   The default value is 150.
    Only functions marked inline (or methods defined in the class
    definition for C++) are affected by this, unless you set the
    -finline-functions (included in -O3) compiler option.
@@ -51,7 +51,7 @@ Software Foundation, 59 Temple Place - S
 DEFPARAM (PARAM_MAX_INLINE_INSNS_SINGLE,
 	  "max-inline-insns-single",
 	  "The maximum number of instructions in a single function eligible for inlining",
-	  300)
+	  150)
 
 /* The single function inlining limit for functions that are
    inlined by virtue of -finline-functions (-O3).
@@ -59,11 +59,11 @@ DEFPARAM (PARAM_MAX_INLINE_INSNS_SINGLE,
    that is applied to functions marked inlined (or defined in the
    class declaration in C++) given by the "max-inline-insns-single"
    parameter.
-   The default value is 300.  */
+   The default value is 150.  */
 DEFPARAM (PARAM_MAX_INLINE_INSNS_AUTO,
 	  "max-inline-insns-auto",
 	  "The maximum number of instructions when automatically inlining",
-	  300)
+	  150)
 
 /* The repeated inlining limit.  After this number of instructions 
    (in the internal gcc representation, not real machine instructions)
@@ -74,7 +74,7 @@ DEFPARAM (PARAM_MAX_INLINE_INSNS_AUTO,
    could otherwise become very high.
    It is recommended to set this value to twice the value of the single
    function limit (set by the "max-inline-insns-single" parameter) or
-   higher.  The default value is 600.
+   higher.  The default value is 300.
    Higher values mean that more inlining is done, resulting in
    better performance of the code, at the expense of higher 
    compile-time resource (time, memory) requirements and larger
@@ -82,7 +82,7 @@ DEFPARAM (PARAM_MAX_INLINE_INSNS_AUTO,
 DEFPARAM (PARAM_MAX_INLINE_INSNS,
 	  "max-inline-insns",
 	  "The maximum number of instructions by repeated inlining before gcc starts to throttle inlining",
-	  600)
+	  300)
 
 /* After the repeated inline limit has been exceeded (see
    "max-inline-insns" parameter), a linear function is used to
@@ -102,13 +102,13 @@ DEFPARAM (PARAM_MAX_INLINE_SLOPE,
    inlining for very small functions is still desirable to
    achieve good runtime performance.  The size of single functions 
    (measured in gcc instructions) which will still be eligible for 
-   inlining then is given by this parameter.  It defaults to 130.
+   inlining then is given by this parameter.  It defaults to 100.
    Only much later (after exceeding 128 times the recursive limit)
    inlining is cut down completely.  */
 DEFPARAM (PARAM_MIN_INLINE_INSNS,
 	  "min-inline-insns",
 	  "The number of instructions in a single functions still eligible to inlining after a lot recursive inlining",
-	  130)
+	  100)
 
 /* For languages that (still) use the RTL inliner, we can specify
    limits for the RTL inliner separately.
Index: doc/invoke.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/invoke.texi,v
retrieving revision 1.209.2.26
diff -u -3 -p -r1.209.2.26 invoke.texi
--- doc/invoke.texi	23 Apr 2003 21:45:32 -0000	1.209.2.26
+++ doc/invoke.texi	2 May 2003 17:34:05 -0000
@@ -3540,13 +3540,13 @@ as follows:
 
  @table @gcctabopt
  @item max-inline-insns
-  is set to @var{n}.
- @item max-inline-insns-single
   is set to @var{n}/2.
+ @item max-inline-insns-single
+  is set to @var{n}/4.
  @item max-inline-insns-auto
-  is set to @var{n}/2.
+  is set to @var{n}/4.
  @item min-inline-insns
-  is set to 130 or @var{n}/4, whichever is smaller.
+  is set to 100 or @var{n}/4, whichever is smaller.
  @item max-inline-insns-rtl
   is set to @var{n}.
  @end table
@@ -4311,7 +4311,7 @@ This number sets the maximum number of i
 internal representation) in a single function that the tree inliner 
 will consider for inlining.  This only affects functions declared
 inline and methods implemented in a class declaration (C++).
-The default value is 300.
+The default value is 150.
 
 @item max-inline-insns-auto
 When you use @option{-finline-functions} (included in @option{-O3}),
@@ -4319,7 +4319,7 @@ a lot of functions that would otherwise 
 by the compiler will be investigated.  To those functions, a different
 (more restrictive) limit compared to functions declared inline can
 be applied.
-The default value is 300.
+The default value is 150.
 
 @item max-inline-insns
 The tree inliner does decrease the allowable size for single functions 
@@ -4330,7 +4330,7 @@ Higher numbers result in better runtime 
 compile-time resource (CPU time, memory) requirements and result in
 larger binaries.  Very high values are not advisable, as too large
 binaries may adversely affect runtime performance.
-The default value is 600.
+The default value is 300.
 
 @item max-inline-slope
 After exceeding the maximum number of inlined instructions by repeated
@@ -4344,7 +4344,7 @@ The repeated inlining is throttled more 
 after exceeding the limit.  To avoid too much throttling, a minimum for
 this function is specified here to allow repeated inlining for very small
 functions even when a lot of repeated inlining already has been done.
-The default value is 130.
+The default value is 100.
 
 @item max-inline-insns-rtl
 For languages that use the RTL inliner (this happens at a later stage


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