From: Jeff Law <jlaw@ventanamicro.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: [committed][RISC-V]Don't reject constants in cmov condition
Date: Mon, 7 Aug 2023 14:36:37 -0600 [thread overview]
Message-ID: <f913b618-f708-2018-898b-57a8b84bb07f@ventanamicro.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 214 bytes --]
This test is too aggressive. Constants have VOIDmode, so we need to let
the through this phase of conditional move support.
Fixes several missed conditional moves with the trunk.
Committed to the trunk,
Jeff
[-- Attachment #2: P --]
[-- Type: text/plain, Size: 1304 bytes --]
commit 18c453f0e633abb9b317947b011ec6e07780fba8
Author: Jeff Law <jlaw@ventanamicro.com>
Date: Mon Aug 7 14:34:40 2023 -0600
[committed][RISC-V]Don't reject constants in cmov condition
This test is too aggressive. Constants have VOIDmode, so we need to let the
through this phase of conditional move support.
Fixes several missed conditional moves with the trunk.
gcc/
* config/riscv/riscv.cc (riscv_expand_conditional_move): Allow
VOIDmode operands to conditional before canonicalization.
diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index 279304afc19..5248dd3febe 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -3582,7 +3582,8 @@ riscv_expand_conditional_move (rtx dest, rtx op, rtx cons, rtx alt)
enforce that so that we don't strip away a sign_extension
thinking it is unnecessary. We might consider using
riscv_extend_operands if they are not already properly extended. */
- if (GET_MODE (op0) != word_mode || GET_MODE (op1) != word_mode)
+ if ((GET_MODE (op0) != word_mode && GET_MODE (op0) != VOIDmode)
+ || (GET_MODE (op1) != word_mode && GET_MODE (op1) != VOIDmode))
return false;
/* Canonicalize the comparison. It must be an equality comparison
next reply other threads:[~2023-08-07 20:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-07 20:36 Jeff Law [this message]
2023-08-07 23:42 ` Vineet Gupta
2023-08-08 14:27 ` Jeff Law
2023-08-08 17:21 ` RV64 Zicond ICE (was Re: [committed][RISC-V]Don't reject constants in cmov condition) Vineet Gupta
2023-08-08 17:46 ` Jeff Law
2023-08-08 21:41 ` Jeff Law
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=f913b618-f708-2018-898b-57a8b84bb07f@ventanamicro.com \
--to=jlaw@ventanamicro.com \
--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).