From: Juzhe-Zhong <juzhe.zhong@rivai.ai>
To: gcc-patches@gcc.gnu.org
Cc: richard.sandiford@arm.com, rguenther@suse.de,
Juzhe-Zhong <juzhe.zhong@rivai.ai>
Subject: [PATCH] MATCH: Optimize COND_ADD reduction pattern
Date: Tue, 26 Sep 2023 16:25:48 +0800 [thread overview]
Message-ID: <20230926082548.944794-1-juzhe.zhong@rivai.ai> (raw)
Current COND_ADD reduction pattern can't optimize floating-point vector.
As Richard suggested: https://gcc.gnu.org/pipermail/gcc-patches/2023-September/631336.html
Allow COND_ADD reduction pattern to optimize floating-point vector.
Bootstrap and Regression is running.
Ok for trunk if tests pass ?
gcc/ChangeLog:
* match.pd: Optimize COND_ADD reduction pattern.
---
gcc/match.pd | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/gcc/match.pd b/gcc/match.pd
index 5061c19e086..398beaebd27 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -8863,8 +8863,10 @@ and,
c = mask1 && mask2 ? d + b : d. */
(simplify
- (IFN_COND_ADD @0 @1 (vec_cond @2 @3 integer_zerop) @1)
- (IFN_COND_ADD (bit_and @0 @2) @1 @3 @1))
+ (IFN_COND_ADD @0 @1 (vec_cond @2 @3 zerop@4) @1)
+ (if (ANY_INTEGRAL_TYPE_P (type)
+ || fold_real_zero_addition_p (type, NULL_TREE, @4, 0))
+ (IFN_COND_ADD (bit_and @0 @2) @1 @3 @1)))
/* Detect simplication for a conditional length reduction where
--
2.36.3
next reply other threads:[~2023-09-26 8:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-26 8:25 Juzhe-Zhong [this message]
2023-09-26 9:41 ` Richard Biener
2023-09-26 9:59 ` juzhe.zhong
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=20230926082548.944794-1-juzhe.zhong@rivai.ai \
--to=juzhe.zhong@rivai.ai \
--cc=gcc-patches@gcc.gnu.org \
--cc=rguenther@suse.de \
--cc=richard.sandiford@arm.com \
/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).