aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-slp.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-slp.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-slp.c')
-rw-r--r--gcc/tree-vect-slp.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index cee2c7f..f9a83dd 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -1848,8 +1848,7 @@ vect_find_last_scalar_stmt_in_slp (slp_tree node)
for (int i = 0; SLP_TREE_SCALAR_STMTS (node).iterate (i, &stmt_vinfo); i++)
{
- if (is_pattern_stmt_p (stmt_vinfo))
- stmt_vinfo = STMT_VINFO_RELATED_STMT (stmt_vinfo);
+ stmt_vinfo = vect_orig_stmt (stmt_vinfo);
last = last ? get_later_stmt (stmt_vinfo, last) : stmt_vinfo;
}
@@ -2314,10 +2313,7 @@ vect_detect_hybrid_slp_stmts (slp_tree node, unsigned i, slp_vect_type stype)
gcc_checking_assert (PURE_SLP_STMT (stmt_vinfo));
/* If we get a pattern stmt here we have to use the LHS of the
original stmt for immediate uses. */
- gimple *stmt = stmt_vinfo->stmt;
- if (! STMT_VINFO_IN_PATTERN_P (stmt_vinfo)
- && STMT_VINFO_RELATED_STMT (stmt_vinfo))
- stmt = STMT_VINFO_RELATED_STMT (stmt_vinfo)->stmt;
+ gimple *stmt = vect_orig_stmt (stmt_vinfo)->stmt;
tree def;
if (gimple_code (stmt) == GIMPLE_PHI)
def = gimple_phi_result (stmt);
@@ -4087,8 +4083,7 @@ vect_schedule_slp (vec_info *vinfo)
if (!STMT_VINFO_DATA_REF (store_info))
break;
- if (is_pattern_stmt_p (store_info))
- store_info = STMT_VINFO_RELATED_STMT (store_info);
+ store_info = vect_orig_stmt (store_info);
/* Free the attached stmt_vec_info and remove the stmt. */
vinfo->remove_stmt (store_info);
}