Commit 35836a43 by Jan Hubicka Committed by Jan Hubicka

flow.c (calculate_loop_depth): Make global, remove prototype, rewrite to use new…

flow.c (calculate_loop_depth): Make global, remove prototype, rewrite to use new loop infrastructure.

	* flow.c (calculate_loop_depth): Make global, remove prototype,
	rewrite to use new loop infrastructure.
	(find_basic_block): Remove calculate_loop_depth call.
	* toplev.c (rest_of_compilation): Call find_basic_block.
	* output.h (calculate_loop_depth): Declare.

From-SVN: r30955
parent ce4bbac7
Wed Dec 15 15:05:30 MET 1999 Jan Hubicka <hubicka@freesoft.cz>
* flow.c (calculate_loop_depth): Make global, remove prototype,
rewrite to use new loop infrastructure.
(find_basic_block): Remove calculate_loop_depth call.
* toplev.c (rest_of_compilation): Call find_basic_block.
* output.h (calculate_loop_depth): Declare.
* flow.c (dump_flow_info): Dump loop_depth.
(flow_loops_nodes_find): Increase loop_depth for basic block in the
body.
......
......@@ -314,7 +314,6 @@ static void merge_blocks_nomove PROTO((basic_block, basic_block));
static int merge_blocks PROTO((edge,basic_block,basic_block));
static void try_merge_blocks PROTO((void));
static void tidy_fallthru_edge PROTO((edge,basic_block,basic_block));
static void calculate_loop_depth PROTO((rtx));
static int verify_wide_reg_1 PROTO((rtx *, void *));
static void verify_wide_reg PROTO((int, rtx, rtx));
......@@ -434,10 +433,6 @@ find_basic_blocks (f, nregs, file, do_cleanup)
mark_critical_edges ();
/* Discover the loop depth at the start of each basic block to aid
register allocation. */
calculate_loop_depth (f);
/* Kill the data we won't maintain. */
label_value_list = NULL_RTX;
......@@ -2389,37 +2384,17 @@ tidy_fallthru_edge (e, b, c)
/* Discover and record the loop depth at the head of each basic block. */
static void
calculate_loop_depth (insns)
rtx insns;
void
calculate_loop_depth (dump)
FILE *dump;
{
basic_block bb;
rtx insn;
int i = 0, depth = 1;
struct loops loops;
bb = BASIC_BLOCK (i);
for (insn = insns; insn ; insn = NEXT_INSN (insn))
{
if (insn == bb->head)
{
bb->loop_depth = depth;
if (++i >= n_basic_blocks)
break;
bb = BASIC_BLOCK (i);
}
if (GET_CODE (insn) == NOTE)
{
if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG)
depth++;
else if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END)
depth--;
/* If we have LOOP_DEPTH == 0, there has been a bookkeeping error. */
if (depth == 0)
abort ();
}
}
/* The loop infrastructure does the real job for us. */
flow_loops_find (&loops);
if (dump)
flow_loops_dump (&loops, dump, 0);
flow_loops_free (&loops);
}
/* Perform data flow analysis.
......
......@@ -132,6 +132,7 @@ extern int regno_uninitialized PROTO((int));
extern int regno_clobbered_at_setjmp PROTO((int));
extern void dump_flow_info PROTO((FILE *));
extern void find_basic_blocks PROTO((rtx, int, FILE *, int));
extern void calculate_loop_depth PROTO((FILE *));
extern void free_basic_block_vars PROTO((int));
extern void set_block_num PROTO((rtx, int));
extern void life_analysis PROTO((rtx, int, FILE *, int));
......
......@@ -4060,6 +4060,7 @@ rest_of_compilation (decl)
(flow_time,
{
find_basic_blocks (insns, max_reg_num (), rtl_dump_file, 1);
calculate_loop_depth (rtl_dump_file);
life_analysis (insns, max_reg_num (), rtl_dump_file, 1);
});
......
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