diff options
author | Richard Biener <rguenther@suse.de> | 2020-05-29 12:00:00 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2020-05-29 13:00:36 +0200 |
commit | c735929a2503a7d03ac4739bba5b25336bf954c3 (patch) | |
tree | 32a3c744207e5a93d1b9d156a2fb1caa6d2ff10c /gcc/tree-vectorizer.h | |
parent | ddf90b72d2a723decc487db6d3131846b9a618de (diff) | |
download | gcc-c735929a2503a7d03ac4739bba5b25336bf954c3.zip gcc-c735929a2503a7d03ac4739bba5b25336bf954c3.tar.gz gcc-c735929a2503a7d03ac4739bba5b25336bf954c3.tar.bz2 |
tree-optimization/95272 - add SLP_TREE_REPRESENTATIVE
This adds SLP_TREE_REPRESENTATIVE - a representative stmt-info that
is used by SLP analysis and code generation. This avoids the need
for the hack in vect_slp_rearrange_stmts which previously avoided
to re-arrange stmts that might not have been isomorphic because
of operand swapping. It also plays nice with future directions of SLP
and for the forseeable future is easier than replicating more and
more info in the SLP node as long as non-SLP is in-tree.
2020-05-29 Richard Biener <rguenther@suse.de>
PR tree-optimization/95272
* tree-vectorizer.h (_slp_tree::representative): Add.
(SLP_TREE_REPRESENTATIVE): Likewise.
* tree-vect-loop.c (vectorizable_reduction): Adjust SLP
node gathering.
(vectorizable_live_operation): Use the representative to
attach the reduction info to.
* tree-vect-slp.c (_slp_tree::_slp_tree): Initialize
SLP_TREE_REPRESENTATIVE.
(vect_create_new_slp_node): Likewise.
(slp_copy_subtree): Copy it.
(vect_slp_rearrange_stmts): Re-arrange even COND_EXPR stmts.
(vect_slp_analyze_node_operations_1): Pass the representative
to vect_analyze_stmt.
(vect_schedule_slp_instance): Pass the representative to
vect_transform_stmt.
* gcc.dg/vect/pr95272.c: New testcase.
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r-- | gcc/tree-vectorizer.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 2bde717..5a5648b 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -128,6 +128,9 @@ struct _slp_tree { vec<stmt_vec_info> stmts; /* A group of scalar operands to be vectorized together. */ vec<tree> ops; + /* The representative that should be used for analysis and + code generation. */ + stmt_vec_info representative; /* Load permutation relative to the stores, NULL if there is no permutation. */ @@ -193,6 +196,7 @@ public: #define SLP_TREE_TWO_OPERATORS(S) (S)->two_operators #define SLP_TREE_DEF_TYPE(S) (S)->def_type #define SLP_TREE_VECTYPE(S) (S)->vectype +#define SLP_TREE_REPRESENTATIVE(S) (S)->representative /* Key for map that records association between scalar conditions and corresponding loop mask, and |