diff options
author | Richard Biener <rguenther@suse.de> | 2024-05-06 12:03:09 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2024-05-07 08:24:04 +0200 |
commit | d0d6dcc019cd32eebf85d625f56e0f7573938319 (patch) | |
tree | 26c33a7eeac2b8bfd845c4b15f6847edff2e7e80 /gcc/tree-vect-stmts.cc | |
parent | 79649a5dcd81bc05c0ba591068c9075de43bd417 (diff) | |
download | gcc-d0d6dcc019cd32eebf85d625f56e0f7573938319.zip gcc-d0d6dcc019cd32eebf85d625f56e0f7573938319.tar.gz gcc-d0d6dcc019cd32eebf85d625f56e0f7573938319.tar.bz2 |
tree-optimization/114921 - _Float16 -> __bf16 isn't noop fixup
The following further strengthens the check which convert expressions
we allow to vectorize as simple copy by resorting to
tree_nop_conversion_p on the vector components.
PR tree-optimization/114921
* tree-vect-stmts.cc (vectorizable_assignment): Use
tree_nop_conversion_p to identify converts we can vectorize
with a simple assignment.
Diffstat (limited to 'gcc/tree-vect-stmts.cc')
-rw-r--r-- | gcc/tree-vect-stmts.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index 7e57196..21e8fe9 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -5957,15 +5957,15 @@ vectorizable_assignment (vec_info *vinfo, /* We can handle VIEW_CONVERT conversions that do not change the number of elements or the vector size or other conversions when the component - mode keeps the same. */ + types are nop-convertible. */ if (!vectype_in || maybe_ne (TYPE_VECTOR_SUBPARTS (vectype_in), nunits) || (code == VIEW_CONVERT_EXPR && maybe_ne (GET_MODE_SIZE (TYPE_MODE (vectype)), GET_MODE_SIZE (TYPE_MODE (vectype_in)))) || (CONVERT_EXPR_CODE_P (code) - && (TYPE_MODE (TREE_TYPE (vectype)) - != TYPE_MODE (TREE_TYPE (vectype_in))))) + && !tree_nop_conversion_p (TREE_TYPE (vectype), + TREE_TYPE (vectype_in)))) return false; if (VECTOR_BOOLEAN_TYPE_P (vectype) != VECTOR_BOOLEAN_TYPE_P (vectype_in)) |