https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109885
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|target |tree-optimization
CC| |pinskia at gcc dot gnu.org
Blocks| |53947
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
What is even funnier on the LLVM side is if we have:
```
void f(unsigned int * __restrict a, unsigned int * __restrict b)
{
unsigned int t = 0;
t += (a[0] == b[0]);
t += (a[1] == b[1])<<1;
t += (a[2] == b[2])<<2;
t += (a[3] == b[3])<<3;
*a = t;
}
```
LLVM can produce movmskps for x86_64 but then does do a similar trick that it
did for the sum for aarch64.
Note GCC does not handle reductions that well for SLP either.
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53947
[Bug 53947] [meta-bug] vectorizer missed-optimizations