aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.h
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-vectorizer.h
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-vectorizer.h')
-rw-r--r--gcc/tree-vectorizer.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index 37833ce..a8403d5 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -1120,6 +1120,17 @@ is_pattern_stmt_p (stmt_vec_info stmt_info)
return stmt_info->pattern_stmt_p;
}
+/* If STMT_INFO is a pattern statement, return the statement that it
+ replaces, otherwise return STMT_INFO itself. */
+
+inline stmt_vec_info
+vect_orig_stmt (stmt_vec_info stmt_info)
+{
+ if (is_pattern_stmt_p (stmt_info))
+ return STMT_VINFO_RELATED_STMT (stmt_info);
+ return stmt_info;
+}
+
/* Return true if BB is a loop header. */
static inline bool