This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Change (flatten) representation of memory references
Hi,
> > > > What about the indices whose value is a constant? These can be
> > > > moved to offset, but that makes dependency analysis harder, so perhaps
> > > > it would make sense to make this lowering only after loop optimizations?
> > >
> > > Constant valued indices are at the moment do not create an IDX_EXPR.
> > > This would be easy to change, but I thought this wouldn't complicate
> > > data dependency analysis (at least it shouldn't make it impossible).
> >
> > How would dependency analysis know that these indices are there, and
> > what are their values?
>
> I don't know, but I would guess it doesn't need to?
it does, in cases like
int a[100][100];
for (i = 0; i < 100; i++)
a[i][40] = a[20][i];
It would probably be possible to reconstruct the information about
indices in the dependency analysis, but I would much more prefer not
to throw this information away in the first place.
After the loop optimizer, of course lowering the accesses further
and folding the constant offsets should not be a problem -- although
we might want to lower the memory references to TARGET_MEM_REFs at
that point, instead.
Zdenek