summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog16
-rw-r--r--gcc/basic-block.h5
-rw-r--r--gcc/df-problems.c6
-rw-r--r--gcc/df-scan.c24
-rw-r--r--gcc/df.h5
-rw-r--r--gcc/regclass.c32
6 files changed, 55 insertions, 33 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8c10d1a789b..07009dade54 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,6 +1,22 @@
2008-12-18 Jan Hubicka <jh@suse.cz>
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.
2008-12-18 Jan Hubicka <jh@suse.cz>
diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index f954c9ffa5d..bd741b52275 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -106,6 +106,11 @@ 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;
+
/* Type we use to hold basic block counters. Should be at least
64bit. Although a counter cannot be negative, we use a signed
type, because erroneous negative counts can be generated when the
diff --git a/gcc/df-problems.c b/gcc/df-problems.c
index 829698ba1b3..9175f106c96 100644
--- a/gcc/df-problems.c
+++ b/gcc/df-problems.c
@@ -443,7 +443,7 @@ df_rd_local_compute (bitmap all_blocks)
}
/* 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)
bitmap_set_bit (sparse_invalidated, regno);
@@ -975,7 +975,7 @@ 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)
- bitmap_ior_and_compl_into (op1, op2, df_invalidated_by_call);
+ bitmap_ior_and_compl_into (op1, op2, regs_invalidated_by_call_regset);
else
bitmap_ior_into (op1, op2);
@@ -2542,7 +2542,7 @@ df_byte_lr_alloc (bitmap all_blocks ATTRIBUTE_UNUSED)
df_byte_lr_expand_bitmap (problem_data->hardware_regs_used,
df->hardware_regs_used);
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)
{
diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index 6a750a8a9b3..14434d2c092 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -75,20 +75,10 @@ along with GCC; see the file COPYING3. If not see
free (V); \
} 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. */
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
available. */
@@ -436,7 +426,7 @@ df_scan_start_dump (FILE *file ATTRIBUTE_UNUSED)
rtx insn;
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");
df_print_regset (file, df->hardware_regs_used);
fprintf (file, ";; regular block artificial uses \t");
@@ -3391,7 +3381,7 @@ df_get_call_refs (struct df_collection_rec * collection_rec,
}
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]
&& (!bitmap_bit_p (defs_generated, ui))
@@ -4121,8 +4111,6 @@ df_hard_reg_init (void)
if (initialized)
return;
- bitmap_obstack_initialize (&persistent_obstack);
-
/* Record which registers will be eliminated. We use this in
mark_used_regs. */
CLEAR_HARD_REG_SET (elim_reg_set);
@@ -4134,14 +4122,6 @@ df_hard_reg_init (void)
SET_HARD_REG_BIT (elim_reg_set, FRAME_POINTER_REGNUM);
#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;
}
diff --git a/gcc/df.h b/gcc/df.h
index 5cd5dfccb25..dd00d9284d1 100644
--- a/gcc/df.h
+++ b/gcc/df.h
@@ -762,11 +762,6 @@ struct df
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. */
struct df_scan_bb_info
diff --git a/gcc/regclass.c b/gcc/regclass.c
index b12d4168506..f31ccd15e40 100644
--- a/gcc/regclass.c
+++ b/gcc/regclass.c
@@ -145,6 +145,16 @@ char global_regs[FIRST_PSEUDO_REGISTER];
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. */
#ifdef REG_ALLOC_ORDER
int reg_alloc_order[FIRST_PSEUDO_REGISTER] = REG_ALLOC_ORDER;
@@ -568,6 +578,13 @@ init_reg_sets_1 (void)
CLEAR_HARD_REG_SET (call_fixed_reg_set);
CLEAR_HARD_REG_SET (regs_invalidated_by_call);
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);
@@ -602,7 +619,10 @@ 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_HARD_REG_BIT (regs_invalidated_by_call, i);
+ SET_REGNO_REG_SET (regs_invalidated_by_call_regset, i);
+ }
else if (i == FRAME_POINTER_REGNUM)
;
#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
@@ -618,7 +638,10 @@ init_reg_sets_1 (void)
;
#endif
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. */
@@ -912,7 +935,10 @@ globalize_reg (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_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 (fixed_regs[i])