summaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.h
diff options
context:
space:
mode:
authoralahay01 <alahay01@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-23 12:40:33 +0000
committeralahay01 <alahay01@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-23 12:40:33 +0000
commitd09d8733585c184235fa47bdd5e607e2c40eeb21 (patch)
treeec11a15022b2040f90b22b7cbb903f7113eb29ec /gcc/tree-vectorizer.h
parentfc387d082ecab0a6c2dd73e471006756a430e14c (diff)
downloadgcc-d09d8733585c184235fa47bdd5e607e2c40eeb21.tar.gz
Support for vectorizing conditional expressions
2015-10-23 Alan Hayward <alan.hayward@arm.com> gcc/ PR tree-optimization/65947 * tree-vect-loop.c (vect_is_simple_reduction_1): Find condition reductions. (vect_model_reduction_cost): Add condition reduction costs. (get_initial_def_for_reduction): Add condition reduction initial var. (vect_create_epilog_for_reduction): Add condition reduction epilog. (vectorizable_reduction): Condition reduction support. * tree-vect-stmts.c (vectorizable_condition): Add vect reduction arg * doc/sourcebuild.texi (Vector-specific attributes): Document vect_max_reduc gcc/testsuite PR tree-optimization/65947 * lib/target-supports.exp (check_effective_target_vect_max_reduc): Add. * gcc.dg/vect/pr65947-1.c: New test. * gcc.dg/vect/pr65947-2.c: New test. * gcc.dg/vect/pr65947-3.c: New test. * gcc.dg/vect/pr65947-4.c: New test. * gcc.dg/vect/pr65947-5.c: New test. * gcc.dg/vect/pr65947-6.c: New test. * gcc.dg/vect/pr65947-7.c: New test. * gcc.dg/vect/pr65947-8.c: New test. * gcc.dg/vect/pr65947-9.c: New test. * gcc.dg/vect/pr65947-10.c: New test. * gcc.dg/vect/pr65947-11.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229245 138bc75d-0d04-0410-961f-82ee72b054a4
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 bdd8e6aec32..bf01deda4c5 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -60,6 +60,12 @@ enum vect_def_type {
vect_unknown_def_type
};
+/* Define type of reduction. */
+enum vect_reduction_type {
+ TREE_CODE_REDUCTION,
+ COND_REDUCTION
+};
+
#define VECTORIZABLE_CYCLE_DEF(D) (((D) == vect_reduction_def) \
|| ((D) == vect_double_reduction_def) \
|| ((D) == vect_nested_cycle))
@@ -581,6 +587,10 @@ typedef struct _stmt_vec_info {
/* For both loads and stores. */
bool simd_lane_access_p;
+
+ /* For reduction loops, this is the type of reduction. */
+ enum vect_reduction_type v_reduc_type;
+
} *stmt_vec_info;
/* Access Functions. */
@@ -609,6 +619,7 @@ STMT_VINFO_BB_VINFO (stmt_vec_info stmt_vinfo)
#define STMT_VINFO_GATHER_SCATTER_P(S) (S)->gather_scatter_p
#define STMT_VINFO_STRIDED_P(S) (S)->strided_p
#define STMT_VINFO_SIMD_LANE_ACCESS_P(S) (S)->simd_lane_access_p
+#define STMT_VINFO_VEC_REDUCTION_TYPE(S) (S)->v_reduc_type
#define STMT_VINFO_DR_BASE_ADDRESS(S) (S)->dr_base_address
#define STMT_VINFO_DR_INIT(S) (S)->dr_init