public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jeff Law <law@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/vendors/riscv/heads/ext-dce)] Strip STRICT_LOW_PART and paradoxical subregs before the mode size test.
Date: Tue, 14 Nov 2023 21:30:50 +0000 (GMT)	[thread overview]
Message-ID: <20231114213050.3C1023858D32@sourceware.org> (raw)

https://gcc.gnu.org/g:3b02d7ab96cf4d7fcdb8b9e0ed904002551e9597

commit 3b02d7ab96cf4d7fcdb8b9e0ed904002551e9597
Author: Jeff Law <jlaw@ventanamicro.com>
Date:   Tue Nov 14 14:29:33 2023 -0700

    Strip STRICT_LOW_PART and paradoxical subregs before the mode size test.

Diff:
---
 gcc/ext-dce.cc | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/gcc/ext-dce.cc b/gcc/ext-dce.cc
index e3e5cc5588c..d26da53418a 100644
--- a/gcc/ext-dce.cc
+++ b/gcc/ext-dce.cc
@@ -115,10 +115,6 @@ ext_dce_process_sets (rtx_insn *insn, bitmap livenow, bitmap live_tmp)
 	  if (VECTOR_MODE_P (GET_MODE (x)) || GET_MODE (x) > E_DImode)
 	    continue;
 
-	  /* Similarly if we have a SUBREG of a wide mode.  */
-	  if (SUBREG_P (x) && GET_MODE (SUBREG_REG (x)) > E_DImode)
-	    continue;
-
 	  /* We could have (strict_low_part (subreg ...)).  It's always safe
 	     to leave bits live, even when they are not.  So we can just
 	     strip the STRICT_LOW_PART for now.  Similarly for a paradoxical
@@ -126,6 +122,12 @@ ext_dce_process_sets (rtx_insn *insn, bitmap livenow, bitmap live_tmp)
 	  if (GET_CODE (x) == STRICT_LOW_PART || paradoxical_subreg_p (x))
 	    x = XEXP (x, 0);
 
+	  /* Similarly if we have a SUBREG of a wide mode.  Do this after
+	     stripping STRICT_LOW_PART or a paradoxical SUBREG to catch
+	     stuff like (strict_low_part (subreg:HI (reg:TI))).  */
+	  if (SUBREG_P (x) && GET_MODE (SUBREG_REG (x)) > E_DImode)
+	    continue;
+
 	  /* Phase one of destination handling.  First remove any wrapper
 	     such as SUBREG or ZERO_EXTRACT.  */
 	  unsigned HOST_WIDE_INT mask = GET_MODE_MASK (GET_MODE (x));

                 reply	other threads:[~2023-11-14 21:30 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=20231114213050.3C1023858D32@sourceware.org \
    --to=law@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).