aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2023-06-29 10:23:29 +0200
committerRichard Biener <rguenther@suse.de>2023-06-29 11:54:05 +0200
commitcd23ed2119120bd7b710fbe679fdfcb8f4461800 (patch)
tree081b537b19dec8bf6130a17adbe81fb3af11f52b /gcc
parent4633e38cd22c5e51fac984124c7627be912d0999 (diff)
downloadgcc-cd23ed2119120bd7b710fbe679fdfcb8f4461800.zip
gcc-cd23ed2119120bd7b710fbe679fdfcb8f4461800.tar.gz
gcc-cd23ed2119120bd7b710fbe679fdfcb8f4461800.tar.bz2
tree-optimization/110460 - fend off vector types from vectorizer
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree-vect-stmts.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index d642d3c..68faa8e 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -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);