Commit d648b5ff by Trevor Saunders Committed by Trevor Saunders

use auto_bitmap more with alternate obstacks

gcc/ChangeLog:

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.

From-SVN: r248023
parent 8f9b31f7
2017-05-13 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> 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 * haifa-sched.c (estimate_shadow_tick): Replace manual bitmap
management with auto_bitmap. management with auto_bitmap.
(fix_inter_tick): Likewise. (fix_inter_tick): Likewise.
......
...@@ -497,9 +497,8 @@ df_set_blocks (bitmap blocks) ...@@ -497,9 +497,8 @@ df_set_blocks (bitmap blocks)
/* This block is called to change the focus from one subset /* This block is called to change the focus from one subset
to another. */ to another. */
int p; int p;
bitmap_head diff; auto_bitmap diff (&df_bitmap_obstack);
bitmap_initialize (&diff, &df_bitmap_obstack); bitmap_and_compl (diff, df->blocks_to_analyze, blocks);
bitmap_and_compl (&diff, df->blocks_to_analyze, blocks);
for (p = 0; p < df->num_problems_defined; p++) for (p = 0; p < df->num_problems_defined; p++)
{ {
struct dataflow *dflow = df->problems_in_order[p]; struct dataflow *dflow = df->problems_in_order[p];
...@@ -510,7 +509,7 @@ df_set_blocks (bitmap blocks) ...@@ -510,7 +509,7 @@ df_set_blocks (bitmap blocks)
bitmap_iterator bi; bitmap_iterator bi;
unsigned int bb_index; 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); basic_block bb = BASIC_BLOCK_FOR_FN (cfun, bb_index);
if (bb) if (bb)
...@@ -522,8 +521,6 @@ df_set_blocks (bitmap blocks) ...@@ -522,8 +521,6 @@ df_set_blocks (bitmap blocks)
} }
} }
} }
bitmap_clear (&diff);
} }
else else
{ {
...@@ -1652,9 +1649,8 @@ df_compact_blocks (void) ...@@ -1652,9 +1649,8 @@ df_compact_blocks (void)
int i, p; int i, p;
basic_block bb; basic_block bb;
void *problem_temps; 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++) for (p = 0; p < df->num_problems_defined; p++)
{ {
struct dataflow *dflow = df->problems_in_order[p]; struct dataflow *dflow = df->problems_in_order[p];
...@@ -1663,17 +1659,17 @@ df_compact_blocks (void) ...@@ -1663,17 +1659,17 @@ df_compact_blocks (void)
dflow problem. */ dflow problem. */
if (dflow->out_of_date_transfer_functions) 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); 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); 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); bitmap_set_bit (dflow->out_of_date_transfer_functions, EXIT_BLOCK);
i = NUM_FIXED_BLOCKS; i = NUM_FIXED_BLOCKS;
FOR_EACH_BB_FN (bb, cfun) 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); bitmap_set_bit (dflow->out_of_date_transfer_functions, i);
i++; i++;
} }
...@@ -1711,23 +1707,21 @@ df_compact_blocks (void) ...@@ -1711,23 +1707,21 @@ df_compact_blocks (void)
if (df->blocks_to_analyze) 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); 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_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); bitmap_clear (df->blocks_to_analyze);
i = NUM_FIXED_BLOCKS; i = NUM_FIXED_BLOCKS;
FOR_EACH_BB_FN (bb, cfun) 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); bitmap_set_bit (df->blocks_to_analyze, i);
i++; i++;
} }
} }
bitmap_clear (&tmp);
i = NUM_FIXED_BLOCKS; i = NUM_FIXED_BLOCKS;
FOR_EACH_BB_FN (bb, cfun) FOR_EACH_BB_FN (bb, cfun)
{ {
......
...@@ -461,19 +461,17 @@ df_rd_confluence_n (edge e) ...@@ -461,19 +461,17 @@ df_rd_confluence_n (edge e)
bitmap dense_invalidated = &problem_data->dense_invalidated_by_call; bitmap dense_invalidated = &problem_data->dense_invalidated_by_call;
bitmap_iterator bi; bitmap_iterator bi;
unsigned int regno; unsigned int regno;
bitmap_head tmp;
bitmap_initialize (&tmp, &df_bitmap_obstack); auto_bitmap tmp (&df_bitmap_obstack);
bitmap_and_compl (&tmp, op2, dense_invalidated); bitmap_and_compl (tmp, op2, dense_invalidated);
EXECUTE_IF_SET_IN_BITMAP (sparse_invalidated, 0, regno, bi) EXECUTE_IF_SET_IN_BITMAP (sparse_invalidated, 0, regno, bi)
{ {
bitmap_clear_range (&tmp, bitmap_clear_range (tmp,
DF_DEFS_BEGIN (regno), DF_DEFS_BEGIN (regno),
DF_DEFS_COUNT (regno)); DF_DEFS_COUNT (regno));
} }
changed |= bitmap_ior_into (op1, &tmp); changed |= bitmap_ior_into (op1, tmp);
bitmap_clear (&tmp);
return changed; return changed;
} }
else else
......
...@@ -1161,9 +1161,6 @@ df_insn_rescan_all (void) ...@@ -1161,9 +1161,6 @@ df_insn_rescan_all (void)
basic_block bb; basic_block bb;
bitmap_iterator bi; bitmap_iterator bi;
unsigned int uid; unsigned int uid;
bitmap_head tmp;
bitmap_initialize (&tmp, &df_bitmap_obstack);
if (df->changeable_flags & DF_NO_INSN_RESCAN) if (df->changeable_flags & DF_NO_INSN_RESCAN)
{ {
...@@ -1177,15 +1174,15 @@ df_insn_rescan_all (void) ...@@ -1177,15 +1174,15 @@ df_insn_rescan_all (void)
defer_insn_rescan = true; defer_insn_rescan = true;
} }
bitmap_copy (&tmp, &df->insns_to_delete); auto_bitmap tmp (&df_bitmap_obstack);
EXECUTE_IF_SET_IN_BITMAP (&tmp, 0, uid, bi) 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); struct df_insn_info *insn_info = DF_INSN_UID_SAFE_GET (uid);
if (insn_info) if (insn_info)
df_insn_info_delete (uid); df_insn_info_delete (uid);
} }
bitmap_clear (&tmp);
bitmap_clear (&df->insns_to_delete); bitmap_clear (&df->insns_to_delete);
bitmap_clear (&df->insns_to_rescan); bitmap_clear (&df->insns_to_rescan);
bitmap_clear (&df->insns_to_notes_rescan); bitmap_clear (&df->insns_to_notes_rescan);
...@@ -1215,9 +1212,6 @@ df_process_deferred_rescans (void) ...@@ -1215,9 +1212,6 @@ df_process_deferred_rescans (void)
bool defer_insn_rescan = false; bool defer_insn_rescan = false;
bitmap_iterator bi; bitmap_iterator bi;
unsigned int uid; unsigned int uid;
bitmap_head tmp;
bitmap_initialize (&tmp, &df_bitmap_obstack);
if (df->changeable_flags & DF_NO_INSN_RESCAN) if (df->changeable_flags & DF_NO_INSN_RESCAN)
{ {
...@@ -1234,24 +1228,25 @@ df_process_deferred_rescans (void) ...@@ -1234,24 +1228,25 @@ df_process_deferred_rescans (void)
if (dump_file) if (dump_file)
fprintf (dump_file, "starting the processing of deferred insns\n"); fprintf (dump_file, "starting the processing of deferred insns\n");
bitmap_copy (&tmp, &df->insns_to_delete); auto_bitmap tmp (&df_bitmap_obstack);
EXECUTE_IF_SET_IN_BITMAP (&tmp, 0, uid, bi) 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); struct df_insn_info *insn_info = DF_INSN_UID_SAFE_GET (uid);
if (insn_info) if (insn_info)
df_insn_info_delete (uid); df_insn_info_delete (uid);
} }
bitmap_copy (&tmp, &df->insns_to_rescan); bitmap_copy (tmp, &df->insns_to_rescan);
EXECUTE_IF_SET_IN_BITMAP (&tmp, 0, uid, bi) EXECUTE_IF_SET_IN_BITMAP (tmp, 0, uid, bi)
{ {
struct df_insn_info *insn_info = DF_INSN_UID_SAFE_GET (uid); struct df_insn_info *insn_info = DF_INSN_UID_SAFE_GET (uid);
if (insn_info) if (insn_info)
df_insn_rescan (insn_info->insn); df_insn_rescan (insn_info->insn);
} }
bitmap_copy (&tmp, &df->insns_to_notes_rescan); bitmap_copy (tmp, &df->insns_to_notes_rescan);
EXECUTE_IF_SET_IN_BITMAP (&tmp, 0, uid, bi) EXECUTE_IF_SET_IN_BITMAP (tmp, 0, uid, bi)
{ {
struct df_insn_info *insn_info = DF_INSN_UID_SAFE_GET (uid); struct df_insn_info *insn_info = DF_INSN_UID_SAFE_GET (uid);
if (insn_info) if (insn_info)
...@@ -1261,7 +1256,6 @@ df_process_deferred_rescans (void) ...@@ -1261,7 +1256,6 @@ df_process_deferred_rescans (void)
if (dump_file) if (dump_file)
fprintf (dump_file, "ending the processing of deferred insns\n"); fprintf (dump_file, "ending the processing of deferred insns\n");
bitmap_clear (&tmp);
bitmap_clear (&df->insns_to_delete); bitmap_clear (&df->insns_to_delete);
bitmap_clear (&df->insns_to_rescan); bitmap_clear (&df->insns_to_rescan);
bitmap_clear (&df->insns_to_notes_rescan); bitmap_clear (&df->insns_to_notes_rescan);
...@@ -3628,14 +3622,13 @@ df_record_entry_block_defs (bitmap entry_block_defs) ...@@ -3628,14 +3622,13 @@ df_record_entry_block_defs (bitmap entry_block_defs)
void void
df_update_entry_block_defs (void) df_update_entry_block_defs (void)
{ {
bitmap_head refs;
bool changed = false; bool changed = false;
bitmap_initialize (&refs, &df_bitmap_obstack); auto_bitmap refs (&df_bitmap_obstack);
df_get_entry_block_def_set (&refs); df_get_entry_block_def_set (refs);
if (df->entry_block_defs) 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); struct df_scan_bb_info *bb_info = df_scan_get_bb_info (ENTRY_BLOCK);
df_ref_chain_delete_du_chain (bb_info->artificial_defs); df_ref_chain_delete_du_chain (bb_info->artificial_defs);
...@@ -3655,11 +3648,10 @@ df_update_entry_block_defs (void) ...@@ -3655,11 +3648,10 @@ df_update_entry_block_defs (void)
if (changed) if (changed)
{ {
df_record_entry_block_defs (&refs); df_record_entry_block_defs (refs);
bitmap_copy (df->entry_block_defs, &refs); bitmap_copy (df->entry_block_defs, refs);
df_set_bb_dirty (BASIC_BLOCK_FOR_FN (cfun, ENTRY_BLOCK)); df_set_bb_dirty (BASIC_BLOCK_FOR_FN (cfun, ENTRY_BLOCK));
} }
bitmap_clear (&refs);
} }
...@@ -3804,14 +3796,13 @@ df_record_exit_block_uses (bitmap exit_block_uses) ...@@ -3804,14 +3796,13 @@ df_record_exit_block_uses (bitmap exit_block_uses)
void void
df_update_exit_block_uses (void) df_update_exit_block_uses (void)
{ {
bitmap_head refs;
bool changed = false; bool changed = false;
bitmap_initialize (&refs, &df_bitmap_obstack); auto_bitmap refs (&df_bitmap_obstack);
df_get_exit_block_use_set (&refs); df_get_exit_block_use_set (refs);
if (df->exit_block_uses) 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); struct df_scan_bb_info *bb_info = df_scan_get_bb_info (EXIT_BLOCK);
df_ref_chain_delete_du_chain (bb_info->artificial_uses); df_ref_chain_delete_du_chain (bb_info->artificial_uses);
...@@ -3831,11 +3822,10 @@ df_update_exit_block_uses (void) ...@@ -3831,11 +3822,10 @@ df_update_exit_block_uses (void)
if (changed) if (changed)
{ {
df_record_exit_block_uses (&refs); df_record_exit_block_uses (refs);
bitmap_copy (df->exit_block_uses,& refs); bitmap_copy (df->exit_block_uses, refs);
df_set_bb_dirty (BASIC_BLOCK_FOR_FN (cfun, EXIT_BLOCK)); df_set_bb_dirty (BASIC_BLOCK_FOR_FN (cfun, EXIT_BLOCK));
} }
bitmap_clear (&refs);
} }
static bool initialized = false; static bool initialized = false;
...@@ -4171,25 +4161,22 @@ df_bb_verify (basic_block bb) ...@@ -4171,25 +4161,22 @@ df_bb_verify (basic_block bb)
static bool static bool
df_entry_block_bitmap_verify (bool abort_if_fail) df_entry_block_bitmap_verify (bool abort_if_fail)
{ {
bitmap_head entry_block_defs;
bool is_eq; bool is_eq;
bitmap_initialize (&entry_block_defs, &df_bitmap_obstack); auto_bitmap entry_block_defs (&df_bitmap_obstack);
df_get_entry_block_def_set (&entry_block_defs); 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) if (!is_eq && abort_if_fail)
{ {
fprintf (stderr, "entry_block_defs = "); 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 = "); fprintf (stderr, "df->entry_block_defs = ");
df_print_regset (stderr, df->entry_block_defs); df_print_regset (stderr, df->entry_block_defs);
gcc_assert (0); gcc_assert (0);
} }
bitmap_clear (&entry_block_defs);
return is_eq; return is_eq;
} }
...@@ -4200,25 +4187,22 @@ df_entry_block_bitmap_verify (bool abort_if_fail) ...@@ -4200,25 +4187,22 @@ df_entry_block_bitmap_verify (bool abort_if_fail)
static bool static bool
df_exit_block_bitmap_verify (bool abort_if_fail) df_exit_block_bitmap_verify (bool abort_if_fail)
{ {
bitmap_head exit_block_uses;
bool is_eq; bool is_eq;
bitmap_initialize (&exit_block_uses, &df_bitmap_obstack); auto_bitmap exit_block_uses (&df_bitmap_obstack);
df_get_exit_block_use_set (&exit_block_uses); 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) if (!is_eq && abort_if_fail)
{ {
fprintf (stderr, "exit_block_uses = "); 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 = "); fprintf (stderr, "df->exit_block_uses = ");
df_print_regset (stderr, df->exit_block_uses); df_print_regset (stderr, df->exit_block_uses);
gcc_assert (0); gcc_assert (0);
} }
bitmap_clear (&exit_block_uses);
return is_eq; return is_eq;
} }
...@@ -4231,8 +4215,6 @@ df_scan_verify (void) ...@@ -4231,8 +4215,6 @@ df_scan_verify (void)
{ {
unsigned int i; unsigned int i;
basic_block bb; basic_block bb;
bitmap_head regular_block_artificial_uses;
bitmap_head eh_block_artificial_uses;
if (!df) if (!df)
return; return;
...@@ -4253,24 +4235,21 @@ df_scan_verify (void) ...@@ -4253,24 +4235,21 @@ df_scan_verify (void)
/* (2) There are various bitmaps whose value may change over the /* (2) There are various bitmaps whose value may change over the
course of the compilation. This step recomputes them to make course of the compilation. This step recomputes them to make
sure that they have not slipped out of date. */ sure that they have not slipped out of date. */
bitmap_initialize (&regular_block_artificial_uses, &df_bitmap_obstack); auto_bitmap regular_block_artificial_uses (&df_bitmap_obstack);
bitmap_initialize (&eh_block_artificial_uses, &df_bitmap_obstack); auto_bitmap eh_block_artificial_uses (&df_bitmap_obstack);
df_get_regular_block_artificial_uses (&regular_block_artificial_uses); df_get_regular_block_artificial_uses (regular_block_artificial_uses);
df_get_eh_block_artificial_uses (&eh_block_artificial_uses); df_get_eh_block_artificial_uses (eh_block_artificial_uses);
bitmap_ior_into (&eh_block_artificial_uses, bitmap_ior_into (eh_block_artificial_uses,
&regular_block_artificial_uses); regular_block_artificial_uses);
/* Check artificial_uses bitmaps didn't change. */ /* Check artificial_uses bitmaps didn't change. */
gcc_assert (bitmap_equal_p (&regular_block_artificial_uses, gcc_assert (bitmap_equal_p (regular_block_artificial_uses,
&df->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)); &df->eh_block_artificial_uses));
bitmap_clear (&regular_block_artificial_uses);
bitmap_clear (&eh_block_artificial_uses);
/* Verify entry block and exit block. These only verify the bitmaps, /* Verify entry block and exit block. These only verify the bitmaps,
the refs are verified in df_bb_verify. */ the refs are verified in df_bb_verify. */
df_entry_block_bitmap_verify (true); df_entry_block_bitmap_verify (true);
......
...@@ -4644,7 +4644,6 @@ lra_constraints (bool first_p) ...@@ -4644,7 +4644,6 @@ lra_constraints (bool first_p)
unsigned int min_len, new_min_len, uid; unsigned int min_len, new_min_len, uid;
rtx set, x, reg, dest_reg; rtx set, x, reg, dest_reg;
basic_block last_bb; basic_block last_bb;
bitmap_head equiv_insn_bitmap;
bitmap_iterator bi; bitmap_iterator bi;
lra_constraint_iter++; lra_constraint_iter++;
...@@ -4676,7 +4675,7 @@ lra_constraints (bool first_p) ...@@ -4676,7 +4675,7 @@ lra_constraints (bool first_p)
/* Do elimination before the equivalence processing as we can spill /* Do elimination before the equivalence processing as we can spill
some pseudos during elimination. */ some pseudos during elimination. */
lra_eliminate (false, first_p); lra_eliminate (false, first_p);
bitmap_initialize (&equiv_insn_bitmap, &reg_obstack); auto_bitmap equiv_insn_bitmap (&reg_obstack);
for (i = FIRST_PSEUDO_REGISTER; i < new_regno_start; i++) for (i = FIRST_PSEUDO_REGISTER; i < new_regno_start; i++)
if (lra_reg_info[i].nrefs != 0) if (lra_reg_info[i].nrefs != 0)
{ {
...@@ -4737,14 +4736,14 @@ lra_constraints (bool first_p) ...@@ -4737,14 +4736,14 @@ lra_constraints (bool first_p)
if (contains_reg_p (x, false, true)) if (contains_reg_p (x, false, true))
ira_reg_equiv[i].profitable_p = false; ira_reg_equiv[i].profitable_p = false;
if (get_equiv (reg) != reg) 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++) for (i = FIRST_PSEUDO_REGISTER; i < new_regno_start; i++)
update_equiv (i); update_equiv (i);
/* We should add all insns containing pseudos which should be /* We should add all insns containing pseudos which should be
substituted by their equivalences. */ 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); lra_push_insn_by_uid (uid);
min_len = lra_insn_stack_length (); min_len = lra_insn_stack_length ();
new_insns_num = 0; new_insns_num = 0;
...@@ -4775,7 +4774,7 @@ lra_constraints (bool first_p) ...@@ -4775,7 +4774,7 @@ lra_constraints (bool first_p)
/* We need to check equivalence in debug insn and change /* We need to check equivalence in debug insn and change
pseudo to the equivalent value if necessary. */ pseudo to the equivalent value if necessary. */
curr_id = lra_get_insn_recog_data (curr_insn); 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]; rtx old = *curr_id->operand_loc[0];
*curr_id->operand_loc[0] *curr_id->operand_loc[0]
...@@ -4849,7 +4848,7 @@ lra_constraints (bool first_p) ...@@ -4849,7 +4848,7 @@ lra_constraints (bool first_p)
/* Check non-transformed insns too for equiv change as USE /* Check non-transformed insns too for equiv change as USE
or CLOBBER don't need reloads but can contain pseudos or CLOBBER don't need reloads but can contain pseudos
being changed on their equivalences. */ 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))) && loc_equivalence_change_p (&PATTERN (curr_insn)))
{ {
lra_update_insn_regno_info (curr_insn); lra_update_insn_regno_info (curr_insn);
...@@ -4857,7 +4856,7 @@ lra_constraints (bool first_p) ...@@ -4857,7 +4856,7 @@ lra_constraints (bool first_p)
} }
} }
} }
bitmap_clear (&equiv_insn_bitmap);
/* If we used a new hard regno, changed_p should be true because the /* If we used a new hard regno, changed_p should be true because the
hard reg is assigned to a new pseudo. */ hard reg is assigned to a new pseudo. */
if (flag_checking && !changed_p) if (flag_checking && !changed_p)
...@@ -6791,10 +6790,9 @@ undo_optional_reloads (void) ...@@ -6791,10 +6790,9 @@ undo_optional_reloads (void)
bitmap_iterator bi, bi2; bitmap_iterator bi, bi2;
rtx_insn *insn; rtx_insn *insn;
rtx set, src, dest; rtx set, src, dest;
bitmap_head removed_optional_reload_pseudos, insn_bitmap; auto_bitmap removed_optional_reload_pseudos (&reg_obstack);
bitmap_initialize (&removed_optional_reload_pseudos, &reg_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) EXECUTE_IF_SET_IN_BITMAP (&lra_optional_reload_pseudos, 0, regno, bi)
{ {
keep_p = false; keep_p = false;
...@@ -6829,19 +6827,19 @@ undo_optional_reloads (void) ...@@ -6829,19 +6827,19 @@ undo_optional_reloads (void)
} }
if (keep_p) if (keep_p)
{ {
bitmap_clear_bit (&removed_optional_reload_pseudos, regno); bitmap_clear_bit (removed_optional_reload_pseudos, regno);
if (lra_dump_file != NULL) if (lra_dump_file != NULL)
fprintf (lra_dump_file, "Keep optional reload reg %d\n", regno); fprintf (lra_dump_file, "Keep optional reload reg %d\n", regno);
} }
} }
change_p = ! bitmap_empty_p (&removed_optional_reload_pseudos); change_p = ! bitmap_empty_p (removed_optional_reload_pseudos);
bitmap_initialize (&insn_bitmap, &reg_obstack); auto_bitmap insn_bitmap (&reg_obstack);
EXECUTE_IF_SET_IN_BITMAP (&removed_optional_reload_pseudos, 0, regno, bi) EXECUTE_IF_SET_IN_BITMAP (removed_optional_reload_pseudos, 0, regno, bi)
{ {
if (lra_dump_file != NULL) if (lra_dump_file != NULL)
fprintf (lra_dump_file, "Remove optional reload reg %d\n", regno); fprintf (lra_dump_file, "Remove optional reload reg %d\n", regno);
bitmap_copy (&insn_bitmap, &lra_reg_info[regno].insn_bitmap); bitmap_copy (insn_bitmap, &lra_reg_info[regno].insn_bitmap);
EXECUTE_IF_SET_IN_BITMAP (&insn_bitmap, 0, uid, bi2) EXECUTE_IF_SET_IN_BITMAP (insn_bitmap, 0, uid, bi2)
{ {
insn = lra_insn_recog_data[uid]->insn; insn = lra_insn_recog_data[uid]->insn;
if ((set = single_set (insn)) != NULL_RTX) if ((set = single_set (insn)) != NULL_RTX)
...@@ -6885,8 +6883,6 @@ undo_optional_reloads (void) ...@@ -6885,8 +6883,6 @@ undo_optional_reloads (void)
/* Clear restore_regnos. */ /* Clear restore_regnos. */
EXECUTE_IF_SET_IN_BITMAP (&lra_optional_reload_pseudos, 0, regno, bi) EXECUTE_IF_SET_IN_BITMAP (&lra_optional_reload_pseudos, 0, regno, bi)
lra_reg_info[regno].restore_rtx = NULL_RTX; lra_reg_info[regno].restore_rtx = NULL_RTX;
bitmap_clear (&insn_bitmap);
bitmap_clear (&removed_optional_reload_pseudos);
return change_p; return change_p;
} }
...@@ -6899,7 +6895,6 @@ lra_undo_inheritance (void) ...@@ -6899,7 +6895,6 @@ lra_undo_inheritance (void)
int hard_regno; int hard_regno;
int n_all_inherit, n_inherit, n_all_split, n_split; int n_all_inherit, n_inherit, n_all_split, n_split;
rtx restore_rtx; rtx restore_rtx;
bitmap_head remove_pseudos;
bitmap_iterator bi; bitmap_iterator bi;
bool change_p; bool change_p;
...@@ -6910,7 +6905,7 @@ lra_undo_inheritance (void) ...@@ -6910,7 +6905,7 @@ lra_undo_inheritance (void)
fprintf (lra_dump_file, fprintf (lra_dump_file,
"\n********** Undoing inheritance #%d: **********\n\n", "\n********** Undoing inheritance #%d: **********\n\n",
lra_undo_inheritance_iter); lra_undo_inheritance_iter);
bitmap_initialize (&remove_pseudos, &reg_obstack); auto_bitmap remove_pseudos (&reg_obstack);
n_inherit = n_all_inherit = 0; n_inherit = n_all_inherit = 0;
EXECUTE_IF_SET_IN_BITMAP (&lra_inheritance_pseudos, 0, regno, bi) EXECUTE_IF_SET_IN_BITMAP (&lra_inheritance_pseudos, 0, regno, bi)
if (lra_reg_info[regno].restore_rtx != NULL_RTX) if (lra_reg_info[regno].restore_rtx != NULL_RTX)
...@@ -6922,7 +6917,7 @@ lra_undo_inheritance (void) ...@@ -6922,7 +6917,7 @@ lra_undo_inheritance (void)
allocation we used shorter live-ranges. */ allocation we used shorter live-ranges. */
&& (! REG_P (lra_reg_info[regno].restore_rtx) && (! REG_P (lra_reg_info[regno].restore_rtx)
|| reg_renumber[REGNO (lra_reg_info[regno].restore_rtx)] < 0)) || reg_renumber[REGNO (lra_reg_info[regno].restore_rtx)] < 0))
bitmap_set_bit (&remove_pseudos, regno); bitmap_set_bit (remove_pseudos, regno);
else else
n_inherit++; n_inherit++;
} }
...@@ -6940,7 +6935,7 @@ lra_undo_inheritance (void) ...@@ -6940,7 +6935,7 @@ lra_undo_inheritance (void)
hard_regno = (restore_regno >= FIRST_PSEUDO_REGISTER hard_regno = (restore_regno >= FIRST_PSEUDO_REGISTER
? reg_renumber[restore_regno] : restore_regno); ? reg_renumber[restore_regno] : restore_regno);
if (hard_regno < 0 || reg_renumber[regno] == hard_regno) if (hard_regno < 0 || reg_renumber[regno] == hard_regno)
bitmap_set_bit (&remove_pseudos, regno); bitmap_set_bit (remove_pseudos, regno);
else else
{ {
n_split++; n_split++;
...@@ -6953,8 +6948,7 @@ lra_undo_inheritance (void) ...@@ -6953,8 +6948,7 @@ lra_undo_inheritance (void)
fprintf (lra_dump_file, "Split %d out of %d (%.2f%%)\n", fprintf (lra_dump_file, "Split %d out of %d (%.2f%%)\n",
n_split, n_all_split, n_split, n_all_split,
(double) n_split / n_all_split * 100); (double) n_split / n_all_split * 100);
change_p = remove_inheritance_pseudos (&remove_pseudos); change_p = remove_inheritance_pseudos (remove_pseudos);
bitmap_clear (&remove_pseudos);
/* Clear restore_regnos. */ /* Clear restore_regnos. */
EXECUTE_IF_SET_IN_BITMAP (&lra_inheritance_pseudos, 0, regno, bi) EXECUTE_IF_SET_IN_BITMAP (&lra_inheritance_pseudos, 0, regno, bi)
lra_reg_info[regno].restore_rtx = NULL_RTX; lra_reg_info[regno].restore_rtx = NULL_RTX;
......
...@@ -746,14 +746,12 @@ calculate_gen_cands (void) ...@@ -746,14 +746,12 @@ calculate_gen_cands (void)
{ {
basic_block bb; basic_block bb;
bitmap gen_cands; bitmap gen_cands;
bitmap_head gen_insns;
rtx_insn *insn; rtx_insn *insn;
bitmap_initialize (&gen_insns, &reg_obstack);
FOR_EACH_BB_FN (bb, cfun) FOR_EACH_BB_FN (bb, cfun)
{ {
gen_cands = &get_remat_bb_data (bb)->gen_cands; gen_cands = &get_remat_bb_data (bb)->gen_cands;
bitmap_clear (&gen_insns); auto_bitmap gen_insns (&reg_obstack);
FOR_BB_INSNS (bb, insn) FOR_BB_INSNS (bb, insn)
if (INSN_P (insn)) if (INSN_P (insn))
{ {
...@@ -782,7 +780,7 @@ calculate_gen_cands (void) ...@@ -782,7 +780,7 @@ calculate_gen_cands (void)
reg = reg->next) reg = reg->next)
if (reg->type != OP_IN if (reg->type != OP_IN
|| find_regno_note (insn, REG_DEAD, reg->regno) != NULL) || 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; rtx_insn *insn2 = lra_insn_recog_data[uid]->insn;
...@@ -801,7 +799,7 @@ calculate_gen_cands (void) ...@@ -801,7 +799,7 @@ calculate_gen_cands (void)
} }
if (CALL_P (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; rtx_insn *insn2 = lra_insn_recog_data[uid]->insn;
...@@ -813,17 +811,16 @@ calculate_gen_cands (void) ...@@ -813,17 +811,16 @@ calculate_gen_cands (void)
bitmap_set_bit (&temp_bitmap, uid); 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)]; cand = insn_to_cand[INSN_UID (insn)];
if (cand != NULL) if (cand != NULL)
{ {
bitmap_set_bit (gen_cands, cand->index); 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);
} }
...@@ -1059,15 +1056,13 @@ do_remat (void) ...@@ -1059,15 +1056,13 @@ do_remat (void)
unsigned regno; unsigned regno;
rtx_insn *insn; rtx_insn *insn;
basic_block bb; basic_block bb;
bitmap_head avail_cands;
bitmap_head active_cands;
bool changed_p = false; bool changed_p = false;
/* Living hard regs and hard registers of living pseudos. */ /* Living hard regs and hard registers of living pseudos. */
HARD_REG_SET live_hard_regs; HARD_REG_SET live_hard_regs;
bitmap_iterator bi; bitmap_iterator bi;
bitmap_initialize (&avail_cands, &reg_obstack); auto_bitmap avail_cands (&reg_obstack);
bitmap_initialize (&active_cands, &reg_obstack); auto_bitmap active_cands (&reg_obstack);
FOR_EACH_BB_FN (bb, cfun) FOR_EACH_BB_FN (bb, cfun)
{ {
CLEAR_HARD_REG_SET (live_hard_regs); CLEAR_HARD_REG_SET (live_hard_regs);
...@@ -1079,11 +1074,11 @@ do_remat (void) ...@@ -1079,11 +1074,11 @@ do_remat (void)
if (hard_regno >= 0) if (hard_regno >= 0)
SET_HARD_REG_BIT (live_hard_regs, hard_regno); 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); &get_remat_bb_data (bb)->livein_cands);
/* Activating insns are always in the same block as their corresponding /* 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. */ 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) FOR_BB_INSNS (bb, insn)
{ {
if (!NONDEBUG_INSN_P (insn)) if (!NONDEBUG_INSN_P (insn))
...@@ -1117,8 +1112,8 @@ do_remat (void) ...@@ -1117,8 +1112,8 @@ do_remat (void)
for (cand = regno_cands[src_regno]; for (cand = regno_cands[src_regno];
cand != NULL; cand != NULL;
cand = cand->next_regno_cand) cand = cand->next_regno_cand)
if (bitmap_bit_p (&avail_cands, cand->index) if (bitmap_bit_p (avail_cands, cand->index)
&& bitmap_bit_p (&active_cands, cand->index)) && bitmap_bit_p (active_cands, cand->index))
break; break;
} }
int i, hard_regno, nregs; int i, hard_regno, nregs;
...@@ -1189,7 +1184,7 @@ do_remat (void) ...@@ -1189,7 +1184,7 @@ do_remat (void)
reg = reg->next) reg = reg->next)
if (reg->type != OP_IN if (reg->type != OP_IN
|| find_regno_note (insn, REG_DEAD, reg->regno) != NULL) || 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]; cand = all_cands[cid];
...@@ -1203,7 +1198,7 @@ do_remat (void) ...@@ -1203,7 +1198,7 @@ do_remat (void)
} }
if (CALL_P (insn)) 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]; cand = all_cands[cid];
...@@ -1211,22 +1206,22 @@ do_remat (void) ...@@ -1211,22 +1206,22 @@ do_remat (void)
bitmap_set_bit (&temp_bitmap, cand->index); 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 /* Now see whether a candidate is made active or available
by this insn. */ by this insn. */
cand = insn_to_cand_activation[INSN_UID (insn)]; cand = insn_to_cand_activation[INSN_UID (insn)];
if (cand) if (cand)
bitmap_set_bit (&active_cands, cand->index); bitmap_set_bit (active_cands, cand->index);
cand = insn_to_cand[INSN_UID (insn)]; cand = insn_to_cand[INSN_UID (insn)];
if (cand != NULL) if (cand != NULL)
{ {
bitmap_set_bit (&avail_cands, cand->index); bitmap_set_bit (avail_cands, cand->index);
if (cand->reload_regno == -1) if (cand->reload_regno == -1)
bitmap_set_bit (&active_cands, cand->index); bitmap_set_bit (active_cands, cand->index);
else else
bitmap_clear_bit (&active_cands, cand->index); bitmap_clear_bit (active_cands, cand->index);
} }
if (remat_insn != NULL) if (remat_insn != NULL)
...@@ -1274,8 +1269,6 @@ do_remat (void) ...@@ -1274,8 +1269,6 @@ do_remat (void)
SET_HARD_REG_BIT (live_hard_regs, reg->regno); SET_HARD_REG_BIT (live_hard_regs, reg->regno);
} }
} }
bitmap_clear (&avail_cands);
bitmap_clear (&active_cands);
return changed_p; return changed_p;
} }
......
...@@ -223,7 +223,6 @@ assign_spill_hard_regs (int *pseudo_regnos, int n) ...@@ -223,7 +223,6 @@ assign_spill_hard_regs (int *pseudo_regnos, int n)
rtx set; rtx set;
basic_block bb; basic_block bb;
HARD_REG_SET conflict_hard_regs; HARD_REG_SET conflict_hard_regs;
bitmap_head ok_insn_bitmap;
bitmap setjump_crosses = regstat_get_setjmp_crosses (); bitmap setjump_crosses = regstat_get_setjmp_crosses ();
/* Hard registers which can not be used for any purpose at given /* Hard registers which can not be used for any purpose at given
program point because they are unallocatable or already allocated program point because they are unallocatable or already allocated
...@@ -243,13 +242,13 @@ assign_spill_hard_regs (int *pseudo_regnos, int n) ...@@ -243,13 +242,13 @@ assign_spill_hard_regs (int *pseudo_regnos, int n)
for (p = r->start; p <= r->finish; p++) for (p = r->start; p <= r->finish; p++)
add_to_hard_reg_set (&reserved_hard_regs[p], add_to_hard_reg_set (&reserved_hard_regs[p],
lra_reg_info[i].biggest_mode, hard_regno); lra_reg_info[i].biggest_mode, hard_regno);
bitmap_initialize (&ok_insn_bitmap, &reg_obstack); auto_bitmap ok_insn_bitmap (&reg_obstack);
FOR_EACH_BB_FN (bb, cfun) FOR_EACH_BB_FN (bb, cfun)
FOR_BB_INSNS (bb, insn) FOR_BB_INSNS (bb, insn)
if (DEBUG_INSN_P (insn) if (DEBUG_INSN_P (insn)
|| ((set = single_set (insn)) != NULL_RTX || ((set = single_set (insn)) != NULL_RTX
&& REG_P (SET_SRC (set)) && REG_P (SET_DEST (set)))) && 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++) for (res = i = 0; i < n; i++)
{ {
regno = pseudo_regnos[i]; regno = pseudo_regnos[i];
...@@ -260,7 +259,7 @@ assign_spill_hard_regs (int *pseudo_regnos, int n) ...@@ -260,7 +259,7 @@ assign_spill_hard_regs (int *pseudo_regnos, int n)
targetm.spill_class ((reg_class_t) rclass, targetm.spill_class ((reg_class_t) rclass,
PSEUDO_REGNO_MODE (regno)))) == NO_REGS PSEUDO_REGNO_MODE (regno)))) == NO_REGS
|| bitmap_intersect_compl_p (&lra_reg_info[regno].insn_bitmap, || bitmap_intersect_compl_p (&lra_reg_info[regno].insn_bitmap,
&ok_insn_bitmap)) ok_insn_bitmap))
{ {
pseudo_regnos[res++] = regno; pseudo_regnos[res++] = regno;
continue; continue;
...@@ -300,7 +299,6 @@ assign_spill_hard_regs (int *pseudo_regnos, int n) ...@@ -300,7 +299,6 @@ assign_spill_hard_regs (int *pseudo_regnos, int n)
/* Just loop. */ /* Just loop. */
df_set_regs_ever_live (hard_regno + nr, true); df_set_regs_ever_live (hard_regno + nr, true);
} }
bitmap_clear (&ok_insn_bitmap);
free (reserved_hard_regs); free (reserved_hard_regs);
return res; return res;
} }
...@@ -449,17 +447,16 @@ spill_pseudos (void) ...@@ -449,17 +447,16 @@ spill_pseudos (void)
basic_block bb; basic_block bb;
rtx_insn *insn, *curr; rtx_insn *insn, *curr;
int i; int i;
bitmap_head spilled_pseudos, changed_insns;
bitmap_initialize (&spilled_pseudos, &reg_obstack); auto_bitmap spilled_pseudos (&reg_obstack);
bitmap_initialize (&changed_insns, &reg_obstack); auto_bitmap changed_insns (&reg_obstack);
for (i = FIRST_PSEUDO_REGISTER; i < regs_num; i++) for (i = FIRST_PSEUDO_REGISTER; i < regs_num; i++)
{ {
if (lra_reg_info[i].nrefs != 0 && lra_get_regno_hard_regno (i) < 0 if (lra_reg_info[i].nrefs != 0 && lra_get_regno_hard_regno (i) < 0
&& ! lra_former_scratch_p (i)) && ! lra_former_scratch_p (i))
{ {
bitmap_set_bit (&spilled_pseudos, i); bitmap_set_bit (spilled_pseudos, i);
bitmap_ior_into (&changed_insns, &lra_reg_info[i].insn_bitmap); bitmap_ior_into (changed_insns, &lra_reg_info[i].insn_bitmap);
} }
} }
FOR_EACH_BB_FN (bb, cfun) FOR_EACH_BB_FN (bb, cfun)
...@@ -468,7 +465,7 @@ spill_pseudos (void) ...@@ -468,7 +465,7 @@ spill_pseudos (void)
{ {
bool removed_pseudo_p = false; 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; rtx *link_loc, link;
...@@ -526,12 +523,10 @@ spill_pseudos (void) ...@@ -526,12 +523,10 @@ spill_pseudos (void)
"Debug insn #%u is reset because it referenced " "Debug insn #%u is reset because it referenced "
"removed pseudo\n", INSN_UID (insn)); "removed pseudo\n", INSN_UID (insn));
} }
bitmap_and_compl_into (df_get_live_in (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_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. */ /* Return true if we need to change some pseudos into memory. */
......
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