* basic-block.h (reg_set_iterator): New.
(EXECUTE_IF_SET_IN_REG_SET): Make it iterator style.
(EXECUTE_IF_AND_COMPL_IN_REG_SET): Likewise.
(EXECUTE_IF_AND_IN_REG_SET): Likewise.
* caller-save.c (save_call_clobbered_regs): Adjust to the new
style.
* cfgcleanup.c (thread_jump): Likewise.
* cfgrtl.c (safe_insert_insn_on_edge): Likewise.
* conflict.c (conflict_graph_compute): Likewise.
* flow.c (verify_local_live_at_start, update_life_info,
initialize_uninitialized_subregs, propagate_one_insn,
init_propagate_block_info, free_propagate_block_info,
propagate_block, dump_regset): Likewise.
* global.c (global_conflicts): Likewise.
* graph.c (start_bb): Likewise.
* local-alloc.c (update_equiv_regs): Likewise.
* loop.c (load_mems): Likewise.
* reload1.c (compute_use_by_pseudos, order_regs_for_reload,
find_reg, finish_spills): Likewise.
* resource.c (mark_target_live_regs): Likewise.
* sched-deps.c (sched_analyze_insn): Likewise.
* sched-rgn.c (sched-rgn.c): Likewise.
* config/frv/frv.c (frv_ifcvt_modify_tests): Likewise.
From-SVN: r89226
+2004-10-18 Kazu Hirata <kazu@cs.umass.edu>
+
+ * basic-block.h (reg_set_iterator): New.
+ (EXECUTE_IF_SET_IN_REG_SET): Make it iterator style.
+ (EXECUTE_IF_AND_COMPL_IN_REG_SET): Likewise.
+ (EXECUTE_IF_AND_IN_REG_SET): Likewise.
+ * caller-save.c (save_call_clobbered_regs): Adjust to the new
+ style.
+ * cfgcleanup.c (thread_jump): Likewise.
+ * cfgrtl.c (safe_insert_insn_on_edge): Likewise.
+ * conflict.c (conflict_graph_compute): Likewise.
+ * flow.c (verify_local_live_at_start, update_life_info,
+ initialize_uninitialized_subregs, propagate_one_insn,
+ init_propagate_block_info, free_propagate_block_info,
+ propagate_block, dump_regset): Likewise.
+ * global.c (global_conflicts): Likewise.
+ * graph.c (start_bb): Likewise.
+ * local-alloc.c (update_equiv_regs): Likewise.
+ * loop.c (load_mems): Likewise.
+ * reload1.c (compute_use_by_pseudos, order_regs_for_reload,
+ find_reg, finish_spills): Likewise.
+ * resource.c (mark_target_live_regs): Likewise.
+ * sched-deps.c (sched_analyze_insn): Likewise.
+ * sched-rgn.c (sched-rgn.c): Likewise.
+ * config/frv/frv.c (frv_ifcvt_modify_tests): Likewise.
+
2004-10-18 Jakub Jelinek <jakub@redhat.com>
* config/i386/i386.md (addqi_1_slp): Test for incdec_operand
reg_set_to_hard_reg_set (&TO, FROM); \
} while (0)
+typedef bitmap_iterator reg_set_iterator;
+
/* Loop over all registers in REGSET, starting with MIN, setting REGNUM to the
register number and executing CODE for all registers that are set. */
-#define EXECUTE_IF_SET_IN_REG_SET(REGSET, MIN, REGNUM, CODE) \
- do \
- { \
- bitmap_iterator bi; \
- \
- EXECUTE_IF_SET_IN_BITMAP (REGSET, MIN, REGNUM, bi) \
- { \
- CODE; \
- } \
- } while (0)
+#define EXECUTE_IF_SET_IN_REG_SET(REGSET, MIN, REGNUM, RSI) \
+ EXECUTE_IF_SET_IN_BITMAP (REGSET, MIN, REGNUM, RSI)
/* Loop over all registers in REGSET1 and REGSET2, starting with MIN, setting
REGNUM to the register number and executing CODE for all registers that are
set in the first regset and not set in the second. */
-#define EXECUTE_IF_AND_COMPL_IN_REG_SET(REGSET1, REGSET2, MIN, REGNUM, CODE) \
- do \
- { \
- bitmap_iterator bi; \
- \
- EXECUTE_IF_AND_COMPL_IN_BITMAP (REGSET1, REGSET2, MIN, REGNUM, bi) \
- { \
- CODE; \
- } \
- } while (0)
+#define EXECUTE_IF_AND_COMPL_IN_REG_SET(REGSET, MIN, REGNUM, RSI) \
+ EXECUTE_IF_AND_COMPL_IN_BITMAP (REGSET, MIN, REGNUM, RSI)
/* Loop over all registers in REGSET1 and REGSET2, starting with MIN, setting
REGNUM to the register number and executing CODE for all registers that are
set in both regsets. */
-#define EXECUTE_IF_AND_IN_REG_SET(REGSET1, REGSET2, MIN, REGNUM, CODE) \
- do \
- { \
- bitmap_iterator bi; \
- \
- EXECUTE_IF_AND_IN_BITMAP (REGSET1, REGSET2, MIN, REGNUM, bi) \
- { \
- CODE; \
- } \
- } while (0)
+#define EXECUTE_IF_AND_IN_REG_SET(REGSET1, REGSET2, MIN, REGNUM, RSI) \
+ EXECUTE_IF_AND_IN_BITMAP (REGSET1, REGSET2, MIN, REGNUM, RSI) \
/* Allocate a register set with oballoc. */
#define OBSTACK_ALLOC_REG_SET(OBSTACK) BITMAP_OBSTACK_ALLOC (OBSTACK)
{
int regno;
HARD_REG_SET hard_regs_to_save;
+ reg_set_iterator rsi;
/* Use the register life information in CHAIN to compute which
regs are live during the call. */
/* Look through all live pseudos, mark their hard registers
and choose proper mode for saving. */
EXECUTE_IF_SET_IN_REG_SET
- (&chain->live_throughout, FIRST_PSEUDO_REGISTER, regno,
- {
- int r = reg_renumber[regno];
- int nregs;
- enum machine_mode mode;
-
- gcc_assert (r >= 0);
- nregs = hard_regno_nregs[r][PSEUDO_REGNO_MODE (regno)];
- mode = HARD_REGNO_CALLER_SAVE_MODE
- (r, nregs, PSEUDO_REGNO_MODE (regno));
- if (GET_MODE_BITSIZE (mode)
- > GET_MODE_BITSIZE (save_mode[r]))
- save_mode[r] = mode;
- while (nregs-- > 0)
- SET_HARD_REG_BIT (hard_regs_to_save, r + nregs);
- });
+ (&chain->live_throughout, FIRST_PSEUDO_REGISTER, regno, rsi)
+ {
+ int r = reg_renumber[regno];
+ int nregs;
+ enum machine_mode mode;
+
+ gcc_assert (r >= 0);
+ nregs = hard_regno_nregs[r][PSEUDO_REGNO_MODE (regno)];
+ mode = HARD_REGNO_CALLER_SAVE_MODE
+ (r, nregs, PSEUDO_REGNO_MODE (regno));
+ if (GET_MODE_BITSIZE (mode)
+ > GET_MODE_BITSIZE (save_mode[r]))
+ save_mode[r] = mode;
+ while (nregs-- > 0)
+ SET_HARD_REG_BIT (hard_regs_to_save, r + nregs);
+ }
/* Record all registers set in this call insn. These don't need
to be saved. N.B. the call insn might set a subreg of a
int i;
regset nonequal;
bool failed = false;
+ reg_set_iterator rsi;
if (BB_FLAGS (b) & BB_NONTHREADABLE_BLOCK)
return NULL;
if (mode & CLEANUP_UPDATE_LIFE)
AND_REG_SET (nonequal, b->global_live_at_end);
- EXECUTE_IF_SET_IN_REG_SET (nonequal, 0, i, goto failed_exit;);
+ EXECUTE_IF_SET_IN_REG_SET (nonequal, 0, i, rsi)
+ goto failed_exit;
BITMAP_XFREE (nonequal);
cselib_finish ();
rtx save_regs = NULL_RTX;
int regno, noccmode;
enum machine_mode mode;
+ reg_set_iterator rsi;
#ifdef AVOID_CCMODE_COPIES
noccmode = true;
bitmap_operation (killed, killed, e->dest->global_live_at_start,
BITMAP_AND);
- EXECUTE_IF_SET_IN_REG_SET (killed, 0, regno,
+ EXECUTE_IF_SET_IN_REG_SET (killed, 0, regno, rsi)
{
mode = regno < FIRST_PSEUDO_REGISTER
? reg_raw_mode[regno]
gen_reg_rtx (mode),
gen_raw_REG (mode, regno)),
save_regs);
- });
+ }
if (save_regs)
{
enum reg_class cr_class;
int cc_first;
int cc_last;
+ reg_set_iterator rsi;
/* Make sure we are only dealing with hard registers. Also honor the
-mno-cond-exec switch, and -mno-nested-cond-exec switches if
/* Remove anything live at the beginning of the join block from being
available for allocation. */
- EXECUTE_IF_SET_IN_REG_SET (join_bb->global_live_at_start, 0, regno,
- {
- if (regno < FIRST_PSEUDO_REGISTER)
- CLEAR_HARD_REG_BIT (tmp_reg->regs, regno);
- });
+ EXECUTE_IF_SET_IN_REG_SET (join_bb->global_live_at_start, 0, regno, rsi)
+ {
+ if (regno < FIRST_PSEUDO_REGISTER)
+ CLEAR_HARD_REG_BIT (tmp_reg->regs, regno);
+ }
}
/* Add in all of the blocks in multiple &&/|| blocks to be scanned. */
/* Anything live at the beginning of the block is obviously unavailable
for allocation. */
- EXECUTE_IF_SET_IN_REG_SET (bb[j]->global_live_at_start, 0, regno,
- {
- if (regno < FIRST_PSEUDO_REGISTER)
- CLEAR_HARD_REG_BIT (tmp_reg->regs, regno);
- });
+ EXECUTE_IF_SET_IN_REG_SET (bb[j]->global_live_at_start, 0, regno, rsi)
+ {
+ if (regno < FIRST_PSEUDO_REGISTER)
+ CLEAR_HARD_REG_BIT (tmp_reg->regs, regno);
+ }
/* Loop through the insns in the block. */
for (;;)
/* Are we interested in this insn? */
if (INSN_P (insn))
{
+ reg_set_iterator rsi;
+
/* Determine which regs are set in this insn. Since
we're in SSA form, if a reg is set here it isn't set
anywhere else, so this insn is where the reg is born. */
/* For every reg born here, add a conflict with every other
reg live coming into this insn. */
EXECUTE_IF_SET_IN_REG_SET
- (born, FIRST_PSEUDO_REGISTER, born_reg,
- {
- EXECUTE_IF_SET_IN_REG_SET
- (live, FIRST_PSEUDO_REGISTER, live_reg,
- {
- /* Build the conflict graph in terms of canonical
- regnos. */
- int b = partition_find (p, born_reg);
- int l = partition_find (p, live_reg);
-
- if (b != l)
- conflict_graph_add (graph, b, l);
- });
- });
+ (born, FIRST_PSEUDO_REGISTER, born_reg, rsi)
+ {
+ reg_set_iterator rsj;
+
+ EXECUTE_IF_SET_IN_REG_SET
+ (live, FIRST_PSEUDO_REGISTER, live_reg, rsj)
+ {
+ /* Build the conflict graph in terms of canonical
+ regnos. */
+ int b = partition_find (p, born_reg);
+ int l = partition_find (p, live_reg);
+
+ if (b != l)
+ conflict_graph_add (graph, b, l);
+ }
+ }
/* Morgan's algorithm checks the operands of the insn
and adds them to the set of live regs. Instead, we
else
{
int i;
+ reg_set_iterator rsi;
/* Find the set of changed registers. */
XOR_REG_SET (new_live_at_start, bb->global_live_at_start);
- EXECUTE_IF_SET_IN_REG_SET (new_live_at_start, 0, i,
+ EXECUTE_IF_SET_IN_REG_SET (new_live_at_start, 0, i, rsi)
{
/* No registers should die. */
if (REGNO_REG_SET_P (bb->global_live_at_start, i))
}
/* Verify that the now-live register is wider than word_mode. */
verify_wide_reg (i, bb);
- });
+ }
}
}
if (prop_flags & PROP_REG_INFO)
{
+ reg_set_iterator rsi;
+
/* The only pseudos that are live at the beginning of the function
are those that were not set anywhere in the function. local-alloc
doesn't know how to handle these correctly, so mark them as not
local to any one basic block. */
EXECUTE_IF_SET_IN_REG_SET (ENTRY_BLOCK_PTR->global_live_at_end,
- FIRST_PSEUDO_REGISTER, i,
- { REG_BASIC_BLOCK (i) = REG_BLOCK_GLOBAL; });
+ FIRST_PSEUDO_REGISTER, i, rsi)
+ REG_BASIC_BLOCK (i) = REG_BLOCK_GLOBAL;
/* We have a problem with any pseudoreg that lives across the setjmp.
ANSI says that if a user variable does not change in value between
that hard reg where this pseudo is dead, thus clobbering the pseudo.
Conclusion: such a pseudo must not go in a hard reg. */
EXECUTE_IF_SET_IN_REG_SET (regs_live_at_setjmp,
- FIRST_PSEUDO_REGISTER, i,
- {
- if (regno_reg_rtx[i] != 0)
- {
- REG_LIVE_LENGTH (i) = -1;
- REG_BASIC_BLOCK (i) = REG_BLOCK_UNKNOWN;
- }
- });
+ FIRST_PSEUDO_REGISTER, i, rsi)
+ {
+ if (regno_reg_rtx[i] != 0)
+ {
+ REG_LIVE_LENGTH (i) = -1;
+ REG_BASIC_BLOCK (i) = REG_BLOCK_UNKNOWN;
+ }
+ }
}
if (reg_deaths)
{
{
basic_block bb = e->dest;
regset map = bb->global_live_at_start;
- EXECUTE_IF_SET_IN_REG_SET (map,
- FIRST_PSEUDO_REGISTER, reg,
+ reg_set_iterator rsi;
+
+ EXECUTE_IF_SET_IN_REG_SET (map, FIRST_PSEUDO_REGISTER, reg, rsi)
{
int uid = REGNO_FIRST_UID (reg);
rtx i;
did_something = 1;
}
}
- });
+ }
}
if (did_something)
record this for them. */
if (CALL_P (insn) && (flags & PROP_REG_INFO))
- EXECUTE_IF_SET_IN_REG_SET (pbi->reg_live, 0, i,
- { REG_N_CALLS_CROSSED (i)++; });
+ {
+ reg_set_iterator rsi;
+ EXECUTE_IF_SET_IN_REG_SET (pbi->reg_live, 0, i, rsi)
+ REG_N_CALLS_CROSSED (i)++;
+ }
/* Record sets. Do this even for dead instructions, since they
would have killed the values if they hadn't been deleted. */
= gen_rtx_fmt_ee (inv_cond,
GET_MODE (cond_true), XEXP (cond_true, 0),
XEXP (cond_true, 1));
+ reg_set_iterator rsi;
+
if (GET_CODE (XEXP (set_src, 1)) == PC)
{
rtx t = cond_false;
SET_REGNO_REG_SET (pbi->reg_cond_reg, REGNO (reg));
/* For each such register, mark it conditionally dead. */
- EXECUTE_IF_SET_IN_REG_SET
- (diff, 0, i,
- {
- struct reg_cond_life_info *rcli;
- rtx cond;
-
- rcli = xmalloc (sizeof (*rcli));
-
- if (REGNO_REG_SET_P (bb_true->global_live_at_start, i))
- cond = cond_false;
- else
- cond = cond_true;
- rcli->condition = cond;
- rcli->stores = const0_rtx;
- rcli->orig_condition = cond;
-
- splay_tree_insert (pbi->reg_cond_dead, i,
- (splay_tree_value) rcli);
- });
+ EXECUTE_IF_SET_IN_REG_SET (diff, 0, i, rsi)
+ {
+ struct reg_cond_life_info *rcli;
+ rtx cond;
+
+ rcli = xmalloc (sizeof (*rcli));
+
+ if (REGNO_REG_SET_P (bb_true->global_live_at_start, i))
+ cond = cond_false;
+ else
+ cond = cond_true;
+ rcli->condition = cond;
+ rcli->stores = const0_rtx;
+ rcli->orig_condition = cond;
+
+ splay_tree_insert (pbi->reg_cond_dead, i,
+ (splay_tree_value) rcli);
+ }
}
}
{
int num = pbi->insn_num;
int i;
+ reg_set_iterator rsi;
- EXECUTE_IF_SET_IN_REG_SET (pbi->reg_live, 0, i,
- { REG_LIVE_LENGTH (i) += num - reg_deaths[i];
- reg_deaths[i] = 0;
- });
+ EXECUTE_IF_SET_IN_REG_SET (pbi->reg_live, 0, i, rsi)
+ {
+ REG_LIVE_LENGTH (i) += num - reg_deaths[i];
+ reg_deaths[i] = 0;
+ }
}
if (pbi->reg_next_use)
free (pbi->reg_next_use);
if (flags & PROP_REG_INFO)
{
int i;
+ reg_set_iterator rsi;
/* Process the regs live at the end of the block.
Mark them as not local to any one basic block. */
- EXECUTE_IF_SET_IN_REG_SET (live, 0, i,
- { REG_BASIC_BLOCK (i) = REG_BLOCK_GLOBAL; });
+ EXECUTE_IF_SET_IN_REG_SET (live, 0, i, rsi)
+ REG_BASIC_BLOCK (i) = REG_BLOCK_GLOBAL;
}
/* Scan the block an insn at a time from end to beginning. */
dump_regset (regset r, FILE *outf)
{
int i;
+ reg_set_iterator rsi;
+
if (r == NULL)
{
fputs (" (nil)", outf);
return;
}
- EXECUTE_IF_SET_IN_REG_SET (r, 0, i,
+ EXECUTE_IF_SET_IN_REG_SET (r, 0, i, rsi)
{
fprintf (outf, " %d", i);
if (i < FIRST_PSEUDO_REGISTER)
fprintf (outf, " [%s]",
reg_names[i]);
- });
+ }
}
/* Print a human-readable representation of R on the standard error
{
regset old = b->global_live_at_start;
int ax = 0;
+ reg_set_iterator rsi;
REG_SET_TO_HARD_REG_SET (hard_regs_live, old);
- EXECUTE_IF_SET_IN_REG_SET (old, FIRST_PSEUDO_REGISTER, i,
- {
- int a = reg_allocno[i];
- if (a >= 0)
- {
- SET_ALLOCNO_LIVE (a);
- block_start_allocnos[ax++] = a;
- }
- else if ((a = reg_renumber[i]) >= 0)
- mark_reg_live_nc
- (a, PSEUDO_REGNO_MODE (i));
- });
+ EXECUTE_IF_SET_IN_REG_SET (old, FIRST_PSEUDO_REGISTER, i, rsi)
+ {
+ int a = reg_allocno[i];
+ if (a >= 0)
+ {
+ SET_ALLOCNO_LIVE (a);
+ block_start_allocnos[ax++] = a;
+ }
+ else if ((a = reg_renumber[i]) >= 0)
+ mark_reg_live_nc (a, PSEUDO_REGNO_MODE (i));
+ }
/* Record that each allocno now live conflicts with each hard reg
now live.
static void
start_bb (FILE *fp, int bb)
{
+#if 0
+ reg_set_iterator rsi;
+#endif
+
switch (graph_dump_format)
{
case vcg:
/* Print the live-at-start register list. */
fputc ('\n', fp);
- EXECUTE_IF_SET_IN_REG_SET (basic_block_live_at_start[bb], 0, i,
- {
- fprintf (fp, " %d", i);
- if (i < FIRST_PSEUDO_REGISTER)
- fprintf (fp, " [%s]",
- reg_names[i]);
- });
+ EXECUTE_IF_SET_IN_REG_SET (basic_block_live_at_start[bb], 0, i, rsi)
+ {
+ fprintf (fp, " %d", i);
+ if (i < FIRST_PSEUDO_REGISTER)
+ fprintf (fp, " [%s]", reg_names[i]);
+ }
#endif
switch (graph_dump_format)
}
}
else
- EXECUTE_IF_SET_IN_REG_SET (&cleared_regs, 0, j,
- {
- FOR_EACH_BB (bb)
- {
- CLEAR_REGNO_REG_SET (bb->global_live_at_start, j);
- CLEAR_REGNO_REG_SET (bb->global_live_at_end, j);
- }
- });
+ {
+ reg_set_iterator rsi;
+ EXECUTE_IF_SET_IN_REG_SET (&cleared_regs, 0, j, rsi)
+ {
+ FOR_EACH_BB (bb)
+ {
+ CLEAR_REGNO_REG_SET (bb->global_live_at_start, j);
+ CLEAR_REGNO_REG_SET (bb->global_live_at_end, j);
+ }
+ }
+ }
}
/* Clean up. */
rtx best = mem;
int j;
struct elt_loc_list *const_equiv = 0;
+ reg_set_iterator rsi;
if (e)
{
data flow, and enables {basic,general}_induction_var to find
more bivs/givs. */
EXECUTE_IF_SET_IN_REG_SET
- (&load_copies, FIRST_PSEUDO_REGISTER, j,
- {
- try_copy_prop (loop, reg, j);
- });
+ (&load_copies, FIRST_PSEUDO_REGISTER, j, rsi)
+ {
+ try_copy_prop (loop, reg, j);
+ }
CLEAR_REG_SET (&load_copies);
EXECUTE_IF_SET_IN_REG_SET
- (&store_copies, FIRST_PSEUDO_REGISTER, j,
- {
- try_swap_copy_prop (loop, reg, j);
- });
+ (&store_copies, FIRST_PSEUDO_REGISTER, j, rsi)
+ {
+ try_swap_copy_prop (loop, reg, j);
+ }
CLEAR_REG_SET (&store_copies);
}
}
compute_use_by_pseudos (HARD_REG_SET *to, regset from)
{
unsigned int regno;
+ reg_set_iterator rsi;
- EXECUTE_IF_SET_IN_REG_SET
- (from, FIRST_PSEUDO_REGISTER, regno,
- {
- int r = reg_renumber[regno];
- int nregs;
-
- if (r < 0)
- {
- /* reload_combine uses the information from
- BASIC_BLOCK->global_live_at_start, which might still
- contain registers that have not actually been allocated
- since they have an equivalence. */
- gcc_assert (reload_completed);
- }
- else
- {
- nregs = hard_regno_nregs[r][PSEUDO_REGNO_MODE (regno)];
- while (nregs-- > 0)
- SET_HARD_REG_BIT (*to, r + nregs);
- }
- });
+ EXECUTE_IF_SET_IN_REG_SET (from, FIRST_PSEUDO_REGISTER, regno, rsi)
+ {
+ int r = reg_renumber[regno];
+ int nregs;
+
+ if (r < 0)
+ {
+ /* reload_combine uses the information from
+ BASIC_BLOCK->global_live_at_start, which might still
+ contain registers that have not actually been allocated
+ since they have an equivalence. */
+ gcc_assert (reload_completed);
+ }
+ else
+ {
+ nregs = hard_regno_nregs[r][PSEUDO_REGNO_MODE (regno)];
+ while (nregs-- > 0)
+ SET_HARD_REG_BIT (*to, r + nregs);
+ }
+ }
}
/* Replace all pseudos found in LOC with their corresponding
int i;
HARD_REG_SET used_by_pseudos;
HARD_REG_SET used_by_pseudos2;
+ reg_set_iterator rsi;
COPY_HARD_REG_SET (bad_spill_regs, fixed_reg_set);
CLEAR_REG_SET (&pseudos_counted);
EXECUTE_IF_SET_IN_REG_SET
- (&chain->live_throughout, FIRST_PSEUDO_REGISTER, i,
- {
- count_pseudo (i);
- });
+ (&chain->live_throughout, FIRST_PSEUDO_REGISTER, i, rsi)
+ {
+ count_pseudo (i);
+ }
EXECUTE_IF_SET_IN_REG_SET
- (&chain->dead_or_set, FIRST_PSEUDO_REGISTER, i,
- {
- count_pseudo (i);
- });
+ (&chain->dead_or_set, FIRST_PSEUDO_REGISTER, i, rsi)
+ {
+ count_pseudo (i);
+ }
CLEAR_REG_SET (&pseudos_counted);
}
\f
int k;
HARD_REG_SET not_usable;
HARD_REG_SET used_by_other_reload;
+ reg_set_iterator rsi;
COPY_HARD_REG_SET (not_usable, bad_spill_regs);
IOR_HARD_REG_SET (not_usable, bad_spill_regs_global);
rl->regno = best_reg;
EXECUTE_IF_SET_IN_REG_SET
- (&chain->live_throughout, FIRST_PSEUDO_REGISTER, j,
- {
- count_spilled_pseudo (best_reg, rl->nregs, j);
- });
+ (&chain->live_throughout, FIRST_PSEUDO_REGISTER, j, rsi)
+ {
+ count_spilled_pseudo (best_reg, rl->nregs, j);
+ }
EXECUTE_IF_SET_IN_REG_SET
- (&chain->dead_or_set, FIRST_PSEUDO_REGISTER, j,
- {
- count_spilled_pseudo (best_reg, rl->nregs, j);
- });
+ (&chain->dead_or_set, FIRST_PSEUDO_REGISTER, j, rsi)
+ {
+ count_spilled_pseudo (best_reg, rl->nregs, j);
+ }
for (i = 0; i < rl->nregs; i++)
{
struct insn_chain *chain;
int something_changed = 0;
int i;
+ reg_set_iterator rsi;
/* Build the spill_regs array for the function. */
/* If there are some registers still to eliminate and one of the spill regs
else
spill_reg_order[i] = -1;
- EXECUTE_IF_SET_IN_REG_SET
- (&spilled_pseudos, FIRST_PSEUDO_REGISTER, i,
- {
- /* Record the current hard register the pseudo is allocated to in
- pseudo_previous_regs so we avoid reallocating it to the same
- hard reg in a later pass. */
- gcc_assert (reg_renumber[i] >= 0);
-
- SET_HARD_REG_BIT (pseudo_previous_regs[i], reg_renumber[i]);
- /* Mark it as no longer having a hard register home. */
- reg_renumber[i] = -1;
- /* We will need to scan everything again. */
- something_changed = 1;
- });
+ EXECUTE_IF_SET_IN_REG_SET (&spilled_pseudos, FIRST_PSEUDO_REGISTER, i, rsi)
+ {
+ /* Record the current hard register the pseudo is allocated to in
+ pseudo_previous_regs so we avoid reallocating it to the same
+ hard reg in a later pass. */
+ gcc_assert (reg_renumber[i] >= 0);
+
+ SET_HARD_REG_BIT (pseudo_previous_regs[i], reg_renumber[i]);
+ /* Mark it as no longer having a hard register home. */
+ reg_renumber[i] = -1;
+ /* We will need to scan everything again. */
+ something_changed = 1;
+ }
/* Retry global register allocation if possible. */
if (global)
for (chain = insns_need_reload; chain; chain = chain->next_need_reload)
{
EXECUTE_IF_SET_IN_REG_SET
- (&chain->live_throughout, FIRST_PSEUDO_REGISTER, i,
- {
- ior_hard_reg_set (pseudo_forbidden_regs + i,
- &chain->used_spill_regs);
- });
+ (&chain->live_throughout, FIRST_PSEUDO_REGISTER, i, rsi)
+ {
+ ior_hard_reg_set (pseudo_forbidden_regs + i,
+ &chain->used_spill_regs);
+ }
EXECUTE_IF_SET_IN_REG_SET
- (&chain->dead_or_set, FIRST_PSEUDO_REGISTER, i,
- {
- ior_hard_reg_set (pseudo_forbidden_regs + i,
- &chain->used_spill_regs);
- });
+ (&chain->dead_or_set, FIRST_PSEUDO_REGISTER, i, rsi)
+ {
+ ior_hard_reg_set (pseudo_forbidden_regs + i,
+ &chain->used_spill_regs);
+ }
}
/* Retry allocating the spilled pseudos. For each reg, merge the
unsigned int j;
unsigned int regno;
rtx start_insn, stop_insn;
+ reg_set_iterator rsi;
/* Compute hard regs live at start of block -- this is the real hard regs
marked live, plus live pseudo regs that have been renumbered to
REG_SET_TO_HARD_REG_SET (current_live_regs, regs_live);
- EXECUTE_IF_SET_IN_REG_SET
- (regs_live, FIRST_PSEUDO_REGISTER, i,
- {
- if (reg_renumber[i] >= 0)
- {
- regno = reg_renumber[i];
- for (j = regno;
- j < regno + hard_regno_nregs[regno]
- [PSEUDO_REGNO_MODE (i)];
- j++)
- SET_HARD_REG_BIT (current_live_regs, j);
- }
- });
+ EXECUTE_IF_SET_IN_REG_SET (regs_live, FIRST_PSEUDO_REGISTER, i, rsi)
+ {
+ if (reg_renumber[i] >= 0)
+ {
+ regno = reg_renumber[i];
+ for (j = regno;
+ j < regno + hard_regno_nregs[regno][PSEUDO_REGNO_MODE (i)];
+ j++)
+ SET_HARD_REG_BIT (current_live_regs, j);
+ }
+ }
/* Get starting and ending insn, handling the case where each might
be a SEQUENCE. */
RTX_CODE code = GET_CODE (x);
rtx link;
int i;
+ reg_set_iterator rsi;
if (code == COND_EXEC)
{
(*current_sched_info->compute_jump_reg_dependencies)
(insn, &deps->reg_conditional_sets, &tmp_uses, &tmp_sets);
/* Make latency of jump equal to 0 by using anti-dependence. */
- EXECUTE_IF_SET_IN_REG_SET (&tmp_uses, 0, i,
+ EXECUTE_IF_SET_IN_REG_SET (&tmp_uses, 0, i, rsi)
{
struct deps_reg *reg_last = &deps->reg_last[i];
add_dependence_list (insn, reg_last->sets, REG_DEP_ANTI);
add_dependence_list (insn, reg_last->clobbers, REG_DEP_ANTI);
reg_last->uses_length++;
reg_last->uses = alloc_INSN_LIST (insn, reg_last->uses);
- });
+ }
IOR_REG_SET (reg_pending_sets, &tmp_sets);
CLEAR_REG_SET (&tmp_uses);
real, so we use anti-dependence here. */
if (GET_CODE (PATTERN (insn)) == COND_EXEC)
{
- EXECUTE_IF_SET_IN_REG_SET (&deps->reg_last_in_use, 0, i,
+ EXECUTE_IF_SET_IN_REG_SET (&deps->reg_last_in_use, 0, i, rsi)
{
struct deps_reg *reg_last = &deps->reg_last[i];
add_dependence_list (insn, reg_last->uses, REG_DEP_ANTI);
add_dependence_list
(insn, reg_last->clobbers,
reg_pending_barrier == TRUE_BARRIER ? 0 : REG_DEP_ANTI);
- });
+ }
}
else
{
- EXECUTE_IF_SET_IN_REG_SET (&deps->reg_last_in_use, 0, i,
+ EXECUTE_IF_SET_IN_REG_SET (&deps->reg_last_in_use, 0, i, rsi)
{
struct deps_reg *reg_last = &deps->reg_last[i];
add_dependence_list_and_free (insn, ®_last->uses,
reg_pending_barrier == TRUE_BARRIER ? 0 : REG_DEP_ANTI);
reg_last->uses_length = 0;
reg_last->clobbers_length = 0;
- });
+ }
}
for (i = 0; i < deps->max_reg; i++)
of the lists. */
if (GET_CODE (PATTERN (insn)) == COND_EXEC)
{
- EXECUTE_IF_SET_IN_REG_SET (reg_pending_uses, 0, i,
+ EXECUTE_IF_SET_IN_REG_SET (reg_pending_uses, 0, i, rsi)
{
struct deps_reg *reg_last = &deps->reg_last[i];
add_dependence_list (insn, reg_last->sets, 0);
add_dependence_list (insn, reg_last->clobbers, 0);
reg_last->uses = alloc_INSN_LIST (insn, reg_last->uses);
reg_last->uses_length++;
- });
- EXECUTE_IF_SET_IN_REG_SET (reg_pending_clobbers, 0, i,
+ }
+ EXECUTE_IF_SET_IN_REG_SET (reg_pending_clobbers, 0, i, rsi)
{
struct deps_reg *reg_last = &deps->reg_last[i];
add_dependence_list (insn, reg_last->sets, REG_DEP_OUTPUT);
add_dependence_list (insn, reg_last->uses, REG_DEP_ANTI);
reg_last->clobbers = alloc_INSN_LIST (insn, reg_last->clobbers);
reg_last->clobbers_length++;
- });
- EXECUTE_IF_SET_IN_REG_SET (reg_pending_sets, 0, i,
+ }
+ EXECUTE_IF_SET_IN_REG_SET (reg_pending_sets, 0, i, rsi)
{
struct deps_reg *reg_last = &deps->reg_last[i];
add_dependence_list (insn, reg_last->sets, REG_DEP_OUTPUT);
add_dependence_list (insn, reg_last->uses, REG_DEP_ANTI);
reg_last->sets = alloc_INSN_LIST (insn, reg_last->sets);
SET_REGNO_REG_SET (&deps->reg_conditional_sets, i);
- });
+ }
}
else
{
- EXECUTE_IF_SET_IN_REG_SET (reg_pending_uses, 0, i,
+ EXECUTE_IF_SET_IN_REG_SET (reg_pending_uses, 0, i, rsi)
{
struct deps_reg *reg_last = &deps->reg_last[i];
add_dependence_list (insn, reg_last->sets, 0);
add_dependence_list (insn, reg_last->clobbers, 0);
reg_last->uses_length++;
reg_last->uses = alloc_INSN_LIST (insn, reg_last->uses);
- });
- EXECUTE_IF_SET_IN_REG_SET (reg_pending_clobbers, 0, i,
+ }
+ EXECUTE_IF_SET_IN_REG_SET (reg_pending_clobbers, 0, i, rsi)
{
struct deps_reg *reg_last = &deps->reg_last[i];
if (reg_last->uses_length > MAX_PENDING_LIST_LENGTH
}
reg_last->clobbers_length++;
reg_last->clobbers = alloc_INSN_LIST (insn, reg_last->clobbers);
- });
- EXECUTE_IF_SET_IN_REG_SET (reg_pending_sets, 0, i,
+ }
+ EXECUTE_IF_SET_IN_REG_SET (reg_pending_sets, 0, i, rsi)
{
struct deps_reg *reg_last = &deps->reg_last[i];
add_dependence_list_and_free (insn, ®_last->sets,
reg_last->uses_length = 0;
reg_last->clobbers_length = 0;
CLEAR_REGNO_REG_SET (&deps->reg_conditional_sets, i);
- });
+ }
}
IOR_REG_SET (&deps->reg_last_in_use, reg_pending_uses);
free_deps (struct deps *deps)
{
int i;
+ reg_set_iterator rsi;
free_INSN_LIST_list (&deps->pending_read_insns);
free_EXPR_LIST_list (&deps->pending_read_mems);
/* Without the EXECUTE_IF_SET, this loop is executed max_reg * nr_regions
times. For a testcase with 42000 regs and 8000 small basic blocks,
this loop accounted for nearly 60% (84 sec) of the total -O2 runtime. */
- EXECUTE_IF_SET_IN_REG_SET (&deps->reg_last_in_use, 0, i,
+ EXECUTE_IF_SET_IN_REG_SET (&deps->reg_last_in_use, 0, i, rsi)
{
struct deps_reg *reg_last = &deps->reg_last[i];
if (reg_last->uses)
free_INSN_LIST_list (®_last->sets);
if (reg_last->clobbers)
free_INSN_LIST_list (®_last->clobbers);
- });
+ }
CLEAR_REG_SET (&deps->reg_last_in_use);
CLEAR_REG_SET (&deps->reg_conditional_sets);
{
struct deps *succ_deps;
int reg;
+ reg_set_iterator rsi;
/* Only bbs "below" bb, in the same region, are interesting. */
if (e->dest == EXIT_BLOCK_PTR
succ_deps = bb_deps + BLOCK_TO_BB (e->dest->index);
/* The reg_last lists are inherited by successor. */
- EXECUTE_IF_SET_IN_REG_SET (&pred_deps->reg_last_in_use, 0, reg,
+ EXECUTE_IF_SET_IN_REG_SET (&pred_deps->reg_last_in_use, 0, reg, rsi)
{
struct deps_reg *pred_rl = &pred_deps->reg_last[reg];
struct deps_reg *succ_rl = &succ_deps->reg_last[reg];
succ_rl->clobbers);
succ_rl->uses_length += pred_rl->uses_length;
succ_rl->clobbers_length += pred_rl->clobbers_length;
- });
+ }
IOR_REG_SET (&succ_deps->reg_last_in_use, &pred_deps->reg_last_in_use);
/* Mem read/write lists are inherited by successor. */