+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.
{
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;
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;
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 ();
{
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;
}
/* 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);
DF_DEFS_BEGIN (regno),
DF_DEFS_COUNT (regno));
}
- }
bitmap_release (&seen_in_block);
bitmap_release (&seen_in_insn);
/* ??? 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);
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);
}
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");
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 *);
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;
}
/* 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;
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++)
#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);
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
&& 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;
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])
#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;