diff options
author | Richard Biener <rguenther@suse.de> | 2017-07-03 07:28:28 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2017-07-03 07:28:28 +0000 |
commit | c78e36522d21297b555185f5eeedd6e848eda684 (patch) | |
tree | 7fdd88d9eb9c5f83544cb4ff2ec1df7197ccc648 /gcc/tree-vect-slp.c | |
parent | bc9f4235bcac6304141c472c94ecedeb9dbbff56 (diff) | |
download | gcc-c78e36522d21297b555185f5eeedd6e848eda684.zip gcc-c78e36522d21297b555185f5eeedd6e848eda684.tar.gz gcc-c78e36522d21297b555185f5eeedd6e848eda684.tar.bz2 |
tree-vect-loop.c (vect_analyze_loop_operations): Also analyze reduction PHIs.
2016-07-03 Richard Biener <rguenther@suse.de>
* tree-vect-loop.c (vect_analyze_loop_operations): Also analyze
reduction PHIs.
(vect_force_simple_reduction): Record reduction def -> phi mapping.
(vectorizable_reduction): Perform reduction PHI creation when
visiting a reduction PHI and adjust and simplify code generation
phase of the reduction op. Cache dts, use fold_binary, not fold_build2.
(vect_transform_loop): Visit reduction PHIs.
* tree-vect-slp.c (vect_get_and_check_slp_defs): Record reduction
defs into the SLP tree.
(vect_build_slp_tree): Reduction defs terminate the recursion.
* tree-vect-stmts.c (vect_get_vec_def_for_operand_1): Allow lookup
of reduction defs.
(vect_get_vec_defs_for_stmt_copy): Export.
(vect_get_vec_defs): Likewise.
* tree-vectorizer.h (struct _stmt_vec_info): Amend reduc_def
purpose.
(vect_get_vec_defs_for_stmt_copy): Declare.
(vect_get_vec_defs): Likewise.
From-SVN: r249897
Diffstat (limited to 'gcc/tree-vect-slp.c')
-rw-r--r-- | gcc/tree-vect-slp.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index dd8658e..131f8f3 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -403,9 +403,9 @@ again: { case vect_constant_def: case vect_external_def: - case vect_reduction_def: break; + case vect_reduction_def: case vect_induction_def: case vect_internal_def: oprnd_info->def_stmts.quick_push (def_stmt); @@ -943,13 +943,15 @@ vect_build_slp_tree (vec_info *vinfo, else return NULL; - /* If the SLP node is a PHI (induction), terminate the recursion. */ + /* If the SLP node is a PHI (induction or reduction), terminate + the recursion. */ if (gimple_code (stmt) == GIMPLE_PHI) { - FOR_EACH_VEC_ELT (stmts, i, stmt) - if (stmt != stmts[0]) - /* Induction from different IVs is not supported. */ - return NULL; + /* Induction from different IVs is not supported. */ + if (STMT_VINFO_DEF_TYPE (vinfo_for_stmt (stmt)) == vect_induction_def) + FOR_EACH_VEC_ELT (stmts, i, stmt) + if (stmt != stmts[0]) + return NULL; node = vect_create_new_slp_node (stmts); return node; } @@ -1005,6 +1007,7 @@ vect_build_slp_tree (vec_info *vinfo, unsigned int j; if (oprnd_info->first_dt != vect_internal_def + && oprnd_info->first_dt != vect_reduction_def && oprnd_info->first_dt != vect_induction_def) continue; |