+2017-05-13 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
+
+ * df-core.c (df_set_blocks): Start using auto_bitmap.
+ (df_compact_blocks): Likewise.
+ * df-problems.c (df_rd_confluence_n): Likewise.
+ * df-scan.c (df_insn_rescan_all): Likewise.
+ (df_process_deferred_rescans): Likewise.
+ (df_update_entry_block_defs): Likewise.
+ (df_update_exit_block_uses): Likewise.
+ (df_entry_block_bitmap_verify): Likewise.
+ (df_exit_block_bitmap_verify): Likewise.
+ (df_scan_verify): Likewise.
+ * lra-constraints.c (lra_constraints): Likewise.
+ (undo_optional_reloads): Likewise.
+ (lra_undo_inheritance): Likewise.
+ * lra-remat.c (calculate_gen_cands): Likewise.
+ (do_remat): Likewise.
+ * lra-spills.c (assign_spill_hard_regs): Likewise.
+ (spill_pseudos): Likewise.
+ * tree-ssa-pre.c (bitmap_set_and): Likewise.
+ (bitmap_set_subtract_values): Likewise.
+
2017-05-13 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* haifa-sched.c (estimate_shadow_tick): Replace manual bitmap
/* This block is called to change the focus from one subset
to another. */
int p;
- bitmap_head diff;
- bitmap_initialize (&diff, &df_bitmap_obstack);
- bitmap_and_compl (&diff, df->blocks_to_analyze, blocks);
+ auto_bitmap diff (&df_bitmap_obstack);
+ bitmap_and_compl (diff, df->blocks_to_analyze, blocks);
for (p = 0; p < df->num_problems_defined; p++)
{
struct dataflow *dflow = df->problems_in_order[p];
bitmap_iterator bi;
unsigned int bb_index;
- EXECUTE_IF_SET_IN_BITMAP (&diff, 0, bb_index, bi)
+ EXECUTE_IF_SET_IN_BITMAP (diff, 0, bb_index, bi)
{
basic_block bb = BASIC_BLOCK_FOR_FN (cfun, bb_index);
if (bb)
}
}
}
-
- bitmap_clear (&diff);
}
else
{
int i, p;
basic_block bb;
void *problem_temps;
- bitmap_head tmp;
- bitmap_initialize (&tmp, &df_bitmap_obstack);
+ auto_bitmap tmp (&df_bitmap_obstack);
for (p = 0; p < df->num_problems_defined; p++)
{
struct dataflow *dflow = df->problems_in_order[p];
dflow problem. */
if (dflow->out_of_date_transfer_functions)
{
- bitmap_copy (&tmp, dflow->out_of_date_transfer_functions);
+ bitmap_copy (tmp, dflow->out_of_date_transfer_functions);
bitmap_clear (dflow->out_of_date_transfer_functions);
- if (bitmap_bit_p (&tmp, ENTRY_BLOCK))
+ if (bitmap_bit_p (tmp, ENTRY_BLOCK))
bitmap_set_bit (dflow->out_of_date_transfer_functions, ENTRY_BLOCK);
- if (bitmap_bit_p (&tmp, EXIT_BLOCK))
+ if (bitmap_bit_p (tmp, EXIT_BLOCK))
bitmap_set_bit (dflow->out_of_date_transfer_functions, EXIT_BLOCK);
i = NUM_FIXED_BLOCKS;
FOR_EACH_BB_FN (bb, cfun)
{
- if (bitmap_bit_p (&tmp, bb->index))
+ if (bitmap_bit_p (tmp, bb->index))
bitmap_set_bit (dflow->out_of_date_transfer_functions, i);
i++;
}
if (df->blocks_to_analyze)
{
- if (bitmap_bit_p (&tmp, ENTRY_BLOCK))
+ if (bitmap_bit_p (tmp, ENTRY_BLOCK))
bitmap_set_bit (df->blocks_to_analyze, ENTRY_BLOCK);
- if (bitmap_bit_p (&tmp, EXIT_BLOCK))
+ if (bitmap_bit_p (tmp, EXIT_BLOCK))
bitmap_set_bit (df->blocks_to_analyze, EXIT_BLOCK);
- bitmap_copy (&tmp, df->blocks_to_analyze);
+ bitmap_copy (tmp, df->blocks_to_analyze);
bitmap_clear (df->blocks_to_analyze);
i = NUM_FIXED_BLOCKS;
FOR_EACH_BB_FN (bb, cfun)
{
- if (bitmap_bit_p (&tmp, bb->index))
+ if (bitmap_bit_p (tmp, bb->index))
bitmap_set_bit (df->blocks_to_analyze, i);
i++;
}
}
- bitmap_clear (&tmp);
-
i = NUM_FIXED_BLOCKS;
FOR_EACH_BB_FN (bb, cfun)
{
bitmap dense_invalidated = &problem_data->dense_invalidated_by_call;
bitmap_iterator bi;
unsigned int regno;
- bitmap_head tmp;
- bitmap_initialize (&tmp, &df_bitmap_obstack);
- bitmap_and_compl (&tmp, op2, dense_invalidated);
+ auto_bitmap tmp (&df_bitmap_obstack);
+ bitmap_and_compl (tmp, op2, dense_invalidated);
EXECUTE_IF_SET_IN_BITMAP (sparse_invalidated, 0, regno, bi)
{
- bitmap_clear_range (&tmp,
+ bitmap_clear_range (tmp,
DF_DEFS_BEGIN (regno),
DF_DEFS_COUNT (regno));
}
- changed |= bitmap_ior_into (op1, &tmp);
- bitmap_clear (&tmp);
+ changed |= bitmap_ior_into (op1, tmp);
return changed;
}
else
basic_block bb;
bitmap_iterator bi;
unsigned int uid;
- bitmap_head tmp;
-
- bitmap_initialize (&tmp, &df_bitmap_obstack);
if (df->changeable_flags & DF_NO_INSN_RESCAN)
{
defer_insn_rescan = true;
}
- bitmap_copy (&tmp, &df->insns_to_delete);
- EXECUTE_IF_SET_IN_BITMAP (&tmp, 0, uid, bi)
+ auto_bitmap tmp (&df_bitmap_obstack);
+ bitmap_copy (tmp, &df->insns_to_delete);
+ EXECUTE_IF_SET_IN_BITMAP (tmp, 0, uid, bi)
{
struct df_insn_info *insn_info = DF_INSN_UID_SAFE_GET (uid);
if (insn_info)
df_insn_info_delete (uid);
}
- bitmap_clear (&tmp);
bitmap_clear (&df->insns_to_delete);
bitmap_clear (&df->insns_to_rescan);
bitmap_clear (&df->insns_to_notes_rescan);
bool defer_insn_rescan = false;
bitmap_iterator bi;
unsigned int uid;
- bitmap_head tmp;
-
- bitmap_initialize (&tmp, &df_bitmap_obstack);
if (df->changeable_flags & DF_NO_INSN_RESCAN)
{
if (dump_file)
fprintf (dump_file, "starting the processing of deferred insns\n");
- bitmap_copy (&tmp, &df->insns_to_delete);
- EXECUTE_IF_SET_IN_BITMAP (&tmp, 0, uid, bi)
+ auto_bitmap tmp (&df_bitmap_obstack);
+ bitmap_copy (tmp, &df->insns_to_delete);
+ EXECUTE_IF_SET_IN_BITMAP (tmp, 0, uid, bi)
{
struct df_insn_info *insn_info = DF_INSN_UID_SAFE_GET (uid);
if (insn_info)
df_insn_info_delete (uid);
}
- bitmap_copy (&tmp, &df->insns_to_rescan);
- EXECUTE_IF_SET_IN_BITMAP (&tmp, 0, uid, bi)
+ bitmap_copy (tmp, &df->insns_to_rescan);
+ EXECUTE_IF_SET_IN_BITMAP (tmp, 0, uid, bi)
{
struct df_insn_info *insn_info = DF_INSN_UID_SAFE_GET (uid);
if (insn_info)
df_insn_rescan (insn_info->insn);
}
- bitmap_copy (&tmp, &df->insns_to_notes_rescan);
- EXECUTE_IF_SET_IN_BITMAP (&tmp, 0, uid, bi)
+ bitmap_copy (tmp, &df->insns_to_notes_rescan);
+ EXECUTE_IF_SET_IN_BITMAP (tmp, 0, uid, bi)
{
struct df_insn_info *insn_info = DF_INSN_UID_SAFE_GET (uid);
if (insn_info)
if (dump_file)
fprintf (dump_file, "ending the processing of deferred insns\n");
- bitmap_clear (&tmp);
bitmap_clear (&df->insns_to_delete);
bitmap_clear (&df->insns_to_rescan);
bitmap_clear (&df->insns_to_notes_rescan);
void
df_update_entry_block_defs (void)
{
- bitmap_head refs;
bool changed = false;
- bitmap_initialize (&refs, &df_bitmap_obstack);
- df_get_entry_block_def_set (&refs);
+ auto_bitmap refs (&df_bitmap_obstack);
+ df_get_entry_block_def_set (refs);
if (df->entry_block_defs)
{
- if (!bitmap_equal_p (df->entry_block_defs, &refs))
+ if (!bitmap_equal_p (df->entry_block_defs, refs))
{
struct df_scan_bb_info *bb_info = df_scan_get_bb_info (ENTRY_BLOCK);
df_ref_chain_delete_du_chain (bb_info->artificial_defs);
if (changed)
{
- df_record_entry_block_defs (&refs);
- bitmap_copy (df->entry_block_defs, &refs);
+ df_record_entry_block_defs (refs);
+ bitmap_copy (df->entry_block_defs, refs);
df_set_bb_dirty (BASIC_BLOCK_FOR_FN (cfun, ENTRY_BLOCK));
}
- bitmap_clear (&refs);
}
void
df_update_exit_block_uses (void)
{
- bitmap_head refs;
bool changed = false;
- bitmap_initialize (&refs, &df_bitmap_obstack);
- df_get_exit_block_use_set (&refs);
+ auto_bitmap refs (&df_bitmap_obstack);
+ df_get_exit_block_use_set (refs);
if (df->exit_block_uses)
{
- if (!bitmap_equal_p (df->exit_block_uses, &refs))
+ if (!bitmap_equal_p (df->exit_block_uses, refs))
{
struct df_scan_bb_info *bb_info = df_scan_get_bb_info (EXIT_BLOCK);
df_ref_chain_delete_du_chain (bb_info->artificial_uses);
if (changed)
{
- df_record_exit_block_uses (&refs);
- bitmap_copy (df->exit_block_uses,& refs);
+ df_record_exit_block_uses (refs);
+ bitmap_copy (df->exit_block_uses, refs);
df_set_bb_dirty (BASIC_BLOCK_FOR_FN (cfun, EXIT_BLOCK));
}
- bitmap_clear (&refs);
}
static bool initialized = false;
static bool
df_entry_block_bitmap_verify (bool abort_if_fail)
{
- bitmap_head entry_block_defs;
bool is_eq;
- bitmap_initialize (&entry_block_defs, &df_bitmap_obstack);
- df_get_entry_block_def_set (&entry_block_defs);
+ auto_bitmap entry_block_defs (&df_bitmap_obstack);
+ df_get_entry_block_def_set (entry_block_defs);
- is_eq = bitmap_equal_p (&entry_block_defs, df->entry_block_defs);
+ is_eq = bitmap_equal_p (entry_block_defs, df->entry_block_defs);
if (!is_eq && abort_if_fail)
{
fprintf (stderr, "entry_block_defs = ");
- df_print_regset (stderr, &entry_block_defs);
+ df_print_regset (stderr, entry_block_defs);
fprintf (stderr, "df->entry_block_defs = ");
df_print_regset (stderr, df->entry_block_defs);
gcc_assert (0);
}
- bitmap_clear (&entry_block_defs);
-
return is_eq;
}
static bool
df_exit_block_bitmap_verify (bool abort_if_fail)
{
- bitmap_head exit_block_uses;
bool is_eq;
- bitmap_initialize (&exit_block_uses, &df_bitmap_obstack);
- df_get_exit_block_use_set (&exit_block_uses);
+ auto_bitmap exit_block_uses (&df_bitmap_obstack);
+ df_get_exit_block_use_set (exit_block_uses);
- is_eq = bitmap_equal_p (&exit_block_uses, df->exit_block_uses);
+ is_eq = bitmap_equal_p (exit_block_uses, df->exit_block_uses);
if (!is_eq && abort_if_fail)
{
fprintf (stderr, "exit_block_uses = ");
- df_print_regset (stderr, &exit_block_uses);
+ df_print_regset (stderr, exit_block_uses);
fprintf (stderr, "df->exit_block_uses = ");
df_print_regset (stderr, df->exit_block_uses);
gcc_assert (0);
}
- bitmap_clear (&exit_block_uses);
-
return is_eq;
}
{
unsigned int i;
basic_block bb;
- bitmap_head regular_block_artificial_uses;
- bitmap_head eh_block_artificial_uses;
if (!df)
return;
/* (2) There are various bitmaps whose value may change over the
course of the compilation. This step recomputes them to make
sure that they have not slipped out of date. */
- bitmap_initialize (®ular_block_artificial_uses, &df_bitmap_obstack);
- bitmap_initialize (&eh_block_artificial_uses, &df_bitmap_obstack);
+ auto_bitmap regular_block_artificial_uses (&df_bitmap_obstack);
+ auto_bitmap eh_block_artificial_uses (&df_bitmap_obstack);
- df_get_regular_block_artificial_uses (®ular_block_artificial_uses);
- df_get_eh_block_artificial_uses (&eh_block_artificial_uses);
+ df_get_regular_block_artificial_uses (regular_block_artificial_uses);
+ df_get_eh_block_artificial_uses (eh_block_artificial_uses);
- bitmap_ior_into (&eh_block_artificial_uses,
- ®ular_block_artificial_uses);
+ bitmap_ior_into (eh_block_artificial_uses,
+ regular_block_artificial_uses);
/* Check artificial_uses bitmaps didn't change. */
- gcc_assert (bitmap_equal_p (®ular_block_artificial_uses,
+ gcc_assert (bitmap_equal_p (regular_block_artificial_uses,
&df->regular_block_artificial_uses));
- gcc_assert (bitmap_equal_p (&eh_block_artificial_uses,
+ gcc_assert (bitmap_equal_p (eh_block_artificial_uses,
&df->eh_block_artificial_uses));
- bitmap_clear (®ular_block_artificial_uses);
- bitmap_clear (&eh_block_artificial_uses);
-
/* Verify entry block and exit block. These only verify the bitmaps,
the refs are verified in df_bb_verify. */
df_entry_block_bitmap_verify (true);
unsigned int min_len, new_min_len, uid;
rtx set, x, reg, dest_reg;
basic_block last_bb;
- bitmap_head equiv_insn_bitmap;
bitmap_iterator bi;
lra_constraint_iter++;
/* Do elimination before the equivalence processing as we can spill
some pseudos during elimination. */
lra_eliminate (false, first_p);
- bitmap_initialize (&equiv_insn_bitmap, ®_obstack);
+ auto_bitmap equiv_insn_bitmap (®_obstack);
for (i = FIRST_PSEUDO_REGISTER; i < new_regno_start; i++)
if (lra_reg_info[i].nrefs != 0)
{
if (contains_reg_p (x, false, true))
ira_reg_equiv[i].profitable_p = false;
if (get_equiv (reg) != reg)
- bitmap_ior_into (&equiv_insn_bitmap, &lra_reg_info[i].insn_bitmap);
+ bitmap_ior_into (equiv_insn_bitmap, &lra_reg_info[i].insn_bitmap);
}
}
for (i = FIRST_PSEUDO_REGISTER; i < new_regno_start; i++)
update_equiv (i);
/* We should add all insns containing pseudos which should be
substituted by their equivalences. */
- EXECUTE_IF_SET_IN_BITMAP (&equiv_insn_bitmap, 0, uid, bi)
+ EXECUTE_IF_SET_IN_BITMAP (equiv_insn_bitmap, 0, uid, bi)
lra_push_insn_by_uid (uid);
min_len = lra_insn_stack_length ();
new_insns_num = 0;
/* We need to check equivalence in debug insn and change
pseudo to the equivalent value if necessary. */
curr_id = lra_get_insn_recog_data (curr_insn);
- if (bitmap_bit_p (&equiv_insn_bitmap, INSN_UID (curr_insn)))
+ if (bitmap_bit_p (equiv_insn_bitmap, INSN_UID (curr_insn)))
{
rtx old = *curr_id->operand_loc[0];
*curr_id->operand_loc[0]
/* Check non-transformed insns too for equiv change as USE
or CLOBBER don't need reloads but can contain pseudos
being changed on their equivalences. */
- else if (bitmap_bit_p (&equiv_insn_bitmap, INSN_UID (curr_insn))
+ else if (bitmap_bit_p (equiv_insn_bitmap, INSN_UID (curr_insn))
&& loc_equivalence_change_p (&PATTERN (curr_insn)))
{
lra_update_insn_regno_info (curr_insn);
}
}
}
- bitmap_clear (&equiv_insn_bitmap);
+
/* If we used a new hard regno, changed_p should be true because the
hard reg is assigned to a new pseudo. */
if (flag_checking && !changed_p)
bitmap_iterator bi, bi2;
rtx_insn *insn;
rtx set, src, dest;
- bitmap_head removed_optional_reload_pseudos, insn_bitmap;
+ auto_bitmap removed_optional_reload_pseudos (®_obstack);
- bitmap_initialize (&removed_optional_reload_pseudos, ®_obstack);
- bitmap_copy (&removed_optional_reload_pseudos, &lra_optional_reload_pseudos);
+ bitmap_copy (removed_optional_reload_pseudos, &lra_optional_reload_pseudos);
EXECUTE_IF_SET_IN_BITMAP (&lra_optional_reload_pseudos, 0, regno, bi)
{
keep_p = false;
}
if (keep_p)
{
- bitmap_clear_bit (&removed_optional_reload_pseudos, regno);
+ bitmap_clear_bit (removed_optional_reload_pseudos, regno);
if (lra_dump_file != NULL)
fprintf (lra_dump_file, "Keep optional reload reg %d\n", regno);
}
}
- change_p = ! bitmap_empty_p (&removed_optional_reload_pseudos);
- bitmap_initialize (&insn_bitmap, ®_obstack);
- EXECUTE_IF_SET_IN_BITMAP (&removed_optional_reload_pseudos, 0, regno, bi)
+ change_p = ! bitmap_empty_p (removed_optional_reload_pseudos);
+ auto_bitmap insn_bitmap (®_obstack);
+ EXECUTE_IF_SET_IN_BITMAP (removed_optional_reload_pseudos, 0, regno, bi)
{
if (lra_dump_file != NULL)
fprintf (lra_dump_file, "Remove optional reload reg %d\n", regno);
- bitmap_copy (&insn_bitmap, &lra_reg_info[regno].insn_bitmap);
- EXECUTE_IF_SET_IN_BITMAP (&insn_bitmap, 0, uid, bi2)
+ bitmap_copy (insn_bitmap, &lra_reg_info[regno].insn_bitmap);
+ EXECUTE_IF_SET_IN_BITMAP (insn_bitmap, 0, uid, bi2)
{
insn = lra_insn_recog_data[uid]->insn;
if ((set = single_set (insn)) != NULL_RTX)
/* Clear restore_regnos. */
EXECUTE_IF_SET_IN_BITMAP (&lra_optional_reload_pseudos, 0, regno, bi)
lra_reg_info[regno].restore_rtx = NULL_RTX;
- bitmap_clear (&insn_bitmap);
- bitmap_clear (&removed_optional_reload_pseudos);
return change_p;
}
int hard_regno;
int n_all_inherit, n_inherit, n_all_split, n_split;
rtx restore_rtx;
- bitmap_head remove_pseudos;
bitmap_iterator bi;
bool change_p;
fprintf (lra_dump_file,
"\n********** Undoing inheritance #%d: **********\n\n",
lra_undo_inheritance_iter);
- bitmap_initialize (&remove_pseudos, ®_obstack);
+ auto_bitmap remove_pseudos (®_obstack);
n_inherit = n_all_inherit = 0;
EXECUTE_IF_SET_IN_BITMAP (&lra_inheritance_pseudos, 0, regno, bi)
if (lra_reg_info[regno].restore_rtx != NULL_RTX)
allocation we used shorter live-ranges. */
&& (! REG_P (lra_reg_info[regno].restore_rtx)
|| reg_renumber[REGNO (lra_reg_info[regno].restore_rtx)] < 0))
- bitmap_set_bit (&remove_pseudos, regno);
+ bitmap_set_bit (remove_pseudos, regno);
else
n_inherit++;
}
hard_regno = (restore_regno >= FIRST_PSEUDO_REGISTER
? reg_renumber[restore_regno] : restore_regno);
if (hard_regno < 0 || reg_renumber[regno] == hard_regno)
- bitmap_set_bit (&remove_pseudos, regno);
+ bitmap_set_bit (remove_pseudos, regno);
else
{
n_split++;
fprintf (lra_dump_file, "Split %d out of %d (%.2f%%)\n",
n_split, n_all_split,
(double) n_split / n_all_split * 100);
- change_p = remove_inheritance_pseudos (&remove_pseudos);
- bitmap_clear (&remove_pseudos);
+ change_p = remove_inheritance_pseudos (remove_pseudos);
/* Clear restore_regnos. */
EXECUTE_IF_SET_IN_BITMAP (&lra_inheritance_pseudos, 0, regno, bi)
lra_reg_info[regno].restore_rtx = NULL_RTX;
{
basic_block bb;
bitmap gen_cands;
- bitmap_head gen_insns;
rtx_insn *insn;
- bitmap_initialize (&gen_insns, ®_obstack);
FOR_EACH_BB_FN (bb, cfun)
{
gen_cands = &get_remat_bb_data (bb)->gen_cands;
- bitmap_clear (&gen_insns);
+ auto_bitmap gen_insns (®_obstack);
FOR_BB_INSNS (bb, insn)
if (INSN_P (insn))
{
reg = reg->next)
if (reg->type != OP_IN
|| find_regno_note (insn, REG_DEAD, reg->regno) != NULL)
- EXECUTE_IF_SET_IN_BITMAP (&gen_insns, 0, uid, bi)
+ EXECUTE_IF_SET_IN_BITMAP (gen_insns, 0, uid, bi)
{
rtx_insn *insn2 = lra_insn_recog_data[uid]->insn;
}
if (CALL_P (insn))
- EXECUTE_IF_SET_IN_BITMAP (&gen_insns, 0, uid, bi)
+ EXECUTE_IF_SET_IN_BITMAP (gen_insns, 0, uid, bi)
{
rtx_insn *insn2 = lra_insn_recog_data[uid]->insn;
bitmap_set_bit (&temp_bitmap, uid);
}
}
- bitmap_and_compl_into (&gen_insns, &temp_bitmap);
+ bitmap_and_compl_into (gen_insns, &temp_bitmap);
cand = insn_to_cand[INSN_UID (insn)];
if (cand != NULL)
{
bitmap_set_bit (gen_cands, cand->index);
- bitmap_set_bit (&gen_insns, INSN_UID (insn));
+ bitmap_set_bit (gen_insns, INSN_UID (insn));
}
}
}
- bitmap_clear (&gen_insns);
}
\f
unsigned regno;
rtx_insn *insn;
basic_block bb;
- bitmap_head avail_cands;
- bitmap_head active_cands;
bool changed_p = false;
/* Living hard regs and hard registers of living pseudos. */
HARD_REG_SET live_hard_regs;
bitmap_iterator bi;
- bitmap_initialize (&avail_cands, ®_obstack);
- bitmap_initialize (&active_cands, ®_obstack);
+ auto_bitmap avail_cands (®_obstack);
+ auto_bitmap active_cands (®_obstack);
FOR_EACH_BB_FN (bb, cfun)
{
CLEAR_HARD_REG_SET (live_hard_regs);
if (hard_regno >= 0)
SET_HARD_REG_BIT (live_hard_regs, hard_regno);
}
- bitmap_and (&avail_cands, &get_remat_bb_data (bb)->avin_cands,
+ bitmap_and (avail_cands, &get_remat_bb_data (bb)->avin_cands,
&get_remat_bb_data (bb)->livein_cands);
/* Activating insns are always in the same block as their corresponding
remat insn, so at the start of a block the two bitsets are equal. */
- bitmap_copy (&active_cands, &avail_cands);
+ bitmap_copy (active_cands, avail_cands);
FOR_BB_INSNS (bb, insn)
{
if (!NONDEBUG_INSN_P (insn))
for (cand = regno_cands[src_regno];
cand != NULL;
cand = cand->next_regno_cand)
- if (bitmap_bit_p (&avail_cands, cand->index)
- && bitmap_bit_p (&active_cands, cand->index))
+ if (bitmap_bit_p (avail_cands, cand->index)
+ && bitmap_bit_p (active_cands, cand->index))
break;
}
int i, hard_regno, nregs;
reg = reg->next)
if (reg->type != OP_IN
|| find_regno_note (insn, REG_DEAD, reg->regno) != NULL)
- EXECUTE_IF_SET_IN_BITMAP (&avail_cands, 0, cid, bi)
+ EXECUTE_IF_SET_IN_BITMAP (avail_cands, 0, cid, bi)
{
cand = all_cands[cid];
}
if (CALL_P (insn))
- EXECUTE_IF_SET_IN_BITMAP (&avail_cands, 0, cid, bi)
+ EXECUTE_IF_SET_IN_BITMAP (avail_cands, 0, cid, bi)
{
cand = all_cands[cid];
bitmap_set_bit (&temp_bitmap, cand->index);
}
- bitmap_and_compl_into (&avail_cands, &temp_bitmap);
+ bitmap_and_compl_into (avail_cands, &temp_bitmap);
/* Now see whether a candidate is made active or available
by this insn. */
cand = insn_to_cand_activation[INSN_UID (insn)];
if (cand)
- bitmap_set_bit (&active_cands, cand->index);
+ bitmap_set_bit (active_cands, cand->index);
cand = insn_to_cand[INSN_UID (insn)];
if (cand != NULL)
{
- bitmap_set_bit (&avail_cands, cand->index);
+ bitmap_set_bit (avail_cands, cand->index);
if (cand->reload_regno == -1)
- bitmap_set_bit (&active_cands, cand->index);
+ bitmap_set_bit (active_cands, cand->index);
else
- bitmap_clear_bit (&active_cands, cand->index);
+ bitmap_clear_bit (active_cands, cand->index);
}
if (remat_insn != NULL)
SET_HARD_REG_BIT (live_hard_regs, reg->regno);
}
}
- bitmap_clear (&avail_cands);
- bitmap_clear (&active_cands);
return changed_p;
}
rtx set;
basic_block bb;
HARD_REG_SET conflict_hard_regs;
- bitmap_head ok_insn_bitmap;
bitmap setjump_crosses = regstat_get_setjmp_crosses ();
/* Hard registers which can not be used for any purpose at given
program point because they are unallocatable or already allocated
for (p = r->start; p <= r->finish; p++)
add_to_hard_reg_set (&reserved_hard_regs[p],
lra_reg_info[i].biggest_mode, hard_regno);
- bitmap_initialize (&ok_insn_bitmap, ®_obstack);
+ auto_bitmap ok_insn_bitmap (®_obstack);
FOR_EACH_BB_FN (bb, cfun)
FOR_BB_INSNS (bb, insn)
if (DEBUG_INSN_P (insn)
|| ((set = single_set (insn)) != NULL_RTX
&& REG_P (SET_SRC (set)) && REG_P (SET_DEST (set))))
- bitmap_set_bit (&ok_insn_bitmap, INSN_UID (insn));
+ bitmap_set_bit (ok_insn_bitmap, INSN_UID (insn));
for (res = i = 0; i < n; i++)
{
regno = pseudo_regnos[i];
targetm.spill_class ((reg_class_t) rclass,
PSEUDO_REGNO_MODE (regno)))) == NO_REGS
|| bitmap_intersect_compl_p (&lra_reg_info[regno].insn_bitmap,
- &ok_insn_bitmap))
+ ok_insn_bitmap))
{
pseudo_regnos[res++] = regno;
continue;
/* Just loop. */
df_set_regs_ever_live (hard_regno + nr, true);
}
- bitmap_clear (&ok_insn_bitmap);
free (reserved_hard_regs);
return res;
}
basic_block bb;
rtx_insn *insn, *curr;
int i;
- bitmap_head spilled_pseudos, changed_insns;
- bitmap_initialize (&spilled_pseudos, ®_obstack);
- bitmap_initialize (&changed_insns, ®_obstack);
+ auto_bitmap spilled_pseudos (®_obstack);
+ auto_bitmap changed_insns (®_obstack);
for (i = FIRST_PSEUDO_REGISTER; i < regs_num; i++)
{
if (lra_reg_info[i].nrefs != 0 && lra_get_regno_hard_regno (i) < 0
&& ! lra_former_scratch_p (i))
{
- bitmap_set_bit (&spilled_pseudos, i);
- bitmap_ior_into (&changed_insns, &lra_reg_info[i].insn_bitmap);
+ bitmap_set_bit (spilled_pseudos, i);
+ bitmap_ior_into (changed_insns, &lra_reg_info[i].insn_bitmap);
}
}
FOR_EACH_BB_FN (bb, cfun)
{
bool removed_pseudo_p = false;
- if (bitmap_bit_p (&changed_insns, INSN_UID (insn)))
+ if (bitmap_bit_p (changed_insns, INSN_UID (insn)))
{
rtx *link_loc, link;
"Debug insn #%u is reset because it referenced "
"removed pseudo\n", INSN_UID (insn));
}
- bitmap_and_compl_into (df_get_live_in (bb), &spilled_pseudos);
- bitmap_and_compl_into (df_get_live_out (bb), &spilled_pseudos);
+ bitmap_and_compl_into (df_get_live_in (bb), spilled_pseudos);
+ bitmap_and_compl_into (df_get_live_out (bb), spilled_pseudos);
}
}
- bitmap_clear (&spilled_pseudos);
- bitmap_clear (&changed_insns);
}
/* Return true if we need to change some pseudos into memory. */