+2019-11-23 Jan Hubicka <hubicka@ucw.cz>
+
+ * cif-code.def (MAX_INLINE_INSNS_SINGLE_O2_LIMIT): Remove.
+ * doc/invoke.texi (max-inline-insns-single-O2,
+ inline-heuristics-hint-percent-O2, inline-min-speedup-O2,
+ early-inlining-insns-O2): Remove documentation.
+ * ipa-fnsummary.c (analyze_function_body,
+ compute_fn_summary): Use opt_for_fn when accessing parameters.
+ * ipa-inline.c (caller_growth_limits, can_inline_edge_p,
+ inline_insns_auto, can_inline_edge_by_limits_p,
+ want_early_inline_function_p, big_speedup_p,
+ want_inline_small_function_p, want_inline_self_recursive_call_p,
+ recursive_inlining, compute_max_insns, inline_small_functions):
+ Likewise.
+ * opts.c (default_options): Add -O3 defaults for
+ OPT__param_early_inlining_insns_,
+ OPT__param_inline_heuristics_hint_percent_,
+ OPT__param_inline_min_speedup_, OPT__param_max_inline_insns_single_.
+ * params.opt (-param=early-inlining-insns-O2=,
+ -param=inline-heuristics-hint-percent-O2=,
+ -param=inline-min-speedup-O2=, -param=max-inline-insns-single-O2=
+ -param=early-inlining-insns=, -param=inline-heuristics-hint-percent=,
+ -param=inline-min-speedup=, -param=inline-unit-growth=,
+ -param=large-function-growth=, -param=large-stack-frame=,
+ -param=large-stack-frame-growth=, -param=large-unit-insns=,
+ -param=max-inline-insns-recursive=,
+ -param=max-inline-insns-recursive-auto=,
+ -param=max-inline-insns-single=,
+ -param=max-inline-insns-size=, -param=max-inline-insns-small=,
+ -param=max-inline-recursive-depth=,
+ -param=max-inline-recursive-depth-auto=,
+ -param=min-inline-recursive-probability=,
+ -param=partial-inlining-entry-probability=,
+ -param=uninlined-function-insns=, -param=uninlined-function-time=,
+ -param=uninlined-thunk-insns=, -param=uninlined-thunk-time=): Add
+ Optimization.
+
2019-11-23 Jakub Jelinek <jakub@redhat.com>
* ipa-fnsummary.c: Fix comment typos.
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(INLINE_UNIT_GROWTH_LIMIT, CIF_FINAL_NORMAL,
compilation time.
@item max-inline-insns-single
-@item max-inline-insns-single-O2
Several parameters control the tree inliner used in GCC@. This number sets the
maximum number of instructions (counted in GCC's internal representation) in a
single function that the tree inliner considers for inlining. This only
affects functions declared inline and methods implemented in a class
declaration (C++).
-For functions compiled with optimization levels
-@option{-O3} and @option{-Ofast} parameter @option{max-inline-insns-single} is
-applied. In other cases @option{max-inline-insns-single-O2} is applied.
-
@item max-inline-insns-auto
When you use @option{-finline-functions} (included in @option{-O3}),
execute function prologue and epilogue
@item inline-heuristics-hint-percent
-@item inline-heuristics-hint-percent-O2
The scale (in percents) applied to @option{inline-insns-single},
@option{inline-insns-single-O2}, @option{inline-insns-auto}
when inline heuristics hints that inlining is
very profitable (will enable later optimizations).
-For functions compiled with optimization levels
-@option{-O3} and @option{-Ofast} parameter
-@option{inline-heuristics-hint-percent} is applied. In other cases
-@option{inline-heuristics-hint-percent-O2} is applied.
-
@item uninlined-thunk-insns
@item uninlined-thunk-time
Same as @option{--param uninlined-function-insns} and
@option{--param uninlined-function-time} but applied to function thunks
@item inline-min-speedup
-@item inline-min-speedup-O2
When estimated performance improvement of caller + callee runtime exceeds this
threshold (in percent), the function can be inlined regardless of the limit on
@option{--param max-inline-insns-single} and @option{--param
max-inline-insns-auto}.
-For functions compiled with optimization levels
-@option{-O3} and @option{-Ofast} parameter @option{inline-min-speedup} is
-applied. In other cases @option{inline-min-speedup-O2} is applied.
-
@item large-function-insns
The limit specifying really large functions. For functions larger than this
limit after inlining, inlining is constrained by
expressions whose probability exceeds the given threshold (in percents).
@item early-inlining-insns
-@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.
-For functions compiled with optimization levels
-@option{-O3} and @option{-Ofast} parameter @option{early-inlining-insns} is
-applied. In other cases @option{early-inlining-insns-O2} is applied.
-
@item max-early-inliner-iterations
Limit of iterations of the early inliner. This basically bounds
the number of nested indirect calls the early inliner can resolve.
static void
analyze_function_body (struct cgraph_node *node, bool early)
{
- sreal time = param_uninlined_function_time;
+ sreal time = opt_for_fn (node->decl, param_uninlined_function_time);
/* Estimate static overhead for function prologue/epilogue and alignment. */
- int size = param_uninlined_function_insns;
+ int size = opt_for_fn (node->decl, param_uninlined_function_insns);
/* Benefits are scaled by probability of elimination that is in range
<0,2>. */
basic_block bb;
info->account_size_time (0, 0, bb_predicate, bb_predicate);
bb_predicate = predicate::not_inlined ();
- info->account_size_time (param_uninlined_function_insns
+ info->account_size_time (opt_for_fn (node->decl,
+ param_uninlined_function_insns)
* ipa_fn_summary::size_scale,
- param_uninlined_function_time,
+ opt_for_fn (node->decl,
+ param_uninlined_function_time),
bb_predicate,
bb_predicate);
es->call_stmt_size = eni_size_weights.call_cost;
es->call_stmt_time = eni_time_weights.call_cost;
info->account_size_time (ipa_fn_summary::size_scale
- * param_uninlined_function_thunk_insns,
- param_uninlined_function_thunk_time, t, t);
+ * opt_for_fn (node->decl,
+ param_uninlined_function_thunk_insns),
+ opt_for_fn (node->decl,
+ param_uninlined_function_thunk_time), t, t);
t = predicate::not_inlined ();
info->account_size_time (2 * ipa_fn_summary::size_scale, 0, t, t);
ipa_update_overall_fn_summary (node);
/* -O3 parameters. */
{ OPT_LEVELS_3_PLUS, OPT__param_max_inline_insns_auto_, NULL, 30 },
+ { 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_single_, NULL, 200 },
/* -Ofast adds optimizations to -O3. */
{ OPT_LEVELS_FAST, OPT_ffast_math, NULL, 1 },
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) Optimization 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
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) Optimization 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) Optimization IntegerRange(0, 100) Param
The minimal estimated speedup allowing inliner to ignore inline-insns-single and inline-insns-auto.
-param=inline-unit-growth=
-Common Joined UInteger Var(param_inline_unit_growth) Init(40) Param
+Common Joined UInteger Var(param_inline_unit_growth) Init(40) Optimization Param
How much can given compilation unit grow because of the inlining (in percent).
-param=integer-share-limit=
The size of L2 cache.
-param=large-function-growth=
-Common Joined UInteger Var(param_large_function_growth) Init(100) Param
+Common Joined UInteger Var(param_large_function_growth) Optimization Init(100) Param
Maximal growth due to inlining of large function (in percent).
-param=large-function-insns=
-Common Joined UInteger Var(param_large_function_insns) Init(2700) Param
+Common Joined UInteger Var(param_large_function_insns) Optimization Init(2700) Param
The size of function body to be considered large.
-param=large-stack-frame=
-Common Joined UInteger Var(param_large_stack_frame) Init(256) Param
+Common Joined UInteger Var(param_large_stack_frame) Init(256) Optimization Param
The size of stack frame to be considered large.
-param=large-stack-frame-growth=
-Common Joined UInteger Var(param_stack_frame_growth) Init(1000) Param
+Common Joined UInteger Var(param_stack_frame_growth) Optimization Init(1000) Param
Maximal stack frame growth due to inlining (in percent).
-param=large-unit-insns=
-Common Joined UInteger Var(param_large_unit_insns) Init(10000) Param
+Common Joined UInteger Var(param_large_unit_insns) Optimization Init(10000) Param
The size of translation unit to be considered large.
-param=lim-expensive=
The maximum number of instructions when automatically inlining.
-param=max-inline-insns-recursive=
-Common Joined UInteger Var(param_max_inline_insns_recursive) Init(450) Param
+Common Joined UInteger Var(param_max_inline_insns_recursive) Optimization Init(450) Param
The maximum number of instructions inline function can grow to via recursive inlining.
-param=max-inline-insns-recursive-auto=
-Common Joined UInteger Var(param_max_inline_insns_recursive_auto) Init(450) Param
+Common Joined UInteger Var(param_max_inline_insns_recursive_auto) Optimization Init(450) Param
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(70) Param
+Common Joined UInteger Var(param_max_inline_insns_single) Optimization Init(70) Param
The maximum number of instructions in a single function eligible for inlining.
-param=max-inline-insns-size=
-Common Joined UInteger Var(param_max_inline_insns_size) Param
+Common Joined UInteger Var(param_max_inline_insns_size) Optimization Param
The maximum number of instructions when inlining for size.
-param=max-inline-insns-small=
-Common Joined UInteger Var(param_max_inline_insns_small) Param
+Common Joined UInteger Var(param_max_inline_insns_small) Optimization Param
The maximum number of instructions when automatically inlining small functions.
-param=max-inline-recursive-depth=
-Common Joined UInteger Var(param_max_inline_recursive_depth) Init(8) Param
+Common Joined UInteger Var(param_max_inline_recursive_depth) Optimization Init(8) Param
The maximum depth of recursive inlining for inline functions.
-param=max-inline-recursive-depth-auto=
-Common Joined UInteger Var(param_max_inline_recursive_depth_auto) Init(8) Param
+Common Joined UInteger Var(param_max_inline_recursive_depth_auto) Optimization Init(8) Param
The maximum depth of recursive inlining for non-inline functions.
-param=max-isl-operations=
The minimum number of matching instructions to consider for crossjumping.
-param=min-inline-recursive-probability=
-Common Joined UInteger Var(param_min_inline_recursive_probability) Init(10) Param
+Common Joined UInteger Var(param_min_inline_recursive_probability) Init(10) Optimization Param
Inline recursively only when the probability of call being executed exceeds the parameter.
-param=min-insn-to-prefetch-ratio=
Enum(parloops_schedule_type) String(runtime) Value(PARLOOPS_SCHEDULE_RUNTIME)
-param=partial-inlining-entry-probability=
-Common Joined UInteger Var(param_partial_inlining_entry_probability) Init(70) IntegerRange(0, 100) Param
+Common Joined UInteger Var(param_partial_inlining_entry_probability) Init(70) Optimization IntegerRange(0, 100) Param
Maximum probability of the entry BB of split region (in percent relative to entry BB of the function) to make partial inlining happen.
-param=predictable-branch-outcome=
Maximum number of nested calls to search for control dependencies during uninitialized variable analysis.
-param=uninlined-function-insns=
-Common Joined UInteger Var(param_uninlined_function_insns) Init(2) IntegerRange(0, 1000000) Param
+Common Joined UInteger Var(param_uninlined_function_insns) Init(2) Optimization IntegerRange(0, 1000000) Param
Instruction accounted for function prologue, epilogue and other overhead.
-param=uninlined-function-time=
-Common Joined UInteger Var(param_uninlined_function_time) IntegerRange(0, 1000000) Param
+Common Joined UInteger Var(param_uninlined_function_time) Optimization IntegerRange(0, 1000000) Param
Time accounted for function prologue, epilogue and other overhead.
-param=uninlined-thunk-insns=
-Common Joined UInteger Var(param_uninlined_function_thunk_insns) Init(2) IntegerRange(0, 1000000) Param
+Common Joined UInteger Var(param_uninlined_function_thunk_insns) Optimization Init(2) IntegerRange(0, 1000000) Param
Instruction accounted for function thunk overhead.
-param=uninlined-thunk-time=
-Common Joined UInteger Var(param_uninlined_function_thunk_time) Init(2) IntegerRange(0, 1000000) Param
+Common Joined UInteger Var(param_uninlined_function_thunk_time) Optimization Init(2) IntegerRange(0, 1000000) Param
Time accounted for function thunk overhead.
-param=unlikely-bb-count-fraction=
+2019-11-23 Jan Hubicka <hubicka@ucw.cz>
+
+ * g++.dg/tree-ssa/pr53844.C: Drop -O2 from param name.
+ * g++.dg/tree-ssa/pr61034.C: Likewise.
+ * g++.dg/tree-ssa/pr8781.C: Likewise.
+ * g++.dg/warn/Wstringop-truncation-1.C: Likewise.
+ * gcc.dg/ipa/pr63416.c: Likewise.
+ * gcc.dg/tree-ssa/ssa-thread-12.c: Likewise.
+ * gcc.dg/vect/pr66142.c: Likewise.
+ * gcc.dg/winline-3.c: Likewise.
+ * gcc.target/powerpc/pr72804.c: Likewise.
+
2019-11-23 Jakub Jelinek <jakub@redhat.com>
PR target/92615
// { 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;
// { 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()
/* { 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();
/* 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>
/* { 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);
/* { 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 *-*-* } } } */
/* 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; };
/* { 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" } */
/* { 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)