tree-vect-patterns.c (vect_pattern_recog_1): Use VECTOR_TYPE_P instead of VECTOR_MODE...
authorJon Beniston <jon@beniston.com>
Wed, 30 Aug 2017 16:16:37 +0000 (16:16 +0000)
committerJon Beniston <jbeniston@gcc.gnu.org>
Wed, 30 Aug 2017 16:16:37 +0000 (16:16 +0000)
* 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 <rguenther@suse.de>
From-SVN: r251538

gcc/ChangeLog
gcc/tree-vect-patterns.c
gcc/tree-vect-stmts.c

index da37ce8a9657c9949493899d43547827b7cd0143..cc0dc48575e6cff15a13fb5860f5d20cdc6d89a8 100644 (file)
@@ -1,3 +1,11 @@
+2017-08-30  Jon Beniston  <jon@beniston.com>
+           Richard Biener  <rguenther@suse.de>
+
+       * 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  <richard.sandiford@linaro.org>
 
        * df.h (df_read_modify_subreg_p): Remove in favor of...
index 4fee7a8f60ca9fb1ebbf81e3294b39f78ff31ebc..cdad26112e421f599819a175f55146d84afb5fda 100644 (file)
@@ -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).  */
index 14089a65659d26ebdc01e336d6e8f0f2ab13fcbb..c9a0aafa1e5ec0837b339bf6fdf8a6e67d24b4fb 100644 (file)
@@ -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);