https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98113

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Created attachment 49668
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49668&action=edit
prototype

So like this (some correctness verification is missing as well as more general
matching on the def side).  SLP discovery works but it somehow fails to
vectorize the popcount call:

t.i:12:10: note:   Final SLP tree for instance 0x3af32e0:
t.i:12:10: note:   node 0x3a0f6f0 (max_nunits=4, refcnt=2)
t.i:12:10: note:   op template: _18 = (unsigned int) _4;
t.i:12:10: note:        stmt 0 _18 = (unsigned int) _4;
t.i:12:10: note:        stmt 1 _27 = (unsigned int) _26;
t.i:12:10: note:        stmt 2 _36 = (unsigned int) _35;
t.i:12:10: note:        stmt 3 _3 = (unsigned int) _2;
t.i:12:10: note:        children 0x3a0f778
t.i:12:10: note:   node 0x3a0f778 (max_nunits=4, refcnt=2)
t.i:12:10: note:   op template: _4 = __builtin_popcount (_5);
t.i:12:10: note:        stmt 0 _4 = __builtin_popcount (_5);
t.i:12:10: note:        stmt 1 _26 = __builtin_popcount (_25);
t.i:12:10: note:        stmt 2 _35 = __builtin_popcount (_34);
t.i:12:10: note:        stmt 3 _2 = __builtin_popcount (_1);
t.i:12:10: note:        children 0x3a0f800
t.i:12:10: note:   node 0x3a0f800 (max_nunits=1, refcnt=2)
t.i:12:10: note:   op: VEC_PERM_EXPR
t.i:12:10: note:        stmt 0 _5 = BIT_FIELD_REF <a_17(D), 32, 0>;
t.i:12:10: note:        stmt 1 _25 = BIT_FIELD_REF <a_17(D), 32, 32>;
t.i:12:10: note:        stmt 2 _34 = BIT_FIELD_REF <a_17(D), 32, 64>;
t.i:12:10: note:        stmt 3 _1 = BIT_FIELD_REF <a_17(D), 32, 96>;
t.i:12:10: note:        lane permutation { 0[0] 0[1] 0[2] 0[3] }
t.i:12:10: note:        children 0x3a0f888
t.i:12:10: note:   node (external) 0x3a0f888 (max_nunits=1, refcnt=1)
t.i:12:10: note:        { }
...
t.i:10:10: note:   ==> examining statement: _4 = __builtin_popcount (_5);
t.i:10:10: note:   vect_is_simple_use: operand BIT_FIELD_REF <a_17(D), 32, 0>,
type of def: internal
t.i:10:10: missed:   function is not vectorizable.
t.i:10:12: missed:   not vectorized: relevant stmt not supported: _4 =
__builtin_popcount (_5);
t.i:10:10: note:   Building vector operands of 0x3a0f778 from scalars instead

Reply via email to