This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Early inlining with early optimization and passmanagerization of the inliner


> 
> I believe re-optimizing during early inlining makes a lot more sense
> than optimizing during inlining.  We _really_ want to remove all
> abstraction - and if this needs re-optimizing then so be it.  After

Well, removing all abstraction is easy to say, but dificult to do.  For
tramp3d the code seems to be working sufficiently well (apparently all
real abstraction we are shooting for there are the forwarder functions
of various kinds), but it is not that dificult to write abstraction that
require non-trivial inlining decision to make it disappear.
For DLV we are already in trouble apparently as still pretty large unit
growth factors are needed to get good performance, I will do more tests
tonight or tomorrow.

> all, early inlining was sort of an abstraction remover already - and
> I think we should turn off regular inlining for -Os after this patch
> (and maybe even for -O1, but that needs some measurements).

Why would you like to turn off the regular inliner?
I agree that the regular inliner should use same limits as early inliner
for -Os - ie inline function only when the size after inlining is
estimated to decrease, but still early inliner is limited to one given
topological order (reverse postorder) and for cyclic callgraphs (that
are common) it then often miss inlining posibilities, so we still need
global algorithm to catch the remaining cases.

Disabling regular inliner for -O1 would make sense if inliner turns out
to be expensive in some testcases (but that would be QOI bug of the
inliner).  In fact I am just running benchmarks to see how compiler
without the second inliner score overall.

Thanks for comments, I will deifnitly wait till tonight with commiting
the patch, but I would like to see results from our nightly testers soon
so we can figure out how much returning is needed.
Honza
> 
> I will have a more detailed look at the patch later.
> 
> Thanks!
> Richard.
> 
> > 	* cgraph.h (cgraph_decide_inlining_incrementally): Kill.
> > 	* tree-pass.h: Reorder to make IPA passes appear toegher.
> > 	(pass_early_inline, pass_inline_parameters, pass_apply_inline): Declare.
> > 	* cgraphunit.c (cgraph_finalize_function): Do not compute inling
> > 	parameters, do not call early inliner.
> > 	* ipa-inline.c: Update comments.  Include tree-flow.h
> > 	(cgraph_decide_inlining): Do not compute inlining parameters.
> > 	(cgraph_decide_inlining_incrementally): Return TODOs; assume to
> > 	be called with function context set up.
> > 	(pass_ipa_inline): Remove unreachable functions before pass.
> > 	(cgraph_early_inlining): Simplify assuming to be called from the
> > 	PM as local pass.
> > 	(pass_early_inline): New pass.
> > 	(cgraph_gate_ipa_early_inlining): New gate.
> > 	(pass_ipa_early_inline): Turn into simple wrapper.
> > 	(compute_inline_parameters): New function.
> > 	(gate_inline_passes): New gate.
> > 	(pass_inline_parameters): New pass.
> > 	(apply_inline): Move here from tree-optimize.c
> > 	(pass_apply_inline): New pass.
> > 	* ipa.c (cgraph_remove_unreachable_nodes): Verify cgraph after
> > 	transforming.
> > 	* tree-inline.c (optimize_inline_calls): Return TODOs rather than
> > 	doing them by hand.
> > 	(tree_function_versioning): Do not allocate dummy struct function.
> > 	* tree-inline.h (optimize_inline_calls): Update prototype.
> > 	* tree-optimize.c (execute_fixup_cfg): Export.
> > 	(pass_fixup_cfg): Remove
> > 	(tree_rest_of_compilation): Do not apply inlines.
> > 	* tree-flow.h (execute_fixup_cfg): Declare.
> > 	* Makefile.in (gt-passes.c): New.
> > 	* passes.c: Include gt-passes.h
> > 	(init_optimization_passes): New passes.
> > 	(nnodes, order): New static vars.
> > 	(do_per_function_toporder): New function.
> > 	(execute_one_pass): Dump current pass here.
> > 	(execute_ipa_pass_list): Don't dump current pass here.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]