From: Richard Biener Date: Fri, 22 May 2015 08:55:59 +0000 (+0000) Subject: tree-vect-patterns.c (vect_recog_dot_prod_pattern): Replace assert with guard, remove... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=328dc4771b6a34b8630f6508577d10d5ea1774a2;p=gcc.git tree-vect-patterns.c (vect_recog_dot_prod_pattern): Replace assert with guard, remove check on detected reduction. 2015-05-22 Richard Biener * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Replace assert with guard, remove check on detected reduction. (vect_recog_sad_pattern): Likewise. (vect_recog_widen_sum_pattern): Likewise. From-SVN: r223525 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fa8e76502d4..4a6a81edec2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-05-22 Richard Biener + + * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Replace + assert with guard, remove check on detected reduction. + (vect_recog_sad_pattern): Likewise. + (vect_recog_widen_sum_pattern): Likewise. + 2015-05-22 Kyrylo Tkachov * config/aarch64/arm_neon.h (vaeseq_u8): Add __extension__ and diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c index 86d2447361b..42002c464d0 100644 --- a/gcc/tree-vect-patterns.c +++ b/gcc/tree-vect-patterns.c @@ -318,6 +318,11 @@ vect_recog_dot_prod_pattern (vec *stmts, tree *type_in, loop = LOOP_VINFO_LOOP (loop_info); + /* We don't allow changing the order of the computation in the inner-loop + when doing outer-loop vectorization. */ + if (loop && nested_in_vect_loop_p (loop, last_stmt)) + return NULL; + if (!is_gimple_assign (last_stmt)) return NULL; @@ -366,8 +371,6 @@ vect_recog_dot_prod_pattern (vec *stmts, tree *type_in, { gimple def_stmt; - if (STMT_VINFO_DEF_TYPE (stmt_vinfo) != vect_reduction_def) - return NULL; oprnd0 = gimple_assign_rhs1 (last_stmt); oprnd1 = gimple_assign_rhs2 (last_stmt); if (!types_compatible_p (TREE_TYPE (oprnd0), type) @@ -469,10 +472,6 @@ vect_recog_dot_prod_pattern (vec *stmts, tree *type_in, dump_printf (MSG_NOTE, "\n"); } - /* We don't allow changing the order of the computation in the inner-loop - when doing outer-loop vectorization. */ - gcc_assert (!nested_in_vect_loop_p (loop, last_stmt)); - return pattern_stmt; } @@ -533,6 +532,11 @@ vect_recog_sad_pattern (vec *stmts, tree *type_in, loop = LOOP_VINFO_LOOP (loop_info); + /* We don't allow changing the order of the computation in the inner-loop + when doing outer-loop vectorization. */ + if (loop && nested_in_vect_loop_p (loop, last_stmt)) + return NULL; + if (!is_gimple_assign (last_stmt)) return NULL; @@ -586,8 +590,6 @@ vect_recog_sad_pattern (vec *stmts, tree *type_in, { gimple def_stmt; - if (STMT_VINFO_DEF_TYPE (stmt_vinfo) != vect_reduction_def) - return NULL; plus_oprnd0 = gimple_assign_rhs1 (last_stmt); plus_oprnd1 = gimple_assign_rhs2 (last_stmt); if (!types_compatible_p (TREE_TYPE (plus_oprnd0), sum_type) @@ -703,10 +705,6 @@ vect_recog_sad_pattern (vec *stmts, tree *type_in, dump_printf (MSG_NOTE, "\n"); } - /* We don't allow changing the order of the computation in the inner-loop - when doing outer-loop vectorization. */ - gcc_assert (!nested_in_vect_loop_p (loop, last_stmt)); - return pattern_stmt; } @@ -1201,6 +1199,11 @@ vect_recog_widen_sum_pattern (vec *stmts, tree *type_in, loop = LOOP_VINFO_LOOP (loop_info); + /* We don't allow changing the order of the computation in the inner-loop + when doing outer-loop vectorization. */ + if (loop && nested_in_vect_loop_p (loop, last_stmt)) + return NULL; + if (!is_gimple_assign (last_stmt)) return NULL; @@ -1219,9 +1222,6 @@ vect_recog_widen_sum_pattern (vec *stmts, tree *type_in, if (gimple_assign_rhs_code (last_stmt) != PLUS_EXPR) return NULL; - if (STMT_VINFO_DEF_TYPE (stmt_vinfo) != vect_reduction_def) - return NULL; - oprnd0 = gimple_assign_rhs1 (last_stmt); oprnd1 = gimple_assign_rhs2 (last_stmt); if (!types_compatible_p (TREE_TYPE (oprnd0), type) @@ -1255,10 +1255,6 @@ vect_recog_widen_sum_pattern (vec *stmts, tree *type_in, dump_printf (MSG_NOTE, "\n"); } - /* We don't allow changing the order of the computation in the inner-loop - when doing outer-loop vectorization. */ - gcc_assert (!nested_in_vect_loop_p (loop, last_stmt)); - return pattern_stmt; }