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

Alexander Monakov <amonakov at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|SLP does not handle         |Poor code generation for
                   |BIT_FIELD_REF or            |vector casts and loads
                   |CONSTRUCTOR                 |

--- Comment #3 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
Thanks for confirming and for the extra testcase. However, the initial issue is
really not about SLP (I just used it to demonstrate that proper abstraction is
available on the gimple level): I think that kind of code should be handled
well at -O2 when no auto-vectorization is active, because the desired code
generation can be naturally inferred from original source code.

Your testcase will exhibit poor code generation even without the implicit
casts; simply constructing a vector won't use (unaligned) vector loads, even at
-O3:

typedef float v4sf __attribute__((vector_size(16)));
v4sf vec_load(float *f)
{
  return (v4sf){f[0], f[1], f[2], f[3]};
}

(clang/llvm generates one unaligned vector load here)

Reply via email to