On Wed, Apr 13, 2011 at 3:20 PM, Jan Hubicka <hubi...@ucw.cz> wrote:
> Hi,
> this patch moves inline_summary from field in cgraph_node into its own on side
> datastructure. This moves it from arcane decision of mine to split all IPA 
> data
> into global/local datas stored in common datastructure into the scheme we
> developed for new IPA passes some time ago.
>
> The advantage is that the code is more contained and less spread across the
> compiler. We also make cgraph_node smaller and dumps more compact that never
> hurts.
>
> While working on it I noticed that Richi's patch to introduce cgraph_edge
> times/sizes is bit iffy in computing data when they are missing in the
> datastructure. Also it computes incomming edge costs instead of outgoing that
> leads to fact that not all edges gets their info computed for IPA inliner
> (think of newly discovered direct calls or IPA merging).
>
> I fixed this on the and added sanity check that the fields are initialized.
> This has shown problem with early inliner iteration fixed thusly and fact that
> early inliner is attempting to compute overall growth at a time the inline
> parameters are not computed for functions not visited by early optimizations
> yet. We previously agreed that early inliner should not try to do that (as 
> this
> leads to early inliner inlining functions called once that should be deferred
> for later consieration).  I just hope it won't cause benchmarks to
> regress too much ;)
>
> Having place to pile inline analysis info in, there is more to cleanup. The
> cgraph_local/cgraph_global fields probably should go and the stuff from global
> info should go into inline_summary datastructure, too (the lifetimes are
> essentially the same so there is no need for the split).  I will handle this
> incrementally.
>
> Bootstrapped/regtested x86_64-linux with slightly modified version of the 
> patch.
> Re-testing with final version and intend to commit the patch tomorrow.
>
> Honza
>
>        * cgraph.c (dump_cgraph_node): Do not dump inline summaries.
>        * cgraph.h (struct inline_summary): Move to ipa-inline.h
>        (cgraph_local_info): Remove inline_summary.
>        * ipa-cp.c: Include ipa-inline.h.
>        (ipcp_cloning_candidate_p, ipcp_estimate_growth,
>        ipcp_estimate_cloning_cost, ipcp_insert_stage): Use inline_summary
>        accesor.
>        * lto-cgraph.c (lto_output_node): Do not stream inline summary.
>        (input_overwrite_node): Do not set inline summary.
>        (input_node): Do not stream inline summary.
>        * ipa-inline.c (cgraph_decide_inlining): Dump inline summaries.
>        (cgraph_decide_inlining_incrementally): Do not try to estimate overall
>        growth; we do not have inline parameters computed for that anyway.
>        (cgraph_early_inlining): After inlining compute call_stmt_sizes.
>        * ipa-inline.h (struct inline_summary): Move here from ipa-inline.h
>        (inline_summary_t): New type and VECtor.
>        (debug_inline_summary, dump_inline_summaries): Declare.
>        (inline_summary): Use VOCtor.
>        (estimate_edge_growth): Kill hack computing call stmt size directly.
>        * lto-section-in.c (lto_section_name): Add inline section.
>        * ipa-inline-analysis.c: Include lto-streamer.h
>        (node_removal_hook_holder, node_duplication_hook_holder): New holders
>        (inline_node_removal_hook, inline_node_duplication_hook): New 
> functions.
>        (inline_summary_vec): Define.
>        (inline_summary_alloc, dump_inline_summary, debug_inline_summary,
>        dump_inline_summaries): New functions.
>        (estimate_function_body_sizes): Properly compute size/time of outgoing 
> calls.
>        (compute_inline_parameters): Alloc inline_summary; do not compute 
> size/time
>        of incomming calls.
>        (estimate_edge_time): Avoid missing time summary hack.
>        (inline_read_summary): Read inline summary info.
>        (inline_write_summary): Write inline summary info.
>        (inline_free_summary): Free all hooks and inline summary vector.
>        * lto-streamer.h: Add LTO_section_inline_summary section.
>        * Makefile.in (ipa-cp.o, ipa-inline-analysis.o): Update dependencies.
>        * ipa.c (cgraph_remove_unreachable_nodes): Fix dump file formating.
>
>        * lto.c: Include ipa-inline.h
>        (add_cgraph_node_to_partition, undo_partition): Use inline_summary 
> accessor.
>        (ipa_node_duplication_hook): Fix declaration.
>        * Make-lang.in (lto.o): Update dependencies.

This may have caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48645

-- 
H.J.

Reply via email to