[Bug tree-optimization/98254] Failure to optimize simple pattern for __builtin_convertvector

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Dec 12 19:36:07 GMT 2020


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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to rguenther@suse.de from comment #2)
> Should already be handled by vectorizing the CTOR.

I've tried:

typedef int __attribute__((vector_size(16))) V;

V
foo (short *a)
{
  return (V){a[0], a[1], a[2], a[3]};
}

V
bar (int *a)
{
  return (V){a[0], a[1], a[2], a[3]};
}

and we don't do a vector (unaligned) read even in bar with -O3
-fno-tree-slp-vectorize, it is just SLP vectorization that makes it vectorize.
If we should handle foo as convertvector, we should handle bar in the same spot
as vector load from memory.


More information about the Gcc-bugs mailing list