Hi,

On Tue, Nov 13, 2012 at 01:08:56PM -0800, Ian Lance Taylor wrote:
> On Tue, Nov 13, 2012 at 9:03 AM, Martin Jambor <mjam...@suse.cz> wrote:
> 
> > Index: src/gcc/ipa-cp.c
> > ===================================================================
> > --- src.orig/gcc/ipa-cp.c
> > +++ src/gcc/ipa-cp.c
> > @@ -1276,6 +1276,8 @@ merge_aggregate_lattices (struct cgraph_
> >      return true;
> >    if (src_plats->aggs_bottom)
> >      return set_agg_lats_contain_variable (dest_plats);
> > +  if (src_plats->aggs_contain_variable)
> > +    ret |= set_agg_lats_contain_variable (dest_plats);
> >    dst_aglat = &dest_plats->aggs;
> 
> Out of curiousity, why are the lines just above the ones you added not
> 
>     if (src_plats->aggs_bottom)
>       return set_agg_lats_to_bottom (dest_plats);
> 

Since IPA-CP started gathering multiple known constant values per
lattice and can create specialized clones for just some contexts, our
bottom is not the classic bottom from simple constant propagation any
more (classic bottom would be contains_variable flag set and no known
values).  Bottom is a sort of unusable flag, but it does not make
other lattices unusable.  They should be quite rare, they occur when
their function is not local and also not versionable or not clonable,
when we accumulated too many known constants in a lattice (so that it
still adheres to the definition of lattice, here it really means a
lattice bottom) or, in case of propagation of values in aggregates,
when there is a (weird) mix of values passed by reference and values
passed by value.  At the moment, there are in fact no other reasons to
create a bottom lattice, though there might be more in the future.

If we know there might be more than the listed known values,
contains_variable and aggs_contain_variable flags are the way to go.

Martin

Reply via email to