From 0b0310e9a0e0d553bbe9f961c52e0851328aa8b0 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Mon, 9 Sep 2019 18:01:55 +0000 Subject: Remove global REG_SETs We currently maintain global REG_SET versions of fixed_reg_set and regs_invalidated_by_call. With bitmap_view, we can instead operate directly on the underlying HARD_REG_SETs, avoiding the need to keep the two pieces of data in sync. I have a series of patches that removes the assumption that there's a single global ABI for all functions in the translation unit, which includes not relying on having a global regs_invalidated_by_call. Removing the REG_SET equivalent is one step to doing that. Note that the affected DF code is used for EH edges or dumping only, so shouldn't be performance critical. 2019-09-09 Richard Sandiford gcc/ * regset.h (regs_invalidated_by_call_regset): Delete. (fixed_reg_set_regset): Likewise. * reginfo.c (regs_invalidated_by_call_regset): Likewise. (fixed_reg_set_regset, persistent_obstack): Likewise. (init_reg_sets_1, globalize_reg): Update accordingly. * df.h (df_print_regset, df_print_word_regset): Take a const_bitmap instead of a bitmap. * df-core.c (df_print_regset, df_print_word_regset): Likewise. * df-problems.c (df_rd_local_compute): Use regs_invalidated_by_call instead of regs_invalidated_by_call_regset. (df_lr_confluence_n, df_md_confluence_n): Likewise. * df-scan.c (df_scan_start_dump): Likewise. * dse.c (copy_fixed_regs): Likewise. * config/sh/sh.c (sh_find_equiv_gbr_addr): Likewise. From-SVN: r275537 --- gcc/df-problems.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'gcc/df-problems.c') diff --git a/gcc/df-problems.c b/gcc/df-problems.c index e8a45ae..89a9293 100644 --- a/gcc/df-problems.c +++ b/gcc/df-problems.c @@ -389,7 +389,6 @@ df_rd_local_compute (bitmap all_blocks) { unsigned int bb_index; bitmap_iterator bi; - unsigned int regno; class df_rd_problem_data *problem_data = (class df_rd_problem_data *) df_rd->problem_data; bitmap sparse_invalidated = &problem_data->sparse_invalidated_by_call; @@ -406,10 +405,9 @@ df_rd_local_compute (bitmap all_blocks) } /* Set up the knockout bit vectors to be applied across EH_EDGES. */ - EXECUTE_IF_SET_IN_BITMAP (regs_invalidated_by_call_regset, 0, regno, bi) - { - if (! HARD_REGISTER_NUM_P (regno) - || !(df->changeable_flags & DF_NO_HARD_REGS)) + if (!(df->changeable_flags & DF_NO_HARD_REGS)) + for (unsigned int regno = 0; regno < FIRST_PSEUDO_REGISTER; ++regno) + if (TEST_HARD_REG_BIT (regs_invalidated_by_call, regno)) { if (DF_DEFS_COUNT (regno) > DF_SPARSE_THRESHOLD) bitmap_set_bit (sparse_invalidated, regno); @@ -418,7 +416,6 @@ df_rd_local_compute (bitmap all_blocks) DF_DEFS_BEGIN (regno), DF_DEFS_COUNT (regno)); } - } bitmap_release (&seen_in_block); bitmap_release (&seen_in_insn); @@ -983,7 +980,10 @@ df_lr_confluence_n (edge e) /* ??? Abnormal call edges ignored for the moment, as this gets confused by sibling call edges, which crashes reg-stack. */ if (e->flags & EDGE_EH) - changed = bitmap_ior_and_compl_into (op1, op2, regs_invalidated_by_call_regset); + { + bitmap_view eh_kills (regs_invalidated_by_call); + changed = bitmap_ior_and_compl_into (op1, op2, eh_kills); + } else changed = bitmap_ior_into (op1, op2); @@ -4635,8 +4635,10 @@ df_md_confluence_n (edge e) return false; if (e->flags & EDGE_EH) - return bitmap_ior_and_compl_into (op1, op2, - regs_invalidated_by_call_regset); + { + bitmap_view eh_kills (regs_invalidated_by_call); + return bitmap_ior_and_compl_into (op1, op2, eh_kills); + } else return bitmap_ior_into (op1, op2); } -- cgit v1.1