aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-stmts.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-06-06 07:37:14 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-06-06 07:37:14 +0000
commite7baeb396d313ef141f972cdedc19b12ef1b9cfe (patch)
treebcb9603549d0ee4ff166d61a0be4175d7142c721 /gcc/tree-vect-stmts.c
parent09a04a5e5e254b283b2ac765f75414ad5064e787 (diff)
downloadgcc-e7baeb396d313ef141f972cdedc19b12ef1b9cfe.zip
gcc-e7baeb396d313ef141f972cdedc19b12ef1b9cfe.tar.gz
gcc-e7baeb396d313ef141f972cdedc19b12ef1b9cfe.tar.bz2
re PR tree-optimization/80928 (SLP vectorization does not handle induction in outer loop vectorization)
2017-06-06 Richard Biener <rguenther@suse.de> PR tree-optimization/80928 * tree-vect-loop.c (vect_update_vf_for_slp): Amend dumps. (vect_analyze_loop_operations): Properly guard analysis for pure SLP case. (vect_transform_loop): Likewise. (vect_analyze_loop_2): Also reset SLP type on PHIs. (vect_model_induction_cost): Do not cost for pure SLP. (vectorizable_induction): Pass in SLP node, implement SLP vectorization of induction in inner loop vectorization. * tree-vect-slp.c (vect_create_new_slp_node): Handle PHIs. (vect_get_and_check_slp_defs): Handle vect_induction_def. (vect_build_slp_tree): Likewise. Handle PHIs as terminating the recursion. (vect_analyze_slp_cost_1): Cost induction. (vect_detect_hybrid_slp_stmts): Handle PHIs. (vect_get_slp_vect_defs): Likewise. * tree-vect-stmts.c (vect_analyze_stmt): Handle induction. (vect_transform_stmt): Handle SLP reductions. * tree-vectorizer.h (vectorizable_induction): Adjust. * gcc.dg/vect/pr80928.c: New testcase. * gcc.dg/vect/slp-13-big-array.c: Remove XFAILs. * gcc.dg/vect/slp-13.c: Likewise. * gcc.dg/vect/slp-perm-9.c: Prevent vectorization of check loop. From-SVN: r248909
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r--gcc/tree-vect-stmts.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 1e9d42c..d1d97cb 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -8520,6 +8520,9 @@ vect_analyze_stmt (gimple *stmt, bool *need_to_vectorize, slp_tree node)
break;
case vect_induction_def:
+ gcc_assert (!bb_vinfo);
+ break;
+
case vect_constant_def:
case vect_external_def:
case vect_unknown_def_type:
@@ -8598,6 +8601,7 @@ vect_analyze_stmt (gimple *stmt, bool *need_to_vectorize, slp_tree node)
|| vectorizable_call (stmt, NULL, NULL, node)
|| vectorizable_store (stmt, NULL, NULL, node)
|| vectorizable_reduction (stmt, NULL, NULL, node)
+ || vectorizable_induction (stmt, NULL, NULL, node)
|| vectorizable_condition (stmt, NULL, NULL, NULL, 0, node)
|| vectorizable_comparison (stmt, NULL, NULL, NULL, node));
else
@@ -8681,8 +8685,7 @@ vect_transform_stmt (gimple *stmt, gimple_stmt_iterator *gsi,
break;
case induc_vec_info_type:
- gcc_assert (!slp_node);
- done = vectorizable_induction (stmt, gsi, &vec_stmt);
+ done = vectorizable_induction (stmt, gsi, &vec_stmt, slp_node);
gcc_assert (done);
break;