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

            Bug ID: 48045
           Summary: Missed loop vectorization with conditional store
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected],
                    [email protected]

#define N 1024
float a[N], b[N], d[N];


void
foo (float *__restrict p, float *__restrict q)
{
  int i;
  for (i = 0; i < N; i++)
    d[i] = a[i] < b[i] ? p[i] : q[i];
}

Clang does not vectorize it due to AVX 2 cost model.

ICC and GCC vectorizes it with AVX2. GCC even with AVX.

https://godbolt.org/z/WjKdjf

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to