aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-10-27 15:55:01 +0100
committerRichard Biener <rguenther@suse.de>2020-10-27 17:02:47 +0100
commit4a972479f050bc19ad55f0171523db14295924c2 (patch)
tree5520da5ad8e5759ae36580c94eda9b4536e6b611
parentfe90c504416e6423c6a56f37a9265deabdb03de9 (diff)
downloadgcc-4a972479f050bc19ad55f0171523db14295924c2.zip
gcc-4a972479f050bc19ad55f0171523db14295924c2.tar.gz
gcc-4a972479f050bc19ad55f0171523db14295924c2.tar.bz2
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.
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-67.c16
-rw-r--r--gcc/tree-vect-slp.c2
2 files changed, 17 insertions, 1 deletions
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-67.c b/gcc/testsuite/gcc.dg/vect/bb-slp-67.c
new file mode 100644
index 0000000..ff959c7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-67.c
@@ -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" } } */
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index ba43adb..470b67d 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -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))