diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2014-04-17 20:35:54 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2014-04-17 18:35:54 +0000 |
commit | 5e750dc69f9e2580bed0d45bd0383622cc272b39 (patch) | |
tree | d9d58ac41ea36e27fed4e20250e6280a4154de93 | |
parent | 32337f1014e18221050f034723d3b75f2b08c908 (diff) | |
download | gcc-5e750dc69f9e2580bed0d45bd0383622cc272b39.zip gcc-5e750dc69f9e2580bed0d45bd0383622cc272b39.tar.gz gcc-5e750dc69f9e2580bed0d45bd0383622cc272b39.tar.bz2 |
ipa-inline.c (inline_small_functions): Account only non-cold functions.
* ipa-inline.c (inline_small_functions): Account only non-cold
functions.
* doc/invoke.texi (inline-unit-growth): Update documentation.
From-SVN: r209490
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/doc/invoke.texi | 3 | ||||
-rw-r--r-- | gcc/ipa-inline.c | 5 |
3 files changed, 12 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 11df516..b9874c0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-04-17 Jan Hubicka <hubicka@ucw.cz> + + * ipa-inline.c (inline_small_functions): Account only non-cold + functions. + * doc/invoke.texi (inline-unit-growth): Update documentation. + 2014-04-17 Pat Haugen <pthaugen@us.ibm.com> * config/rs6000/rs6000.md (addti3, subti3): New. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 3fdfeb9..8004da8 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -9409,7 +9409,8 @@ before applying @option{--param inline-unit-growth}. The default is 10000. @item inline-unit-growth Specifies maximal overall growth of the compilation unit caused by inlining. The default value is 30 which limits unit growth to 1.3 times the original -size. +size. Cold functions (either marked cold via an attribibute or by profile +feedback) are not accounted into the unit size. @item ipcp-unit-growth Specifies maximal overall growth of the compilation unit caused by diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 83a836a..e8f03be 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -1585,7 +1585,10 @@ inline_small_functions (void) struct inline_summary *info = inline_summary (node); struct ipa_dfs_info *dfs = (struct ipa_dfs_info *) node->aux; - if (!DECL_EXTERNAL (node->decl)) + /* Do not account external functions, they will be optimized out + if not inlined. Also only count the non-cold portion of program. */ + if (!DECL_EXTERNAL (node->decl) + && node->frequency != NODE_FREQUENCY_UNLIKELY_EXECUTED) initial_size += info->size; info->growth = estimate_growth (node); if (dfs && dfs->next_cycle) |