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: [tree-ssa] PATCH to expose calculation of VLA ARRAY_REFs


On Wed, Mar 05, 2003 at 05:56:21PM -0500, Diego Novillo wrote:
> On Wed, 2003-03-05 at 17:35, Pop Sébastian wrote:
> > On Wed, Mar 05, 2003 at 04:59:40PM -0500, Jason Merrill wrote:
> > > On Wed, 5 Mar 2003 22:48:15 +0100, Pop Sébastian <pop at gauvain dot u-strasbg dot fr> wrote:
> > > 
> > > > why not simplify_array_ref_to_plus all the ARRAY_REFs?
> > > 
> > > Because currently alias set calculations work better with the ARRAY_REF
> > > form; with an ARRAY_REF it's clear that it references a particular
> > > subobject of the array.  I'm not sure that this is a reason to keep it in
> > > the long term, though.  Other thoughts?
> > > 
> > 
> > It's simpler to deal with a program that contains only pointer arithmetic in 
> > the dependence test that will be based on the ind var framework I work on:
> >
> I would rather not lower ARRAY_REFs too early.  Array optimizations are
> not my forte, but it is my impression that for several types of
> transformations it is easier to deal with multidimensional arrays than
> with all the lowered pointer arithmetic.
> 
You're right.

However I think that reconstruct ("promote") arrays dimensions is the 
right thing to do when array accesses are mixed with pointer arithmetics.
Such a pass is described by O'Boyle and then slightly modified by Engelen:

  http://citeseer.nj.nec.com/485503.html

Since I use the chains of rec framework for representing closed form expressions, 
it is possible to deal with a similar algorithm to redimension arrays.

> In principle, I would vote to have a separate pass that converts
> ARRAY_REFs to pointer arithmetic for those passes that prefer to deal in
> the lower level representation.
> 
Waiting until all the IV framework is implemented seems a reasonable 
strategy.  If this framework is able to reconstruct more precise information, 
then you could decide to accept it in tree-ssa.

> If we later discover that keeping ARRAY_REFs serves no useful purpose,
> we can move the lowering pass earlier.
> 
Agree.


	Sebastian


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