diff options
author | Richard Biener <rguenther@suse.de> | 2019-08-29 08:07:35 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2019-08-29 08:07:35 +0000 |
commit | f48e4da3259d52076f86aa081cece40dfda7b235 (patch) | |
tree | 1614e85332b07f8e43f1bfa8746ecce55a7c2d1d /gcc/tree-vectorizer.h | |
parent | 8a902edbbdb53a00209e88b6182457941ff196a9 (diff) | |
download | gcc-f48e4da3259d52076f86aa081cece40dfda7b235.zip gcc-f48e4da3259d52076f86aa081cece40dfda7b235.tar.gz gcc-f48e4da3259d52076f86aa081cece40dfda7b235.tar.bz2 |
re PR tree-optimization/91568 (internal compiler error: in vect_schedule_slp_instance, at tree-vect-slp.c:3922)
2019-08-29 Richard Biener <rguenther@suse.de>
PR tree-optimization/91568
* tree-vectorizer.h (_slp_tree::max_nunits): Add.
(vect_update_max_nunits): Add overload for poly_uint64.
* tree-vect-slp.c (vect_create_new_slp_node): Initialize it.
(vect_build_slp_tree): Record max_nunits into the subtree
and merge it upwards.
(vect_print_slp_tree): Print max_nunits.
* gfortran.dg/pr91568.f: New testcase.
From-SVN: r275023
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r-- | gcc/tree-vectorizer.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 1456cde..05ad1c6 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -132,6 +132,9 @@ struct _slp_tree { unsigned int vec_stmts_size; /* Reference count in the SLP graph. */ unsigned int refcnt; + /* The maximum number of vector elements for the subtree rooted + at this node. */ + poly_uint64 max_nunits; /* Whether the scalar computations use two different operators. */ bool two_operators; /* The DEF type of this node. */ @@ -1375,19 +1378,27 @@ vect_get_num_copies (loop_vec_info loop_vinfo, tree vectype) } /* Update maximum unit count *MAX_NUNITS so that it accounts for - the number of units in vector type VECTYPE. *MAX_NUNITS can be 1 - if we haven't yet recorded any vector types. */ + NUNITS. *MAX_NUNITS can be 1 if we haven't yet recorded anything. */ static inline void -vect_update_max_nunits (poly_uint64 *max_nunits, tree vectype) +vect_update_max_nunits (poly_uint64 *max_nunits, poly_uint64 nunits) { /* All unit counts have the form current_vector_size * X for some rational X, so two unit sizes must have a common multiple. Everything is a multiple of the initial value of 1. */ - poly_uint64 nunits = TYPE_VECTOR_SUBPARTS (vectype); *max_nunits = force_common_multiple (*max_nunits, nunits); } +/* Update maximum unit count *MAX_NUNITS so that it accounts for + the number of units in vector type VECTYPE. *MAX_NUNITS can be 1 + if we haven't yet recorded any vector types. */ + +static inline void +vect_update_max_nunits (poly_uint64 *max_nunits, tree vectype) +{ + vect_update_max_nunits (max_nunits, TYPE_VECTOR_SUBPARTS (vectype)); +} + /* Return the vectorization factor that should be used for costing purposes while vectorizing the loop described by LOOP_VINFO. Pick a reasonable estimate if the vectorization factor isn't |