]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ipa-inline.c (inline_small_functions): Account only non-cold functions.
authorJan Hubicka <hubicka@ucw.cz>
Thu, 17 Apr 2014 18:35:54 +0000 (20:35 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Thu, 17 Apr 2014 18:35:54 +0000 (18:35 +0000)
* ipa-inline.c (inline_small_functions): Account only non-cold
functions.
* doc/invoke.texi (inline-unit-growth): Update documentation.

From-SVN: r209490

gcc/ChangeLog
gcc/doc/invoke.texi
gcc/ipa-inline.c

index 11df5164e0ad9d478daf2e7184a146e676b7365f..b9874c0c9d507e7d44a0d1cdbbf0f567e21419ab 100644 (file)
@@ -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.
index 3fdfeb9571d92986b36a7e7d3c2d153be677d2f8..8004da86f4f50b7126c28af30669b3055244121e 100644 (file)
@@ -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
index 83a836a12116c40becfda3a48f2c461bb94dd564..e8f03be397b86c862134c8b8658c022f2d5bf059 100644 (file)
@@ -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)