Commit 04389919 by Nathan Sidwell Committed by Nathan Sidwell

basic-block.h (OBSTACK_ALLOC_REG_SET): Rename to ...

	* basic-block.h (OBSTACK_ALLOC_REG_SET): Rename to ...
	(ALLOC_REG_SET): ... here.
	(FREE_REG_SET): Adjust.
	(XMALLOC_REG_SET, XFREE_REG_SET): Remove.
	* bb-reorder.c (fix_crossing_conditional_branches): Adjust.
	* cfglayout.c (cfg_layout_duplicate_bb): Adjust.
	* cfgrtl.c (rtl_split_block, rtl_split_edge,
	safe_insert_insn_on_edge, cfg_layout_split_edge): Adjust.
	* flow.c (update_life_info, calculate_global_regs_live,
	allocate_bb_life_data, init_propagate_block_info): Adjust.
	* global.c (build_insn_chain): Adjust.
	* ifcvt.c (dead_or_predicable): Adjust.
	* loop-iv.c (simplify_using_initial_values): Adjust.
	* recog.c (peephole2_optimize): Adjust.
	* sched-deps.c (init_deps_global): Adjust.

From-SVN: r91279
parent eb9744a7
2004-11-25 Nathan Sidwell <nathan@codesourcery.com>
* basic-block.h (OBSTACK_ALLOC_REG_SET): Rename to ...
(ALLOC_REG_SET): ... here.
(FREE_REG_SET): Adjust.
(XMALLOC_REG_SET, XFREE_REG_SET): Remove.
* bb-reorder.c (fix_crossing_conditional_branches): Adjust.
* cfglayout.c (cfg_layout_duplicate_bb): Adjust.
* cfgrtl.c (rtl_split_block, rtl_split_edge,
safe_insert_insn_on_edge, cfg_layout_split_edge): Adjust.
* flow.c (update_life_info, calculate_global_regs_live,
allocate_bb_life_data, init_propagate_block_info): Adjust.
* global.c (build_insn_chain): Adjust.
* ifcvt.c (dead_or_predicable): Adjust.
* loop-iv.c (simplify_using_initial_values): Adjust.
* recog.c (peephole2_optimize): Adjust.
* sched-deps.c (init_deps_global): Adjust.
2004-11-25 Ralf Corsepius <ralf.corsepius@rtems.org> 2004-11-25 Ralf Corsepius <ralf.corsepius@rtems.org>
* config.gcc (avr-*-rtems*): Fix typo. * config.gcc (avr-*-rtems*): Fix typo.
......
...@@ -37,6 +37,12 @@ typedef bitmap_head regset_head; ...@@ -37,6 +37,12 @@ typedef bitmap_head regset_head;
/* A pointer to a regset_head. */ /* A pointer to a regset_head. */
typedef bitmap regset; typedef bitmap regset;
/* Allocate a register set with oballoc. */
#define ALLOC_REG_SET(OBSTACK) BITMAP_OBSTACK_ALLOC (OBSTACK)
/* Do any cleanup needed on a regset when it is no longer used. */
#define FREE_REG_SET(REGSET) BITMAP_OBSTACK_FREE (REGSET)
/* Initialize a new regset. */ /* Initialize a new regset. */
#define INIT_REG_SET(HEAD) bitmap_initialize (HEAD, &reg_obstack) #define INIT_REG_SET(HEAD) bitmap_initialize (HEAD, &reg_obstack)
...@@ -101,18 +107,6 @@ typedef bitmap_iterator reg_set_iterator; ...@@ -101,18 +107,6 @@ 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) \
/* Allocate a register set with oballoc. */
#define OBSTACK_ALLOC_REG_SET(OBSTACK) BITMAP_OBSTACK_ALLOC (OBSTACK)
/* Do any cleanup needed on a regset when it is no longer used. */
#define FREE_REG_SET(REGSET) BITMAP_OBSTACK_FREE(REGSET)
/* Allocate a register set with xmalloc. */
#define XMALLOC_REG_SET() BITMAP_XMALLOC ()
/* Free a register set. */
#define XFREE_REG_SET(REGSET) BITMAP_XFREE (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
......
...@@ -1690,10 +1690,8 @@ fix_crossing_conditional_branches (void) ...@@ -1690,10 +1690,8 @@ fix_crossing_conditional_branches (void)
/* Update register liveness information. */ /* Update register liveness information. */
new_bb->global_live_at_start = new_bb->global_live_at_start = ALLOC_REG_SET (&reg_obstack);
OBSTACK_ALLOC_REG_SET (&reg_obstack); new_bb->global_live_at_end = ALLOC_REG_SET (&reg_obstack);
new_bb->global_live_at_end =
OBSTACK_ALLOC_REG_SET (&reg_obstack);
COPY_REG_SET (new_bb->global_live_at_end, COPY_REG_SET (new_bb->global_live_at_end,
prev_bb->global_live_at_end); prev_bb->global_live_at_end);
COPY_REG_SET (new_bb->global_live_at_start, COPY_REG_SET (new_bb->global_live_at_start,
......
...@@ -1116,8 +1116,8 @@ cfg_layout_duplicate_bb (basic_block bb) ...@@ -1116,8 +1116,8 @@ cfg_layout_duplicate_bb (basic_block bb)
if (bb->global_live_at_start) if (bb->global_live_at_start)
{ {
new_bb->global_live_at_start = OBSTACK_ALLOC_REG_SET (&reg_obstack); new_bb->global_live_at_start = ALLOC_REG_SET (&reg_obstack);
new_bb->global_live_at_end = OBSTACK_ALLOC_REG_SET (&reg_obstack); new_bb->global_live_at_end = ALLOC_REG_SET (&reg_obstack);
COPY_REG_SET (new_bb->global_live_at_start, bb->global_live_at_start); COPY_REG_SET (new_bb->global_live_at_start, bb->global_live_at_start);
COPY_REG_SET (new_bb->global_live_at_end, bb->global_live_at_end); COPY_REG_SET (new_bb->global_live_at_end, bb->global_live_at_end);
} }
......
...@@ -484,8 +484,8 @@ rtl_split_block (basic_block bb, void *insnp) ...@@ -484,8 +484,8 @@ rtl_split_block (basic_block bb, void *insnp)
if (bb->global_live_at_start) if (bb->global_live_at_start)
{ {
new_bb->global_live_at_start = OBSTACK_ALLOC_REG_SET (&reg_obstack); new_bb->global_live_at_start = ALLOC_REG_SET (&reg_obstack);
new_bb->global_live_at_end = OBSTACK_ALLOC_REG_SET (&reg_obstack); new_bb->global_live_at_end = ALLOC_REG_SET (&reg_obstack);
COPY_REG_SET (new_bb->global_live_at_end, bb->global_live_at_end); COPY_REG_SET (new_bb->global_live_at_end, bb->global_live_at_end);
/* We now have to calculate which registers are live at the end /* We now have to calculate which registers are live at the end
...@@ -1089,10 +1089,8 @@ force_nonfallthru_and_redirect (edge e, basic_block target) ...@@ -1089,10 +1089,8 @@ force_nonfallthru_and_redirect (edge e, basic_block target)
if (target->global_live_at_start) if (target->global_live_at_start)
{ {
jump_block->global_live_at_start jump_block->global_live_at_start = ALLOC_REG_SET (&reg_obstack);
= OBSTACK_ALLOC_REG_SET (&reg_obstack); jump_block->global_live_at_end = ALLOC_REG_SET (&reg_obstack);
jump_block->global_live_at_end
= OBSTACK_ALLOC_REG_SET (&reg_obstack);
COPY_REG_SET (jump_block->global_live_at_start, COPY_REG_SET (jump_block->global_live_at_start,
target->global_live_at_start); target->global_live_at_start);
COPY_REG_SET (jump_block->global_live_at_end, COPY_REG_SET (jump_block->global_live_at_end,
...@@ -1378,8 +1376,8 @@ rtl_split_edge (edge edge_in) ...@@ -1378,8 +1376,8 @@ rtl_split_edge (edge edge_in)
/* ??? This info is likely going to be out of date very soon. */ /* ??? This info is likely going to be out of date very soon. */
if (edge_in->dest->global_live_at_start) if (edge_in->dest->global_live_at_start)
{ {
bb->global_live_at_start = OBSTACK_ALLOC_REG_SET (&reg_obstack); bb->global_live_at_start = ALLOC_REG_SET (&reg_obstack);
bb->global_live_at_end = OBSTACK_ALLOC_REG_SET (&reg_obstack); bb->global_live_at_end = ALLOC_REG_SET (&reg_obstack);
COPY_REG_SET (bb->global_live_at_start, COPY_REG_SET (bb->global_live_at_start,
edge_in->dest->global_live_at_start); edge_in->dest->global_live_at_start);
COPY_REG_SET (bb->global_live_at_end, COPY_REG_SET (bb->global_live_at_end,
...@@ -1467,7 +1465,7 @@ safe_insert_insn_on_edge (rtx insn, edge e) ...@@ -1467,7 +1465,7 @@ safe_insert_insn_on_edge (rtx insn, edge e)
noccmode = false; noccmode = false;
#endif #endif
killed = OBSTACK_ALLOC_REG_SET (&reg_obstack); killed = ALLOC_REG_SET (&reg_obstack);
for (x = insn; x; x = NEXT_INSN (x)) for (x = insn; x; x = NEXT_INSN (x))
if (INSN_P (x)) if (INSN_P (x))
...@@ -2850,8 +2848,8 @@ cfg_layout_split_edge (edge e) ...@@ -2850,8 +2848,8 @@ cfg_layout_split_edge (edge e)
create it to avoid getting an ICE later. */ create it to avoid getting an ICE later. */
if (e->dest->global_live_at_start) if (e->dest->global_live_at_start)
{ {
new_bb->global_live_at_start = OBSTACK_ALLOC_REG_SET (&reg_obstack); new_bb->global_live_at_start = ALLOC_REG_SET (&reg_obstack);
new_bb->global_live_at_end = OBSTACK_ALLOC_REG_SET (&reg_obstack); new_bb->global_live_at_end = ALLOC_REG_SET (&reg_obstack);
COPY_REG_SET (new_bb->global_live_at_start, COPY_REG_SET (new_bb->global_live_at_start,
e->dest->global_live_at_start); e->dest->global_live_at_start);
COPY_REG_SET (new_bb->global_live_at_end, COPY_REG_SET (new_bb->global_live_at_end,
......
...@@ -575,7 +575,7 @@ update_life_info (sbitmap blocks, enum update_life_extent extent, ...@@ -575,7 +575,7 @@ update_life_info (sbitmap blocks, enum update_life_extent extent,
int stabilized_prop_flags = prop_flags; int stabilized_prop_flags = prop_flags;
basic_block bb; basic_block bb;
tmp = OBSTACK_ALLOC_REG_SET (&reg_obstack); tmp = ALLOC_REG_SET (&reg_obstack);
ndead = 0; ndead = 0;
if ((prop_flags & PROP_REG_INFO) && !reg_deaths) if ((prop_flags & PROP_REG_INFO) && !reg_deaths)
...@@ -1033,9 +1033,9 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags) ...@@ -1033,9 +1033,9 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags)
gcc_assert (!bb->aux); gcc_assert (!bb->aux);
#endif #endif
tmp = OBSTACK_ALLOC_REG_SET (&reg_obstack); tmp = ALLOC_REG_SET (&reg_obstack);
new_live_at_end = OBSTACK_ALLOC_REG_SET (&reg_obstack); new_live_at_end = ALLOC_REG_SET (&reg_obstack);
invalidated_by_call = OBSTACK_ALLOC_REG_SET (&reg_obstack); invalidated_by_call = ALLOC_REG_SET (&reg_obstack);
/* Inconveniently, this is only readily available in hard reg set form. */ /* Inconveniently, this is only readily available in hard reg set form. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i) for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i)
...@@ -1189,8 +1189,10 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags) ...@@ -1189,8 +1189,10 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags)
if (local_sets[bb->index - (INVALID_BLOCK + 1)] == NULL) if (local_sets[bb->index - (INVALID_BLOCK + 1)] == NULL)
{ {
local_sets[bb->index - (INVALID_BLOCK + 1)] = XMALLOC_REG_SET (); local_sets[bb->index - (INVALID_BLOCK + 1)]
cond_local_sets[bb->index - (INVALID_BLOCK + 1)] = XMALLOC_REG_SET (); = ALLOC_REG_SET (&reg_obstack);
cond_local_sets[bb->index - (INVALID_BLOCK + 1)]
= ALLOC_REG_SET (&reg_obstack);
rescan = 1; rescan = 1;
} }
else else
...@@ -1294,16 +1296,16 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags) ...@@ -1294,16 +1296,16 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags)
EXECUTE_IF_SET_IN_SBITMAP (blocks_out, 0, i, EXECUTE_IF_SET_IN_SBITMAP (blocks_out, 0, i,
{ {
basic_block bb = BASIC_BLOCK (i); basic_block bb = BASIC_BLOCK (i);
XFREE_REG_SET (local_sets[bb->index - (INVALID_BLOCK + 1)]); FREE_REG_SET (local_sets[bb->index - (INVALID_BLOCK + 1)]);
XFREE_REG_SET (cond_local_sets[bb->index - (INVALID_BLOCK + 1)]); FREE_REG_SET (cond_local_sets[bb->index - (INVALID_BLOCK + 1)]);
}); });
} }
else else
{ {
FOR_EACH_BB (bb) FOR_EACH_BB (bb)
{ {
XFREE_REG_SET (local_sets[bb->index - (INVALID_BLOCK + 1)]); FREE_REG_SET (local_sets[bb->index - (INVALID_BLOCK + 1)]);
XFREE_REG_SET (cond_local_sets[bb->index - (INVALID_BLOCK + 1)]); FREE_REG_SET (cond_local_sets[bb->index - (INVALID_BLOCK + 1)]);
} }
} }
...@@ -1436,11 +1438,11 @@ allocate_bb_life_data (void) ...@@ -1436,11 +1438,11 @@ allocate_bb_life_data (void)
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb) FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
{ {
bb->global_live_at_start = OBSTACK_ALLOC_REG_SET (&reg_obstack); bb->global_live_at_start = ALLOC_REG_SET (&reg_obstack);
bb->global_live_at_end = OBSTACK_ALLOC_REG_SET (&reg_obstack); bb->global_live_at_end = ALLOC_REG_SET (&reg_obstack);
} }
regs_live_at_setjmp = OBSTACK_ALLOC_REG_SET (&reg_obstack); regs_live_at_setjmp = ALLOC_REG_SET (&reg_obstack);
} }
void void
...@@ -1843,7 +1845,7 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set, ...@@ -1843,7 +1845,7 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set,
if (JUMP_P (BB_END (bb)) if (JUMP_P (BB_END (bb))
&& any_condjump_p (BB_END (bb))) && any_condjump_p (BB_END (bb)))
{ {
regset diff = OBSTACK_ALLOC_REG_SET (&reg_obstack); regset diff = ALLOC_REG_SET (&reg_obstack);
basic_block bb_true, bb_false; basic_block bb_true, bb_false;
unsigned i; unsigned i;
......
...@@ -1805,7 +1805,7 @@ build_insn_chain (rtx first) ...@@ -1805,7 +1805,7 @@ build_insn_chain (rtx first)
struct insn_chain *prev = 0; struct insn_chain *prev = 0;
basic_block b = ENTRY_BLOCK_PTR->next_bb; basic_block b = ENTRY_BLOCK_PTR->next_bb;
live_relevant_regs = OBSTACK_ALLOC_REG_SET (&reg_obstack); live_relevant_regs = ALLOC_REG_SET (&reg_obstack);
for (; first; first = NEXT_INSN (first)) for (; first; first = NEXT_INSN (first))
{ {
......
...@@ -3165,10 +3165,10 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb, ...@@ -3165,10 +3165,10 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb,
TEST_SET = set of registers set between EARLIEST and the TEST_SET = set of registers set between EARLIEST and the
end of the block. */ end of the block. */
tmp = OBSTACK_ALLOC_REG_SET (&reg_obstack); tmp = ALLOC_REG_SET (&reg_obstack);
merge_set = OBSTACK_ALLOC_REG_SET (&reg_obstack); merge_set = ALLOC_REG_SET (&reg_obstack);
test_live = OBSTACK_ALLOC_REG_SET (&reg_obstack); test_live = ALLOC_REG_SET (&reg_obstack);
test_set = OBSTACK_ALLOC_REG_SET (&reg_obstack); test_set = ALLOC_REG_SET (&reg_obstack);
/* ??? bb->local_set is only valid during calculate_global_regs_live, /* ??? bb->local_set is only valid during calculate_global_regs_live,
so we must recompute usage for MERGE_BB. Not so bad, I suppose, so we must recompute usage for MERGE_BB. Not so bad, I suppose,
......
...@@ -1778,7 +1778,7 @@ simplify_using_initial_values (struct loop *loop, enum rtx_code op, rtx *expr) ...@@ -1778,7 +1778,7 @@ simplify_using_initial_values (struct loop *loop, enum rtx_code op, rtx *expr)
if (e->src == ENTRY_BLOCK_PTR) if (e->src == ENTRY_BLOCK_PTR)
return; return;
altered = OBSTACK_ALLOC_REG_SET (&reg_obstack); altered = ALLOC_REG_SET (&reg_obstack);
while (1) while (1)
{ {
......
...@@ -2972,8 +2972,8 @@ peephole2_optimize (FILE *dump_file ATTRIBUTE_UNUSED) ...@@ -2972,8 +2972,8 @@ peephole2_optimize (FILE *dump_file ATTRIBUTE_UNUSED)
/* Initialize the regsets we're going to use. */ /* Initialize the regsets we're going to use. */
for (i = 0; i < MAX_INSNS_PER_PEEP2 + 1; ++i) for (i = 0; i < MAX_INSNS_PER_PEEP2 + 1; ++i)
peep2_insn_data[i].live_before = OBSTACK_ALLOC_REG_SET (&reg_obstack); peep2_insn_data[i].live_before = ALLOC_REG_SET (&reg_obstack);
live = OBSTACK_ALLOC_REG_SET (&reg_obstack); live = ALLOC_REG_SET (&reg_obstack);
#ifdef HAVE_conditional_execution #ifdef HAVE_conditional_execution
blocks = sbitmap_alloc (last_basic_block); blocks = sbitmap_alloc (last_basic_block);
......
...@@ -1580,9 +1580,9 @@ free_dependency_caches (void) ...@@ -1580,9 +1580,9 @@ free_dependency_caches (void)
void void
init_deps_global (void) init_deps_global (void)
{ {
reg_pending_sets = OBSTACK_ALLOC_REG_SET (&reg_obstack); reg_pending_sets = ALLOC_REG_SET (&reg_obstack);
reg_pending_clobbers = OBSTACK_ALLOC_REG_SET (&reg_obstack); reg_pending_clobbers = ALLOC_REG_SET (&reg_obstack);
reg_pending_uses = OBSTACK_ALLOC_REG_SET (&reg_obstack); reg_pending_uses = ALLOC_REG_SET (&reg_obstack);
reg_pending_barrier = NOT_A_BARRIER; reg_pending_barrier = NOT_A_BARRIER;
} }
......
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