This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/77399] Poor code generation for vector casts and loads
- From: "amonakov at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 30 Aug 2016 08:03:53 +0000
- Subject: [Bug tree-optimization/77399] Poor code generation for vector casts and loads
- Auto-submitted: auto-generated
- References: <bug-77399-4@http.gcc.gnu.org/bugzilla/>
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)