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: [ast-optimizer-branch] PATCH to simplify array base


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.


r~


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