From bc5a36398cd9f6cc88b4c152bc7300c60463bfc7 Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Thu, 19 Jun 2014 14:14:03 -0400
Subject: [PATCH 077/236] fwprop.c: Use rtx_insn

gcc/
	* fwprop.c (single_def_use_dom_walker::before_dom_children):
	Strengthen local "insn" from rtx to rtx_insn *.
	(use_killed_between): Likewise for param "target_insn".
	(all_uses_available_at): Likewise for param "target_insn" and
	local "next".
	(update_df_init): Likewise for params "def_insn", "insn".
	(update_df): Likewise for param "insn".
	(try_fwprop_subst): Likewise for param "def_insn" and local
	"insn".
	(free_load_extend): Likewise for param "insn".
	(forward_propagate_subreg): Likewise for param "def_insn" and
	local "use_insn".
	(forward_propagate_asm): Likewise for param "def_insn" and local
	"use_insn".
	(forward_propagate_and_simplify): Likewise for param "def_insn"
	and local "use_insn".
	(forward_propagate_into): Likewise for locals "def_insn" and
	"use_insn".
---
 gcc/fwprop.c | 36 ++++++++++++++++++++----------------
 1 file changed, 20 insertions(+), 16 deletions(-)

diff --git a/gcc/fwprop.c b/gcc/fwprop.c
index 547fcd6..a7fee9d 100644
--- a/gcc/fwprop.c
+++ b/gcc/fwprop.c
@@ -218,7 +218,7 @@ single_def_use_dom_walker::before_dom_children (basic_block bb)
   int bb_index = bb->index;
   struct df_md_bb_info *md_bb_info = df_md_get_bb_info (bb_index);
   struct df_lr_bb_info *lr_bb_info = df_lr_get_bb_info (bb_index);
-  rtx insn;
+  rtx_insn *insn;
 
   bitmap_copy (local_md, &md_bb_info->in);
   bitmap_copy (local_lr, &lr_bb_info->in);
@@ -719,7 +719,7 @@ local_ref_killed_between_p (df_ref ref, rtx from, rtx to)
      we check if the definition is killed after DEF_INSN or before
      TARGET_INSN insn, in their respective basic blocks.  */
 static bool
-use_killed_between (df_ref use, rtx def_insn, rtx target_insn)
+use_killed_between (df_ref use, rtx_insn *def_insn, rtx_insn *target_insn)
 {
   basic_block def_bb = BLOCK_FOR_INSN (def_insn);
   basic_block target_bb = BLOCK_FOR_INSN (target_insn);
@@ -783,12 +783,12 @@ use_killed_between (df_ref use, rtx def_insn, rtx target_insn)
    would require full computation of available expressions;
    we check only restricted conditions, see use_killed_between.  */
 static bool
-all_uses_available_at (rtx def_insn, rtx target_insn)
+all_uses_available_at (rtx_insn *def_insn, rtx_insn *target_insn)
 {
   df_ref use;
   struct df_insn_info *insn_info = DF_INSN_INFO_GET (def_insn);
   rtx def_set = single_set (def_insn);
-  rtx next;
+  rtx_insn *next;
 
   gcc_assert (def_set);
 
@@ -869,7 +869,7 @@ register_active_defs (df_ref use)
    I'm not doing this yet, though.  */
 
 static void
-update_df_init (rtx def_insn, rtx insn)
+update_df_init (rtx_insn *def_insn, rtx_insn *insn)
 {
 #ifdef ENABLE_CHECKING
   sparseset_clear (active_defs_check);
@@ -906,7 +906,7 @@ update_uses (df_ref use)
    uses if NOTES_ONLY is true.  */
 
 static void
-update_df (rtx insn, rtx note)
+update_df (rtx_insn *insn, rtx note)
 {
   struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
 
@@ -933,9 +933,10 @@ update_df (rtx insn, rtx note)
    performed.  */
 
 static bool
-try_fwprop_subst (df_ref use, rtx *loc, rtx new_rtx, rtx def_insn, bool set_reg_equal)
+try_fwprop_subst (df_ref use, rtx *loc, rtx new_rtx, rtx_insn *def_insn,
+		  bool set_reg_equal)
 {
-  rtx insn = DF_REF_INSN (use);
+  rtx_insn *insn = DF_REF_INSN (use);
   rtx set = single_set (insn);
   rtx note = NULL_RTX;
   bool speed = optimize_bb_for_speed_p (BLOCK_FOR_INSN (insn));
@@ -1016,7 +1017,7 @@ try_fwprop_subst (df_ref use, rtx *loc, rtx new_rtx, rtx def_insn, bool set_reg_
    load from memory.  */
 
 static bool
-free_load_extend (rtx src, rtx insn)
+free_load_extend (rtx src, rtx_insn *insn)
 {
   rtx reg;
   df_ref def, use;
@@ -1057,10 +1058,11 @@ free_load_extend (rtx src, rtx insn)
 /* If USE is a subreg, see if it can be replaced by a pseudo.  */
 
 static bool
-forward_propagate_subreg (df_ref use, rtx def_insn, rtx def_set)
+forward_propagate_subreg (df_ref use, rtx_insn *def_insn, rtx def_set)
 {
   rtx use_reg = DF_REF_REG (use);
-  rtx use_insn, src;
+  rtx_insn *use_insn;
+  rtx src;
 
   /* Only consider subregs... */
   enum machine_mode use_mode = GET_MODE (use_reg);
@@ -1127,9 +1129,10 @@ forward_propagate_subreg (df_ref use, rtx def_insn, rtx def_set)
 /* Try to replace USE with SRC (defined in DEF_INSN) in __asm.  */
 
 static bool
-forward_propagate_asm (df_ref use, rtx def_insn, rtx def_set, rtx reg)
+forward_propagate_asm (df_ref use, rtx_insn *def_insn, rtx def_set, rtx reg)
 {
-  rtx use_insn = DF_REF_INSN (use), src, use_pat, asm_operands, new_rtx, *loc;
+  rtx_insn *use_insn = DF_REF_INSN (use);
+  rtx src, use_pat, asm_operands, new_rtx, *loc;
   int speed_p, i;
   df_ref uses;
 
@@ -1204,9 +1207,9 @@ forward_propagate_asm (df_ref use, rtx def_insn, rtx def_set, rtx reg)
    result.  */
 
 static bool
-forward_propagate_and_simplify (df_ref use, rtx def_insn, rtx def_set)
+forward_propagate_and_simplify (df_ref use, rtx_insn *def_insn, rtx def_set)
 {
-  rtx use_insn = DF_REF_INSN (use);
+  rtx_insn *use_insn = DF_REF_INSN (use);
   rtx use_set = single_set (use_insn);
   rtx src, reg, new_rtx, *loc;
   bool set_reg_equal;
@@ -1329,7 +1332,8 @@ static bool
 forward_propagate_into (df_ref use)
 {
   df_ref def;
-  rtx def_insn, def_set, use_insn;
+  rtx_insn *def_insn, *use_insn;
+  rtx def_set;
   rtx parent;
 
   if (DF_REF_FLAGS (use) & DF_REF_READ_WRITE)
-- 
1.8.5.3

