invoke.texi (max-inline-insns-small): New parameters.
authorJan Hubicka <hubicka@ucw.cz>
Sat, 5 Jan 2019 22:47:24 +0000 (23:47 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 5 Jan 2019 22:47:24 +0000 (22:47 +0000)
* doc/invoke.texi (max-inline-insns-small): New parameters.
* ipa-inline.c (want_early_inline_function_p): simplify.
(want_inline_small_function_p): Fix pasto from previous patch;
use max-inline-insns-small bound.
* params.def (max-inline-insns-small): New param.
* ipa-fnsummary.c (analyze_function_body): Initialize time/size
variables correctly.

From-SVN: r267603

gcc/ChangeLog
gcc/doc/invoke.texi
gcc/ipa-fnsummary.c
gcc/ipa-inline.c
gcc/params.def
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/ipa/ipcp-2.c

index 1cf9aae3781af388f6457b51ac34c2ed191c3383..a231aeea3567f4c2a9d4af7c51c7f5680d192933 100644 (file)
@@ -1,3 +1,13 @@
+2019-01-05  Jan Hubicka  <hubicka@ucw.cz>
+
+       * doc/invoke.texi (max-inline-insns-small): New parameters.
+       * ipa-inline.c (want_early_inline_function_p): simplify.
+       (want_inline_small_function_p): Fix pasto from previous patch;
+       use max-inline-insns-small bound.
+       * params.def (max-inline-insns-small): New param.
+       * ipa-fnsummary.c (analyze_function_body): Initialize time/size
+       variables correctly.
+
 2019-01-05  Jan Hubicka  <hubicka@ucw.cz>
 
        * doc/invoke.texi: Document max-inline-insns-size,
index 3501a62abb4bbb83f8124250b3cc808cd52587da..0706db60e11f867e7cd6579e10957eb76956ee73 100644 (file)
@@ -11007,6 +11007,10 @@ by the compiler are investigated.  To those functions, a different
 (more restrictive) limit compared to functions declared inline can
 be applied.
 
+@item max-inline-insns-small
+This is bound applied to calls which are considered relevant with
+@option{-finline-small-functions}.
+
 @item max-inline-insns-size
 This is bound applied to calls which are optimized for size. Small growth
 may be desirable to anticipate optimization oppurtunities exposed by inlining.
index 1f5ff98782573fcaff8a32a6493bbeab78c36ad8..6bc9cb3c57fd4af6994a549d6f9d18bd8b33689e 100644 (file)
@@ -1969,9 +1969,9 @@ fp_expression_p (gimple *stmt)
 static void
 analyze_function_body (struct cgraph_node *node, bool early)
 {
-  sreal time = 0;
+  sreal time = PARAM_VALUE (PARAM_UNINLINED_FUNCTION_TIME);
   /* Estimate static overhead for function prologue/epilogue and alignment. */
-  int size = 2;
+  int size = PARAM_VALUE (PARAM_UNINLINED_FUNCTION_INSNS);
   /* Benefits are scaled by probability of elimination that is in range
      <0,2>.  */
   basic_block bb;
index b51e2282cc712fa3055f9df54c78aace6695bbd6..73da38c78599aacedf4692266218c6e2a4da4d23 100644 (file)
@@ -637,8 +637,7 @@ want_early_inline_function_p (struct cgraph_edge *e)
 
       if (growth <= PARAM_VALUE (PARAM_MAX_INLINE_INSNS_SIZE))
        ;
-      else if (!e->maybe_hot_p ()
-              && growth > 0)
+      else if (!e->maybe_hot_p ())
        {
          if (dump_enabled_p ())
            dump_printf_loc (MSG_MISSED_OPTIMIZATION, e->call_stmt,
@@ -791,7 +790,7 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report)
       ipa_hints hints = estimate_edge_hints (e);
       int big_speedup = -1; /* compute this lazily */
 
-      if (growth <= PARAM_VALUE (PARAM_VALUE (PARAM_MAX_INLINE_INSNS_SIZE)))
+      if (growth <= PARAM_VALUE (PARAM_MAX_INLINE_INSNS_SIZE))
        ;
       /* Apply MAX_INLINE_INSNS_SINGLE limit.  Do not do so when
         hints suggests that inlining given function is very profitable.  */
@@ -809,9 +808,8 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report)
          want_inline = false;
        }
       else if (!DECL_DECLARED_INLINE_P (callee->decl)
-              && (in_lto_p
-                  && growth >= PARAM_VALUE (PARAM_EARLY_INLINING_INSNS))
-              && !opt_for_fn (e->caller->decl, flag_inline_functions))
+              && !opt_for_fn (e->caller->decl, flag_inline_functions)
+              && growth >= PARAM_VALUE (PARAM_MAX_INLINE_INSNS_SMALL))
        {
          /* growth_likely_positive is expensive, always test it last.  */
           if (growth >= MAX_INLINE_INSNS_SINGLE
index b89b475ca96327193c4043ec18844cf49bb2b8f5..0e08db2fe3749bb2902c384276f9733a1b7000cd 100644 (file)
@@ -83,6 +83,11 @@ DEFPARAM (PARAM_MAX_INLINE_INSNS_AUTO,
          "The maximum number of instructions when automatically inlining.",
          30, 0, 0)
 
+DEFPARAM (PARAM_MAX_INLINE_INSNS_SMALL,
+         "max-inline-insns-small",
+         "The maximum number of instructions when automatically inlining small functions.",
+         0, 0, 0)
+
 DEFPARAM (PARAM_MAX_INLINE_INSNS_SIZE,
          "max-inline-insns-size",
          "The maximum number of instructions when inlining for size.",
index fe449c2861c56981c2de44985e593ffd09fd0242..bbc65cb16736f88dd324b4c5cec00c00cde1e15c 100644 (file)
@@ -1,3 +1,7 @@
+2019-01-05  Jan Hubicka  <hubicka@ucw.cz>
+
+       * gcc.dg/ipa/ipcp-2.c: Update bounds.
+
 2019-01-05  Dominique d'Humieres  <dominiq@gcc.gnu.org>
 
        * gcc.dg/plugin/plugindir1.c: Adjust dg-prune-output for Darwin.
index 6b6fc4e4318a842e6fbdc51e162a4785eb7f106e..74b2c03103e37037a7cdc4288a2ea2e4625fc19b 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining --param ipa-cp-eval-threshold=80"  } */
+/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining --param ipa-cp-eval-threshold=200"  } */
 /* { dg-add-options bind_pic_locally } */
 
 extern int get_stuff (int);