[llvm-bugs] [Bug 44286] New: SLP vectorization failure

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Dec 12 06:44:43 PST 2019


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

            Bug ID: 44286
           Summary: SLP vectorization failure
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedbugs at nondot.org
          Reporter: david.bolvansky at gmail.com
                CC: llvm-bugs at lists.llvm.org

char src[512];
char dst[512];

#define WIDTH 32

void foo(int height, int a, int b, int c, int d, int dst_stride) {
    char * ptr_src = src;
    char * ptr_dst = dst;

    for( int y = 0; y < height; y++ )
    {
        for( int x = 0; x < WIDTH; x++ )
           {
             char x1 = ((a + c) * ptr_src[x]  ) >> 6;
             char x2 = ((b + d) * ptr_src[x+1]) >> 6;
             ptr_dst[x] = x1 + x2;
           }

        ptr_dst += dst_stride;
        ptr_src += 32;
    }
}

ICC and GCC can vectorize this loop, Clang does not.

https://godbolt.org/z/EsHdPg

-- 
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/20191212/7e6ee52a/attachment.html>


More information about the llvm-bugs mailing list