This is the mail archive of the gcc@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: Problem with -ftree-ter and loop unrolling


On Wed, 2005-05-18 at 09:23, Steven Bosscher wrote:
> On May 18, 2005 03:06 PM, Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> wrote:
> 
> > So far OK, but with ter, this becomes
> > 
> > sum1 = 0;
> > sum2 = 0;
> > for (i = 0; i < n; i+=4)
> >   {
> >     x_1 = a[i];
> >     y_1 = b[i];
> >     x_2 = a[i+1];
> >     y_2 = b[i+1];
> >     x_3 = a[i+2];
> >     y_3 = b[i+2];
> >     x_4 = a[i+3];
> >     y_4 = b[i+3];
> >     sum1 += x_1 * y_1 + x_2 * y_2 + x_3 * y_3 + x_4 * y_4;
> >     sum2 += x_1 / y_1 + x_2 / y_2 + x_3 / y_3 + x_4 / y_4;
> >   }
> > 
> > Now we need some 11 registers for the loop, instead of the original 5
> > (and the number of registers grows with the unroll factor).
> 
> The TER hack we settled on for PR17549 was supposed to prevent this kind
> of thing, but it was already obvious at the time that a better fix is
> needed in the general case.  You've find a pretty nasty one here.

Why didn't it trigger?  I can't reproduce it by a bit of simple hacking
around, have you got a little testcase and options to turn on to produce
this? 

Andrew



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