Commit 852c6ec7 by Roger Sayle Committed by Roger Sayle

cfgrtl.c (create_basic_block_structure): Remove index argument and use last_basic_block++ instead.

2002-06-10  Roger Sayle  <roger@eyesopen.com>
	    Andreas Jaeger <aj@suse.de>

	* cfgrtl.c (create_basic_block_structure):  Remove index argument
	and use last_basic_block++ instead.  (create_basic_block): Update.
	* cfgbuild.c (find_basic_blocks_1): Likewise.

	* cfgrtl.c (compute_bb_for_insn): Remove unused "max" argument.
	* haifa-sched.c (sched_init): Update compute_bb_for_insn caller.
	* sched-ebb.c (schedule_ebbs): Likewise.
	* sched-rgn.c (schedule_insns): Likewise.
	* ssa-ccp.c (ssa_const_prop): Likewise.
	* ssa-dcs.c (ssa_eliminate_dead_code): Likewise.
	* toplev.c (rest_of_compilation): Likewise.
	* config/ia64/ia64.c (ia64_reorg): Likewise.

Co-Authored-By: Andreas Jaeger <aj@suse.de>

From-SVN: r54477
parent 60c86d4e
2002-06-10 Roger Sayle <roger@eyesopen.com> 2002-06-10 Roger Sayle <roger@eyesopen.com>
Andreas Jaeger <aj@suse.de>
* cfgrtl.c (create_basic_block_structure): Remove index argument
and use last_basic_block++ instead. (create_basic_block): Update.
* cfgbuild.c (find_basic_blocks_1): Likewise.
* cfgrtl.c (compute_bb_for_insn): Remove unused "max" argument.
* haifa-sched.c (sched_init): Update compute_bb_for_insn caller.
* sched-ebb.c (schedule_ebbs): Likewise.
* sched-rgn.c (schedule_insns): Likewise.
* ssa-ccp.c (ssa_const_prop): Likewise.
* ssa-dcs.c (ssa_eliminate_dead_code): Likewise.
* toplev.c (rest_of_compilation): Likewise.
* config/ia64/ia64.c (ia64_reorg): Likewise.
2002-06-10 Roger Sayle <roger@eyesopen.com>
* simplify-rtx.c (simplify_replace_rtx): Allow replacement * simplify-rtx.c (simplify_replace_rtx): Allow replacement
of matching registers. of matching registers.
......
...@@ -306,7 +306,7 @@ extern struct basic_block_def entry_exit_blocks[2]; ...@@ -306,7 +306,7 @@ extern struct basic_block_def entry_exit_blocks[2];
#define BLOCK_NUM(INSN) (BLOCK_FOR_INSN (INSN)->index + 0) #define BLOCK_NUM(INSN) (BLOCK_FOR_INSN (INSN)->index + 0)
#define set_block_for_insn(INSN, BB) (BLOCK_FOR_INSN (INSN) = BB) #define set_block_for_insn(INSN, BB) (BLOCK_FOR_INSN (INSN) = BB)
extern void compute_bb_for_insn PARAMS ((int)); extern void compute_bb_for_insn PARAMS ((void));
extern void free_bb_for_insn PARAMS ((void)); extern void free_bb_for_insn PARAMS ((void));
extern void update_bb_for_insn PARAMS ((basic_block)); extern void update_bb_for_insn PARAMS ((basic_block));
...@@ -333,7 +333,7 @@ extern void remove_edge PARAMS ((edge)); ...@@ -333,7 +333,7 @@ extern void remove_edge PARAMS ((edge));
extern void redirect_edge_succ PARAMS ((edge, basic_block)); extern void redirect_edge_succ PARAMS ((edge, basic_block));
extern edge redirect_edge_succ_nodup PARAMS ((edge, basic_block)); extern edge redirect_edge_succ_nodup PARAMS ((edge, basic_block));
extern void redirect_edge_pred PARAMS ((edge, basic_block)); extern void redirect_edge_pred PARAMS ((edge, basic_block));
extern basic_block create_basic_block_structure PARAMS ((int, rtx, rtx, rtx, basic_block)); extern basic_block create_basic_block_structure PARAMS ((rtx, rtx, rtx, basic_block));
extern basic_block create_basic_block PARAMS ((rtx, rtx, basic_block)); extern basic_block create_basic_block PARAMS ((rtx, rtx, basic_block));
extern int flow_delete_block PARAMS ((basic_block)); extern int flow_delete_block PARAMS ((basic_block));
extern int flow_delete_block_noexpunge PARAMS ((basic_block)); extern int flow_delete_block_noexpunge PARAMS ((basic_block));
......
...@@ -493,7 +493,7 @@ find_basic_blocks_1 (f) ...@@ -493,7 +493,7 @@ find_basic_blocks_1 (f)
if ((GET_CODE (insn) == CODE_LABEL || GET_CODE (insn) == BARRIER) if ((GET_CODE (insn) == CODE_LABEL || GET_CODE (insn) == BARRIER)
&& head) && head)
{ {
prev = create_basic_block_structure (last_basic_block++, head, end, bb_note, prev); prev = create_basic_block_structure (head, end, bb_note, prev);
head = end = NULL_RTX; head = end = NULL_RTX;
bb_note = NULL_RTX; bb_note = NULL_RTX;
} }
...@@ -507,7 +507,7 @@ find_basic_blocks_1 (f) ...@@ -507,7 +507,7 @@ find_basic_blocks_1 (f)
if (head && control_flow_insn_p (insn)) if (head && control_flow_insn_p (insn))
{ {
prev = create_basic_block_structure (last_basic_block++, head, end, bb_note, prev); prev = create_basic_block_structure (head, end, bb_note, prev);
head = end = NULL_RTX; head = end = NULL_RTX;
bb_note = NULL_RTX; bb_note = NULL_RTX;
} }
...@@ -589,7 +589,7 @@ find_basic_blocks_1 (f) ...@@ -589,7 +589,7 @@ find_basic_blocks_1 (f)
} }
if (head != NULL_RTX) if (head != NULL_RTX)
create_basic_block_structure (last_basic_block++, head, end, bb_note, prev); create_basic_block_structure (head, end, bb_note, prev);
else if (bb_note) else if (bb_note)
delete_insn (bb_note); delete_insn (bb_note);
...@@ -612,7 +612,6 @@ find_basic_blocks (f, nregs, file) ...@@ -612,7 +612,6 @@ find_basic_blocks (f, nregs, file)
int nregs ATTRIBUTE_UNUSED; int nregs ATTRIBUTE_UNUSED;
FILE *file ATTRIBUTE_UNUSED; FILE *file ATTRIBUTE_UNUSED;
{ {
int max_uid;
basic_block bb; basic_block bb;
timevar_push (TV_CFG); timevar_push (TV_CFG);
...@@ -653,14 +652,7 @@ find_basic_blocks (f, nregs, file) ...@@ -653,14 +652,7 @@ find_basic_blocks (f, nregs, file)
tagged directly with the basic block that it starts. It is used for tagged directly with the basic block that it starts. It is used for
more than that currently, but IMO that is the only valid use. */ more than that currently, but IMO that is the only valid use. */
max_uid = get_max_uid (); compute_bb_for_insn ();
#ifdef AUTO_INC_DEC
/* Leave space for insns life_analysis makes in some cases for auto-inc.
These cases are rare, so we don't need too much space. */
max_uid += max_uid / 10;
#endif
compute_bb_for_insn (max_uid);
/* Discover the edges of our cfg. */ /* Discover the edges of our cfg. */
make_edges (label_value_list, ENTRY_BLOCK_PTR->next_bb, EXIT_BLOCK_PTR->prev_bb, 0); make_edges (label_value_list, ENTRY_BLOCK_PTR->next_bb, EXIT_BLOCK_PTR->prev_bb, 0);
......
...@@ -245,8 +245,7 @@ delete_insn_chain_and_edges (first, last) ...@@ -245,8 +245,7 @@ delete_insn_chain_and_edges (first, last)
AFTER is the basic block we should be put after. */ AFTER is the basic block we should be put after. */
basic_block basic_block
create_basic_block_structure (index, head, end, bb_note, after) create_basic_block_structure (head, end, bb_note, after)
int index;
rtx head, end, bb_note; rtx head, end, bb_note;
basic_block after; basic_block after;
{ {
...@@ -304,10 +303,10 @@ create_basic_block_structure (index, head, end, bb_note, after) ...@@ -304,10 +303,10 @@ create_basic_block_structure (index, head, end, bb_note, after)
bb->head = head; bb->head = head;
bb->end = end; bb->end = end;
bb->index = index; bb->index = last_basic_block++;
bb->flags = BB_NEW; bb->flags = BB_NEW;
link_block (bb, after); link_block (bb, after);
BASIC_BLOCK (index) = bb; BASIC_BLOCK (bb->index) = bb;
update_bb_for_insn (bb); update_bb_for_insn (bb);
/* Tag the block so that we know it has been used when considering /* Tag the block so that we know it has been used when considering
...@@ -328,14 +327,13 @@ create_basic_block (head, end, after) ...@@ -328,14 +327,13 @@ create_basic_block (head, end, after)
basic_block after; basic_block after;
{ {
basic_block bb; basic_block bb;
int index = last_basic_block++;
/* Place the new block just after the end. */ /* Place the new block just after the end. */
VARRAY_GROW (basic_block_info, last_basic_block); VARRAY_GROW (basic_block_info, last_basic_block+1);
n_basic_blocks++; n_basic_blocks++;
bb = create_basic_block_structure (index, head, end, NULL, after); bb = create_basic_block_structure (head, end, NULL, after);
bb->aux = NULL; bb->aux = NULL;
return bb; return bb;
} }
...@@ -423,12 +421,10 @@ flow_delete_block (b) ...@@ -423,12 +421,10 @@ flow_delete_block (b)
return deleted_handler; return deleted_handler;
} }
/* Records the basic block struct in BB_FOR_INSN, for every instruction /* Records the basic block struct in BLOCK_FOR_INSN for every insn. */
indexed by INSN_UID. MAX is the size of the array. */
void void
compute_bb_for_insn (max) compute_bb_for_insn ()
int max;
{ {
basic_block bb; basic_block bb;
......
...@@ -6933,7 +6933,7 @@ ia64_reorg (insns) ...@@ -6933,7 +6933,7 @@ ia64_reorg (insns)
{ {
/* We are freeing block_for_insn in the toplev to keep compatibility /* We are freeing block_for_insn in the toplev to keep compatibility
with old MDEP_REORGS that are not CFG based. Recompute it now. */ with old MDEP_REORGS that are not CFG based. Recompute it now. */
compute_bb_for_insn (get_max_uid ()); compute_bb_for_insn ();
/* If optimizing, we'll have split before scheduling. */ /* If optimizing, we'll have split before scheduling. */
if (optimize == 0) if (optimize == 0)
......
...@@ -2368,7 +2368,7 @@ sched_init (dump_file) ...@@ -2368,7 +2368,7 @@ sched_init (dump_file)
init_dependency_caches (luid); init_dependency_caches (luid);
compute_bb_for_insn (old_max_uid); compute_bb_for_insn ();
init_alias_analysis (); init_alias_analysis ();
......
...@@ -291,7 +291,7 @@ schedule_ebbs (dump_file) ...@@ -291,7 +291,7 @@ schedule_ebbs (dump_file)
current_sched_info = &ebb_sched_info; current_sched_info = &ebb_sched_info;
allocate_reg_life_data (); allocate_reg_life_data ();
compute_bb_for_insn (get_max_uid ()); compute_bb_for_insn ();
/* Schedule every region in the subroutine. */ /* Schedule every region in the subroutine. */
FOR_EACH_BB (bb) FOR_EACH_BB (bb)
......
...@@ -3016,7 +3016,7 @@ schedule_insns (dump_file) ...@@ -3016,7 +3016,7 @@ schedule_insns (dump_file)
best way to test for this kind of thing... */ best way to test for this kind of thing... */
allocate_reg_life_data (); allocate_reg_life_data ();
compute_bb_for_insn (get_max_uid ()); compute_bb_for_insn ();
any_large_regions = 0; any_large_regions = 0;
large_region_blocks = sbitmap_alloc (last_basic_block); large_region_blocks = sbitmap_alloc (last_basic_block);
......
...@@ -992,7 +992,7 @@ ssa_const_prop () ...@@ -992,7 +992,7 @@ ssa_const_prop ()
DF_RD_CHAIN | DF_RU_CHAIN | DF_REG_INFO | DF_HARD_REGS); DF_RD_CHAIN | DF_RU_CHAIN | DF_REG_INFO | DF_HARD_REGS);
/* We need mappings from insn to its containing block. */ /* We need mappings from insn to its containing block. */
compute_bb_for_insn (get_max_uid ()); compute_bb_for_insn ();
/* Perform a quick and dirty dead code elimination pass. This is not /* Perform a quick and dirty dead code elimination pass. This is not
as aggressive as it could be, but it's good enough to clean up a as aggressive as it could be, but it's good enough to clean up a
......
...@@ -500,8 +500,6 @@ ssa_eliminate_dead_code () ...@@ -500,8 +500,6 @@ ssa_eliminate_dead_code ()
int *pdom; int *pdom;
struct edge_list *el; struct edge_list *el;
int max_insn_uid = get_max_uid ();
/* Initialize the data structures. */ /* Initialize the data structures. */
mark_all_insn_unnecessary (); mark_all_insn_unnecessary ();
VARRAY_RTX_INIT (unprocessed_instructions, 64, VARRAY_RTX_INIT (unprocessed_instructions, 64,
...@@ -511,7 +509,7 @@ ssa_eliminate_dead_code () ...@@ -511,7 +509,7 @@ ssa_eliminate_dead_code ()
/* Prepare for use of BLOCK_NUM (). */ /* Prepare for use of BLOCK_NUM (). */
connect_infinite_loops_to_exit (); connect_infinite_loops_to_exit ();
/* Be careful not to clear the added edges. */ /* Be careful not to clear the added edges. */
compute_bb_for_insn (max_insn_uid); compute_bb_for_insn ();
/* Compute control dependence. */ /* Compute control dependence. */
pdom = (int *) xmalloc (last_basic_block * sizeof (int)); pdom = (int *) xmalloc (last_basic_block * sizeof (int));
......
...@@ -2746,7 +2746,7 @@ rest_of_compilation (decl) ...@@ -2746,7 +2746,7 @@ rest_of_compilation (decl)
we'll save big on memory. */ we'll save big on memory. */
renumber_insns (rtl_dump_file); renumber_insns (rtl_dump_file);
if (optimize) if (optimize)
compute_bb_for_insn (get_max_uid ()); compute_bb_for_insn ();
timevar_pop (TV_JUMP); timevar_pop (TV_JUMP);
close_dump_file (DFI_jump, print_rtl_with_bb, insns); close_dump_file (DFI_jump, print_rtl_with_bb, insns);
...@@ -2794,7 +2794,7 @@ rest_of_compilation (decl) ...@@ -2794,7 +2794,7 @@ rest_of_compilation (decl)
/* The second pass of jump optimization is likely to have /* The second pass of jump optimization is likely to have
removed a bunch more instructions. */ removed a bunch more instructions. */
renumber_insns (rtl_dump_file); renumber_insns (rtl_dump_file);
compute_bb_for_insn (get_max_uid ()); compute_bb_for_insn ();
timevar_pop (TV_CSE); timevar_pop (TV_CSE);
close_dump_file (DFI_cse, print_rtl_with_bb, insns); close_dump_file (DFI_cse, print_rtl_with_bb, insns);
......
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