diff options
author | Trevor Saunders <tbsaunde+gcc@tbsaunde.org> | 2017-05-14 00:38:59 +0000 |
---|---|---|
committer | Trevor Saunders <tbsaunde@gcc.gnu.org> | 2017-05-14 00:38:59 +0000 |
commit | d648b5ff3cb2bf7aec320312e79c90e49cd9b39b (patch) | |
tree | dcf7daa4381cf183540db2795959f7f418fc0e5e /gcc/df-scan.c | |
parent | 8f9b31f7f161bd00d9c7847f117591ec85f9484d (diff) | |
download | gcc-d648b5ff3cb2bf7aec320312e79c90e49cd9b39b.zip gcc-d648b5ff3cb2bf7aec320312e79c90e49cd9b39b.tar.gz gcc-d648b5ff3cb2bf7aec320312e79c90e49cd9b39b.tar.bz2 |
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
Diffstat (limited to 'gcc/df-scan.c')
-rw-r--r-- | gcc/df-scan.c | 93 |
1 files changed, 36 insertions, 57 deletions
diff --git a/gcc/df-scan.c b/gcc/df-scan.c index f75098c..4884608 100644 --- a/gcc/df-scan.c +++ b/gcc/df-scan.c @@ -1161,9 +1161,6 @@ df_insn_rescan_all (void) 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) { @@ -1177,15 +1174,15 @@ df_insn_rescan_all (void) 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); @@ -1215,9 +1212,6 @@ df_process_deferred_rescans (void) 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) { @@ -1234,24 +1228,25 @@ df_process_deferred_rescans (void) 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) @@ -1261,7 +1256,6 @@ df_process_deferred_rescans (void) 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); @@ -3628,14 +3622,13 @@ df_record_entry_block_defs (bitmap entry_block_defs) 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); @@ -3655,11 +3648,10 @@ df_update_entry_block_defs (void) 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); } @@ -3804,14 +3796,13 @@ df_record_exit_block_uses (bitmap exit_block_uses) 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); @@ -3831,11 +3822,10 @@ df_update_exit_block_uses (void) 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; @@ -4171,25 +4161,22 @@ df_bb_verify (basic_block bb) 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; } @@ -4200,25 +4187,22 @@ df_entry_block_bitmap_verify (bool abort_if_fail) 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; } @@ -4231,8 +4215,6 @@ df_scan_verify (void) { unsigned int i; basic_block bb; - bitmap_head regular_block_artificial_uses; - bitmap_head eh_block_artificial_uses; if (!df) return; @@ -4253,24 +4235,21 @@ df_scan_verify (void) /* (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); |