[llvm-bugs] [Bug 38330] New: Missing vectorization for step 4

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jul 26 05:01:37 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=38330

            Bug ID: 38330
           Summary: Missing vectorization for step 4
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: david.bolvansky at gmail.com
                CC: llvm-bugs at lists.llvm.org

Hello,

Code:
int vec_step_four(int *restrict A, int *restrict B, int *restrict C, int N) {
    int sum = 0;
    for (int i = 0; i < N; i += 4) {
        C[i] = A[i] + B[i];
        sum += C[i];
    }

    return sum;
}

Clang -O3 currently cannot vectorize this loop.
https://godbolt.org/g/NSHVVL

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180726/1390a71e/attachment-0001.html>


More information about the llvm-bugs mailing list