http://llvm.org/bugs/show_bug.cgi?id=17673

            Bug ID: 17673
           Summary: [Vectorization] Recognize strided access for
                    vectorization
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Loop Optimizer
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Stride Access is not supported in the LLVM vectorizer. In order to recognize
loops like:

for (i..N/3) {
 a[3*i] = b[3*i] + I;
 a[3*i+1] = b[3*i+1] + J;
 a[3*i+2] = b[3*i+2] + K;
}

We can't re-roll the loop, nor we can use sequential access, since I, J and K
might have different values (assuming I, J, K, N constant). Detecting the
stride in this case is essential to be able to use interleaved loads/stores
(such as VLDN/VSTN on ARM).

The case where I==J==K can, sometimes, be rerolled, and on such cases, the
current vectorizer can already deal with the transformed loop, but we might
still want the vectorizer to deal with such cases, when loop re-roller is
disabled or it can't detect specific semantics.

Another case, when "a" is a reduction variable, like:

for (i..N/3) {
 a += b[3*i] + I;
 a += b[3*i+1] + J;
 a += b[3*i+2] + K;
}

Should be dealt with the same way, so we need to make sure that the reduction
logic can also cope with non-unit strides.

Finally, non-unit memory induction should be transformed/mapped into the stride
access above, so that loops such as this:

for (i..N/3) {
 a++ = b++ + I;
 a++ = b++ + J;
 a++ = b++ + K;
}

can also be vectorized.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to