diff options
Diffstat (limited to 'gcc/tree-vect-patterns.c')
-rw-r--r-- | gcc/tree-vect-patterns.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c index 86d2447..42002c4 100644 --- a/gcc/tree-vect-patterns.c +++ b/gcc/tree-vect-patterns.c @@ -318,6 +318,11 @@ vect_recog_dot_prod_pattern (vec<gimple> *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<gimple> *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<gimple> *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<gimple> *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<gimple> *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<gimple> *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<gimple> *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<gimple> *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<gimple> *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; } |