]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
invoke.texi (large-unit-insns): Document.
authorJan Hubicka <jh@suse.cz>
Tue, 15 Nov 2005 12:27:33 +0000 (13:27 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 15 Nov 2005 12:27:33 +0000 (12:27 +0000)
* invoke.texi (large-unit-insns): Document.
* ipa-inline.c (cgraph_decide_inlining): Use large-unit-insns param.
* params.def (large-unit-insns): New param.
* gcc.dg/winline-5.c: Add large-unit-insns limit.

From-SVN: r106948

gcc/ChangeLog
gcc/doc/invoke.texi
gcc/ipa-inline.c
gcc/params.def
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/winline-5.c

index a53ef4281ec081da71dee455e937d52070fb2940..6515936795c8e9a27ee7e7b8388d8608e97e4745 100644 (file)
@@ -1,3 +1,9 @@
+2005-11-15  Jan Hubicka  <jh@suse.cz>
+
+       * invoke.texi (large-unit-insns): Document.
+       * ipa-inline.c (cgraph_decide_inlining): Use large-unit-insns param.
+       * params.def (large-unit-insns): New param.
+
 2005-11-15  Hans-Peter Nilsson  <hp@axis.com>
 
        PR target/24869
index 2b71c96432c8c959298360cf615e5d27f5f0ca7c..1001c0e1aa61e9a59151838655f77e7a09e1f5f6 100644 (file)
@@ -5822,6 +5822,17 @@ This parameter is ignored when @option{-funit-at-a-time} is not used.
 The default value is 100 which limits large function growth to 2.0 times
 the original size.
 
+@item large-unit-insns
+The limit specifying large translation unit.  Growth caused by inlining of
+units larger than this limit is limited by @option{--param inline-unit-growth}.
+For small units this might be too tight (consider unit consisting of function A
+that is inline and B that just calls A three time.  If B is small relative to
+A, the growth of unit is 300\% and yet such inlining is very sane.  For very
+large units consisting of small inlininable functions however the overall unit
+growth limit is needed to avoid exponential explosion of code size.  Thus for
+smaller units, the size is increased to @option{--param large-unit-insns}
+before aplying @option{--param inline-unit-growth}.  The default is 10000
+
 @item inline-unit-growth
 Specifies maximal overall growth of the compilation unit caused by inlining.
 This parameter is ignored when @option{-funit-at-a-time} is not used.
index 9e42dcf701af599412d3f69407aafc34af974270..c16e9475a02657aab843fe1dfaffc5cd2b9c5db4 100644 (file)
@@ -877,7 +877,11 @@ cgraph_decide_inlining (void)
   overall_insns = initial_insns;
   gcc_assert (!max_count || (profile_info && flag_branch_probabilities));
 
-  max_insns = ((HOST_WIDEST_INT) overall_insns
+  max_insns = overall_insns;
+  if (max_insns < PARAM_VALUE (PARAM_LARGE_UNIT_INSNS))
+    max_insns = PARAM_VALUE (PARAM_LARGE_UNIT_INSNS);
+
+  max_insns = ((HOST_WIDEST_INT) max_insns
               * (100 + PARAM_VALUE (PARAM_INLINE_UNIT_GROWTH)) / 100);
 
   nnodes = cgraph_postorder (order);
index af0fbdcb3c12211c8e8e72121dae3092ae88b661..f585c39dd9821d69175a1e9096e2dfa287d01d6a 100644 (file)
@@ -179,6 +179,10 @@ DEFPARAM(PARAM_LARGE_FUNCTION_GROWTH,
         "large-function-growth",
         "Maximal growth due to inlining of large function (in percent)",
         100, 0, 0)
+DEFPARAM(PARAM_LARGE_UNIT_INSNS,
+        "large-unit-insns",
+        "The size of translation unit to be considered large",
+        10000, 0, 0)
 DEFPARAM(PARAM_INLINE_UNIT_GROWTH,
         "inline-unit-growth",
         "how much can given compilation unit grow because of the inlining (in percent)",
index 4508da6dd9c15984f65bf86f32bd2a363acd8aca..c9ae49db6c91a8e96e74db522f6553900723247b 100644 (file)
@@ -1,3 +1,7 @@
+2005-11-15  Jan Hubicka  <jh@suse.cz>
+
+       * gcc.dg/winline-5.c: Add large-unit-insns limit.
+
 2005-11-14  David Edelsohn  <edelsohn@gnu.org>
 
        * g++.dg/eh/simd-2.C: XFAIL on AIX and SPE.
index 20df786a7571e60d94231fe90d51d2b4313846e1..57fa3937e0ac8387ab26547bfeedc8dd4764450d 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-Winline -O2 --param inline-unit-growth=0" } */
+/* { dg-options "-Winline -O2 --param inline-unit-growth=0 --param large-unit-insns=0" } */
 
 void big (void);
 inline int q(void)