https://llvm.org/bugs/show_bug.cgi?id=27252
Bug ID: 27252
Summary: [ppc] missed vectorization of simple loop
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Backend: PowerPC
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Compile the following code with command line
~/llvm/obj3/bin/clang --target=powerpc64le-grtev4-linux-gnu -mvsx -mcpu=power8
-O2 -c t12.c -o t12.o
int foo(unsigned int* buf, unsigned int end, unsigned int endmask){
unsigned int* p;
int sum = 0;
for (p = buf; p < buf + end; ++p) {
sum += __builtin_popcount(*p);
}
return sum + __builtin_popcount(*p & endmask);
}
The simple loop is unrolled but not vectorized. If I change the last line to
return sum;
Then the loop can be vectorized.
--
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