The following prevents non-grouped load SLP in case the element
to splat is from a gather operation. While it should be possible
to support this it is not similar to the single element interleaving
case I was trying to mimic here.
PR tree-optimization/110443
* tree-vect-slp.cc (vect_build_slp_tree_1): Reject non-grouped
gather loads.
* gcc.dg/torture/pr110443.c: New testcase.
--- /dev/null
+/* { dg-do compile } */
+
+typedef struct {
+ float real;
+ float imag;
+} complex_t;
+extern unsigned char fftorder[];
+float *a52_imdct_256_data;
+int a52_imdct_256_i, a52_imdct_256_k;
+float a52_imdct_256_b_r;
+void a52_imdct_256()
+{
+ complex_t buf1[64];
+ a52_imdct_256_i = 0;
+ for (; a52_imdct_256_i < 64; a52_imdct_256_i++) {
+ a52_imdct_256_k = fftorder[a52_imdct_256_i];
+ buf1[a52_imdct_256_i].real = buf1[a52_imdct_256_i].imag =
+ a52_imdct_256_data[a52_imdct_256_k];
+ }
+ a52_imdct_256_b_r = buf1[0].real * buf1[0].imag;
+}
vectorization. For loop vectorization we can handle
splats the same we handle single element interleaving. */
&& (is_a <bb_vec_info> (vinfo)
- || stmt_info != first_stmt_info))
+ || stmt_info != first_stmt_info
+ || STMT_VINFO_GATHER_SCATTER_P (stmt_info)))
{
/* Not grouped load. */
if (dump_enabled_p ())