diff mbox series

[PR,90889] Fix IPA-CP topological sorting

Message ID ri61rzs54ph.fsf@suse.cz
State New
Headers show
Series [PR,90889] Fix IPA-CP topological sorting | expand

Commit Message

Martin Jambor June 17, 2019, 8:36 p.m. UTC
Hi,

r272115 introduced IPA-CP hook to ignore some edges in order to break
useless SCCs, but the condition in the new hook was a bit too lenient.

If we want to break SCCs in which contains some nodes has IPA-CP
disabled, we must do it at the incoming edges, not at the outgoing, at
least without making sure that we propagate that these calls have to
mark callee's lattices as containing variable stuff.

But breaking SCCs only at the edges which are easier to handle
is... well.. easier, and so the following patch does that.  The patch
has restored LTO bootstrap with Ada, C and C++, I am now running LTO
bootstrap and testing with all languages, OK if it passes?

Thanks,

Martin


2019-06-17  Martin Jambor  <mjambor@suse.cz>

	PR ipa/90889
	* ipa-cp.c (ignore_edge_p): Do not ignore edges when only the
	caller does not have flag_ipa_cp set.
---
 gcc/ipa-cp.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Martin Liška June 18, 2019, 4:35 a.m. UTC | #1
On 6/17/19 10:36 PM, Martin Jambor wrote:
> Hi,
> 
> r272115 introduced IPA-CP hook to ignore some edges in order to break
> useless SCCs, but the condition in the new hook was a bit too lenient.

Oh, sorry for the breakage.
Thank you Martin for the patch.

Martin

> 
> If we want to break SCCs in which contains some nodes has IPA-CP
> disabled, we must do it at the incoming edges, not at the outgoing, at
> least without making sure that we propagate that these calls have to
> mark callee's lattices as containing variable stuff.
> 
> But breaking SCCs only at the edges which are easier to handle
> is... well.. easier, and so the following patch does that.  The patch
> has restored LTO bootstrap with Ada, C and C++, I am now running LTO
> bootstrap and testing with all languages, OK if it passes?
> 
> Thanks,
> 
> Martin
> 
> 
> 2019-06-17  Martin Jambor  <mjambor@suse.cz>
> 
> 	PR ipa/90889
> 	* ipa-cp.c (ignore_edge_p): Do not ignore edges when only the
> 	caller does not have flag_ipa_cp set.
> ---
>  gcc/ipa-cp.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
> index a0f6f23829b..d3a88756a91 100644
> --- a/gcc/ipa-cp.c
> +++ b/gcc/ipa-cp.c
> @@ -817,7 +817,6 @@ ignore_edge_p (cgraph_edge *e)
>      = e->callee->function_or_virtual_thunk_symbol (&avail, e->caller);
>  
>    return (avail <= AVAIL_INTERPOSABLE
> -	  || !opt_for_fn (e->caller->decl, flag_ipa_cp)
>  	  || !opt_for_fn (ultimate_target->decl, flag_ipa_cp));
>  }
>  
>
Richard Biener June 18, 2019, 7:01 a.m. UTC | #2
On June 17, 2019 10:36:58 PM GMT+02:00, Martin Jambor <mjambor@suse.cz> wrote:
>Hi,
>
>r272115 introduced IPA-CP hook to ignore some edges in order to break
>useless SCCs, but the condition in the new hook was a bit too lenient.
>
>If we want to break SCCs in which contains some nodes has IPA-CP
>disabled, we must do it at the incoming edges, not at the outgoing, at
>least without making sure that we propagate that these calls have to
>mark callee's lattices as containing variable stuff.
>
>But breaking SCCs only at the edges which are easier to handle
>is... well.. easier, and so the following patch does that.  The patch
>has restored LTO bootstrap with Ada, C and C++, I am now running LTO
>bootstrap and testing with all languages, OK if it passes?

Ok. 

Richard. 

>Thanks,
>
>Martin
>
>
>2019-06-17  Martin Jambor  <mjambor@suse.cz>
>
>	PR ipa/90889
>	* ipa-cp.c (ignore_edge_p): Do not ignore edges when only the
>	caller does not have flag_ipa_cp set.
>---
> gcc/ipa-cp.c | 1 -
> 1 file changed, 1 deletion(-)
>
>diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
>index a0f6f23829b..d3a88756a91 100644
>--- a/gcc/ipa-cp.c
>+++ b/gcc/ipa-cp.c
>@@ -817,7 +817,6 @@ ignore_edge_p (cgraph_edge *e)
>     = e->callee->function_or_virtual_thunk_symbol (&avail, e->caller);
> 
>   return (avail <= AVAIL_INTERPOSABLE
>-	  || !opt_for_fn (e->caller->decl, flag_ipa_cp)
> 	  || !opt_for_fn (ultimate_target->decl, flag_ipa_cp));
> }
>
diff mbox series

Patch

diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index a0f6f23829b..d3a88756a91 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -817,7 +817,6 @@  ignore_edge_p (cgraph_edge *e)
     = e->callee->function_or_virtual_thunk_symbol (&avail, e->caller);
 
   return (avail <= AVAIL_INTERPOSABLE
-	  || !opt_for_fn (e->caller->decl, flag_ipa_cp)
 	  || !opt_for_fn (ultimate_target->decl, flag_ipa_cp));
 }