[llvm-bugs] [Bug 48045] New: Missed loop vectorization with conditional store

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Nov 2 04:56:45 PST 2020


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: unassignedbugs at nondot.org
          Reporter: david.bolvansky at gmail.com
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, pengfei.wang at intel.com,
                    spatel+llvm at rotateright.com

#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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201102/f08675ea/attachment.html>


More information about the llvm-bugs mailing list