Enabling SSA for alpha?

Brad Lucier lucier@math.purdue.edu
Wed Mar 15 13:59:00 GMT 2000


> There is a very readable chapter on SSA and optimizations
> in the book "Modern compiler implementation In C" by 
> Andrew W Appel.

Thank you for that reference; indeed, Appel suggests *not*
coalescing registers when converting from SSA form, and it
appears that convert_from_ssa in ssa.c does not coalesce
registers.

But consider the following test file

double
inner (double *x, double *y)
{
  return
    (x[0] * y[0] +
    (x[1] * y[1] +
    (x[2] * y[2] +
    (x[3] * y[3] +
    (x[4] * y[4] +
    (x[5] * y[5] +
    (x[6] * y[6])))))));
}

compiled with 20000315 on alpha with

gcc -mcpu=ev6 -fno-math-errno -mieee -fPIC -O1 -S -D___DYNAMIC -save-temps -da -fssa test.c

test.s contains a lot of fmovs, while with -O2, test.s is nearly optimal, with
no fmov instructions.

There are no problems after local register allocation with either -O1
or -O2; no source registers are also result registers. However,
if I examine the files test.c.13.greg with both -O1 and -O2, then
I see that the global register allocator with -O1 has attempted (1)
to coalesce certain source and destination registers, and (2) when
that failed (because of the constraints in alpha.md, presumably), to
generate the fmovs necessary to satisfy the constraints.  This didn't
happen with -O2

I can't tell from toplev.c and global.c what the differences are between
the global register allocators with -O1 and -O2; and I don't see why there
should be a difference, anyway, since this is just a single block.  At any
rate, is there some way to use the -O2 register allocator with the set of
optimizations that otherwise go with -O1?

Brad Lucier
to use the -O


More information about the Gcc mailing list