This was added when invariants/externals outside of SLP didn't have
an easily accessible vector type. Now it's redundant so the
following removes it.
Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.
* tree-vectorizer.h (stmt_vec_info_::reduc_vectype_in): Remove.
(STMT_VINFO_REDUC_VECTYPE_IN): Likewise.
* tree-vect-loop.cc (vect_is_emulated_mixed_dot_prod): Get
at the input vectype via the SLP node child.
(vectorizable_lane_reducing): Likewise.
(vect_transform_reduction): Likewise.
(vectorizable_reduction): Do not set STMT_VINFO_REDUC_VECTYPE_IN.
---
gcc/tree-vect-loop.cc | 19 +++++--------------
gcc/tree-vectorizer.h | 3 ---
2 files changed, 5 insertions(+), 17 deletions(-)
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index aab375a4d11..2bea904de82 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -4798,10 +4798,10 @@ vect_is_emulated_mixed_dot_prod (slp_tree slp_node)
if (TYPE_SIGN (TREE_TYPE (rhs1)) == TYPE_SIGN (TREE_TYPE (rhs2)))
return false;
- gcc_assert (STMT_VINFO_REDUC_VECTYPE_IN (stmt_info));
return !directly_supported_p (DOT_PROD_EXPR,
SLP_TREE_VECTYPE (slp_node),
- STMT_VINFO_REDUC_VECTYPE_IN (stmt_info),
+ SLP_TREE_VECTYPE
+ (SLP_TREE_CHILDREN (slp_node)[0]),
optab_vector_mixed_sign);
}
@@ -6934,8 +6934,7 @@ vectorizable_lane_reducing (loop_vec_info loop_vinfo,
stmt_vec_info stmt_info,
return false;
}
- tree vectype_in = STMT_VINFO_REDUC_VECTYPE_IN (stmt_info);
-
+ tree vectype_in = SLP_TREE_VECTYPE (SLP_TREE_CHILDREN (slp_node)[0]);
gcc_assert (vectype_in);
/* Compute number of effective vector statements for costing. */
@@ -7207,11 +7206,6 @@ vectorizable_reduction (loop_vec_info loop_vinfo,
reduction PHI information. */
STMT_VINFO_REDUC_DEF (def) = phi_info;
- /* Each lane-reducing operation has its own input vectype, while
- reduction PHI will record the input vectype with the least
- lanes. */
- STMT_VINFO_REDUC_VECTYPE_IN (vdef) = vectype_op;
-
/* To accommodate lane-reducing operations of mixed input
vectypes, choose input vectype with the least lanes for the
reduction PHI statement, which would result in the most
@@ -8025,10 +8019,7 @@ vect_transform_reduction (loop_vec_info loop_vinfo,
stmt_vec_info phi_info = STMT_VINFO_REDUC_DEF (vect_orig_stmt (stmt_info));
gphi *reduc_def_phi = as_a <gphi *> (phi_info->stmt);
int reduc_index = STMT_VINFO_REDUC_IDX (stmt_info);
- tree vectype_in = STMT_VINFO_REDUC_VECTYPE_IN (stmt_info);
-
- if (!vectype_in)
- vectype_in = SLP_TREE_VECTYPE (slp_node);
+ tree vectype_in = SLP_TREE_VECTYPE (SLP_TREE_CHILDREN (slp_node)[0]);
vec_num = vect_get_num_copies (loop_vinfo, slp_node, vectype_in);
@@ -8205,7 +8196,7 @@ vect_transform_reduction (loop_vec_info loop_vinfo,
}
}
- tree reduc_vectype_in = STMT_VINFO_REDUC_VECTYPE_IN (stmt_info);
+ tree reduc_vectype_in = vectype_in;
gcc_assert (reduc_vectype_in);
unsigned effec_reduc_ncopies
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index 729fa822775..67154d3eaf5 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -1518,9 +1518,6 @@ public:
corresponding PHI. */
stmt_vec_info reduc_def;
- /* The vector input type relevant for reduction vectorization. */
- tree reduc_vectype_in;
-
/* The vector type for performing the actual reduction. */
tree reduc_vectype;
--
2.43.0