public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/riscv/heads/ext-dce)] Strip STRICT_LOW_PART and paradoxical subregs before the mode size test.
@ 2023-11-14 21:30 Jeff Law
  0 siblings, 0 replies; only message in thread
From: Jeff Law @ 2023-11-14 21:30 UTC (permalink / raw)
  To: gcc-cvs

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));

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-14 21:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-14 21:30 [gcc(refs/vendors/riscv/heads/ext-dce)] Strip STRICT_LOW_PART and paradoxical subregs before the mode size test Jeff Law

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).