https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117379
Avinash Jayakar <avinashd at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rguenth at gcc dot gnu.org
--- Comment #4 from Avinash Jayakar <avinashd at gcc dot gnu.org> ---
typedef unsigned long long u64;
u64 mobility(u64 * a, u64 * b) {
u64 mobility = 0;
mobility += a[0];
mobility += a[1];
mobility += a[2];
mobility += a[3];
mobility += b[0];
mobility += b[1];
mobility += b[2];
mobility += b[3];
return mobility;
}
even with same addition operation, the vectorization does happen, but is
sub-optimal.
Only one .REDUC_PLUS operation is seen in tree-slp pass, the other one stays in
scalar form.
Ideally something like this should have happened
.REDUC_PLUS ( vector_a + vector_b)
but now
.REDUC_PLUS (vector_a)
.. scalar reduction of b.
.. add the results.