> >Well, me too :-)  I didn't really understand the choice of the original
> >condition above.  It seemed to be "return true if both access sizes are
> >variable", but the comment implied something else.
> 
> Sorry,! Must_eq is obviously fine. 

Thanks, good to know we are on same page :)
After some thinking I however believe we could reorganize oracle to be
faster.  What we do currently is

1) try to match base pointers and if they do we go for rangle_overlap_p only
2) try to match base types and if they do go for rangle_overlap_p only
3) try nonoverlapping_component_refs_p
4) try aliasing_component_refs_p.

Now I think we could do

1) try to match base pointers, if they do and rangle_overlap_p is false,
   return false. Otherwise remember that we can not have partial overlap
   of arrays which we handle conservatively otherwise.
2) try to match base types. If they do
    a) return false if range_overlap_p is false
    b) do variant of nonoverlaping_component_refs_decl_p starting from
       the known match of types and using LTO friendly
       same_types_for_tbaa_p compare.

       If it does not trip over array_range_refs or unions I do not
       think we need to do sorting like nonoverlapping_component_refs_p
       does. This perhaps the sorting path can be dropped compoetely.
    c) return true if failed
3) continue by looking for match of basetype of one path with inner type
   of the ohter (aliasing_component_refs_p) and if match is found
   repeat a),b),c)
4) do the access path continuation test.

I do not think this scheme should miss any cases where
nonoverlapping_component_refs_p matches since if we have match in the
middle of access path then either the access paths are incompatible
(will be ruled out by 4) or mathing types are found in 2/3.

2) is kind of redundant with 3), but since basetype match is common and
it saves some extra walk I think it makes sense to do it first and make
3) to skip outermost REF.

So I think I will drop this patch, fix divergences between
nonoverlapping_component_refs_p and and nonoverlaping_component_refs_decl_p,
hopefully enable aliasing_component_refs and nonoverlapping
and then see if I can reorgnaize the code this way.

Honza

Reply via email to