Fix BB store group splitting group size compute

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.
This commit is contained in:
Richard Biener 2020-10-27 15:55:01 +01:00
parent fe90c50441
commit 4a972479f0
2 changed files with 17 additions and 1 deletions

View File

@ -0,0 +1,16 @@
/* { 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" } } */

View File

@ -2396,7 +2396,7 @@ vect_build_slp_instance (vec_info *vinfo,
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))