]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/110460 - fend off vector types from vectorizer
authorRichard Biener <rguenther@suse.de>
Thu, 29 Jun 2023 08:23:29 +0000 (10:23 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 29 Jun 2023 09:54:05 +0000 (11:54 +0200)
The following makes fending off existing vector types from vectorization
also apply to word_mode vector types.  I've chosen to add a positive
list of allowed scalar types here for clarity.

PR tree-optimization/110460
* tree-vect-stmts.cc (get_related_vectype_for_scalar_type):
Only allow integral, pointer and scalar float type scalar_type.

gcc/tree-vect-stmts.cc

index d642d3c257f8d540a8562eedbcd40372b9550959..68faa8ead39d34a56e30759cb593ab0a7631ab65 100644 (file)
@@ -12174,8 +12174,11 @@ get_related_vectype_for_scalar_type (machine_mode prevailing_mode,
   machine_mode simd_mode;
   tree vectype;
 
-  if (!is_int_mode (TYPE_MODE (scalar_type), &inner_mode)
-      && !is_float_mode (TYPE_MODE (scalar_type), &inner_mode))
+  if ((!INTEGRAL_TYPE_P (scalar_type)
+       && !POINTER_TYPE_P (scalar_type)
+       && !SCALAR_FLOAT_TYPE_P (scalar_type))
+      || (!is_int_mode (TYPE_MODE (scalar_type), &inner_mode)
+         && !is_float_mode (TYPE_MODE (scalar_type), &inner_mode)))
     return NULL_TREE;
 
   unsigned int nbytes = GET_MODE_SIZE (inner_mode);