This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [ast-optimizer-branch] PATCH to simplify array base
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Jason Merrill <jason at redhat dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 10 Jun 2002 18:04:04 -0400 (EDT)
- Subject: Re: [ast-optimizer-branch] PATCH to simplify array base
On Mon, 10 Jun 2002, Richard Henderson wrote:
> On Mon, Jun 10, 2002 at 10:36:37PM +0100, Jason Merrill wrote:
> > ...though we will eventually want dependence analysis to handle that sort
> > of thing anyway, as code like
> >
> > type *p = array;
> > while (elt = *p++)
> > ...;
> >
> > is pretty common.
>
> Another way to approach this is to canonicalize this (after
> constant propagation) as
>
> t0 = 0;
> while (elt = array[t0++])
> ...;
>
> which I'd expect to allow unrolling to produce nicer code.
> I'd also expect most of this "pessimization" to be undone
> by the later strength reduction pass.
Strength reduction is not going to be a seperate pass anymore, as far as
i'm concerned.
It's integrated into SSAPRE (in my tree, anyway, i haven't committed it
yet).
Compilers that do this (open64, a few others) don't run strength reduction
separately, so i see no need for us to.
So this would mean we'd run SSAPRE after loop, which makes sense anyway,
since we want to lower to pointer arithmetic after loop so it can be
PRE'd.
>
>
> r~
>
>