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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54477
138bc75d-0d04-0410-961f-
82ee72b054a4
+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
#define BLOCK_NUM(INSN) (BLOCK_FOR_INSN (INSN)->index + 0)
#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 update_bb_for_insn PARAMS ((basic_block));
extern void redirect_edge_succ PARAMS ((edge, basic_block));
extern edge redirect_edge_succ_nodup 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 int flow_delete_block PARAMS ((basic_block));
extern int flow_delete_block_noexpunge PARAMS ((basic_block));
if ((GET_CODE (insn) == CODE_LABEL || GET_CODE (insn) == BARRIER)
&& 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;
bb_note = NULL_RTX;
}
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;
bb_note = 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)
delete_insn (bb_note);
int nregs ATTRIBUTE_UNUSED;
FILE *file ATTRIBUTE_UNUSED;
{
- int max_uid;
basic_block bb;
timevar_push (TV_CFG);
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. */
- max_uid = get_max_uid ();
-#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);
+ compute_bb_for_insn ();
/* Discover the edges of our cfg. */
make_edges (label_value_list, ENTRY_BLOCK_PTR->next_bb, EXIT_BLOCK_PTR->prev_bb, 0);
AFTER is the basic block we should be put after. */
basic_block
-create_basic_block_structure (index, head, end, bb_note, after)
- int index;
+create_basic_block_structure (head, end, bb_note, after)
rtx head, end, bb_note;
basic_block after;
{
bb->head = head;
bb->end = end;
- bb->index = index;
+ bb->index = last_basic_block++;
bb->flags = BB_NEW;
link_block (bb, after);
- BASIC_BLOCK (index) = bb;
+ BASIC_BLOCK (bb->index) = bb;
update_bb_for_insn (bb);
/* Tag the block so that we know it has been used when considering
basic_block after;
{
basic_block bb;
- int index = last_basic_block++;
/* 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++;
- bb = create_basic_block_structure (index, head, end, NULL, after);
+ bb = create_basic_block_structure (head, end, NULL, after);
bb->aux = NULL;
return bb;
}
return deleted_handler;
}
\f
-/* Records the basic block struct in BB_FOR_INSN, for every instruction
- indexed by INSN_UID. MAX is the size of the array. */
+/* Records the basic block struct in BLOCK_FOR_INSN for every insn. */
void
-compute_bb_for_insn (max)
- int max;
+compute_bb_for_insn ()
{
basic_block bb;
{
/* We are freeing block_for_insn in the toplev to keep compatibility
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 (optimize == 0)
init_dependency_caches (luid);
- compute_bb_for_insn (old_max_uid);
+ compute_bb_for_insn ();
init_alias_analysis ();
current_sched_info = &ebb_sched_info;
allocate_reg_life_data ();
- compute_bb_for_insn (get_max_uid ());
+ compute_bb_for_insn ();
/* Schedule every region in the subroutine. */
FOR_EACH_BB (bb)
best way to test for this kind of thing... */
allocate_reg_life_data ();
- compute_bb_for_insn (get_max_uid ());
+ compute_bb_for_insn ();
any_large_regions = 0;
large_region_blocks = sbitmap_alloc (last_basic_block);
DF_RD_CHAIN | DF_RU_CHAIN | DF_REG_INFO | DF_HARD_REGS);
/* 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
as aggressive as it could be, but it's good enough to clean up a
int *pdom;
struct edge_list *el;
- int max_insn_uid = get_max_uid ();
-
/* Initialize the data structures. */
mark_all_insn_unnecessary ();
VARRAY_RTX_INIT (unprocessed_instructions, 64,
/* Prepare for use of BLOCK_NUM (). */
connect_infinite_loops_to_exit ();
/* Be careful not to clear the added edges. */
- compute_bb_for_insn (max_insn_uid);
+ compute_bb_for_insn ();
/* Compute control dependence. */
pdom = (int *) xmalloc (last_basic_block * sizeof (int));
we'll save big on memory. */
renumber_insns (rtl_dump_file);
if (optimize)
- compute_bb_for_insn (get_max_uid ());
+ compute_bb_for_insn ();
timevar_pop (TV_JUMP);
close_dump_file (DFI_jump, print_rtl_with_bb, insns);
/* The second pass of jump optimization is likely to have
removed a bunch more instructions. */
renumber_insns (rtl_dump_file);
- compute_bb_for_insn (get_max_uid ());
+ compute_bb_for_insn ();
timevar_pop (TV_CSE);
close_dump_file (DFI_cse, print_rtl_with_bb, insns);