This is the mail archive of the
mailing list for the GCC project.
Re: [lno] [patch] vectorization with unknown loop bound
On May 17, 2004, at 12:07 PM, Zdenek Dvorak wrote:
+ /* If the loop has symbolic number of iterations 'n'
+ (i.e. it's not a compile time constant),
+ then an epilog loop need to be created. We therefore duplicate
+ the initial loop. The original loop will be vectorized, and
+ (n/VF) iterations. The second copy will remain serial and
+ the remaining (n%VF) iterations. (VF is the vectorization
Any reason for not using nested loops approach here? e.g.
for (i=0; i<N; i = i + VF)
for (j=i; j < i + VF && j < N; j++)
I am just curious.
1) You need to test one more condition per iteration of the inner
2) And you still cannot vectorize it (unless I miss something
If we can fill empty slots in last vector iteration then inner loop
can be vectorized. Current approach is reasonable.