diff options
author | Richard Henderson <rth@cygnus.com> | 1999-03-31 04:41:03 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 1999-03-31 04:41:03 -0800 |
commit | 359da67d8aa7661e25fff84bfc65a4ff52f7d84b (patch) | |
tree | db616f128a966c259f3fcaed1815905fa9d0605d /gcc/flow.c | |
parent | 42493273de48c914e4235c83c586f7aa4b8a0ff0 (diff) | |
download | gcc-359da67d8aa7661e25fff84bfc65a4ff52f7d84b.zip gcc-359da67d8aa7661e25fff84bfc65a4ff52f7d84b.tar.gz gcc-359da67d8aa7661e25fff84bfc65a4ff52f7d84b.tar.bz2 |
flow.c (find_basic_blocks): New argument `do_cleanup'.
* flow.c (find_basic_blocks): New argument `do_cleanup'.
Conditionally call delete_unreachable_blocks.
(free_basic_block_vars): Zero ENTRY/EXIT data.
(allocate_for_life_analysis): Kill. Split into...
(allocate_bb_life_data, allocate_reg_life_data): ... new functions.
(life_analysis_1): Update.
* gcse.c (gcse_main): Update find_basic_blocks call.
* toplev.c (rest_of_compilation): Likewise.
* stupid.c (stupid_life_analysis): Update life data calls.
* rtl.h, output.h: Update prototypes.
From-SVN: r26090
Diffstat (limited to 'gcc/flow.c')
-rw-r--r-- | gcc/flow.c | 46 |
1 files changed, 29 insertions, 17 deletions
@@ -340,10 +340,11 @@ static void invalidate_mems_from_autoinc PROTO ((rtx)); numbers in use. */ void -find_basic_blocks (f, nregs, file) +find_basic_blocks (f, nregs, file, do_cleanup) rtx f; int nregs ATTRIBUTE_UNUSED; FILE *file ATTRIBUTE_UNUSED; + int do_cleanup; { rtx *bb_eh_end; int max_uid; @@ -402,9 +403,9 @@ find_basic_blocks (f, nregs, file) make_edges (label_value_list, bb_eh_end); /* Delete unreachable blocks. */ - /* ??? Do this conditionally, or make this another entry point? */ - delete_unreachable_blocks (); + if (do_cleanup) + delete_unreachable_blocks (); /* Mark critical edges. */ @@ -2097,6 +2098,11 @@ free_basic_block_vars (keep_head_end_p) clear_edges (); VARRAY_FREE (basic_block_info); n_basic_blocks = 0; + + ENTRY_BLOCK_PTR->aux = NULL; + ENTRY_BLOCK_PTR->global_live_at_end = NULL; + EXIT_BLOCK_PTR->aux = NULL; + EXIT_BLOCK_PTR->global_live_at_start = NULL; } } @@ -2298,7 +2304,8 @@ life_analysis_1 (f, nregs) /* Allocate and zero out many data structures that will record the data from lifetime analysis. */ - allocate_for_life_analysis (); + allocate_reg_life_data (); + allocate_bb_life_data (); reg_next_use = (rtx *) alloca (nregs * sizeof (rtx)); memset (reg_next_use, 0, nregs * sizeof (rtx)); @@ -2511,21 +2518,10 @@ life_analysis_1 (f, nregs) of life analysis. Not static since used also for stupid life analysis. */ void -allocate_for_life_analysis () +allocate_bb_life_data () { register int i; - /* Recalculate the register space, in case it has grown. Old style - vector oriented regsets would set regset_{size,bytes} here also. */ - allocate_reg_info (max_regno, FALSE, FALSE); - - /* Because both reg_scan and flow_analysis want to set up the REG_N_SETS - information, explicitly reset it here. The allocation should have - already happened on the previous reg_scan pass. Make sure in case - some more registers were allocated. */ - for (i = 0; i < max_regno; i++) - REG_N_SETS (i) = 0; - for (i = 0; i < n_basic_blocks; i++) { basic_block bb = BASIC_BLOCK (i); @@ -2541,7 +2537,23 @@ allocate_for_life_analysis () = OBSTACK_ALLOC_REG_SET (function_obstack); regs_live_at_setjmp = OBSTACK_ALLOC_REG_SET (function_obstack); - CLEAR_REG_SET (regs_live_at_setjmp); +} + +void +allocate_reg_life_data () +{ + int i; + + /* Recalculate the register space, in case it has grown. Old style + vector oriented regsets would set regset_{size,bytes} here also. */ + allocate_reg_info (max_regno, FALSE, FALSE); + + /* Because both reg_scan and flow_analysis want to set up the REG_N_SETS + information, explicitly reset it here. The allocation should have + already happened on the previous reg_scan pass. Make sure in case + some more registers were allocated. */ + for (i = 0; i < max_regno; i++) + REG_N_SETS (i) = 0; } /* Make each element of VECTOR point at a regset. The vector has |