aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-patterns.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2019-10-08 13:39:03 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2019-10-08 13:39:03 +0000
commit69f8c1aef5cdcc54d5cb2ca4f99f4f26c2f822a9 (patch)
tree0ddd2e9b5af7bef9115a71ac714f0b9ab32281a6 /gcc/tree-vect-patterns.c
parent65b67cf390bc0240a91730e8eb95d7a7b2d8aca0 (diff)
downloadgcc-69f8c1aef5cdcc54d5cb2ca4f99f4f26c2f822a9.zip
gcc-69f8c1aef5cdcc54d5cb2ca4f99f4f26c2f822a9.tar.gz
gcc-69f8c1aef5cdcc54d5cb2ca4f99f4f26c2f822a9.tar.bz2
tree-vectorizer.h (_stmt_vec_info::v_reduc_type): Remove.
2019-10-08 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (_stmt_vec_info::v_reduc_type): Remove. (_stmt_vec_info::is_reduc_info): Add. (STMT_VINFO_VEC_REDUCTION_TYPE): Remove. (vectorizable_condition): Remove. (vectorizable_shift): Likewise. (vectorizable_reduction): Adjust. (info_for_reduction): New. * tree-vect-loop.c (vect_force_simple_reduction): Fold into... (vect_analyze_scalar_cycles_1): ... here. (vect_analyze_loop_operations): Adjust. (needs_fold_left_reduction_p): Simplify for single caller. (vect_is_simple_reduction): Likewise. Remove stmt restriction for nested cycles not part of double reductions. (vect_model_reduction_cost): Pass in the reduction type. (info_for_reduction): New function. (vect_create_epilog_for_reduction): Use it, access reduction meta off the stmt info it returns. Use STMT_VINFO_REDUC_TYPE instead of STMT_VINFO_VEC_REDUCTION_TYPE. (vectorize_fold_left_reduction): Remove pointless assert. (vectorizable_reduction): Analyze the full reduction when visiting the outermost PHI. Simplify. Use STMT_VINFO_REDUC_TYPE instead of STMT_VINFO_VEC_REDUCTION_TYPE. Direct reduction stmt code-generation to vectorizable_* in most cases. Verify code-generation only for cases handled by vect_transform_reductuon. (vect_transform_reduction): Use info_for_reduction to get at reduction meta. Simplify. (vect_transform_cycle_phi): Likewise. (vectorizable_live_operation): Likewise. * tree-vect-patterns.c (vect_reassociating_reduction_p): Look at the PHI node for STMT_VINFO_REDUC_TYPE. * tree-vect-slp.c (vect_schedule_slp_instance): Remove no longer necessary code. * tree-vect-stmts.c (vectorizable_shift): Make static again. (vectorizable_condition): Likewise. Get at reduction related info via info_for_reduction. (vect_analyze_stmt): Adjust. (vect_transform_stmt): Likewise. * tree-vectorizer.c (vec_info::new_stmt_vec_info): Initialize STMT_VINFO_REDUC_TYPE instead of STMT_VINFO_VEC_REDUCTION_TYPE. * gcc.dg/vect/pr65947-1.c: Adjust. * gcc.dg/vect/pr65947-13.c: Likewise. * gcc.dg/vect/pr65947-14.c: Likewise. * gcc.dg/vect/pr65947-4.c: Likewise. * gcc.dg/vect/pr80631-1.c: Likewise. * gcc.dg/vect/pr80631-2.c: Likewise. From-SVN: r276700
Diffstat (limited to 'gcc/tree-vect-patterns.c')
-rw-r--r--gcc/tree-vect-patterns.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index 09db74b..f9c7408 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -838,9 +838,11 @@ vect_convert_output (stmt_vec_info stmt_info, tree type, gimple *pattern_stmt,
static bool
vect_reassociating_reduction_p (stmt_vec_info stmt_vinfo)
{
- return (STMT_VINFO_DEF_TYPE (stmt_vinfo) == vect_reduction_def
- ? STMT_VINFO_REDUC_TYPE (stmt_vinfo) != FOLD_LEFT_REDUCTION
- : REDUC_GROUP_FIRST_ELEMENT (stmt_vinfo) != NULL);
+ if (STMT_VINFO_DEF_TYPE (stmt_vinfo) == vect_reduction_def)
+ return (STMT_VINFO_REDUC_TYPE (STMT_VINFO_REDUC_DEF (stmt_vinfo))
+ != FOLD_LEFT_REDUCTION);
+ else
+ return REDUC_GROUP_FIRST_ELEMENT (stmt_vinfo) != NULL;
}
/* As above, but also require it to have code CODE and to be a reduction