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: unassignedb...@nondot.org
Reporter: david.bolvan...@gmail.com
CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs