diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2019-11-23 14:11:25 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2019-11-23 13:11:25 +0000 |
commit | 9340d34599e6d5e7a6f3614de44b2c578b180c1b (patch) | |
tree | d292f43ec703ffdbeb7c1d2ca6d090083b00ae4f /gcc/doc | |
parent | 956d615d66d06a9810000a5b7941be3ee1da7f8e (diff) | |
download | gcc-9340d34599e6d5e7a6f3614de44b2c578b180c1b.zip gcc-9340d34599e6d5e7a6f3614de44b2c578b180c1b.tar.gz gcc-9340d34599e6d5e7a6f3614de44b2c578b180c1b.tar.bz2 |
Convert inliner to function specific param infrastructure
This patch adds opt_for_fn for all cross module params used by inliner
so they can be modified at function granuality. With inlining almost always
there are three functions to consider (callee and caller of the inlined edge
and the outer function caller is inlined to).
I always use the outer function params since that is how local parameters
behave. I hope it is kind of what is also expected in most case: it is better
to inline agressively into -O3 compiled code rather than inline agressively -O3
functions into their callers.
New params infrastructure is nice. One drawback is that is very hard to
search for individual param uses since they all occupy global namespace.
With C++ world we had chance to do something like params.param_flag_name
or params::param_flag_name instead...
Bootstrapped/regtested x86_64-linux, comitted.
* 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.
* 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.
From-SVN: r278644
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/invoke.texi | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 34549e0..403be47 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -11281,17 +11281,12 @@ when modulo scheduling a loop. Larger values can exponentially increase 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}), @@ -11317,33 +11312,22 @@ Extra time accounted by inliner for function overhead such as time needed to 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 @@ -11421,14 +11405,9 @@ 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 -@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. |