public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-2186] tree-optimization/110460 - fend off vector types from vectorizer
@ 2023-06-29  9:57 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2023-06-29  9:57 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:cd23ed2119120bd7b710fbe679fdfcb8f4461800

commit r14-2186-gcd23ed2119120bd7b710fbe679fdfcb8f4461800
Author: Richard Biener <rguenther@suse.de>
Date:   Thu Jun 29 10:23:29 2023 +0200

    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.

Diff:
---
 gcc/tree-vect-stmts.cc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index d642d3c257f..68faa8ead39 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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-06-29  9:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-29  9:57 [gcc r14-2186] tree-optimization/110460 - fend off vector types from vectorizer Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).