public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Uros Bizjak <uros@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-3171] [i386] Call force_reg unconditionally.
Date: Thu, 26 Aug 2021 20:09:36 +0000 (GMT)	[thread overview]
Message-ID: <20210826200936.6ECAC3858D3C@sourceware.org> (raw)

https://gcc.gnu.org/g:5a6c626710ad2ac4baa2dba02fac0750177e3305

commit r12-3171-g5a6c626710ad2ac4baa2dba02fac0750177e3305
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Thu Aug 26 22:08:25 2021 +0200

    [i386] Call force_reg unconditionally.
    
    There is no point to check RTXes before calling force_reg,
    force_reg checks for REG RTX by itself.
    
    2021-08-26  Uroš Bizjak  <ubizjak@gmail.com>
    
    gcc/
            * config/i386/i386.md (*btr<mode>_1): Call force_reg unconditionally.
            (conditional moves with memory inputs splitters): Ditto.
            * config/i386/sse.md (one_cmpl<mode>2): Simplify.

Diff:
---
 gcc/config/i386/i386.md | 15 +++++----------
 gcc/config/i386/sse.md  |  6 +++---
 2 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index c80dcb57a18..528116dfe2d 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -12728,8 +12728,7 @@
       (clobber (reg:CC FLAGS_REG))])]
 {
   operands[0] = lowpart_subreg (SImode, operands[0], <MODE>mode);
-  if (MEM_P (operands[1]))
-    operands[1] = force_reg (<MODE>mode, operands[1]);
+  operands[1] = force_reg (<MODE>mode, operands[1]);
   operands[1] = lowpart_subreg (SImode, operands[1], <MODE>mode);
 })
 
@@ -19352,10 +19351,8 @@
   [(set (match_dup 0)
 	(if_then_else:SWI248 (match_dup 1) (match_dup 2) (match_dup 3)))]
 {
-  if (MEM_P (operands[2]))
-    operands[2] = force_reg (<MODE>mode, operands[2]);
-  if (MEM_P (operands[3]))
-    operands[3] = force_reg (<MODE>mode, operands[3]);
+  operands[2] = force_reg (<MODE>mode, operands[2]);
+  operands[3] = force_reg (<MODE>mode, operands[3]);
 })
 
 (define_insn "*movqicc_noc"
@@ -19603,10 +19600,8 @@
   [(set (match_dup 0)
 	(if_then_else:MODEF (match_dup 1) (match_dup 2) (match_dup 3)))]
 {
-  if (MEM_P (operands[2]))
-    operands[2] = force_reg (<MODE>mode, operands[2]);
-  if (MEM_P (operands[3]))
-    operands[3] = force_reg (<MODE>mode, operands[3]);
+  operands[2] = force_reg (<MODE>mode, operands[2]);
+  operands[3] = force_reg (<MODE>mode, operands[3]);
 })
 
 ;; Don't do conditional moves with memory inputs
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 03fc2df1fb0..0ca322996ce 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -14318,10 +14318,10 @@
 		(match_dup 2)))]
   "TARGET_SSE"
 {
+  operands[2] = CONSTM1_RTX (<MODE>mode);
+
   if (!TARGET_AVX512F)
-    operands[2] = force_reg (<MODE>mode, CONSTM1_RTX (<MODE>mode));
-  else
-    operands[2] = CONSTM1_RTX (<MODE>mode);
+    operands[2] = force_reg (<MODE>mode, operands[2]);
 })
 
 (define_insn "<mask_codefor>one_cmpl<mode>2<mask_name>"


                 reply	other threads:[~2021-08-26 20:09 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=20210826200936.6ECAC3858D3C@sourceware.org \
    --to=uros@gcc.gnu.org \
    --cc=gcc-cvs@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).