From 4c8fd8ac5bdee9b76d41e78d63908129122a51d5 Mon Sep 17 00:00:00 2001 From: Jon Beniston Date: Wed, 30 Aug 2017 16:16:37 +0000 Subject: [PATCH] tree-vect-patterns.c (vect_pattern_recog_1): Use VECTOR_TYPE_P instead of VECTOR_MODE_P check. * tree-vect-patterns.c (vect_pattern_recog_1): Use VECTOR_TYPE_P instead of VECTOR_MODE_P check. * tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): Allow single element vector types. Co-Authored-By: Richard Biener From-SVN: r251538 --- gcc/ChangeLog | 8 ++++++++ gcc/tree-vect-patterns.c | 2 +- gcc/tree-vect-stmts.c | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index da37ce8a965..cc0dc48575e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2017-08-30 Jon Beniston + Richard Biener + + * tree-vect-patterns.c (vect_pattern_recog_1): Use VECTOR_TYPE_P instead + of VECTOR_MODE_P check. + * tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): Allow single + element vector types. + 2017-08-30 Richard Sandiford * df.h (df_read_modify_subreg_p): Remove in favor of... diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c index 4fee7a8f60c..cdad26112e4 100644 --- a/gcc/tree-vect-patterns.c +++ b/gcc/tree-vect-patterns.c @@ -4152,7 +4152,7 @@ vect_pattern_recog_1 (vect_recog_func *recog_func, loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info); if (VECTOR_BOOLEAN_TYPE_P (type_in) - || VECTOR_MODE_P (TYPE_MODE (type_in))) + || VECTOR_TYPE_P (type_in)) { /* No need to check target support (already checked by the pattern recognition function). */ diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 14089a65659..c9a0aafa1e5 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -9101,7 +9101,8 @@ get_vectype_for_scalar_type_and_size (tree scalar_type, unsigned size) else simd_mode = mode_for_vector (inner_mode, size / nbytes); nunits = GET_MODE_SIZE (simd_mode) / nbytes; - if (nunits <= 1) + /* NOTE: nunits == 1 is allowed to support single element vector types. */ + if (nunits < 1) return NULL_TREE; vectype = build_vector_type (scalar_type, nunits); -- 2.30.2