[LTO merge][14/15] cgraph/gimple/ipa changes

Jan Hubicka hubicka@ucw.cz
Tue Sep 29 08:06:00 GMT 2009


> diff -rdupN --exclude=.svn --exclude=.git --exclude='*.diff*' --exclude='autom4te*' --exclude=tags --exclude=ChangeLog.lto --exclude=configure /usr/local/google/homedirs/dnovillo/gcc/trunk/gcc/ipa-cp.c /usr/local/google/homedirs/dnovillo/gcc/trunk.lto/gcc/ipa-cp.c
> --- /usr/local/google/homedirs/dnovillo/gcc/trunk/gcc/ipa-cp.c	2009-09-23 12:45:47.000000000 -0400
> +++ /usr/local/google/homedirs/dnovillo/gcc/trunk.lto/gcc/ipa-cp.c	2009-09-24 10:12:41.000000000 -0400
> @@ -1273,7 +1273,13 @@ ipcp_generate_summary (void)
>  static bool
>  cgraph_gate_cp (void)
>  {
> -  return flag_ipa_cp;
> +  /* FIXME lto.  IPA-CP does not tolerate running when the inlining decisions
> +     have not been applied.  This happens when WPA modifies the callgraph.
> +     Since those decisions are not applied until after all the IPA passes
> +     have been run in LTRANS, this means that IPA passes may see partially
> +     modified callgraphs.  The solution to this is to apply WPA decisions
> +     early during LTRANS.  */
> +  return flag_ipa_cp && !flag_ltrans;

This comment is out of date.  IPA-CP should be able to handle with LTO
if the summaries was read back correctly.
> -  cgraph_remove_function_insertion_hook (function_insertion_hook_holder);
> +  /* FIXME lto.  We need to rethink how to coordinate different passes. */
> +  if (flag_ltrans)
> +    return 0;
> +
> +  /* FIXME lto.  We need to re-think about how the passes get invoked. */
> +  if (!flag_wpa)
> +    cgraph_remove_function_insertion_hook (function_insertion_hook_holder);

I would say that summary reading code ought to re-insert the hooks, or
we leak memory and get things wrong when UIDs gets reused.
> @@ -1128,7 +1133,9 @@ cgraph_decide_inlining (void)
>  	if (max_benefit < inline_summary (node)->time_inlining_benefit)
>  	  max_benefit = inline_summary (node)->time_inlining_benefit;
>        }
> -  gcc_assert (!max_count || (profile_info && flag_branch_probabilities));
> +  gcc_assert (in_lto_p
> +	      || !max_count
> +	      || (profile_info && flag_branch_probabilities));

This seems also wrong, but I guess I will need to look into it after
merging.
> @@ -1918,6 +1925,10 @@ inline_generate_summary (void)
>  {
>    struct cgraph_node *node;
>  
> +  /* FIXME lto.  We should not run any IPA-summary pass in LTRANS mode.  */

We can, in case we produce new function we want to add into the unit.
> +      /* Note that it is not strictly necessary to schedule an early
> +	 inline pass here.  However, some test cases (e.g.,
> +	 g++.dg/other/p334435.C g++.dg/other/i386-1.C) expect extern
> +	 inline functions to be inlined even at -O0.  This does not
> +	 happen during the first early inline pass.  */

The planned fixes for extern inline stuff didn't happen, I guess?

I will take one extra pass at afternoon.  Thanks for breaking this up!

Honza



More information about the Gcc-patches mailing list