public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Use df_read_modify_subreg_p in cprop.c
@ 2016-11-15 16:27 Richard Sandiford
  2016-11-15 21:49 ` Jeff Law
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Sandiford @ 2016-11-15 16:27 UTC (permalink / raw)
  To: gcc-patches

local_cprop_find_used_regs punted on all multiword registers,
with the comment:

      /* Setting a subreg of a register larger than word_mode leaves
         the non-written words unchanged.  */

But this only applies if the outer mode is smaller than the
inner mode.  If they're the same size then writes to the subreg
are a normal full update.

This patch uses df_read_modify_subreg_p instead.  A later patch
adds more uses of the same routine, but this part had a (positive)
effect on code generation for the testsuite whereas the others
seemed to be simple clean-ups.

Tested on aarch64-linux-gnu and x86_64-linux-gnu.  OK to install?

Thanks,
Richard


[ This patch is part of the SVE series posted here:
  https://gcc.gnu.org/ml/gcc/2016-11/msg00030.html ]

gcc/
2016-11-15  Richard Sandiford  <richard.sandiford@arm.com>
	    Alan Hayward  <alan.hayward@arm.com>
	    David Sherwood  <david.sherwood@arm.com>

	* cprop.c (local_cprop_find_used_regs): Use df_read_modify_subreg_p.

diff --git a/gcc/cprop.c b/gcc/cprop.c
index 6b4c0b8..31868a5 100644
--- a/gcc/cprop.c
+++ b/gcc/cprop.c
@@ -1161,9 +1161,7 @@ local_cprop_find_used_regs (rtx *xptr, void *data)
       return;
 
     case SUBREG:
-      /* Setting a subreg of a register larger than word_mode leaves
-	 the non-written words unchanged.  */
-      if (GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (x))) > BITS_PER_WORD)
+      if (df_read_modify_subreg_p (x))
 	return;
       break;
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-15 21:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-15 16:27 Use df_read_modify_subreg_p in cprop.c Richard Sandiford
2016-11-15 21:49 ` 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).