Commit a18820c6 by Richard Henderson Committed by Richard Henderson

gcse.c (gcse_main): Don't rebuild the CFG here.

        * gcse.c (gcse_main): Don't rebuild the CFG here.
        (delete_null_pointer_checks): Likewise.
        * ssa.c (convert_to_ssa): Likewise.
        * toplev.c (rest_of_compilation): Do it here instead.  Combine
        sequential calls to TIMEVAR.  Consistently use `insns' instead of
        `get_insns()'.  Always split insns after reload when optimizing.

From-SVN: r32995
parent dc108b7a
2000-04-07 Richard Henderson <rth@cygnus.com> 2000-04-07 Richard Henderson <rth@cygnus.com>
* gcse.c (gcse_main): Don't rebuild the CFG here.
(delete_null_pointer_checks): Likewise.
* ssa.c (convert_to_ssa): Likewise.
* toplev.c (rest_of_compilation): Do it here instead. Combine
sequential calls to TIMEVAR. Consistently use `insns' instead of
`get_insns()'. Always split insns after reload when optimizing.
* basic-block.h (merge_blocks_nomove): Declare. * basic-block.h (merge_blocks_nomove): Declare.
(tidy_fallthru_edge): Declare. (tidy_fallthru_edge): Declare.
* flow.c (merge_blocks_nomove): Document as merging into previous * flow.c (merge_blocks_nomove): Document as merging into previous
......
...@@ -669,18 +669,13 @@ gcse_main (f, file) ...@@ -669,18 +669,13 @@ gcse_main (f, file)
/* Identify the basic block information for this function, including /* Identify the basic block information for this function, including
successors and predecessors. */ successors and predecessors. */
max_gcse_regno = max_reg_num (); max_gcse_regno = max_reg_num ();
find_basic_blocks (f, max_gcse_regno, file);
cleanup_cfg (f);
if (file) if (file)
dump_flow_info (file); dump_flow_info (file);
/* Return if there's nothing to do. */ /* Return if there's nothing to do. */
if (n_basic_blocks <= 1) if (n_basic_blocks <= 1)
{ return 0;
free_basic_block_vars (0);
return 0;
}
/* Trying to perform global optimizations on flow graphs which have /* Trying to perform global optimizations on flow graphs which have
a high connectivity will take a long time and is unlikely to be a high connectivity will take a long time and is unlikely to be
...@@ -691,10 +686,7 @@ gcse_main (f, file) ...@@ -691,10 +686,7 @@ gcse_main (f, file)
a couple switch statements. So we require a relatively large number a couple switch statements. So we require a relatively large number
of basic blocks and the ratio of edges to blocks to be high. */ of basic blocks and the ratio of edges to blocks to be high. */
if (n_basic_blocks > 1000 && n_edges / n_basic_blocks >= 20) if (n_basic_blocks > 1000 && n_edges / n_basic_blocks >= 20)
{ return 0;
free_basic_block_vars (0);
return 0;
}
/* See what modes support reg/reg copy operations. */ /* See what modes support reg/reg copy operations. */
if (! can_copy_init_p) if (! can_copy_init_p)
...@@ -807,7 +799,6 @@ gcse_main (f, file) ...@@ -807,7 +799,6 @@ gcse_main (f, file)
obstack_free (&gcse_obstack, NULL_PTR); obstack_free (&gcse_obstack, NULL_PTR);
free_reg_set_mem (); free_reg_set_mem ();
free_basic_block_vars (0);
return run_jump_opt_after_gcse; return run_jump_opt_after_gcse;
} }
...@@ -5070,17 +5061,9 @@ delete_null_pointer_checks (f) ...@@ -5070,17 +5061,9 @@ delete_null_pointer_checks (f)
int max_reg; int max_reg;
struct null_pointer_info npi; struct null_pointer_info npi;
/* First break the program into basic blocks. */
find_basic_blocks (f, max_reg_num (), NULL);
cleanup_cfg (f);
/* If we have only a single block, then there's nothing to do. */ /* If we have only a single block, then there's nothing to do. */
if (n_basic_blocks <= 1) if (n_basic_blocks <= 1)
{ return;
/* Free storage allocated by find_basic_blocks. */
free_basic_block_vars (0);
return;
}
/* Trying to perform global optimizations on flow graphs which have /* Trying to perform global optimizations on flow graphs which have
a high connectivity will take a long time and is unlikely to be a high connectivity will take a long time and is unlikely to be
...@@ -5091,11 +5074,7 @@ delete_null_pointer_checks (f) ...@@ -5091,11 +5074,7 @@ delete_null_pointer_checks (f)
a couple switch statements. So we require a relatively large number a couple switch statements. So we require a relatively large number
of basic blocks and the ratio of edges to blocks to be high. */ of basic blocks and the ratio of edges to blocks to be high. */
if (n_basic_blocks > 1000 && n_edges / n_basic_blocks >= 20) if (n_basic_blocks > 1000 && n_edges / n_basic_blocks >= 20)
{ return;
/* Free storage allocated by find_basic_blocks. */
free_basic_block_vars (0);
return;
}
/* We need four bitmaps, each with a bit for each register in each /* We need four bitmaps, each with a bit for each register in each
basic block. */ basic block. */
...@@ -5152,9 +5131,6 @@ delete_null_pointer_checks (f) ...@@ -5152,9 +5131,6 @@ delete_null_pointer_checks (f)
nonnull_avout, &npi); nonnull_avout, &npi);
} }
/* Free storage allocated by find_basic_blocks. */
free_basic_block_vars (0);
/* Free the table of registers compared at the end of every block. */ /* Free the table of registers compared at the end of every block. */
free (block_reg); free (block_reg);
......
...@@ -855,10 +855,6 @@ convert_to_ssa() ...@@ -855,10 +855,6 @@ convert_to_ssa()
if (in_ssa_form) if (in_ssa_form)
abort (); abort ();
find_basic_blocks (get_insns (), max_reg_num(), NULL);
/* The dominator algorithms assume all blocks are reachable; clean
up first. */
cleanup_cfg (get_insns ());
/* Don't eliminate dead code here. The CFG we computed above must /* Don't eliminate dead code here. The CFG we computed above must
remain unchanged until we are finished emerging from SSA form -- remain unchanged until we are finished emerging from SSA form --
the phi node representation depends on it. */ the phi node representation depends on it. */
...@@ -930,8 +926,6 @@ convert_to_ssa() ...@@ -930,8 +926,6 @@ convert_to_ssa()
in_ssa_form = 1; in_ssa_form = 1;
reg_scan (get_insns (), max_reg_num (), 1); reg_scan (get_insns (), max_reg_num (), 1);
find_basic_blocks (get_insns (), max_reg_num (), NULL);
life_analysis (get_insns (), max_reg_num (), NULL, 0);
} }
...@@ -1818,7 +1812,6 @@ convert_from_ssa() ...@@ -1818,7 +1812,6 @@ convert_from_ssa()
rtx insns = get_insns (); rtx insns = get_insns ();
/* We need up-to-date life information. */ /* We need up-to-date life information. */
find_basic_blocks (insns, max_reg_num (), NULL);
life_analysis (insns, max_reg_num (), NULL, 0); life_analysis (insns, max_reg_num (), NULL, 0);
/* Figure out which regs in copies and phi nodes don't conflict and /* Figure out which regs in copies and phi nodes don't conflict and
......
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