From: Richard Biener <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] tree-optimization/110460 - fend off vector types from vectorizer
Date: Thu, 29 Jun 2023 09:56:14 +0000 (UTC) [thread overview]
Message-ID: <20230629095614.4op7C7etcWUdxP5cxO_qqjauxOLyKXefzPB0P4VWKHQ@z> (raw)
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.
Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.
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 | 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);
--
2.35.3
reply other threads:[~2023-06-29 9:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230629095614.4op7C7etcWUdxP5cxO_qqjauxOLyKXefzPB0P4VWKHQ@z \
--to=rguenther@suse.de \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).