public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: tbsaunde+gcc@tbsaunde.org
To: gcc-patches@gcc.gnu.org
Subject: [PATCH 11/13] type reg_equiv_init as rtx_insn_list
Date: Sat, 02 May 2015 21:02:00 -0000	[thread overview]
Message-ID: <1430600503-14069-12-git-send-email-tbsaunde+gcc@tbsaunde.org> (raw)
In-Reply-To: <1430600503-14069-1-git-send-email-tbsaunde+gcc@tbsaunde.org>

From: Trevor Saunders <tsaunders@mozilla.com>

gcc/ChangeLog:

2015-05-02  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* reload.h (struct reg_equivs_t): Change type of init to
	rtx_insn *.
	* ira.c (fix_reg_equiv_init): Adjust.
	* reload1.c (eliminate_regs_1): Likewise.
	(init_eliminable_invariants): Likewise.
---
 gcc/ChangeLog |  8 ++++++++
 gcc/ira.c     | 12 +++++++-----
 gcc/reload.h  |  2 +-
 gcc/reload1.c |  8 ++++----
 4 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d3e23bd..59fa7f7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,13 @@
 2015-05-02  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
 
+	* reload.h (struct reg_equivs_t): Change type of init to
+	rtx_insn *.
+	* ira.c (fix_reg_equiv_init): Adjust.
+	* reload1.c (eliminate_regs_1): Likewise.
+	(init_eliminable_invariants): Likewise.
+
+2015-05-02  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
+
 	* cselib.c (fp_setter_insn): Take a rtx_insn *.
 	* cselib.h (fp_setter_insn): Adjust.
 
diff --git a/gcc/ira.c b/gcc/ira.c
index 25baa90..ab8e9ce 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -2709,20 +2709,22 @@ fix_reg_equiv_init (void)
 {
   int max_regno = max_reg_num ();
   int i, new_regno, max;
-  rtx x, prev, next, insn, set;
+  rtx set;
+  rtx_insn_list *x, *next, *prev;
+  rtx_insn *insn;
 
   if (max_regno_before_ira < max_regno)
     {
       max = vec_safe_length (reg_equivs);
       grow_reg_equivs ();
       for (i = FIRST_PSEUDO_REGISTER; i < max; i++)
-	for (prev = NULL_RTX, x = reg_equiv_init (i);
+	for (prev = NULL, x = reg_equiv_init (i);
 	     x != NULL_RTX;
 	     x = next)
 	  {
-	    next = XEXP (x, 1);
-	    insn = XEXP (x, 0);
-	    set = single_set (as_a <rtx_insn *> (insn));
+	    next = x->next ();
+	    insn = x->insn ();
+	    set = single_set (insn);
 	    ira_assert (set != NULL_RTX
 			&& (REG_P (SET_DEST (set)) || REG_P (SET_SRC (set))));
 	    if (REG_P (SET_DEST (set))
diff --git a/gcc/reload.h b/gcc/reload.h
index c777e54..a58b902 100644
--- a/gcc/reload.h
+++ b/gcc/reload.h
@@ -239,7 +239,7 @@ struct reg_equivs_t
 
   /* The list of insns that initialized reg N from its equivalent
      constant or memory slot.  */
-  rtx init;
+  rtx_insn_list *init;
 };
 
 #define reg_equiv_constant(ELT) \
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 82b106e..4c47906 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -2619,7 +2619,7 @@ eliminate_regs_1 (rtx x, machine_mode mem_mode, rtx insn,
 			             mem_mode, insn, true, for_costs);
 	  /* There exists at least one use of REGNO that cannot be
 	     eliminated.  Prevent the defining insn from being deleted.  */
-	  reg_equiv_init (regno) = NULL_RTX;
+	  reg_equiv_init (regno) = NULL;
 	  if (!for_costs)
 	    alter_reg (regno, -1, true);
 	}
@@ -4252,17 +4252,17 @@ init_eliminable_invariants (rtx_insn *first, bool do_subregs)
 		    {
 		      reg_equiv_memory_loc (i) = force_const_mem (mode, x);
 		      if (! reg_equiv_memory_loc (i))
-			reg_equiv_init (i) = NULL_RTX;
+			reg_equiv_init (i) = NULL;
 		    }
 		}
 	      else
 		{
-		  reg_equiv_init (i) = NULL_RTX;
+		  reg_equiv_init (i) = NULL;
 		  continue;
 		}
 	    }
 	  else
-	    reg_equiv_init (i) = NULL_RTX;
+	    reg_equiv_init (i) = NULL;
 	}
     }
 
-- 
2.4.0

  parent reply	other threads:[~2015-05-02 21:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-02 21:02 [PATCH 00/13] further rtx_insn *ification tbsaunde+gcc
2015-05-02 21:02 ` [PATCH 01/13] change local vars to rtx_insn * tbsaunde+gcc
2015-05-02 21:02 ` tbsaunde+gcc [this message]
2015-05-02 21:02 ` [PATCH 12/13] make set_return_jump_label take an " tbsaunde+gcc
2015-05-02 21:02 ` [PATCH 08/13] make several functions in the scheduler take " tbsaunde+gcc
2015-05-02 21:02 ` [PATCH 07/13] make some functions in config/ take a " tbsaunde+gcc
2015-05-02 21:02 ` [PATCH 04/13] recog_data::insn can be " tbsaunde+gcc
2015-05-02 21:02 ` [PATCH 06/13] make some functions in lra-constraints.c take " tbsaunde+gcc
2015-05-02 21:02 ` [PATCH 03/13] add_cfi_insn can be a " tbsaunde+gcc
2015-05-02 21:02 ` [PATCH 02/13] df_set_note can take " tbsaunde+gcc
2015-05-02 21:02 ` [PATCH 10/13] make fp_setter_insn " tbsaunde+gcc
2015-05-02 21:02 ` [PATCH 13/13] make emit_partition_copy return " tbsaunde+gcc
2015-05-02 21:02 ` [PATCH 05/13] kill_autoinc_value can take " tbsaunde+gcc
2015-05-02 21:02 ` [PATCH 09/13] make validate_replace_src_group " tbsaunde+gcc
2015-05-04 17:16 ` [PATCH 00/13] further rtx_insn *ification Jeff Law

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=1430600503-14069-12-git-send-email-tbsaunde+gcc@tbsaunde.org \
    --to=tbsaunde+gcc@tbsaunde.org \
    --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).