Commit a9052a40 by Richard Sandiford Committed by Richard Sandiford

cse.c (change_cc_mode_args): Delete.

gcc/
	* cse.c (change_cc_mode_args): Delete.
	(cse_change_cc_mode): Turn from being a for_each_rtx callback to being
	a function that examines each subrtx itself.  Take the fields of
	change_cc_mode_args as argument and return void.
	(cse_change_cc_mode_insn): Update calls accordingly.

From-SVN: r214631
parent a5b9bc17
2014-08-28 Richard Sandiford <rdsandiford@googlemail.com> 2014-08-28 Richard Sandiford <rdsandiford@googlemail.com>
* cse.c (change_cc_mode_args): Delete.
(cse_change_cc_mode): Turn from being a for_each_rtx callback to being
a function that examines each subrtx itself. Take the fields of
change_cc_mode_args as argument and return void.
(cse_change_cc_mode_insn): Update calls accordingly.
2014-08-28 Richard Sandiford <rdsandiford@googlemail.com>
* cse.c (is_dead_reg): Change argument to const_rtx. * cse.c (is_dead_reg): Change argument to const_rtx.
(dead_debug_insn_data): Delete. (dead_debug_insn_data): Delete.
(is_dead_debug_insn): Expand commentary. Turn from being a (is_dead_debug_insn): Expand commentary. Turn from being a
......
...@@ -255,14 +255,6 @@ struct qty_table_elem ...@@ -255,14 +255,6 @@ struct qty_table_elem
/* The table of all qtys, indexed by qty number. */ /* The table of all qtys, indexed by qty number. */
static struct qty_table_elem *qty_table; static struct qty_table_elem *qty_table;
/* Structure used to pass arguments via for_each_rtx to function
cse_change_cc_mode. */
struct change_cc_mode_args
{
rtx_insn *insn;
rtx newreg;
};
#ifdef HAVE_cc0 #ifdef HAVE_cc0
/* For machines that have a CC0, we do not record its value in the hash /* For machines that have a CC0, we do not record its value in the hash
table since its use is guaranteed to be the insn immediately following table since its use is guaranteed to be the insn immediately following
...@@ -603,7 +595,6 @@ static struct cse_reg_info * get_cse_reg_info (unsigned int regno); ...@@ -603,7 +595,6 @@ static struct cse_reg_info * get_cse_reg_info (unsigned int regno);
static void flush_hash_table (void); static void flush_hash_table (void);
static bool insn_live_p (rtx_insn *, int *); static bool insn_live_p (rtx_insn *, int *);
static bool set_live_p (rtx, rtx_insn *, int *); static bool set_live_p (rtx, rtx_insn *, int *);
static int cse_change_cc_mode (rtx *, void *);
static void cse_change_cc_mode_insn (rtx_insn *, rtx); static void cse_change_cc_mode_insn (rtx_insn *, rtx);
static void cse_change_cc_mode_insns (rtx_insn *, rtx_insn *, rtx); static void cse_change_cc_mode_insns (rtx_insn *, rtx_insn *, rtx);
static enum machine_mode cse_cc_succs (basic_block, basic_block, rtx, rtx, static enum machine_mode cse_cc_succs (basic_block, basic_block, rtx, rtx,
...@@ -7070,26 +7061,26 @@ delete_trivially_dead_insns (rtx_insn *insns, int nreg) ...@@ -7070,26 +7061,26 @@ delete_trivially_dead_insns (rtx_insn *insns, int nreg)
return ndead; return ndead;
} }
/* This function is called via for_each_rtx. The argument, NEWREG, is /* If LOC contains references to NEWREG in a different mode, change them
a condition code register with the desired mode. If we are looking to use NEWREG instead. */
at the same register in a different mode, replace it with
NEWREG. */
static int static void
cse_change_cc_mode (rtx *loc, void *data) cse_change_cc_mode (subrtx_ptr_iterator::array_type &array,
rtx *loc, rtx insn, rtx newreg)
{ {
struct change_cc_mode_args* args = (struct change_cc_mode_args*)data; FOR_EACH_SUBRTX_PTR (iter, array, loc, NONCONST)
if (*loc
&& REG_P (*loc)
&& REGNO (*loc) == REGNO (args->newreg)
&& GET_MODE (*loc) != GET_MODE (args->newreg))
{ {
validate_change (args->insn, loc, args->newreg, 1); rtx *loc = *iter;
rtx x = *loc;
return -1; if (x
&& REG_P (x)
&& REGNO (x) == REGNO (newreg)
&& GET_MODE (x) != GET_MODE (newreg))
{
validate_change (insn, loc, newreg, 1);
iter.skip_subrtxes ();
}
} }
return 0;
} }
/* Change the mode of any reference to the register REGNO (NEWREG) to /* Change the mode of any reference to the register REGNO (NEWREG) to
...@@ -7098,17 +7089,14 @@ cse_change_cc_mode (rtx *loc, void *data) ...@@ -7098,17 +7089,14 @@ cse_change_cc_mode (rtx *loc, void *data)
static void static void
cse_change_cc_mode_insn (rtx_insn *insn, rtx newreg) cse_change_cc_mode_insn (rtx_insn *insn, rtx newreg)
{ {
struct change_cc_mode_args args;
int success; int success;
if (!INSN_P (insn)) if (!INSN_P (insn))
return; return;
args.insn = insn; subrtx_ptr_iterator::array_type array;
args.newreg = newreg; cse_change_cc_mode (array, &PATTERN (insn), insn, newreg);
cse_change_cc_mode (array, &REG_NOTES (insn), insn, newreg);
for_each_rtx (&PATTERN (insn), cse_change_cc_mode, &args);
for_each_rtx (&REG_NOTES (insn), cse_change_cc_mode, &args);
/* If the following assertion was triggered, there is most probably /* If the following assertion was triggered, there is most probably
something wrong with the cc_modes_compatible back end function. something wrong with the cc_modes_compatible back end function.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment