This fixes a mistake in the previous change in this area to what
was desired - figure the largest power-of-two group size fitting
in the matching area.
2020-10-27 Richard Biener <rguenther@suse.de>
* tree-vect-slp.c (vect_build_slp_instance): Use ceil_log2
to compute maximum group-size.
* gcc.dg/vect/bb-slp-67.c: New testcase.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+
+float a[6];
+
+void foo (float x, float y)
+{
+ a[0] = 1.;
+ a[1] = 2.;
+ a[2] = 3.;
+ a[3] = 4.;
+ a[4] = 5.;
+ a[5] = x + y;
+}
+
+/* { dg-final { scan-tree-dump "optimized: basic block" "slp2" } } */
tree scalar_type
= TREE_TYPE (DR_REF (STMT_VINFO_DATA_REF (stmt_info)));
tree vectype = get_vectype_for_scalar_type (vinfo, scalar_type,
- least_bit_hwi (i));
+ 1 << floor_log2 (i));
unsigned HOST_WIDE_INT const_nunits;
if (vectype
&& TYPE_VECTOR_SUBPARTS (vectype).is_constant (&const_nunits))