aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-12-03 10:25:14 +0100
committerRichard Biener <rguenther@suse.de>2020-12-07 12:07:12 +0100
commitebdfd1606da6b5aa586b0cd156b69b659235c9c2 (patch)
tree5a5649a6f9dd5d39848c76e182968f356e2d32c0 /gcc/testsuite/gcc.dg
parentcdcbef3c3310a14f2994982b44cb1f8e14c77232 (diff)
downloadgcc-ebdfd1606da6b5aa586b0cd156b69b659235c9c2.zip
gcc-ebdfd1606da6b5aa586b0cd156b69b659235c9c2.tar.gz
gcc-ebdfd1606da6b5aa586b0cd156b69b659235c9c2.tar.bz2
tree-optimization/98113 - vectorize a sequence of BIT_INSERT_EXPRs
This adds the capability to handle a sequence of vector BIT_INSERT_EXPRs to be vectorized similar as to how we vectorize vector constructors. 2020-12-03 Richard Biener <rguenther@suse.de> PR tree-optimization/98113 * tree-vectorizer.h (struct slp_root): New. (_bb_vec_info::roots): New member. * tree-vect-slp.c (vect_analyze_slp): Also walk BB info roots. (_bb_vec_info::_bb_vec_info): Adjust. (_bb_vec_info::~_bb_vec_info): Likewise. (vld_cmp): New. (vect_slp_is_lane_insert): Likewise. (vect_slp_check_for_constructors): Match a series of BIT_INSERT_EXPRs as vector constructor. (vect_slp_analyze_bb_1): Continue if BB info roots is not empty. (vect_slp_analyze_bb_1): Mark the whole BIT_INSERT_EXPR root sequence as pure_slp. * gcc.dg/vect/bb-slp-70.c: New testcase.
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-70.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-70.c b/gcc/testsuite/gcc.dg/vect/bb-slp-70.c
new file mode 100644
index 0000000..0eb7011
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-70.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-mavx512vl -mavx512vpopcntdq" { target avx512vpopcntdq } } */
+
+typedef unsigned uv4si __attribute__((vector_size(16)));
+
+uv4si __attribute__((noinline))
+vpopctf (uv4si a)
+{
+ uv4si r;
+ r[2] = __builtin_popcount (a[2]);
+ r[1] = __builtin_popcount (a[1]);
+ r[0] = __builtin_popcount (a[0]);
+ r[3] = __builtin_popcount (a[3]);
+ return r;
+}
+
+/* { dg-final { scan-tree-dump "optimized: basic block" "slp2" { target avx512vpopcntdq } } } */