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
- From: Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>
- To: Richard Guenther <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 25 Feb 2008 22:45:30 +0100
- Subject: Re: [RFC] Change (flatten) representation of memory references
- References: <Pine.LNX.4.64.0802251706340.5150@zhemvz.fhfr.qr>
Hi,
> I thought about the invariant addresses again (that we allow
> &a[5] as is_gimple_min_invariant) and came to the conclusion that
> rather than allowing a nesting of POINTER_PLUS_EXPR <ADDR_EXPR <a>, 5>
> as invariant we'd extend ADDR_EXPR to adjust the address by an offset,
> making all MEM_REF, INDIRECT_MEM_REF, POINTER_PLUS_EXPR and ADDR_EXPR
> "symmetric".
>
> With that addition I wrote up http://gcc.gnu.org/wiki/MemRef
>
> Requests for additions/clarifications welcome.
it would be nice if IDX_EXPR also kept track of the bounds of the index
(i.e., two additional fields). The proposal mentions keeping
"persistent value range information for i" -- I am not quite sure what
that is supposed to mean?
Also, something should be said about the order of the indices -- is it
allowed to reassociate IDX_EXPRs? Is it allowed to access the same
array with several different steps (IIRC, fortran frontend does some
such trick to implement transposition of an array)?
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?
Zdenek