@@ -70,12 +70,8 @@ DEFCIFCODE(LARGE_STACK_FRAME_GROWTH_LIMIT, CIF_FINAL_NORMAL,
N_("--param large-stack-frame-growth limit reached"))
DEFCIFCODE(MAX_INLINE_INSNS_SINGLE_LIMIT, CIF_FINAL_NORMAL,
N_("--param max-inline-insns-single limit reached"))
-DEFCIFCODE(MAX_INLINE_INSNS_SINGLE_O2_LIMIT, CIF_FINAL_NORMAL,
- N_("--param max-inline-insns-single-O2 limit reached"))
DEFCIFCODE(MAX_INLINE_INSNS_AUTO_LIMIT, CIF_FINAL_NORMAL,
N_("--param max-inline-insns-auto limit reached"))
-DEFCIFCODE(MAX_INLINE_INSNS_AUTO_O2_LIMIT, CIF_FINAL_NORMAL,
- N_("--param max-inline-insns-auto-O2 limit reached"))
DEFCIFCODE(INLINE_UNIT_GROWTH_LIMIT, CIF_FINAL_NORMAL,
N_("--param inline-unit-growth limit reached"))
@@ -393,44 +393,24 @@ can_inline_edge_p (struct cgraph_edge *e, bool report,
scale up the bound. */
static int
-inline_insns_single (cgraph_node *n, bool hint)
+inline_insns_single (bool hint)
{
- if (opt_for_fn (n->decl, optimize) >= 3)
- {
- if (hint)
- return param_max_inline_insns_single
- * param_inline_heuristics_hint_percent / 100;
- return param_max_inline_insns_single;
- }
- else
- {
- if (hint)
- return param_max_inline_insns_single_o2
- * param_inline_heuristics_hint_percent_o2 / 100;
- return param_max_inline_insns_single_o2;
- }
+ if (hint)
+ return param_max_inline_insns_single
+ * param_inline_heuristics_hint_percent / 100;
+ return param_max_inline_insns_single;
}
/* Return inlining_insns_auto limit for function N. If HINT is true
scale up the bound. */
static int
-inline_insns_auto (cgraph_node *n, bool hint)
+inline_insns_auto (bool hint)
{
- if (opt_for_fn (n->decl, optimize) >= 3)
- {
- if (hint)
- return param_max_inline_insns_auto
- * param_inline_heuristics_hint_percent / 100;
- return param_max_inline_insns_auto;
- }
- else
- {
- if (hint)
- return param_max_inline_insns_auto_o2
- * param_inline_heuristics_hint_percent_o2 / 100;
- return param_max_inline_insns_auto_o2;
- }
+ if (hint)
+ return param_max_inline_insns_auto
+ * param_inline_heuristics_hint_percent / 100;
+ return param_max_inline_insns_auto;
}
/* Decide if we can inline the edge and possibly update
@@ -575,8 +555,8 @@ can_inline_edge_by_limits_p (struct cgraph_edge *e, bool report,
int growth = estimate_edge_growth (e);
if (growth > param_max_inline_insns_size
&& (!DECL_DECLARED_INLINE_P (callee->decl)
- && growth >= MAX (inline_insns_single (caller, false),
- inline_insns_auto (caller, false))))
+ && growth >= MAX (inline_insns_single (false),
+ inline_insns_auto (false))))
{
e->inline_failed = CIF_OPTIMIZATION_MISMATCH;
inlinable = false;
@@ -684,10 +664,7 @@ 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_early_inlining_insns
- : param_early_inlining_insns_o2;
-
+ int early_inlining_insns = param_early_inlining_insns;
if (growth <= param_max_inline_insns_size)
;
@@ -789,12 +766,7 @@ big_speedup_p (struct cgraph_edge *e)
sreal freq = e->sreal_frequency ();
sreal time = compute_uninlined_call_time (e, unspec_time, freq);
sreal inlined_time = compute_inlined_call_time (e, spec_time, freq);
- cgraph_node *caller = (e->caller->inlined_to
- ? e->caller->inlined_to
- : e->caller);
- int limit = opt_for_fn (caller->decl, optimize) >= 3
- ? param_inline_min_speedup
- : param_inline_min_speedup_o2;
+ int limit = param_inline_min_speedup;
if ((time - inlined_time) * 100 > time * limit)
return true;
@@ -828,28 +800,20 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report)
&& (!e->count.ipa ().initialized_p () || !e->maybe_hot_p ()))
&& ipa_fn_summaries->get (callee)->min_size
- ipa_call_summaries->get (e)->call_stmt_size
- > inline_insns_auto (e->caller, true))
+ > inline_insns_auto (true))
{
- if (opt_for_fn (e->caller->decl, optimize) >= 3)
- e->inline_failed = CIF_MAX_INLINE_INSNS_AUTO_LIMIT;
- else
- e->inline_failed = CIF_MAX_INLINE_INSNS_AUTO_O2_LIMIT;
+ e->inline_failed = CIF_MAX_INLINE_INSNS_AUTO_LIMIT;
want_inline = false;
}
else if ((DECL_DECLARED_INLINE_P (callee->decl)
|| e->count.ipa ().nonzero_p ())
&& ipa_fn_summaries->get (callee)->min_size
- ipa_call_summaries->get (e)->call_stmt_size
- > inline_insns_single (e->caller, true))
+ > inline_insns_single (true))
{
- if (opt_for_fn (e->caller->decl, optimize) >= 3)
- e->inline_failed = (DECL_DECLARED_INLINE_P (callee->decl)
- ? CIF_MAX_INLINE_INSNS_SINGLE_LIMIT
- : CIF_MAX_INLINE_INSNS_AUTO_LIMIT);
- else
- e->inline_failed = (DECL_DECLARED_INLINE_P (callee->decl)
- ? CIF_MAX_INLINE_INSNS_SINGLE_O2_LIMIT
- : CIF_MAX_INLINE_INSNS_AUTO_O2_LIMIT);
+ e->inline_failed = (DECL_DECLARED_INLINE_P (callee->decl)
+ ? CIF_MAX_INLINE_INSNS_SINGLE_LIMIT
+ : CIF_MAX_INLINE_INSNS_AUTO_LIMIT);
want_inline = false;
}
else
@@ -868,15 +832,12 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report)
Avoid computation of big_speedup_p when not necessary to change
outcome of decision. */
else if (DECL_DECLARED_INLINE_P (callee->decl)
- && growth >= inline_insns_single (e->caller, apply_hints)
+ && growth >= inline_insns_single (apply_hints)
&& (apply_hints
- || growth >= inline_insns_single (e->caller, true)
+ || growth >= inline_insns_single (true)
|| !big_speedup_p (e)))
{
- if (opt_for_fn (e->caller->decl, optimize) >= 3)
- e->inline_failed = CIF_MAX_INLINE_INSNS_SINGLE_LIMIT;
- else
- e->inline_failed = CIF_MAX_INLINE_INSNS_SINGLE_O2_LIMIT;
+ e->inline_failed = CIF_MAX_INLINE_INSNS_SINGLE_LIMIT;
want_inline = false;
}
else if (!DECL_DECLARED_INLINE_P (callee->decl)
@@ -884,7 +845,7 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report)
&& growth >= param_max_inline_insns_small)
{
/* growth_positive_p is expensive, always test it last. */
- if (growth >= inline_insns_single (e->caller, false)
+ if (growth >= inline_insns_single (false)
|| growth_positive_p (callee, e, growth))
{
e->inline_failed = CIF_NOT_DECLARED_INLINED;
@@ -894,25 +855,22 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report)
/* Apply param_max_inline_insns_auto limit for functions not declared
inline. Bypass the limit when speedup seems big. */
else if (!DECL_DECLARED_INLINE_P (callee->decl)
- && growth >= inline_insns_auto (e->caller, apply_hints)
+ && growth >= inline_insns_auto (apply_hints)
&& (apply_hints
- || growth >= inline_insns_auto (e->caller, true)
+ || growth >= inline_insns_auto (true)
|| !big_speedup_p (e)))
{
/* growth_positive_p is expensive, always test it last. */
- if (growth >= inline_insns_single (e->caller, false)
+ if (growth >= inline_insns_single (false)
|| growth_positive_p (callee, e, growth))
{
- if (opt_for_fn (e->caller->decl, optimize) >= 3)
- e->inline_failed = CIF_MAX_INLINE_INSNS_AUTO_LIMIT;
- else
- e->inline_failed = CIF_MAX_INLINE_INSNS_AUTO_O2_LIMIT;
+ e->inline_failed = CIF_MAX_INLINE_INSNS_AUTO_LIMIT;
want_inline = false;
}
}
/* If call is cold, do not inline when function body would grow. */
else if (!e->maybe_hot_p ()
- && (growth >= inline_insns_single (e->caller, false)
+ && (growth >= inline_insns_single (false)
|| growth_positive_p (callee, e, growth)))
{
e->inline_failed = CIF_UNLIKELY_CALL;
@@ -1220,8 +1178,8 @@ edge_badness (struct cgraph_edge *edge, bool dump)
&& caller_info->inlinable
&& ipa_size_summaries->get (caller)->size
< (DECL_DECLARED_INLINE_P (caller->decl)
- ? inline_insns_single (caller, false)
- : inline_insns_auto (caller, false)))
+ ? inline_insns_single (false)
+ : inline_insns_auto (false)))
{
if (dump)
fprintf (dump_file,
@@ -388,7 +388,8 @@ maybe_default_option (struct gcc_options *opts,
lang_mask, DK_UNSPECIFIED, loc,
handlers, true, dc);
else if (default_opt->arg == NULL
- && !option->cl_reject_negative)
+ && !option->cl_reject_negative
+ && !(option->flags & CL_PARAMS))
handle_generated_option (opts, opts_set, default_opt->opt_index,
default_opt->arg, !default_opt->value,
lang_mask, DK_UNSPECIFIED, loc,
@@ -541,6 +542,14 @@ static const struct default_options default_options_table[] =
{ OPT_LEVELS_3_PLUS, OPT_fvect_cost_model_, NULL, VECT_COST_MODEL_DYNAMIC },
{ OPT_LEVELS_3_PLUS, OPT_fversion_loops_for_strides, NULL, 1 },
+ /* -O3 parameters. */
+ { OPT_LEVELS_3_PLUS, OPT__param_early_inlining_insns_, NULL, 14 },
+ { OPT_LEVELS_3_PLUS, OPT__param_inline_heuristics_hint_percent_, NULL,
+ 600 },
+ { OPT_LEVELS_3_PLUS, OPT__param_inline_min_speedup_, NULL, 15},
+ { OPT_LEVELS_3_PLUS, OPT__param_max_inline_insns_auto_, NULL, 30 },
+ { OPT_LEVELS_3_PLUS, OPT__param_max_inline_insns_single_, NULL, 200 },
+
/* -Ofast adds optimizations to -O3. */
{ OPT_LEVELS_FAST, OPT_ffast_math, NULL, 1 },
{ OPT_LEVELS_FAST, OPT_fallow_store_data_races, NULL, 1 },
@@ -99,12 +99,8 @@ Common Joined UInteger Var(param_dse_max_object_size) Init(256) Param
Maximum size (in bytes) of objects tracked bytewise by dead store elimination.
-param=early-inlining-insns=
-Common Joined UInteger Var(param_early_inlining_insns) Init(14) Param
-Maximal estimated growth of function body caused by early inlining of single call with -O3 and -Ofast.
-
--param=early-inlining-insns-O2=
-Common Joined UInteger Var(param_early_inlining_insns_o2) Init(6) Param
-Maximal estimated growth of function body caused by early inlining of single call with -O1 and -O2.
+Common Joined UInteger Var(param_early_inlining_insns) Init(6) Param
+Maximal estimated growth of function body caused by early inlining of single call.
-param=fsm-maximum-phi-arguments=
Common Joined UInteger Var(param_fsm_maximum_phi_arguments) Init(100) IntegerRange(1, 999999) Param
@@ -179,19 +175,11 @@ Common Joined UInteger Var(param_hsa_gen_debug_stores) IntegerRange(0, 1) Param
Level of hsa debug stores verbosity.
-param=inline-heuristics-hint-percent=
-Common Joined UInteger Var(param_inline_heuristics_hint_percent) Init(600) IntegerRange(100, 1000000) Param
-The scale (in percents) applied to inline-insns-single and auto limits when heuristics hints that inlining is very profitable with -O3 and -Ofast.
-
--param=inline-heuristics-hint-percent-O2=
-Common Joined UInteger Var(param_inline_heuristics_hint_percent_o2) Init(200) IntegerRange(100, 1000000) Param
+Common Joined UInteger Var(param_inline_heuristics_hint_percent) Init(200) IntegerRange(100, 1000000) Param
The scale (in percents) applied to inline-insns-single and auto limits when heuristics hints that inlining is very profitable.
-param=inline-min-speedup=
-Common Joined UInteger Var(param_inline_min_speedup) Init(15) IntegerRange(0, 100) Param
-The minimal estimated speedup allowing inliner to ignore inline-insns-single and inline-insns-auto with -O3 and -Ofast.
-
--param=inline-min-speedup-O2=
-Common Joined UInteger Var(param_inline_min_speedup_o2) Init(30) IntegerRange(0, 100) Param
+Common Joined UInteger Var(param_inline_min_speedup) Init(30) IntegerRange(0, 100) Param
The minimal estimated speedup allowing inliner to ignore inline-insns-single and inline-insns-auto.
-param=inline-unit-growth=
@@ -467,11 +455,7 @@ Common Joined UInteger Var(param_max_hoist_depth) Init(30) Param
Maximum depth of search in the dominator tree for expressions to hoist.
-param=max-inline-insns-auto=
-Common Joined UInteger Var(param_max_inline_insns_auto) Init(30) Param
-The maximum number of instructions when automatically inlining with -O3 and -Ofast.
-
--param=max-inline-insns-auto-O2=
-Common Joined UInteger Var(param_max_inline_insns_auto_o2) Init(15) Param
+Common Joined UInteger Var(param_max_inline_insns_auto) Init(15) Param
The maximum number of instructions when automatically inlining.
-param=max-inline-insns-recursive=
@@ -483,11 +467,7 @@ Common Joined UInteger Var(param_max_inline_insns_recursive_auto) Init(450) Para
The maximum number of instructions non-inline function can grow to via recursive inlining.
-param=max-inline-insns-single=
-Common Joined UInteger Var(param_max_inline_insns_single) Init(200) Param
-The maximum number of instructions in a single function eligible for inlining with -O3 and -Ofast.
-
--param=max-inline-insns-single-O2=
-Common Joined UInteger Var(param_max_inline_insns_single_o2) Init(30) Param
+Common Joined UInteger Var(param_max_inline_insns_single) Init(30) Param
The maximum number of instructions in a single function eligible for inlining.
-param=max-inline-insns-size=
@@ -16,5 +16,5 @@ main ()
}
/* { dg-output "ERROR: AddressSanitizer: stack-buffer-overflow.*(\n|\r\n|\r)" } */
-/* { dg-output " #1 0x\[0-9a-f\]+ +(in _*(interceptor_|wrap_|)memcmp|\[(\])\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output " #2 0x\[0-9a-f\]+ +(in _*main|\[(\])\[^\n\r]*(\n|\r\n|\r)" } */
+/* { dg-output " #\[1-9\] 0x\[0-9a-f\]+ +(in _*(interceptor_|wrap_|)memcmp|\[(\])\[^\n\r]*(\n|\r\n|\r)" } */
+/* { dg-output " #\[2-9\] 0x\[0-9a-f\]+ +(in _*main|\[(\])\[^\n\r]*(\n|\r\n|\r)" } */
@@ -1,5 +1,5 @@
// { dg-do compile }
-// { dg-options "-O2 -fdump-tree-optimized-vops -fno-inline-functions --param max-inline-insns-single-O2=200" }
+// { dg-options "-O2 -fdump-tree-optimized-vops -fno-inline-functions --param max-inline-insns-single=200" }
struct VBase;
@@ -1,5 +1,5 @@
// { dg-do compile }
-// { dg-options "-O2 -fdump-tree-fre3 -fdump-tree-optimized -fdelete-null-pointer-checks --param early-inlining-insns-O2=14 --param max-inline-insns-single-O2=200" }
+// { dg-options "-O2 -fdump-tree-fre3 -fdump-tree-optimized -fdelete-null-pointer-checks --param early-inlining-insns=14 --param max-inline-insns-single=200" }
#define assume(x) if(!(x))__builtin_unreachable()
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O -fno-tree-sra -fdump-tree-fre1 --param early-inlining-insns-O2=14" } */
+/* { dg-options "-O -fno-tree-sra -fdump-tree-fre1 --param early-inlining-insns=14" } */
int f();
@@ -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 --param early-inlining-insns-O2=14" } */
+ { dg-options "-O2 -Wstringop-truncation --param early-inlining-insns=14" } */
#include <string.h>
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-optimized --param early-inlining-insns-O2=14" } */
+/* { dg-options "-O2 -fdump-tree-optimized --param early-inlining-insns=14" } */
#define _UNUSED_ __attribute__((__unused__))
typedef int TEST_F30 (int *v);
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-thread2-details -fdump-tree-thread3-details -fdump-tree-thread4-details -fno-finite-loops --param early-inlining-insns-O2=14 -fno-inline-functions" } */
+/* { dg-options "-O2 -fdump-tree-thread2-details -fdump-tree-thread3-details -fdump-tree-thread4-details -fno-finite-loops --param early-inlining-insns=14 -fno-inline-functions" } */
/* { dg-final { scan-tree-dump "FSM" "thread2" } } */
/* { dg-final { scan-tree-dump "FSM" "thread3" } } */
/* { dg-final { scan-tree-dump "FSM" "thread4" { xfail *-*-* } } } */
@@ -1,6 +1,6 @@
/* PR middle-end/66142 */
/* { dg-do compile } */
-/* { dg-additional-options "-ffast-math -fopenmp-simd --param early-inlining-insns-O2=14" } */
+/* { dg-additional-options "-ffast-math -fopenmp-simd --param early-inlining-insns=14" } */
/* { dg-additional-options "-mavx" { target avx_runtime } } */
struct A { float x, y; };
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-Winline -O2 --param max-inline-insns-single-O2=1 --param inline-min-speedup-O2=100 -fgnu89-inline" } */
+/* { dg-options "-Winline -O2 --param max-inline-insns-single=1 --param inline-min-speedup=100 -fgnu89-inline" } */
void big (void);
inline int q(void) /* { dg-warning "max-inline-insns-single" } */
@@ -1,7 +1,7 @@
/* { dg-do compile { target { lp64 } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
-/* { dg-options "-O2 -mvsx -fno-inline-functions --param max-inline-insns-single-O2=200" } */
+/* { dg-options "-O2 -mvsx -fno-inline-functions --param max-inline-insns-single=200" } */
__int128_t
foo (__int128_t *src)