Re: Cleanup handling of local/readonly memory in modref and ipa-pure-const

2020-09-23 Thread Richard Biener via Gcc-patches
On Wed, Sep 23, 2020 at 2:32 PM Jan Hubicka wrote: > > > On Wed, Sep 23, 2020 at 11:55 AM Jan Hubicka wrote: > > > > > > > > +/* Return true if T is a pointer pointing to memory location that is > > > > > local > > > > > + for the function (that means, dead after return) or read-only. */ > >

Re: Cleanup handling of local/readonly memory in modref and ipa-pure-const

2020-09-23 Thread Jan Hubicka
> On Wed, Sep 23, 2020 at 11:55 AM Jan Hubicka wrote: > > > > > > +/* Return true if T is a pointer pointing to memory location that is > > > > local > > > > + for the function (that means, dead after return) or read-only. */ > > > > + > > > > +bool > > > >

Re: Cleanup handling of local/readonly memory in modref and ipa-pure-const

2020-09-23 Thread Richard Biener via Gcc-patches
On Wed, Sep 23, 2020 at 11:55 AM Jan Hubicka wrote: > > > > +/* Return true if T is a pointer pointing to memory location that is > > > local > > > + for the function (that means, dead after return) or read-only. */ > > > + > > > +bool > > > +points_to_local_or_readonly_memory_p (tree t) > >

Re: Cleanup handling of local/readonly memory in modref and ipa-pure-const

2020-09-23 Thread Jan Hubicka
> > +/* Return true if T is a pointer pointing to memory location that is local > > + for the function (that means, dead after return) or read-only. */ > > + > > +bool > > +points_to_local_or_readonly_memory_p (tree t) > > +{ > > + /*if (!POINTER_TYPE_P (TREE_TYPE (t))) > > +return false;

Re: Cleanup handling of local/readonly memory in modref and ipa-pure-const

2020-09-23 Thread Richard Biener via Gcc-patches
On Wed, Sep 23, 2020 at 10:44 AM Jan Hubicka wrote: > > Hi, > this is first of cleanup patches for mod-ref interfaces. It removes code > duplication between ipa-pure-const and ipa-modref that both wants to check > whether given memory access can interfere with memory acesses before function >

Cleanup handling of local/readonly memory in modref and ipa-pure-const

2020-09-23 Thread Jan Hubicka
Hi, this is first of cleanup patches for mod-ref interfaces. It removes code duplication between ipa-pure-const and ipa-modref that both wants to check whether given memory access can interfere with memory acesses before function call or after function return. I pulled the logic out to