Commit f2ecb626 by Jan Hubicka Committed by Jan Hubicka

df-scan.c (persistent_obstack, [...]): Remove.

	* df-scan.c (persistent_obstack, df_invalidated_by_call): Remove.
	(df_scan_start_dump, df_get_call_refs, df_hard_reg_init): Rename
	df_invalidated_by_call to invalidated_by_call_regset.
	* df.h (df_invalidated_by_call): Remove.
	* regclass.c (regs_invalidated_by_call_regset, persistent_obstack): New
	variables.
	(init_reg_sets_1): Initialize regs_invalidated_by_call_regset.
	(globalize_reg): Likewise.
	* df-problems.c (df_rd_local_compute, df_lr_confluence_n,
	df_byte_lr_alloc): Rename df_invalidated_by_call to
	invalidated_by_call_regset.
	* basic-block.h (regs_invalidated_by_call_regset): Declare.

Co-Authored-By: Kai Tietz <kai.tietz@onevision.com>

From-SVN: r142812
parent 20377b47
2008-12-18 Jan Hubicka <jh@suse.cz> 2008-12-18 Jan Hubicka <jh@suse.cz>
Kai Tietz <kai.tietz@onevision.com> Kai Tietz <kai.tietz@onevision.com>
* df-scan.c (persistent_obstack, df_invalidated_by_call): Remove.
(df_scan_start_dump, df_get_call_refs, df_hard_reg_init): Rename
df_invalidated_by_call to invalidated_by_call_regset.
* df.h (df_invalidated_by_call): Remove.
* regclass.c (regs_invalidated_by_call_regset, persistent_obstack): New
variables.
(init_reg_sets_1): Initialize regs_invalidated_by_call_regset.
(globalize_reg): Likewise.
* df-problems.c (df_rd_local_compute, df_lr_confluence_n,
df_byte_lr_alloc): Rename df_invalidated_by_call to
invalidated_by_call_regset.
* basic-block.h (regs_invalidated_by_call_regset): Declare.
2008-12-18 Jan Hubicka <jh@suse.cz>
Kai Tietz <kai.tietz@onevision.com>
* ira-cost.c (copy_cost): Lazilly initialize move_cost if needed. * ira-cost.c (copy_cost): Lazilly initialize move_cost if needed.
2008-12-18 Jan Hubicka <jh@suse.cz> 2008-12-18 Jan Hubicka <jh@suse.cz>
...@@ -106,6 +106,11 @@ typedef bitmap_iterator reg_set_iterator; ...@@ -106,6 +106,11 @@ typedef bitmap_iterator reg_set_iterator;
#define EXECUTE_IF_AND_IN_REG_SET(REGSET1, REGSET2, MIN, REGNUM, RSI) \ #define EXECUTE_IF_AND_IN_REG_SET(REGSET1, REGSET2, MIN, REGNUM, RSI) \
EXECUTE_IF_AND_IN_BITMAP (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;
/* Type we use to hold basic block counters. Should be at least /* Type we use to hold basic block counters. Should be at least
64bit. Although a counter cannot be negative, we use a signed 64bit. Although a counter cannot be negative, we use a signed
type, because erroneous negative counts can be generated when the type, because erroneous negative counts can be generated when the
......
...@@ -443,7 +443,7 @@ df_rd_local_compute (bitmap all_blocks) ...@@ -443,7 +443,7 @@ df_rd_local_compute (bitmap all_blocks)
} }
/* Set up the knockout bit vectors to be applied across EH_EDGES. */ /* Set up the knockout bit vectors to be applied across EH_EDGES. */
EXECUTE_IF_SET_IN_BITMAP (df_invalidated_by_call, 0, regno, bi) EXECUTE_IF_SET_IN_BITMAP (regs_invalidated_by_call_regset, 0, regno, bi)
{ {
if (DF_DEFS_COUNT (regno) > DF_SPARSE_THRESHOLD) if (DF_DEFS_COUNT (regno) > DF_SPARSE_THRESHOLD)
bitmap_set_bit (sparse_invalidated, regno); bitmap_set_bit (sparse_invalidated, regno);
...@@ -975,7 +975,7 @@ df_lr_confluence_n (edge e) ...@@ -975,7 +975,7 @@ df_lr_confluence_n (edge e)
/* ??? Abnormal call edges ignored for the moment, as this gets /* ??? Abnormal call edges ignored for the moment, as this gets
confused by sibling call edges, which crashes reg-stack. */ confused by sibling call edges, which crashes reg-stack. */
if (e->flags & EDGE_EH) if (e->flags & EDGE_EH)
bitmap_ior_and_compl_into (op1, op2, df_invalidated_by_call); bitmap_ior_and_compl_into (op1, op2, regs_invalidated_by_call_regset);
else else
bitmap_ior_into (op1, op2); bitmap_ior_into (op1, op2);
...@@ -2542,7 +2542,7 @@ df_byte_lr_alloc (bitmap all_blocks ATTRIBUTE_UNUSED) ...@@ -2542,7 +2542,7 @@ df_byte_lr_alloc (bitmap all_blocks ATTRIBUTE_UNUSED)
df_byte_lr_expand_bitmap (problem_data->hardware_regs_used, df_byte_lr_expand_bitmap (problem_data->hardware_regs_used,
df->hardware_regs_used); df->hardware_regs_used);
df_byte_lr_expand_bitmap (problem_data->invalidated_by_call, df_byte_lr_expand_bitmap (problem_data->invalidated_by_call,
df_invalidated_by_call); regs_invalidated_by_call_regset);
EXECUTE_IF_SET_IN_BITMAP (df_byte_lr->out_of_date_transfer_functions, 0, bb_index, bi) EXECUTE_IF_SET_IN_BITMAP (df_byte_lr->out_of_date_transfer_functions, 0, bb_index, bi)
{ {
......
...@@ -75,20 +75,10 @@ along with GCC; see the file COPYING3. If not see ...@@ -75,20 +75,10 @@ along with GCC; see the file COPYING3. If not see
free (V); \ free (V); \
} while (0) } while (0)
/* 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;
/* The set of hard registers in eliminables[i].from. */ /* The set of hard registers in eliminables[i].from. */
static HARD_REG_SET elim_reg_set; static HARD_REG_SET elim_reg_set;
/* This is a bitmap copy of regs_invalidated_by_call so that we can
easily add it into bitmaps, etc. */
bitmap df_invalidated_by_call = NULL;
/* Initialize ur_in and ur_out as if all hard registers were partially /* Initialize ur_in and ur_out as if all hard registers were partially
available. */ available. */
...@@ -436,7 +426,7 @@ df_scan_start_dump (FILE *file ATTRIBUTE_UNUSED) ...@@ -436,7 +426,7 @@ df_scan_start_dump (FILE *file ATTRIBUTE_UNUSED)
rtx insn; rtx insn;
fprintf (file, ";; invalidated by call \t"); fprintf (file, ";; invalidated by call \t");
df_print_regset (file, df_invalidated_by_call); df_print_regset (file, regs_invalidated_by_call_regset);
fprintf (file, ";; hardware regs used \t"); fprintf (file, ";; hardware regs used \t");
df_print_regset (file, df->hardware_regs_used); df_print_regset (file, df->hardware_regs_used);
fprintf (file, ";; regular block artificial uses \t"); fprintf (file, ";; regular block artificial uses \t");
...@@ -3391,7 +3381,7 @@ df_get_call_refs (struct df_collection_rec * collection_rec, ...@@ -3391,7 +3381,7 @@ df_get_call_refs (struct df_collection_rec * collection_rec,
} }
is_sibling_call = SIBLING_CALL_P (insn_info->insn); is_sibling_call = SIBLING_CALL_P (insn_info->insn);
EXECUTE_IF_SET_IN_BITMAP (df_invalidated_by_call, 0, ui, bi) EXECUTE_IF_SET_IN_BITMAP (regs_invalidated_by_call_regset, 0, ui, bi)
{ {
if (!global_regs[ui] if (!global_regs[ui]
&& (!bitmap_bit_p (defs_generated, ui)) && (!bitmap_bit_p (defs_generated, ui))
...@@ -4121,8 +4111,6 @@ df_hard_reg_init (void) ...@@ -4121,8 +4111,6 @@ df_hard_reg_init (void)
if (initialized) if (initialized)
return; return;
bitmap_obstack_initialize (&persistent_obstack);
/* Record which registers will be eliminated. We use this in /* Record which registers will be eliminated. We use this in
mark_used_regs. */ mark_used_regs. */
CLEAR_HARD_REG_SET (elim_reg_set); CLEAR_HARD_REG_SET (elim_reg_set);
...@@ -4134,14 +4122,6 @@ df_hard_reg_init (void) ...@@ -4134,14 +4122,6 @@ df_hard_reg_init (void)
SET_HARD_REG_BIT (elim_reg_set, FRAME_POINTER_REGNUM); SET_HARD_REG_BIT (elim_reg_set, FRAME_POINTER_REGNUM);
#endif #endif
df_invalidated_by_call = BITMAP_ALLOC (&persistent_obstack);
/* Inconveniently, this is only readily available in hard reg set
form. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i)
if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i))
bitmap_set_bit (df_invalidated_by_call, i);
initialized = true; initialized = true;
} }
......
...@@ -762,11 +762,6 @@ struct df ...@@ -762,11 +762,6 @@ struct df
extern bitmap_obstack df_bitmap_obstack; extern bitmap_obstack df_bitmap_obstack;
/* This is a bitmap copy of regs_invalidated_by_call so that we can
easily add it into bitmaps, etc. */
extern bitmap df_invalidated_by_call;
/* One of these structures is allocated for every basic block. */ /* One of these structures is allocated for every basic block. */
struct df_scan_bb_info struct df_scan_bb_info
......
...@@ -145,6 +145,16 @@ char global_regs[FIRST_PSEUDO_REGISTER]; ...@@ -145,6 +145,16 @@ char global_regs[FIRST_PSEUDO_REGISTER];
HARD_REG_SET regs_invalidated_by_call; HARD_REG_SET regs_invalidated_by_call;
/* Same information as REGS_INVALIDATED_BY_CALL but in regset form to be used
in dataflow more conveniently. */
regset regs_invalidated_by_call_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;
/* Table of register numbers in the order in which to try to use them. */ /* Table of register numbers in the order in which to try to use them. */
#ifdef REG_ALLOC_ORDER #ifdef REG_ALLOC_ORDER
int reg_alloc_order[FIRST_PSEUDO_REGISTER] = REG_ALLOC_ORDER; int reg_alloc_order[FIRST_PSEUDO_REGISTER] = REG_ALLOC_ORDER;
...@@ -568,6 +578,13 @@ init_reg_sets_1 (void) ...@@ -568,6 +578,13 @@ init_reg_sets_1 (void)
CLEAR_HARD_REG_SET (call_fixed_reg_set); CLEAR_HARD_REG_SET (call_fixed_reg_set);
CLEAR_HARD_REG_SET (regs_invalidated_by_call); CLEAR_HARD_REG_SET (regs_invalidated_by_call);
CLEAR_HARD_REG_SET (losing_caller_save_reg_set); CLEAR_HARD_REG_SET (losing_caller_save_reg_set);
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);
memcpy (call_fixed_regs, fixed_regs, sizeof call_fixed_regs); memcpy (call_fixed_regs, fixed_regs, sizeof call_fixed_regs);
...@@ -602,7 +619,10 @@ init_reg_sets_1 (void) ...@@ -602,7 +619,10 @@ init_reg_sets_1 (void)
if (i == STACK_POINTER_REGNUM) if (i == STACK_POINTER_REGNUM)
; ;
else if (global_regs[i]) else if (global_regs[i])
SET_HARD_REG_BIT (regs_invalidated_by_call, i); {
SET_HARD_REG_BIT (regs_invalidated_by_call, i);
SET_REGNO_REG_SET (regs_invalidated_by_call_regset, i);
}
else if (i == FRAME_POINTER_REGNUM) else if (i == FRAME_POINTER_REGNUM)
; ;
#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM #if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
...@@ -618,7 +638,10 @@ init_reg_sets_1 (void) ...@@ -618,7 +638,10 @@ init_reg_sets_1 (void)
; ;
#endif #endif
else if (CALL_REALLY_USED_REGNO_P (i)) else if (CALL_REALLY_USED_REGNO_P (i))
SET_HARD_REG_BIT (regs_invalidated_by_call, i); {
SET_HARD_REG_BIT (regs_invalidated_by_call, i);
SET_REGNO_REG_SET (regs_invalidated_by_call_regset, i);
}
} }
/* Preserve global registers if called more than once. */ /* Preserve global registers if called more than once. */
...@@ -912,7 +935,10 @@ globalize_reg (int i) ...@@ -912,7 +935,10 @@ globalize_reg (int i)
appropriate regs_invalidated_by_call bit, even if it's already appropriate regs_invalidated_by_call bit, even if it's already
set in fixed_regs. */ set in fixed_regs. */
if (i != STACK_POINTER_REGNUM) if (i != STACK_POINTER_REGNUM)
SET_HARD_REG_BIT (regs_invalidated_by_call, i); {
SET_HARD_REG_BIT (regs_invalidated_by_call, i);
SET_REGNO_REG_SET (regs_invalidated_by_call_regset, i);
}
/* If already fixed, nothing else to do. */ /* If already fixed, nothing else to do. */
if (fixed_regs[i]) if (fixed_regs[i])
......
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