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: [autovect] [patch] vectorize in cases when number of iterations may be zero



Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> wrote on 15.06.2006
21:50:36:

> And?  The case that interests me is something like this:
>
> int foo (int n, int m)
> {
>   int i = 0;
>
>     do {
>       a[i] = b[i];
>       i++;
>     } while (i < m);
>
>   return 1;
> }
>
> Now # of iterations is m - 1, may_be_zero is m < 0.  Will the
> transformed loop be correct in case m = -8, for example?

Yes, I see now what do you mean. You are right, we generate wrong code.
we have to add niter.may_be_zero expression as part of guard condition
of vectorized loop.

-- Victor


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