combine.c (record_dead_and_set_regs): Iterate over hard register set with a hard_reg_set_iterator.

* combine.c (record_dead_and_set_regs): Iterate over hard register set
	with a hard_reg_set_iterator.
	* cse.c (invalidate_for_call): Likewise.
	* gcse.c (compute_hash_table_work): Likewise.
	* loop-iv.c (simplify_using_initial_values): Likewise.
	* postreload-gcse.c (record_opr_changes): Likewise.
	* regcprop.c (copyprop_hardreg_forward_1): Likewise.
	* var-tracking.c (dataflow_set_clear_at_call): Likewise.

From-SVN: r192490
This commit is contained in:
Steven Bosscher 2012-10-16 07:46:11 +00:00
parent 909881cb25
commit c7fb4c7aae
8 changed files with 61 additions and 49 deletions

View File

@ -1,3 +1,14 @@
2012-10-16 Steven Bosscher <steven@gcc.gnu.org>
* combine.c (record_dead_and_set_regs): Iterate over hard register set
with a hard_reg_set_iterator.
* cse.c (invalidate_for_call): Likewise.
* gcse.c (compute_hash_table_work): Likewise.
* loop-iv.c (simplify_using_initial_values): Likewise.
* postreload-gcse.c (record_opr_changes): Likewise.
* regcprop.c (copyprop_hardreg_forward_1): Likewise.
* var-tracking.c (dataflow_set_clear_at_call): Likewise.
2012-10-15 Easwaran Raman <eraman@google.com> 2012-10-15 Easwaran Raman <eraman@google.com>
* optabs.c (emit_cmp_and_jump_insn_1): Add a new parameter to * optabs.c (emit_cmp_and_jump_insn_1): Add a new parameter to

View File

@ -12317,8 +12317,8 @@ record_dead_and_set_regs (rtx insn)
if (CALL_P (insn)) if (CALL_P (insn))
{ {
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) hard_reg_set_iterator hrsi;
if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i)) EXECUTE_IF_SET_IN_HARD_REG_SET (regs_invalidated_by_call, 0, i, hrsi)
{ {
reg_stat_type *rsp; reg_stat_type *rsp;

View File

@ -2096,14 +2096,13 @@ invalidate_for_call (void)
unsigned hash; unsigned hash;
struct table_elt *p, *next; struct table_elt *p, *next;
int in_table = 0; int in_table = 0;
hard_reg_set_iterator hrsi;
/* Go through all the hard registers. For each that is clobbered in /* Go through all the hard registers. For each that is clobbered in
a CALL_INSN, remove the register from quantity chains and update a CALL_INSN, remove the register from quantity chains and update
reg_tick if defined. Also see if any of these registers is currently reg_tick if defined. Also see if any of these registers is currently
in the table. */ in the table. */
EXECUTE_IF_SET_IN_HARD_REG_SET (regs_invalidated_by_call, 0, regno, hrsi)
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
if (TEST_HARD_REG_BIT (regs_invalidated_by_call, regno))
{ {
delete_reg_equiv (regno); delete_reg_equiv (regno);
if (REG_TICK (regno) >= 0) if (REG_TICK (regno) >= 0)
@ -2111,7 +2110,6 @@ invalidate_for_call (void)
REG_TICK (regno)++; REG_TICK (regno)++;
SUBREG_TICKED (regno) = -1; SUBREG_TICKED (regno) = -1;
} }
in_table |= (TEST_HARD_REG_BIT (hard_regs_in_table, regno) != 0); in_table |= (TEST_HARD_REG_BIT (hard_regs_in_table, regno) != 0);
} }

View File

