aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-stmts.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2018-08-01 14:59:51 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-08-01 14:59:51 +0000
commit211cd1e2358d52d3863f727b650c65650dd5ce89 (patch)
tree476a8a7f646d5bbc213770789b6a60427671b4fb /gcc/tree-vect-stmts.c
parentb0b45e582f31b496ea37a76a20b1f79b25165635 (diff)
downloadgcc-211cd1e2358d52d3863f727b650c65650dd5ce89.zip
gcc-211cd1e2358d52d3863f727b650c65650dd5ce89.tar.gz
gcc-211cd1e2358d52d3863f727b650c65650dd5ce89.tar.bz2
[04/11] Add a vect_orig_stmt helper function
This patch just adds a helper function for going from a potential pattern statement to the original scalar statement. 2018-08-01 Richard Sandiford <richard.sandiford@arm.com> gcc/ * tree-vectorizer.h (vect_orig_stmt): New function. * tree-vect-data-refs.c (vect_preserves_scalar_order_p): Use it. * tree-vect-loop.c (vect_model_reduction_cost): Likewise. (vect_create_epilog_for_reduction): Likewise. (vectorizable_live_operation): Likewise. * tree-vect-slp.c (vect_find_last_scalar_stmt_in_slp): Likewise. (vect_detect_hybrid_slp_stmts, vect_schedule_slp): Likewise. * tree-vect-stmts.c (vectorizable_call): Likewise. (vectorizable_simd_clone_call, vect_remove_stores): Likewise. From-SVN: r263217
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r--gcc/tree-vect-stmts.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 28d5f8d..f3a2d80 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -3628,8 +3628,7 @@ vectorizable_call (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi,
if (slp_node)
return true;
- if (is_pattern_stmt_p (stmt_info))
- stmt_info = STMT_VINFO_RELATED_STMT (stmt_info);
+ stmt_info = vect_orig_stmt (stmt_info);
lhs = gimple_get_lhs (stmt_info->stmt);
gassign *new_stmt
@@ -4364,10 +4363,7 @@ vectorizable_simd_clone_call (stmt_vec_info stmt_info,
if (scalar_dest)
{
type = TREE_TYPE (scalar_dest);
- if (is_pattern_stmt_p (stmt_info))
- lhs = gimple_call_lhs (STMT_VINFO_RELATED_STMT (stmt_info)->stmt);
- else
- lhs = gimple_call_lhs (stmt);
+ lhs = gimple_call_lhs (vect_orig_stmt (stmt_info)->stmt);
new_stmt = gimple_build_assign (lhs, build_zero_cst (type));
}
else
@@ -9843,8 +9839,7 @@ vect_remove_stores (stmt_vec_info first_stmt_info)
while (next_stmt_info)
{
stmt_vec_info tmp = DR_GROUP_NEXT_ELEMENT (next_stmt_info);
- if (is_pattern_stmt_p (next_stmt_info))
- next_stmt_info = STMT_VINFO_RELATED_STMT (next_stmt_info);
+ next_stmt_info = vect_orig_stmt (next_stmt_info);
/* Free the attached stmt_vec_info and remove the stmt. */
vinfo->remove_stmt (next_stmt_info);
next_stmt_info = tmp;