From aa976da570b177e1a38dddbb3bf035c240bb415f Mon Sep 17 00:00:00 2001 From: hubicka Date: Tue, 15 Nov 2005 12:27:33 +0000 Subject: [PATCH] * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@106948 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/doc/invoke.texi | 11 +++++++++++ gcc/ipa-inline.c | 6 +++++- gcc/params.def | 4 ++++ gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/winline-5.c | 2 +- 6 files changed, 31 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a53ef4281ec..6515936795c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-11-15 Jan Hubicka + + * 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 PR target/24869 diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 2b71c96432c..1001c0e1aa6 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -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. diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 9e42dcf701a..c16e9475a02 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -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); diff --git a/gcc/params.def b/gcc/params.def index af0fbdcb3c1..f585c39dd98 100644 --- a/gcc/params.def +++ b/gcc/params.def @@ -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)", diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4508da6dd9c..c9ae49db6c9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2005-11-15 Jan Hubicka + + * gcc.dg/winline-5.c: Add large-unit-insns limit. + 2005-11-14 David Edelsohn * g++.dg/eh/simd-2.C: XFAIL on AIX and SPE. diff --git a/gcc/testsuite/gcc.dg/winline-5.c b/gcc/testsuite/gcc.dg/winline-5.c index 20df786a757..57fa3937e0a 100644 --- a/gcc/testsuite/gcc.dg/winline-5.c +++ b/gcc/testsuite/gcc.dg/winline-5.c @@ -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) -- 2.11.4.GIT