aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-patterns.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2018-06-20 08:07:37 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2018-06-20 08:07:37 +0000
commitdabec68a1a2cedce988a4ab2d2141f2fee081d5b (patch)
treee2828bf542a88058b47b46e3fe745a3d77498481 /gcc/tree-vect-patterns.c
parentd1055d7bd74eb3eeb0b8ca1d658d13197034860f (diff)
[4/n] PR85694: Remove redundant calls to types_compatible_p
tree-vect-patterns.c checked that operands to primitive arithmetic ops are compatible with each other and with the result. The checks date back years and have long been redundant with verify_gimple_stmt. 2018-06-20 Richard Sandiford <richard.sandiford@arm.com> gcc/ * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Remove redundant check that the types of a PLUS_EXPR or MULT_EXPR agree. (vect_recog_sad_pattern): Likewise PLUS_EXPR, ABS_EXPR and MINUS_EXPR. (vect_recog_widen_mult_pattern): Likewise MULT_EXPR. (vect_recog_widen_sum_pattern): Likewise PLUS_EXPR. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@261787 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-patterns.c')
-rw-r--r--gcc/tree-vect-patterns.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index 5d0543f05d0..2387a8e1053 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -358,9 +358,6 @@ vect_recog_dot_prod_pattern (vec<gimple *> *stmts, tree *type_in,
return NULL;
oprnd0 = gimple_assign_rhs1 (last_stmt);
oprnd1 = gimple_assign_rhs2 (last_stmt);
- if (!types_compatible_p (TREE_TYPE (oprnd0), type)
- || !types_compatible_p (TREE_TYPE (oprnd1), type))
- return NULL;
stmt = last_stmt;
if (type_conversion_p (oprnd0, stmt, true, &half_type, &def_stmt,
@@ -421,9 +418,6 @@ vect_recog_dot_prod_pattern (vec<gimple *> *stmts, tree *type_in,
oprnd0 = gimple_assign_rhs1 (stmt);
oprnd1 = gimple_assign_rhs2 (stmt);
- if (!types_compatible_p (TREE_TYPE (oprnd0), prod_type)
- || !types_compatible_p (TREE_TYPE (oprnd1), prod_type))
- return NULL;
if (!type_conversion_p (oprnd0, stmt, true, &half_type0, &def_stmt,
&promotion)
|| !promotion)
@@ -578,9 +572,6 @@ vect_recog_sad_pattern (vec<gimple *> *stmts, tree *type_in,
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)
- || !types_compatible_p (TREE_TYPE (plus_oprnd1), sum_type))
- return NULL;
/* The type conversion could be promotion, demotion,
or just signed -> unsigned. */
@@ -620,8 +611,6 @@ vect_recog_sad_pattern (vec<gimple *> *stmts, tree *type_in,
return NULL;
tree abs_oprnd = gimple_assign_rhs1 (abs_stmt);
- if (!types_compatible_p (TREE_TYPE (abs_oprnd), abs_type))
- return NULL;
if (TYPE_UNSIGNED (abs_type))
return NULL;
@@ -655,9 +644,6 @@ vect_recog_sad_pattern (vec<gimple *> *stmts, tree *type_in,
tree minus_oprnd0 = gimple_assign_rhs1 (diff_stmt);
tree minus_oprnd1 = gimple_assign_rhs2 (diff_stmt);
- if (!types_compatible_p (TREE_TYPE (minus_oprnd0), abs_type)
- || !types_compatible_p (TREE_TYPE (minus_oprnd1), abs_type))
- return NULL;
if (!type_conversion_p (minus_oprnd0, diff_stmt, false,
&half_type0, &def_stmt, &promotion)
|| !promotion)
@@ -862,9 +848,6 @@ vect_recog_widen_mult_pattern (vec<gimple *> *stmts,
oprnd0 = gimple_assign_rhs1 (last_stmt);
oprnd1 = gimple_assign_rhs2 (last_stmt);
- if (!types_compatible_p (TREE_TYPE (oprnd0), type)
- || !types_compatible_p (TREE_TYPE (oprnd1), type))
- return NULL;
/* Check argument 0. */
if (!type_conversion_p (oprnd0, last_stmt, false, &half_type0, &def_stmt0,
@@ -1264,9 +1247,6 @@ vect_recog_widen_sum_pattern (vec<gimple *> *stmts, tree *type_in,
oprnd0 = gimple_assign_rhs1 (last_stmt);
oprnd1 = gimple_assign_rhs2 (last_stmt);
- if (!types_compatible_p (TREE_TYPE (oprnd0), type)
- || !types_compatible_p (TREE_TYPE (oprnd1), type))
- return NULL;
/* So far so good. Since last_stmt was detected as a (summation) reduction,
we know that oprnd1 is the reduction variable (defined by a loop-header