[tree-ssa] RFC: Dropping INDIRECT_REF variables

tm_gccmail@mail.kloo.net tm_gccmail@mail.kloo.net
Mon May 19 20:24:00 GMT 2003


On Wed, 14 May 2003, Dale Johannesen wrote:

> On Wednesday, May 14, 2003, at 08:31  AM, Timothy J. Wood wrote:
> > On Wednesday, May 14, 2003, at 08:09  AM, Diego Novillo wrote:
> >> - We disable the ability to treat non-aliased pointer
> >>   dereferences as if they were variables.  We would lose the
> >>   ability to do some optimizations like:
> >
> >   Please forgive me if I'm way off base here, but one example on PPC 
> > that your code snippet reminded me of was int->float conversion.  On 
> > PPC this happens by building storing a pair of 32-bit constructed ints 
> > on the stack, loading them as a double and then doing some more 
> > contortions with this.
> >
> >   The current problem is that if you have float conversion in a loop:
> >
> > void convert(int *input, float *output, unsigned int count)
> > {
> >     while (count--)
> >         *output++ = *input++;
> > }
> >
> >   both words of the double on the stack are written on each loop even 
> > though the one 32-bit portion is always the same.  This store should 
> > be hoisted outside the loop (in the degenerate case above this can by 
> > a pretty big performance win).  I don't have a 3.3 compiler right now, 
> > but on Mac OS X 10.2 (3.1-based):
> 
> 3.3 does the same thing.  I have tried to fix it and given up, as have 
> some
> other people.

This is a bit tangential, but would stack-based pseudos help in this
instance? e.g. a pseudo which represents a stack location?
This sounds more friendly to the loop optimizer, as it doesn't need to
differentiate between registers and stack locations.

Toshi




More information about the Gcc mailing list