public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <richard.sandiford@arm.com>
To: gcc-patches@gcc.gnu.org
Subject: [8/9] Remove END_HARD_REGNO
Date: Mon, 18 May 2015 18:26:00 -0000	[thread overview]
Message-ID: <87oalhspxs.fsf@e105548-lin.cambridge.arm.com> (raw)
In-Reply-To: <87oalhu59s.fsf@e105548-lin.cambridge.arm.com> (Richard	Sandiford's message of "Mon, 18 May 2015 19:09:19 +0100")

This patch replaces calls to END_HARD_REGNO with calls to END_REGNO and
moves END_REGNO to rtl.h (since it's now just a REG access).


gcc/
	* regs.h (END_HARD_REGNO): Delete.
	(END_REGNO): Move to...
	* rtl.h: ...here.
	* bt-load.c (note_btr_set): Use END_REGNO instead of END_HARD_REGNO.
	* caller-save.c (mark_set_regs): Likewise.
	* combine.c (move_deaths, distribute_notes): Likewise.
	* cse.c (invalidate, invalidate_for_call): Likewise.
	* df-scan.c (df_ref_record): Likewise.
	* postreload-gcse.c (reg_changed_after_insn_p): Likewise.
	(record_last_reg_set_info): Likewise.
	* reg-stack.c (convert_regs_exit): Likewise.
	* reload.c (reg_overlap_mentioned_for_reload_p): Likewise.
	* resource.c (update_live_status): Likewise.
	* rtlanal.c (find_reg_fusage, find_regno_fusage): Likewise.

Index: gcc/regs.h
===================================================================
--- gcc/regs.h	2015-05-18 08:36:41.951019042 +0100
+++ gcc/regs.h	2015-05-18 08:36:41.947019063 +0100
@@ -286,14 +286,6 @@ end_hard_regno (machine_mode mode, unsig
   return regno + hard_regno_nregs[regno][(int) mode];
 }
 
-/* Likewise for hard register X.  */
-
-#define END_HARD_REGNO(X) END_REGNO (X)
-
-/* Likewise for hard or pseudo register X.  */
-
-#define END_REGNO(X) (REGNO (X) + REG_NREGS (X))
-
 /* Add to REGS all the registers required to store a value of mode MODE
    in register REGNO.  */
 
Index: gcc/rtl.h
===================================================================
--- gcc/rtl.h	2015-05-18 08:36:41.951019042 +0100
+++ gcc/rtl.h	2015-05-18 08:37:14.494621384 +0100
@@ -1733,6 +1733,13 @@ rhs_regno (const_rtx x)
   return REG_CHECK (x)->regno;
 }
 
+/* Return the final register in REG X plus one.  */
+static inline unsigned int
+END_REGNO (const_rtx x)
+{
+  return REGNO (x) + REG_NREGS (x);
+}
+
 /* Change the REGNO and REG_NREGS of REG X to the specified values,
    bypassing the df machinery.  */
 static inline void
Index: gcc/bt-load.c
===================================================================
--- gcc/bt-load.c	2015-05-18 08:36:41.951019042 +0100
+++ gcc/bt-load.c	2015-05-18 08:36:41.943019110 +0100
@@ -443,7 +443,7 @@ note_btr_set (rtx dest, const_rtx set AT
   if (!REG_P (dest))
     return;
   regno = REGNO (dest);
-  end_regno = END_HARD_REGNO (dest);
+  end_regno = END_REGNO (dest);
   for (; regno < end_regno; regno++)
     if (TEST_HARD_REG_BIT (all_btrs, regno))
       {
Index: gcc/caller-save.c
===================================================================
--- gcc/caller-save.c	2015-05-18 08:36:41.951019042 +0100
+++ gcc/caller-save.c	2015-05-18 08:36:41.947019063 +0100
@@ -992,7 +992,7 @@ mark_set_regs (rtx reg, const_rtx setter
 	   && REGNO (reg) < FIRST_PSEUDO_REGISTER)
     {
       regno = REGNO (reg);
-      endregno = END_HARD_REGNO (reg);
+      endregno = END_REGNO (reg);
     }
   else
     return;
Index: gcc/combine.c
===================================================================
--- gcc/combine.c	2015-05-18 08:36:41.951019042 +0100
+++ gcc/combine.c	2015-05-18 08:36:41.947019063 +0100
@@ -13316,8 +13316,8 @@ move_deaths (rtx x, rtx maybe_kill_insn,
 		  > GET_MODE_SIZE (GET_MODE (x))))
 	    {
 	      unsigned int deadregno = REGNO (XEXP (note, 0));
-	      unsigned int deadend = END_HARD_REGNO (XEXP (note, 0));
-	      unsigned int ourend = END_HARD_REGNO (x);
+	      unsigned int deadend = END_REGNO (XEXP (note, 0));
+	      unsigned int ourend = END_REGNO (x);
 	      unsigned int i;
 
 	      for (i = deadregno; i < deadend; i++)
@@ -13337,7 +13337,7 @@ move_deaths (rtx x, rtx maybe_kill_insn,
 		   && regno < FIRST_PSEUDO_REGISTER
 		   && REG_NREGS (x) > 1)
 	    {
-	      unsigned int ourend = END_HARD_REGNO (x);
+	      unsigned int ourend = END_REGNO (x);
 	      unsigned int i, offset;
 	      rtx oldnotes = 0;
 
@@ -13932,7 +13932,7 @@ distribute_notes (rtx notes, rtx_insn *f
 
 	      if (place && REG_NREGS (XEXP (note, 0)) > 1)
 		{
-		  unsigned int endregno = END_HARD_REGNO (XEXP (note, 0));
+		  unsigned int endregno = END_REGNO (XEXP (note, 0));
 		  bool all_used = true;
 		  unsigned int i;
 
Index: gcc/cse.c
===================================================================
--- gcc/cse.c	2015-05-18 08:36:41.951019042 +0100
+++ gcc/cse.c	2015-05-18 08:36:41.947019063 +0100
@@ -1894,7 +1894,7 @@ invalidate (rtx x, machine_mode full_mod
 	  {
 	    HOST_WIDE_INT in_table
 	      = TEST_HARD_REG_BIT (hard_regs_in_table, regno);
-	    unsigned int endregno = END_HARD_REGNO (x);
+	    unsigned int endregno = END_REGNO (x);
 	    unsigned int tregno, tendregno, rn;
 	    struct table_elt *p, *next;
 
@@ -1920,7 +1920,7 @@ invalidate (rtx x, machine_mode full_mod
 		      continue;
 
 		    tregno = REGNO (p->exp);
-		    tendregno = END_HARD_REGNO (p->exp);
+		    tendregno = END_REGNO (p->exp);
 		    if (tendregno > regno && tregno < endregno)
 		      remove_from_table (p, hash);
 		  }
@@ -2139,7 +2139,7 @@ invalidate_for_call (void)
 	    continue;
 
 	  regno = REGNO (p->exp);
-	  endregno = END_HARD_REGNO (p->exp);
+	  endregno = END_REGNO (p->exp);
 
 	  for (i = regno; i < endregno; i++)
 	    if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i))
Index: gcc/df-scan.c
===================================================================
--- gcc/df-scan.c	2015-05-18 08:36:41.951019042 +0100
+++ gcc/df-scan.c	2015-05-18 08:36:41.947019063 +0100
@@ -2624,7 +2624,7 @@ df_ref_record (enum df_ref_class cl,
 	  endregno = regno + subreg_nregs (reg);
 	}
       else
-	endregno = END_HARD_REGNO (reg);
+	endregno = END_REGNO (reg);
 
       /*  If this is a multiword hardreg, we create some extra
 	  datastructures that will enable us to easily build REG_DEAD
Index: gcc/postreload-gcse.c
===================================================================
--- gcc/postreload-gcse.c	2015-05-18 08:36:41.951019042 +0100
+++ gcc/postreload-gcse.c	2015-05-18 08:36:41.947019063 +0100
@@ -551,7 +551,7 @@ reg_changed_after_insn_p (rtx x, int cui
   unsigned int regno, end_regno;
 
   regno = REGNO (x);
-  end_regno = END_HARD_REGNO (x);
+  end_regno = END_REGNO (x);
   do
     if (reg_avail_info[regno] > cuid)
       return true;
@@ -720,7 +720,7 @@ record_last_reg_set_info (rtx_insn *insn
   unsigned int regno, end_regno;
 
   regno = REGNO (reg);
-  end_regno = END_HARD_REGNO (reg);
+  end_regno = END_REGNO (reg);
   do
     reg_avail_info[regno] = INSN_CUID (insn);
   while (++regno < end_regno);
Index: gcc/reg-stack.c
===================================================================
--- gcc/reg-stack.c	2015-05-18 08:36:41.951019042 +0100
+++ gcc/reg-stack.c	2015-05-18 08:36:41.947019063 +0100
@@ -2689,7 +2689,7 @@ convert_regs_exit (void)
   if (retvalue)
     {
       value_reg_low = REGNO (retvalue);
-      value_reg_high = END_HARD_REGNO (retvalue) - 1;
+      value_reg_high = END_REGNO (retvalue) - 1;
     }
 
   output_stack = &BLOCK_INFO (EXIT_BLOCK_PTR_FOR_FN (cfun))->stack_in;
Index: gcc/reload.c
===================================================================
--- gcc/reload.c	2015-05-18 08:36:41.951019042 +0100
+++ gcc/reload.c	2015-05-18 08:36:41.951019042 +0100
@@ -6612,7 +6612,7 @@ reg_overlap_mentioned_for_reload_p (rtx
 	  return 0;
 	}
 
-      endregno = END_HARD_REGNO (x);
+      endregno = END_REGNO (x);
 
       return refers_to_regno_for_reload_p (regno, endregno, in, (rtx*) 0);
     }
Index: gcc/resource.c
===================================================================
--- gcc/resource.c	2015-05-18 08:36:41.951019042 +0100
+++ gcc/resource.c	2015-05-18 08:36:41.951019042 +0100
@@ -115,7 +115,7 @@ update_live_status (rtx dest, const_rtx
   else
     {
       first_regno = REGNO (dest);
-      last_regno = END_HARD_REGNO (dest);
+      last_regno = END_REGNO (dest);
     }
 
   if (GET_CODE (x) == CLOBBER)
Index: gcc/rtlanal.c
===================================================================
--- gcc/rtlanal.c	2015-05-18 08:36:41.951019042 +0100
+++ gcc/rtlanal.c	2015-05-18 08:36:41.951019042 +0100
@@ -2018,7 +2018,7 @@ find_reg_fusage (const_rtx insn, enum rt
 
       if (regno < FIRST_PSEUDO_REGISTER)
 	{
-	  unsigned int end_regno = END_HARD_REGNO (datum);
+	  unsigned int end_regno = END_REGNO (datum);
 	  unsigned int i;
 
 	  for (i = regno; i < end_regno; i++)
@@ -2052,7 +2052,7 @@ find_regno_fusage (const_rtx insn, enum
       if (GET_CODE (op = XEXP (link, 0)) == code
 	  && REG_P (reg = XEXP (op, 0))
 	  && REGNO (reg) <= regno
-	  && END_HARD_REGNO (reg) > regno)
+	  && END_REGNO (reg) > regno)
 	return 1;
     }
 

  parent reply	other threads:[~2015-05-18 18:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-18 18:11 [0/9] Record number of hard registers in a REG Richard Sandiford
2015-05-18 18:13 ` [1/9] Make more use of END_REGNO Richard Sandiford
2015-05-18 19:06   ` Jeff Law
2015-05-18 18:15 ` [2/9] Add a REG_NREGS macro Richard Sandiford
2015-05-18 20:27   ` Jeff Law
2015-05-19  7:00     ` Richard Sandiford
2015-05-18 18:19 ` [3/9] Clean up df_ref_change_reg_with_loc Richard Sandiford
2015-05-18 20:33   ` Jeff Law
2015-05-18 18:22 ` [4/9] Add a dedicated rtx union member for REGs Richard Sandiford
2015-05-18 20:41   ` Jeff Law
2015-05-19  7:04     ` Richard Sandiford
2015-05-19  7:17       ` Jeff Law
2015-05-18 18:23 ` [5/9] Create sensible dummy registers Richard Sandiford
2015-05-18 21:29   ` Jeff Law
2015-05-19  9:02   ` Eric Botcazou
2015-05-22 15:44     ` Richard Sandiford
2015-05-22 20:05       ` Jeff Law
2015-05-18 18:24 ` [7/9] Record the number of registers in a REG Richard Sandiford
2015-05-18 21:33   ` Jeff Law
2015-05-18 18:24 ` [6/9] Pass REG changes through a new function Richard Sandiford
2015-05-18 21:32   ` Jeff Law
2015-05-18 18:26 ` Richard Sandiford [this message]
2015-05-18 21:34   ` [8/9] Remove END_HARD_REGNO Jeff Law
2015-05-18 18:31 ` [9/9] Simplify register bitmap operations Richard Sandiford
2015-05-18 21:39   ` Jeff Law
2015-05-19 15:21 ` breakage with series "[0/9] Record number of hard registers in a REG" Hans-Peter Nilsson
2015-05-19 15:54   ` Richard Sandiford

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=87oalhspxs.fsf@e105548-lin.cambridge.arm.com \
    --to=richard.sandiford@arm.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).