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: [PATCH, middle-end/12392] Do not call compute_inline_parameters excessively in IPA-SRA


On Thu, 1 Oct 2009, Martin Jambor wrote:

> Hi,
> 
> the patch below deals with a compile time regression of the PR 12392
> testcase which was caused by a great number of useless calls to
> compute_inline_parameters in IPA-SRA.  Bootstrapped and tested on
> x86_64-linux, i386-linux and ia64-linux (with IPA-SRA enabled by
> default at -O2).
> 
> OK for trunk?

Ok.

Thanks,
Richard.

> Thanks,
> 
> Martin
> 
> 
> 2009-10-01  Martin Jambor  <mjambor@suse.cz>
> 
> 	PR middle-end/12392
> 	* tree-sra.c (convert_callers): Do not call
> 	compute_inline_parameters on one caller more than once.
> 
> Index: mine/gcc/tree-sra.c
> ===================================================================
> --- mine.orig/gcc/tree-sra.c	2009-09-18 14:53:07.000000000 +0200
> +++ mine/gcc/tree-sra.c	2009-09-18 17:26:57.000000000 +0200
> @@ -3637,6 +3637,7 @@ convert_callers (struct cgraph_node *nod
>    tree old_cur_fndecl = current_function_decl;
>    struct cgraph_edge *cs;
>    basic_block this_block;
> +  bitmap recomputed_callers = BITMAP_ALLOC (NULL);
>  
>    for (cs = node->callers; cs; cs = cs->next_caller)
>      {
> @@ -3644,15 +3645,24 @@ convert_callers (struct cgraph_node *nod
>        push_cfun (DECL_STRUCT_FUNCTION (cs->caller->decl));
>  
>        if (dump_file)
> -	fprintf (dump_file, "Adjusting call %s -> %s\n",
> +	fprintf (dump_file, "Adjusting call (%i -> %i) %s -> %s\n",
> +		 cs->caller->uid, cs->callee->uid,
>  		 cgraph_node_name (cs->caller),
>  		 cgraph_node_name (cs->callee));
>  
>        ipa_modify_call_arguments (cs, cs->call_stmt, adjustments);
> -      compute_inline_parameters (cs->caller);
>  
>        pop_cfun ();
>      }
> +
> +  for (cs = node->callers; cs; cs = cs->next_caller)
> +    if (!bitmap_bit_p (recomputed_callers, cs->caller->uid))
> +      {
> +	compute_inline_parameters (cs->caller);
> +	bitmap_set_bit (recomputed_callers, cs->caller->uid);
> +      }
> +  BITMAP_FREE (recomputed_callers);
> +
>    current_function_decl = old_cur_fndecl;
>    FOR_EACH_BB (this_block)
>      {
> 
> 

-- 
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex


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