public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/autopar_devel] tree-optimization/92260 - improve fix
@ 2020-08-22 21:17 Giuliano Belinassi
0 siblings, 0 replies; only message in thread
From: Giuliano Belinassi @ 2020-08-22 21:17 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:d8e6d84b3c915eb485aadd1de48045fdbd5b112b
commit d8e6d84b3c915eb485aadd1de48045fdbd5b112b
Author: Richard Biener <rguenther@suse.de>
Date: Fri May 15 11:14:53 2020 +0200
tree-optimization/92260 - improve fix
This improves the fix for PR92260 changing the number of vector
computation to the canonical one, not needing to look at the
using stmt.
2020-05-15 Richard Biener <rguenther@suse.de>
PR tree-optimization/92260
* tree-vect-slp.c (vect_get_constant_vectors): Compute
the number of vector stmts in a canonical way.
Diff:
---
gcc/ChangeLog | 6 ++++++
gcc/tree-vect-slp.c | 19 ++++++-------------
2 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cc761f2c6b6..5eaa1b8af27 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2020-05-15 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/92260
+ * tree-vect-slp.c (vect_get_constant_vectors): Compute
+ the number of vector stmts in a canonical way.
+
2020-05-15 Martin Liska <mliska@suse.cz>
* hsa-gen.c (get_symbol_for_decl): Fix misleading indentation
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 6f623955ce5..15eea74d8d1 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -3561,19 +3561,12 @@ vect_get_constant_vectors (vec_info *vinfo,
else
vector_type = get_vectype_for_scalar_type (vinfo, TREE_TYPE (op), op_node);
- /* ??? For lane-reducing ops we should also have the required number
- of vector stmts initialized rather than second-guessing here. */
- unsigned int number_of_vectors;
- if (is_gimple_assign (stmt_vinfo->stmt)
- && (gimple_assign_rhs_code (stmt_vinfo->stmt) == SAD_EXPR
- || gimple_assign_rhs_code (stmt_vinfo->stmt) == DOT_PROD_EXPR
- || gimple_assign_rhs_code (stmt_vinfo->stmt) == WIDEN_SUM_EXPR))
- number_of_vectors = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node);
- else
- number_of_vectors
- = vect_get_num_vectors (SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node)
- * TYPE_VECTOR_SUBPARTS (stmt_vectype),
- vector_type);
+ poly_uint64 vf = 1;
+ if (loop_vec_info loop_vinfo = dyn_cast <loop_vec_info> (vinfo))
+ vf = loop_vinfo->vectorization_factor;
+ unsigned int number_of_vectors
+ = vect_get_num_vectors (vf * group_size, vector_type);
+
vec_oprnds->create (number_of_vectors);
auto_vec<tree> voprnds (number_of_vectors);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-08-22 21:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-22 21:17 [gcc/devel/autopar_devel] tree-optimization/92260 - improve fix Giuliano Belinassi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).