aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.h
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2023-10-17 13:42:59 +0200
committerRichard Biener <rguenther@suse.de>2023-10-17 14:24:51 +0200
commit323209cd73bf1d81d91637677db5883afc8ae5f6 (patch)
tree2e288c4840292fdd7e906c1cd6ccc7a2a2f24297 /gcc/tree-vectorizer.h
parentfbdf88a1f6de2399101ecea948ff1abbf82459fc (diff)
downloadgcc-323209cd73bf1d81d91637677db5883afc8ae5f6.zip
gcc-323209cd73bf1d81d91637677db5883afc8ae5f6.tar.gz
gcc-323209cd73bf1d81d91637677db5883afc8ae5f6.tar.bz2
tree-optimization/111846 - put simd-clone-info into SLP tree
The following avoids bogously re-using the simd-clone-info we currently hang off stmt_info from two different SLP contexts where a different number of lanes should have chosen a different best simdclone. PR tree-optimization/111846 * tree-vectorizer.h (_slp_tree::simd_clone_info): Add. (SLP_TREE_SIMD_CLONE_INFO): New. * tree-vect-slp.cc (_slp_tree::_slp_tree): Initialize SLP_TREE_SIMD_CLONE_INFO. (_slp_tree::~_slp_tree): Release it. * tree-vect-stmts.cc (vectorizable_simd_clone_call): Use SLP_TREE_SIMD_CLONE_INFO or STMT_VINFO_SIMD_CLONE_INFO dependent on if we're doing SLP. * gcc.dg/vect/pr111846.c: New testcase.
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r--gcc/tree-vectorizer.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index f1d0cd7..f315292 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -196,6 +196,11 @@ struct _slp_tree {
denotes the number of output lanes. */
lane_permutation_t lane_permutation;
+ /* Selected SIMD clone's function info. First vector element
+ is SIMD clone's function decl, followed by a pair of trees (base + step)
+ for linear arguments (pair of NULLs for other arguments). */
+ vec<tree> simd_clone_info;
+
tree vectype;
/* Vectorized defs. */
vec<tree> vec_defs;
@@ -300,6 +305,7 @@ public:
#define SLP_TREE_NUMBER_OF_VEC_STMTS(S) (S)->vec_stmts_size
#define SLP_TREE_LOAD_PERMUTATION(S) (S)->load_permutation
#define SLP_TREE_LANE_PERMUTATION(S) (S)->lane_permutation
+#define SLP_TREE_SIMD_CLONE_INFO(S) (S)->simd_clone_info
#define SLP_TREE_DEF_TYPE(S) (S)->def_type
#define SLP_TREE_VECTYPE(S) (S)->vectype
#define SLP_TREE_REPRESENTATIVE(S) (S)->representative