invoke.texi (early-inlining-insns-O2): Document.
authorJan Hubicka <hubicka@ucw.cz>
Tue, 1 Oct 2019 16:58:35 +0000 (18:58 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 1 Oct 2019 16:58:35 +0000 (16:58 +0000)
* doc/invoke.texi (early-inlining-insns-O2): Document.
(early-inlining-insns): Update.
* params.def (early-inlining-insns-O2): New bound.
(early-inlining-insns): Update docs.
* ipa-inline.c (want_early_inline_function_p): Use new bound.

* g++.dg/tree-ssa/pr61034.C: Set early-inlining-insns-O2=14.
* g++.dg/tree-ssa/pr8781.C: Likewise.
* g++.dg/warn/Wstringop-truncation-1.C: Likewise.
* gcc.dg/ipa/pr63416.c: likewise.
* gcc.dg/vect/pr66142.c: Likewise.
* gcc.dg/tree-ssa/ssa-thread-12.c: Mark compure_idf inline.

From-SVN: r276416

gcc/ChangeLog
gcc/doc/invoke.texi
gcc/ipa-inline.c
gcc/params.def
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tree-ssa/pr61034.C
gcc/testsuite/g++.dg/tree-ssa/pr8781.C
gcc/testsuite/g++.dg/warn/Wstringop-truncation-1.C
gcc/testsuite/gcc.dg/ipa/pr63416.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-thread-12.c
gcc/testsuite/gcc.dg/vect/pr66142.c

index bb4de20ab160caf0caf4b6031e50906dee1a6c93..b4c4292c299abbb712bd461169ad59e2d604faae 100644 (file)
@@ -1,3 +1,11 @@
+2019-10-01  Jan Hubicka  <hubicka@ucw.cz>
+
+       * doc/invoke.texi (early-inlining-insns-O2): Document.
+       (early-inlining-insns): Update.
+       * params.def (early-inlining-insns-O2): New bound.
+       (early-inlining-insns): Update docs.
+       * ipa-inline.c (want_early_inline_function_p): Use new bound.
+
 2019-10-01  Oleg Endo  <olegendo@gcc.gnu.org>
 
        PR target/88562
index 83016a5a8eebcd5b044a088061afd1f58eed03e1..4281ee7c61428f5c9bb62f7cb986bbe12b5576aa 100644 (file)
@@ -11291,9 +11291,17 @@ recursion depth can be guessed from the probability that function recurses
 via a given call expression.  This parameter limits inlining only to call
 expressions whose probability exceeds the given threshold (in percents).
 
+@item early-inlining-insns-O2
+Specify growth that the early inliner can make.  In effect it increases
+the amount of inlining for code having a large abstraction penalty.
+This is applied to functions compiled with @option{-O1} or @option{-O2}
+optimization levels.
+
 @item early-inlining-insns
 Specify growth that the early inliner can make.  In effect it increases
 the amount of inlining for code having a large abstraction penalty.
+This is applied to functions compiled with @option{-O3} or @option{-Ofast}
+optimization levels.
 
 @item max-early-inliner-iterations
 Limit of iterations of the early inliner.  This basically bounds
index b62d280eb2587ac95e006bc47e448785e3ecdbb0..c8689c7d9a8b494ad4aeea637329120cb5ac4398 100644 (file)
@@ -641,6 +641,10 @@ want_early_inline_function_p (struct cgraph_edge *e)
     {
       int growth = estimate_edge_growth (e);
       int n;
+      int early_inlining_insns = opt_for_fn (e->caller->decl, optimize) >= 3
+                                ? PARAM_VALUE (PARAM_EARLY_INLINING_INSNS)
+                                : PARAM_VALUE (PARAM_EARLY_INLINING_INSNS_O2);
+
 
       if (growth <= PARAM_VALUE (PARAM_MAX_INLINE_INSNS_SIZE))
        ;
@@ -654,26 +658,28 @@ want_early_inline_function_p (struct cgraph_edge *e)
                             growth);
          want_inline = false;
        }
-      else if (growth > PARAM_VALUE (PARAM_EARLY_INLINING_INSNS))
+      else if (growth > early_inlining_insns)
        {
          if (dump_enabled_p ())
            dump_printf_loc (MSG_MISSED_OPTIMIZATION, e->call_stmt,
                             "  will not early inline: %C->%C, "
-                            "growth %i exceeds --param early-inlining-insns\n",
-                            e->caller, callee,
-                            growth);
+                            "growth %i exceeds --param early-inlining-insns%s\n",
+                            e->caller, callee, growth,
+                            opt_for_fn (e->caller->decl, optimize) >= 3
+                            ? "" : "-O2");
          want_inline = false;
        }
       else if ((n = num_calls (callee)) != 0
-              && growth * (n + 1) > PARAM_VALUE (PARAM_EARLY_INLINING_INSNS))
+              && growth * (n + 1) > early_inlining_insns)
        {
          if (dump_enabled_p ())
            dump_printf_loc (MSG_MISSED_OPTIMIZATION, e->call_stmt,
                             "  will not early inline: %C->%C, "
-                            "growth %i exceeds --param early-inlining-insns "
+                            "growth %i exceeds --param early-inlining-insns%s "
                             "divided by number of calls\n",
-                            e->caller, callee,
-                            growth);
+                            e->caller, callee, growth,
+                            opt_for_fn (e->caller->decl, optimize) >= 3
+                            ? "" : "-O2");
          want_inline = false;
        }
     }
