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: [email protected]
          Reporter: [email protected]
                CC: [email protected]

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.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to