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 2/9] operand_equal_p: add support for FIELD_DECL


> On Tue, Aug 6, 2019 at 5:44 PM Martin Liska <mliska@suse.cz> wrote:
> >
> >
> > gcc/ChangeLog:
> 
> So I suppose this isn't to call operand_equal_p on two FIELD_DECLs
> but to make two COMPONENT_REFs "more equal"?  If so I then

yes. The patch originates from my original patchset I believe and it is
what ICF does.
> I suggest to make this change "local" to the COMPONENT_REF handling.
> This also interacts with path-based disambiguation so you want to make
> sure to only make things equal here iff it wouldn't change the outcome
> of path-based analysis.  Honza?

Indeed this can be handled as part of COMPONENT_REF match.
Access path oracle here basically checks:
 1) that MEM_REF type matches (we want predicate for this)
 2) if it finds type match via same_type_for_tbaa and then it applies
    the assumption about disjointness or overlap

So I guess ideally we should

 1) do matching part of COMPONENT_REF
 2) compare OFFSET, BIT_OFFSET 
    This establishes that the access has same semantics.
 3) for -fno-strict-aliasing be happy
 4) for -fstrict-aliaisng check if access path applies (we should export
    predicate from tree-ssa-alias as discussed earlier)
 5) compare types by same_type_for_tbaa_p

Honza


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