@ -1519,8 +1519,9 @@ compute_hash_table_work (struct hash_table_d *table)
if (CALL_P (insn)) if (CALL_P (insn))
{ {
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) hard_reg_set_iterator hrsi;
if (TEST_HARD_REG_BIT (regs_invalidated_by_call, regno)) EXECUTE_IF_SET_IN_HARD_REG_SET (regs_invalidated_by_call,
0, regno, hrsi)
record_last_reg_set_info (insn, regno); record_last_reg_set_info (insn, regno);
if (! RTL_CONST_OR_PURE_CALL_P (insn)) if (! RTL_CONST_OR_PURE_CALL_P (insn))

View File

@ -1964,11 +1964,11 @@ simplify_using_initial_values (struct loop *loop, enum rtx_code op, rtx *expr)
note_stores (PATTERN (insn), mark_altered, this_altered); note_stores (PATTERN (insn), mark_altered, this_altered);
if (CALL_P (insn)) if (CALL_P (insn))
{ {
int i;
/* Kill all call clobbered registers. */ /* Kill all call clobbered registers. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) unsigned int i;
if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i)) hard_reg_set_iterator hrsi;
EXECUTE_IF_SET_IN_HARD_REG_SET (regs_invalidated_by_call,
0, i, hrsi)
SET_REGNO_REG_SET (this_altered, i); SET_REGNO_REG_SET (this_altered, i);
} }

View File

@ -736,9 +736,8 @@ record_opr_changes (rtx insn)
{ {
unsigned int regno; unsigned int regno;
rtx link, x; rtx link, x;
hard_reg_set_iterator hrsi;
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) EXECUTE_IF_SET_IN_HARD_REG_SET (regs_invalidated_by_call, 0, regno, hrsi)
if (TEST_HARD_REG_BIT (regs_invalidated_by_call, regno))
record_last_reg_set_info_regno (insn, regno); record_last_reg_set_info_regno (insn, regno);
for (link = CALL_INSN_FUNCTION_USAGE (insn); link; link = XEXP (link, 1)) for (link = CALL_INSN_FUNCTION_USAGE (insn); link; link = XEXP (link, 1))

View File

@ -990,9 +990,12 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd)
/* Clobber call-clobbered registers. */ /* Clobber call-clobbered registers. */
if (CALL_P (insn)) if (CALL_P (insn))
{ {
int set_regno = INVALID_REGNUM; unsigned int set_regno = INVALID_REGNUM;
int set_nregs = 0; unsigned int set_nregs = 0;
unsigned int regno;
rtx exp; rtx exp;
hard_reg_set_iterator hrsi;
for (exp = CALL_INSN_FUNCTION_USAGE (insn); exp; exp = XEXP (exp, 1)) for (exp = CALL_INSN_FUNCTION_USAGE (insn); exp; exp = XEXP (exp, 1))
{ {
rtx x = XEXP (exp, 0); rtx x = XEXP (exp, 0);
@ -1009,10 +1012,10 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd)
break; break;
} }
} }
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i) EXECUTE_IF_SET_IN_HARD_REG_SET (regs_invalidated_by_call, 0, regno, hrsi)
&& (i < set_regno || i >= set_regno + set_nregs)) if (regno < set_regno || regno >= set_regno + set_nregs)
kill_value_regno (i, 1, vd); kill_value_regno (regno, 1, vd);
} }
/* Notice stores. */ /* Notice stores. */

View File

@ -4680,10 +4680,10 @@ dataflow_set_remove_mem_locs (void **slot, void *data)
static void static void
dataflow_set_clear_at_call (dataflow_set *set) dataflow_set_clear_at_call (dataflow_set *set)
{ {
int r; unsigned int r;
hard_reg_set_iterator hrsi;
for (r = 0; r < FIRST_PSEUDO_REGISTER; r++) EXECUTE_IF_SET_IN_HARD_REG_SET (regs_invalidated_by_call, 0, r, hrsi)
if (TEST_HARD_REG_BIT (regs_invalidated_by_call, r))
var_regno_delete (set, r); var_regno_delete (set, r);
if (MAY_HAVE_DEBUG_INSNS) if (MAY_HAVE_DEBUG_INSNS)