This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA] pretty-ipa merge 5: fixup_cfg before early passes
- From: Richard Guenther <rguenther at suse dot de>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 28 Mar 2009 15:43:19 +0100 (CET)
- Subject: Re: [RFA] pretty-ipa merge 5: fixup_cfg before early passes
- References: <20090328141029.GE24355@kam.mff.cuni.cz>
On Sat, 28 Mar 2009, Jan Hubicka wrote:
> Hi,
> this patch fix gcov-2.C failure I introduced by previous patch.
>
> EH edges change with functions becoming nothrow or uninlinable. After
> IPA passes we cleanup the difference in inliner by calling fixup_cfg,
> but now we can change the inlinablity also from cgraph build time to
> early optimization (since we know what bodies are available). Thus we
> need to fixup cfg there too.
>
> This fixup will be also used by local pure-const pass I would like to
> merge next.
>
> Bootstrapped/regtested x86_64-linux. OK?
>
> * tree-pass.h (pass_fixup_cfg): New pass.
> * ipa-inline.c (inline_transform): Set
> always_inline_functions_inlined/after_inlining.
> * tree-optimize.c (execute_fixup_cfg): Do not set them here.
> (pass_fixup_cfg): New pass.
> * passes.c (init_optimization_passes
ChangeLog is truncated. Ok otherwise.
Thanks,
Richard.
>
> Index: tree-pass.h
> ===================================================================
> *** tree-pass.h (revision 145181)
> --- tree-pass.h (working copy)
> *************** extern struct gimple_opt_pass pass_tree_
> *** 309,314 ****
> --- 309,315 ----
> extern struct gimple_opt_pass pass_early_tree_profile;
> extern struct gimple_opt_pass pass_cleanup_cfg;
> extern struct gimple_opt_pass pass_referenced_vars;
> + extern struct gimple_opt_pass pass_fixup_cfg;
> extern struct gimple_opt_pass pass_sra;
> extern struct gimple_opt_pass pass_sra_early;
> extern struct gimple_opt_pass pass_tail_recursion;
> Index: ipa-inline.c
> ===================================================================
> *** ipa-inline.c (revision 145181)
> --- ipa-inline.c (working copy)
> *************** inline_transform (struct cgraph_node *no
> *** 1755,1760 ****
> --- 1755,1762 ----
> todo = optimize_inline_calls (current_function_decl);
> timevar_pop (TV_INTEGRATION);
> }
> + cfun->always_inline_functions_inlined = true;
> + cfun->after_inlining = true;
> return todo | execute_fixup_cfg ();
> }
>
> Index: tree-optimize.c
> ===================================================================
> *** tree-optimize.c (revision 145181)
> --- tree-optimize.c (working copy)
> *************** execute_fixup_cfg (void)
> *** 293,301 ****
> gimple_stmt_iterator gsi;
> int todo = gimple_in_ssa_p (cfun) ? TODO_verify_ssa : 0;
>
> - cfun->after_inlining = true;
> - cfun->always_inline_functions_inlined = true;
> -
> if (cfun->eh)
> FOR_EACH_BB (bb)
> {
> --- 293,298 ----
> *************** execute_fixup_cfg (void)
> *** 333,338 ****
> --- 330,354 ----
> return todo;
> }
>
> + struct gimple_opt_pass pass_fixup_cfg =
> + {
> + {
> + GIMPLE_PASS,
> + NULL, /* name */
> + NULL, /* gate */
> + execute_fixup_cfg, /* execute */
> + NULL, /* sub */
> + NULL, /* next */
> + 0, /* static_pass_number */
> + 0, /* tv_id */
> + PROP_cfg, /* properties_required */
> + 0, /* properties_provided */
> + 0, /* properties_destroyed */
> + 0, /* todo_flags_start */
> + 0 /* todo_flags_finish */
> + }
> + };
> +
> /* Do the actions required to initialize internal data structures used
> in tree-ssa optimization passes. */
>
> Index: passes.c
> ===================================================================
> *** passes.c (revision 145181)
> --- passes.c (working copy)
> *************** init_optimization_passes (void)
> *** 536,541 ****
> --- 536,542 ----
> NEXT_PASS (pass_early_local_passes);
> {
> struct opt_pass **p = &pass_early_local_passes.pass.sub;
> + NEXT_PASS (pass_fixup_cfg);
> NEXT_PASS (pass_tree_profile);
> NEXT_PASS (pass_cleanup_cfg);
> NEXT_PASS (pass_init_datastructures);
>
>
--
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex