diff mbox series

Fix handling of symbols in other partition in symtab_node::binds_to_current_def_p

Message ID 20201015115238.GD76073@kam.mff.cuni.cz
State New
Headers show
Series Fix handling of symbols in other partition in symtab_node::binds_to_current_def_p | expand

Commit Message

Jan Hubicka Oct. 15, 2020, 11:52 a.m. UTC
Hi,
this patch makes binds_to_current_def_p to return true when the current
def is in other partition.  This is needed for modref to propagate info
on loads across partition boundary.

Bootstrapped/regtsted x86_64-linux, comitted.

	* symtab.c (symtab_node::binds_to_current_def_p): Also accept symbols
	defined in other partition.

Comments

Richard Biener Oct. 15, 2020, 12:07 p.m. UTC | #1
On Thu, Oct 15, 2020 at 1:53 PM Jan Hubicka <hubicka@ucw.cz> wrote:
>
> Hi,
> this patch makes binds_to_current_def_p to return true when the current
> def is in other partition.  This is needed for modref to propagate info
> on loads across partition boundary.

Hmm, but partitioning shouldn't influence what a def binds to so this looks
like a wrong (possibly pessimizing) change?

> Bootstrapped/regtsted x86_64-linux, comitted.
>
>         * symtab.c (symtab_node::binds_to_current_def_p): Also accept symbols
>         defined in other partition.
> diff --git a/gcc/symtab.c b/gcc/symtab.c
> index 207c9e75890..bc2865f4121 100644
> --- a/gcc/symtab.c
> +++ b/gcc/symtab.c
> @@ -2391,7 +2391,7 @@ symbol_table::symbol_suffix_separator ()
>  bool
>  symtab_node::binds_to_current_def_p (symtab_node *ref)
>  {
> -  if (!definition)
> +  if (!definition && !in_other_partition)
>      return false;
>    if (transparent_alias)
>      return definition
Jan Hubicka Oct. 15, 2020, 12:37 p.m. UTC | #2
> On Thu, Oct 15, 2020 at 1:53 PM Jan Hubicka <hubicka@ucw.cz> wrote:
> >
> > Hi,
> > this patch makes binds_to_current_def_p to return true when the current
> > def is in other partition.  This is needed for modref to propagate info
> > on loads across partition boundary.
> 
> Hmm, but partitioning shouldn't influence what a def binds to so this looks
> like a wrong (possibly pessimizing) change?

If you have symbol in ohter partition you get
  definition == false
  in_other_partition == true
So previously we returned false at the first check, now we proceed
testing if the definition binds locally from the visibility and
resolution info (eventually looking for LDPR_PREVAILING_DEF*)

Honza
> 
> > Bootstrapped/regtsted x86_64-linux, comitted.
> >
> >         * symtab.c (symtab_node::binds_to_current_def_p): Also accept symbols
> >         defined in other partition.
> > diff --git a/gcc/symtab.c b/gcc/symtab.c
> > index 207c9e75890..bc2865f4121 100644
> > --- a/gcc/symtab.c
> > +++ b/gcc/symtab.c
> > @@ -2391,7 +2391,7 @@ symbol_table::symbol_suffix_separator ()
> >  bool
> >  symtab_node::binds_to_current_def_p (symtab_node *ref)
> >  {
> > -  if (!definition)
> > +  if (!definition && !in_other_partition)
> >      return false;
> >    if (transparent_alias)
> >      return definition
Richard Biener Oct. 15, 2020, 12:40 p.m. UTC | #3
On Thu, Oct 15, 2020 at 2:37 PM Jan Hubicka <hubicka@ucw.cz> wrote:
>
> > On Thu, Oct 15, 2020 at 1:53 PM Jan Hubicka <hubicka@ucw.cz> wrote:
> > >
> > > Hi,
> > > this patch makes binds_to_current_def_p to return true when the current
> > > def is in other partition.  This is needed for modref to propagate info
> > > on loads across partition boundary.
> >
> > Hmm, but partitioning shouldn't influence what a def binds to so this looks
> > like a wrong (possibly pessimizing) change?
>
> If you have symbol in ohter partition you get
>   definition == false
>   in_other_partition == true
> So previously we returned false at the first check, now we proceed
> testing if the definition binds locally from the visibility and
> resolution info (eventually looking for LDPR_PREVAILING_DEF*)

Ah, I misread - so the patch fixes what I thought it introduces.

Nice.

Richard.

> Honza
> >
> > > Bootstrapped/regtsted x86_64-linux, comitted.
> > >
> > >         * symtab.c (symtab_node::binds_to_current_def_p): Also accept symbols
> > >         defined in other partition.
> > > diff --git a/gcc/symtab.c b/gcc/symtab.c
> > > index 207c9e75890..bc2865f4121 100644
> > > --- a/gcc/symtab.c
> > > +++ b/gcc/symtab.c
> > > @@ -2391,7 +2391,7 @@ symbol_table::symbol_suffix_separator ()
> > >  bool
> > >  symtab_node::binds_to_current_def_p (symtab_node *ref)
> > >  {
> > > -  if (!definition)
> > > +  if (!definition && !in_other_partition)
> > >      return false;
> > >    if (transparent_alias)
> > >      return definition
diff mbox series

Patch

diff --git a/gcc/symtab.c b/gcc/symtab.c
index 207c9e75890..bc2865f4121 100644
--- a/gcc/symtab.c
+++ b/gcc/symtab.c
@@ -2391,7 +2391,7 @@  symbol_table::symbol_suffix_separator ()
 bool
 symtab_node::binds_to_current_def_p (symtab_node *ref)
 {
-  if (!definition)
+  if (!definition && !in_other_partition)
     return false;
   if (transparent_alias)
     return definition