aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2005-11-15 13:27:33 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2005-11-15 12:27:33 +0000
commitb4f32d07aa53d6831a12a7aabb1c74ee4e7ba269 (patch)
tree5444bc2a19f6cd64c6e05a03f3b4f3348997cbdc
parent4a60d778fa9157187c3504021935389e2f22fed8 (diff)
downloadgcc-b4f32d07aa53d6831a12a7aabb1c74ee4e7ba269.zip
gcc-b4f32d07aa53d6831a12a7aabb1c74ee4e7ba269.tar.gz
gcc-b4f32d07aa53d6831a12a7aabb1c74ee4e7ba269.tar.bz2
invoke.texi (large-unit-insns): Document.
* 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
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/doc/invoke.texi11
-rw-r--r--gcc/ipa-inline.c6
-rw-r--r--gcc/params.def4
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/winline-5.c2
6 files changed, 31 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a53ef42..6515936 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 2b71c96..1001c0e 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 9e42dcf..c16e947 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 af0fbdc..f585c39 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 4508da6..c9ae49d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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.
diff --git a/gcc/testsuite/gcc.dg/winline-5.c b/gcc/testsuite/gcc.dg/winline-5.c
index 20df786..57fa393 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)