index d2d957fc6b1552df8785e1b91fef05407acd6e54..0acf29b6c4dac55f96cfd2db4e8e3ca644fc5479 100644 (file)
@@ -233,8 +233,12 @@ DEFPARAM(PARAM_IPCP_UNIT_GROWTH,
         10, 0, 0)
 DEFPARAM(PARAM_EARLY_INLINING_INSNS,
         "early-inlining-insns",
-        "Maximal estimated growth of function body caused by early inlining of single call.",
+        "Maximal estimated growth of function body caused by early inlining of single call with -O3 and -Ofast.",
         14, 0, 0)
+DEFPARAM(PARAM_EARLY_INLINING_INSNS_O2,
+        "early-inlining-insns-O2",
+        "Maximal estimated growth of function body caused by early inlining of single call with -O1 and -O2.",
+        6, 0, 0)
 DEFPARAM(PARAM_LARGE_STACK_FRAME,
         "large-stack-frame",
         "The size of stack frame to be considered large.",
index df6105f3d13f51b60874c6dae1b6e12c13d7084b..0dcaf4b62925ec975af4d416cad366719b76e610 100644 (file)
@@ -1,3 +1,12 @@
+2019-10-01  Jan Hubicka  <hubicka@ucw.cz>
+
+       * g++.dg/tree-ssa/pr61034.C: Set early-inlining-insns-O2=14.
+       * g++.dg/tree-ssa/pr8781.C: Likewise.
+       * g++.dg/warn/Wstringop-truncation-1.C: Likewise.
+       * gcc.dg/ipa/pr63416.c: likewise.
+       * gcc.dg/vect/pr66142.c: Likewise.
+       * gcc.dg/tree-ssa/ssa-thread-12.c: Mark compure_idf inline.
+
 2019-10-01  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/91925
index 870b23721668dd3c106dbeafc5d2e8b922730acc..2e3dfecacb4a06daa713b4017c895528fb1634d3 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do compile }
-// { dg-options "-O2 -fdump-tree-fre3 -fdump-tree-optimized -fdelete-null-pointer-checks" }
+// { dg-options "-O2 -fdump-tree-fre3 -fdump-tree-optimized -fdelete-null-pointer-checks --param early-inlining-insns-O2=14" }
 
 #define assume(x) if(!(x))__builtin_unreachable()
 
index 1f115b2b26d10075bb7358c470c6036eeebe0823..5bc1ef0352052a41b962f36765983af0686bd2ef 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O -fno-tree-sra -fdump-tree-fre1" } */
+/* { dg-options "-O -fno-tree-sra -fdump-tree-fre1 --param early-inlining-insns-O2=14" } */
 
 int f();
 
index 83066019772e6eadc548afb3ee30a29c88336956..49dde0a65ba669fccefe295f19952d6b8cf5373d 100644 (file)
@@ -1,7 +1,7 @@
 /* PR/tree-optimization/84480 - bogus -Wstringop-truncation despite
    assignment with an inlined string literal
    { dg-do compile }
-   { dg-options "-O2 -Wstringop-truncation" }  */
+   { dg-options "-O2 -Wstringop-truncation --param early-inlining-insns-O2=14" }  */
 
 #include <string.h>
 
index b5374c51fe9293fd38ca3c7ab836c81b5d890ece..5873954fba302173fa72728af503379dfe1abdef 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-optimized"  } */
+/* { dg-options "-O2 -fdump-tree-optimized --param early-inlining-insns-O2=14"  } */
 #define _UNUSED_ __attribute__((__unused__))
 
 typedef int TEST_F30 (int *v);
index 67526762f2c1aa98f333e1a5fbd9fc346d3e66f4..216de23d791b93e257f80c97e6736a305a86970d 100644 (file)
@@ -56,7 +56,7 @@ bmp_iter_and_compl (bitmap_iterator * bi, unsigned *bit_no)
 }
 
 extern int VEC_int_base_length (VEC_int_base *);
-bitmap
+inline bitmap
 compute_idf (bitmap def_blocks, bitmap_head * dfs)
 {
   bitmap_iterator bi;
index 8c79f290767ae7d3a46a9e25d88c8ee8eaab2b24..a0316f1f01ec002dd92e1d614ab8ee9ff2fc01d4 100644 (file)
@@ -1,6 +1,6 @@
 /* PR middle-end/66142 */
 /* { dg-do compile } */
-/* { dg-additional-options "-ffast-math -fopenmp-simd" } */
+/* { dg-additional-options "-ffast-math -fopenmp-simd --param early-inlining-insns-O2=14" } */
 /* { dg-additional-options "-mavx" { target avx_runtime } } */
 
 struct A { float x, y; };