diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 248c5a5ec4b447f702d185de57281d26baba57d7..24e4fbad1c79604387e8ee0f597fb4e2384e148d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,20 @@ +2019-09-09 Richard Sandiford <richard.sandiford@arm.com> + + * 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. + 2019-09-09 Richard Sandiford <richard.sandiford@arm.com> * array-traits.h: New file. diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 7cc8857b735570e7dfefc9b5bc02e6628e8cdc84..b2fb56cab81e527b43590b8bde7fbe88e30c212e 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -11695,7 +11695,7 @@ sh_find_equiv_gbr_addr (rtx_insn* insn, rtx mem) { if (CALL_P (DF_REF_INSN (d))) { - if (REGNO_REG_SET_P (regs_invalidated_by_call_regset, GBR_REG)) + if (TEST_HARD_REG_BIT (regs_invalidated_by_call, GBR_REG)) return NULL_RTX; else continue; diff --git a/gcc/df-core.c b/gcc/df-core.c index be19aba0f1e1188c53c2c3770a2e913bcebe4d84..7250c390be0ddccf2d460e648bafb9b5c9d8f0a6 100644 --- a/gcc/df-core.c +++ b/gcc/df-core.c @@ -2052,7 +2052,7 @@ debug_regset (regset r) This is part of making a debugging dump. */ void -df_print_regset (FILE *file, bitmap r) +df_print_regset (FILE *file, const_bitmap r) { unsigned int i; bitmap_iterator bi; @@ -2077,7 +2077,7 @@ df_print_regset (FILE *file, bitmap r) debugging dump. */ void -df_print_word_regset (FILE *file, bitmap r) +df_print_word_regset (FILE *file, const_bitmap r) { unsigned int max_reg = max_reg_num (); diff --git a/gcc/df-problems.c b/gcc/df-problems.c index e8a45ae68950c75279a5a81172826320280b8480..89a929361bac01d49c0de1f8e9c14be43c5c245b 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<HARD_REG_SET> 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<HARD_REG_SET> eh_kills (regs_invalidated_by_call); + return bitmap_ior_and_compl_into (op1, op2, eh_kills); + } else return bitmap_ior_into (op1, op2); } diff --git a/gcc/df-scan.c b/gcc/df-scan.c index 03294a8a2c3d83d4462e91dd4fdbf257955c2437..d7bc2d8f9d076e2cf570dac8ebbe57c8b1b40fcf 100644 --- a/gcc/df-scan.c +++ b/gcc/df-scan.c @@ -313,7 +313,7 @@ df_scan_start_dump (FILE *file ATTRIBUTE_UNUSED) rtx_insn *insn; fprintf (file, ";; invalidated by call \t"); - df_print_regset (file, regs_invalidated_by_call_regset); + df_print_regset (file, bitmap_view<HARD_REG_SET> (regs_invalidated_by_call)); fprintf (file, ";; hardware regs used \t"); df_print_regset (file, &df->hardware_regs_used); fprintf (file, ";; regular block artificial uses \t"); diff --git a/gcc/df.h b/gcc/df.h index 2e3b825065ea11acab3c245d6e058a7d210d12fc..2454bfaf09ea2639dec12220714412b5686098e8 100644 --- a/gcc/df.h +++ b/gcc/df.h @@ -991,8 +991,8 @@ extern bool df_reg_defined (rtx_insn *, rtx); extern df_ref df_find_use (rtx_insn *, rtx); extern bool df_reg_used (rtx_insn *, rtx); extern void df_worklist_dataflow (struct dataflow *,bitmap, int *, int); -extern void df_print_regset (FILE *file, bitmap r); -extern void df_print_word_regset (FILE *file, bitmap r); +extern void df_print_regset (FILE *file, const_bitmap r); +extern void df_print_word_regset (FILE *file, const_bitmap r); extern void df_dump (FILE *); extern void df_dump_region (FILE *); extern void df_dump_start (FILE *); diff --git a/gcc/dse.c b/gcc/dse.c index 55b3cf1b0b3783a7db477a63028a69c0d8794f09..c03b922bdf98b5a94095fc3f46b46e6846252bdf 100644 --- a/gcc/dse.c +++ b/gcc/dse.c @@ -2392,7 +2392,7 @@ copy_fixed_regs (const_bitmap in) bitmap ret; ret = ALLOC_REG_SET (NULL); - bitmap_and (ret, in, fixed_reg_set_regset); + bitmap_and (ret, in, bitmap_view<HARD_REG_SET> (fixed_reg_set)); return ret; } diff --git a/gcc/reginfo.c b/gcc/reginfo.c index 9b77261bc13511599d2ee4c5ff3ae97cbdd8bfb9..48a3f66840b5044873d8bfeccc7cfb6ae93a6f55 100644 --- a/gcc/reginfo.c +++ b/gcc/reginfo.c @@ -92,17 +92,6 @@ char global_regs[FIRST_PSEUDO_REGISTER]; /* Declaration for the global register. */ tree global_regs_decl[FIRST_PSEUDO_REGISTER]; -/* Same information as REGS_INVALIDATED_BY_CALL but in regset form to be used - in dataflow more conveniently. */ -regset regs_invalidated_by_call_regset; - -/* Same information as FIXED_REG_SET but in regset form. */ -regset fixed_reg_set_regset; - -/* The bitmap_obstack is used to hold some static variables that - should not be reset after each function is compiled. */ -static bitmap_obstack persistent_obstack; - /* Used to initialize reg_alloc_order. */ #ifdef REG_ALLOC_ORDER static int initial_reg_alloc_order[FIRST_PSEUDO_REGISTER] = REG_ALLOC_ORDER; @@ -364,17 +353,6 @@ init_reg_sets_1 (void) CLEAR_HARD_REG_SET (call_used_reg_set); CLEAR_HARD_REG_SET (call_fixed_reg_set); CLEAR_HARD_REG_SET (regs_invalidated_by_call); - if (!regs_invalidated_by_call_regset) - { - bitmap_obstack_initialize (&persistent_obstack); - regs_invalidated_by_call_regset = ALLOC_REG_SET (&persistent_obstack); - } - else - CLEAR_REG_SET (regs_invalidated_by_call_regset); - if (!fixed_reg_set_regset) - fixed_reg_set_regset = ALLOC_REG_SET (&persistent_obstack); - else - CLEAR_REG_SET (fixed_reg_set_regset); operand_reg_set &= accessible_reg_set; for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) @@ -405,10 +383,7 @@ init_reg_sets_1 (void) #endif if (fixed_regs[i]) - { - SET_HARD_REG_BIT (fixed_reg_set, i); - SET_REGNO_REG_SET (fixed_reg_set_regset, i); - } + SET_HARD_REG_BIT (fixed_reg_set, i); if (call_used_regs[i]) SET_HARD_REG_BIT (call_used_reg_set, i); @@ -426,10 +401,7 @@ init_reg_sets_1 (void) if (i == STACK_POINTER_REGNUM) ; else if (global_regs[i]) - { - SET_HARD_REG_BIT (regs_invalidated_by_call, i); - SET_REGNO_REG_SET (regs_invalidated_by_call_regset, i); - } + SET_HARD_REG_BIT (regs_invalidated_by_call, i); else if (i == FRAME_POINTER_REGNUM) ; else if (!HARD_FRAME_POINTER_IS_FRAME_POINTER @@ -442,10 +414,7 @@ init_reg_sets_1 (void) && i == (unsigned) PIC_OFFSET_TABLE_REGNUM && fixed_regs[i]) ; else if (CALL_REALLY_USED_REGNO_P (i)) - { - SET_HARD_REG_BIT (regs_invalidated_by_call, i); - SET_REGNO_REG_SET (regs_invalidated_by_call_regset, i); - } + SET_HARD_REG_BIT (regs_invalidated_by_call, i); } call_fixed_reg_set = fixed_reg_set; @@ -800,10 +769,7 @@ globalize_reg (tree decl, int i) appropriate regs_invalidated_by_call bit, even if it's already set in fixed_regs. */ if (i != STACK_POINTER_REGNUM) - { - SET_HARD_REG_BIT (regs_invalidated_by_call, i); - SET_REGNO_REG_SET (regs_invalidated_by_call_regset, i); - } + SET_HARD_REG_BIT (regs_invalidated_by_call, i); /* If already fixed, nothing else to do. */ if (fixed_regs[i]) diff --git a/gcc/regset.h b/gcc/regset.h index f5e3d390b142ac41d6e50adde38836075f2bd878..72ff4589193df313b206b959c1d1944e88e96d93 100644 --- a/gcc/regset.h +++ b/gcc/regset.h @@ -111,14 +111,6 @@ typedef bitmap_iterator reg_set_iterator; #define EXECUTE_IF_AND_IN_REG_SET(REGSET1, REGSET2, MIN, REGNUM, RSI) \ EXECUTE_IF_AND_IN_BITMAP (REGSET1, REGSET2, MIN, REGNUM, RSI) \ -/* Same information as REGS_INVALIDATED_BY_CALL but in regset form to be used - in dataflow more conveniently. */ - -extern regset regs_invalidated_by_call_regset; - -/* Same information as FIXED_REG_SET but in regset form. */ -extern regset fixed_reg_set_regset; - /* An obstack for regsets. */ extern bitmap_obstack reg_obstack;