From 4bd2cdb74e26f68a4e9d51e74ace60326c9950d1 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 2 Jun 2021 13:25:59 +0200 Subject: Make SLP root stmt a vector This fixes a TODO noticed when adding vectorization of BIT_INSERT_EXPRs and what's now useful for vectorization of BB reductions. 2021-06-08 Richard Biener * tree-vectorizer.h (_slp_instance::root_stmt): Change to... (_slp_instance::root_stmts): ... a vector. (SLP_INSTANCE_ROOT_STMT): Rename to ... (SLP_INSTANCE_ROOT_STMTS): ... this. (slp_root::root): Change to... (slp_root::roots): ... a vector. (slp_root::slp_root): Adjust. * tree-vect-slp.c (_slp_instance::location): Adjust. (vect_free_slp_instance): Release the root stmt vector. (vect_build_slp_instance): Adjust. (vect_analyze_slp): Likewise. (_bb_vec_info::~_bb_vec_info): Likewise. (vect_slp_analyze_operations): Likewise. (vect_bb_vectorization_profitable_p): Likewise. Adjust costs for the root stmt. (vect_slp_check_for_constructors): Gather all BIT_INSERT_EXPRs as root stmts. (vect_slp_analyze_bb_1): Simplify by marking all root stmts as pure_slp. (vectorize_slp_instance_root_stmt): Adjust. (vect_schedule_slp): Likewise. --- gcc/tree-vectorizer.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'gcc/tree-vectorizer.h') diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 7dcb4cd..06d20c7 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -197,7 +197,7 @@ public: /* For vector constructors, the constructor stmt that the SLP tree is built from, NULL otherwise. */ - stmt_vec_info root_stmt; + vec root_stmts; /* The unrolling factor required to vectorized this SLP instance. */ poly_uint64 unrolling_factor; @@ -226,7 +226,7 @@ public: #define SLP_INSTANCE_TREE(S) (S)->root #define SLP_INSTANCE_UNROLLING_FACTOR(S) (S)->unrolling_factor #define SLP_INSTANCE_LOADS(S) (S)->loads -#define SLP_INSTANCE_ROOT_STMT(S) (S)->root_stmt +#define SLP_INSTANCE_ROOT_STMTS(S) (S)->root_stmts #define SLP_INSTANCE_KIND(S) (S)->kind #define SLP_TREE_CHILDREN(S) (S)->children @@ -861,11 +861,11 @@ loop_vec_info_for_loop (class loop *loop) struct slp_root { slp_root (slp_instance_kind kind_, vec stmts_, - stmt_vec_info root_) - : kind(kind_), stmts(stmts_), root(root_) {} + vec roots_) + : kind(kind_), stmts(stmts_), roots(roots_) {} slp_instance_kind kind; vec stmts; - stmt_vec_info root; + vec roots; }; typedef class _bb_vec_info : public vec_info -- cgit v1.1