diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-10-30 11:13:49 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-10-30 11:13:49 +0000 |
commit | 7fb47f9f1adf513b1b2b5798de845536228fe16d (patch) | |
tree | 5aed4d117e8130cabea4a775fc620383c6f0edc9 /gcc/sched-rgn.c | |
parent | 8c2b78bf912345e40f7b955ed80add8d6c49c4dc (diff) | |
download | ppe42-gcc-7fb47f9f1adf513b1b2b5798de845536228fe16d.tar.gz ppe42-gcc-7fb47f9f1adf513b1b2b5798de845536228fe16d.zip |
* lcm.c (optimize_mode_switching): Do not rebuild liveness information
when no changes has been made.
* gcse.c (reg_set_bitmap): Turn into reg_set.
(modify_mem_list_set, canon_modify_mem_list_set)
(clear_modify_mem_tables, free_modify_mem_tables): New.
(gcse_main); Use free_modify_mem_tables.
(free_gcse_mem): Likewise; free the bitmaps.
(alloc_gcse_main): Initialize the bitmaps.
(canon_list_insert): Set canon_modify_mem_list_set.
(record_last_mem_set_info): Likewise; set modify_mem_list_set.
(compute_hash_table): Use clear_modify_mem_tables.
(reset_opr_set_tables): Likewise.
(oprs_not_set_p): reg_set_bitmap is regset.
(mark_set, mark_clobber): Likewise.
* df.h (DF_EQUIV_NOTES): New constant.
(df_insn_refs_record): Record uses inside or REG_EQUIV/EQUAL notes
when asked for.
* sched-rgn.c (CHECK_DEAD_NOTES): New constant.
(init_regions, schedule_insns): Conditionalize the checking
code by CHECK_DEAD_NOTES; avoid multiple calls to update_life_info.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46634 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sched-rgn.c')
-rw-r--r-- | gcc/sched-rgn.c | 85 |
1 files changed, 54 insertions, 31 deletions
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c index 3cd89e913ea..c443cd7c4f0 100644 --- a/gcc/sched-rgn.c +++ b/gcc/sched-rgn.c @@ -62,6 +62,17 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "recog.h" #include "sched-int.h" +/* Define when we want to do count REG_DEAD notes before and after scheduling + for sanity checking. We can't do that when conditional execution is used, + as REG_DEAD exist only for unconditional deaths. */ + +#if !defined (HAVE_conditional_execution) && defined (ENABLE_CHECKING) +#define CHECK_DEAD_NOTES 1 +#else +#define CHECK_DEAD_NOTES 0 +#endif + + #ifdef INSN_SCHEDULING /* Some accessor macros for h_i_d members only used within this file. */ #define INSN_REF_COUNT(INSN) (h_i_d[INSN_UID (INSN)].ref_count) @@ -2790,8 +2801,6 @@ init_regions () block_to_bb = (int *) xmalloc ((n_basic_blocks) * sizeof (int)); containing_rgn = (int *) xmalloc ((n_basic_blocks) * sizeof (int)); - blocks = sbitmap_alloc (n_basic_blocks); - /* Compute regions for scheduling. */ if (reload_completed || n_basic_blocks == 1 @@ -2849,21 +2858,26 @@ init_regions () } } - deaths_in_region = (int *) xmalloc (sizeof (int) * nr_regions); - /* Remove all death notes from the subroutine. */ - for (rgn = 0; rgn < nr_regions; rgn++) + if (CHECK_DEAD_NOTES) { - int b; + blocks = sbitmap_alloc (n_basic_blocks); + deaths_in_region = (int *) xmalloc (sizeof (int) * nr_regions); + /* Remove all death notes from the subroutine. */ + for (rgn = 0; rgn < nr_regions; rgn++) + { + int b; - sbitmap_zero (blocks); - for (b = RGN_NR_BLOCKS (rgn) - 1; b >= 0; --b) - SET_BIT (blocks, rgn_bb_table[RGN_BLOCKS (rgn) + b]); + sbitmap_zero (blocks); + for (b = RGN_NR_BLOCKS (rgn) - 1; b >= 0; --b) + SET_BIT (blocks, rgn_bb_table[RGN_BLOCKS (rgn) + b]); - deaths_in_region[rgn] = count_or_remove_death_notes (blocks, 1); + deaths_in_region[rgn] = count_or_remove_death_notes (blocks, 1); + } + sbitmap_free (blocks); } - - sbitmap_free (blocks); + else + count_or_remove_death_notes (NULL, 1); } /* The one entry point in this file. DUMP_FILE is the dump file for @@ -2916,39 +2930,50 @@ schedule_insns (dump_file) sbitmap_ones (large_region_blocks); blocks = sbitmap_alloc (n_basic_blocks); + sbitmap_zero (blocks); + /* Update life information. For regions consisting of multiple blocks + we've possibly done interblock scheduling that affects global liveness. + For regions consisting of single blocks we need to do only local + liveness. */ for (rgn = 0; rgn < nr_regions; rgn++) if (RGN_NR_BLOCKS (rgn) > 1) any_large_regions = 1; else { - sbitmap_zero (blocks); SET_BIT (blocks, rgn_bb_table[RGN_BLOCKS (rgn)]); RESET_BIT (large_region_blocks, rgn_bb_table[RGN_BLOCKS (rgn)]); - - /* Don't update reg info after reload, since that affects - regs_ever_live, which should not change after reload. */ - update_life_info (blocks, UPDATE_LIFE_LOCAL, - (reload_completed ? PROP_DEATH_NOTES - : PROP_DEATH_NOTES | PROP_REG_INFO)); - -#ifndef HAVE_conditional_execution - /* ??? REG_DEAD notes only exist for unconditional deaths. We need - a count of the conditional plus unconditional deaths for this to - work out. */ - /* In the single block case, the count of registers that died should - not have changed during the schedule. */ - if (count_or_remove_death_notes (blocks, 0) != deaths_in_region[rgn]) - abort (); -#endif } + /* Don't update reg info after reload, since that affects + regs_ever_live, which should not change after reload. */ + update_life_info (blocks, UPDATE_LIFE_LOCAL, + (reload_completed ? PROP_DEATH_NOTES + : PROP_DEATH_NOTES | PROP_REG_INFO)); if (any_large_regions) { update_life_info (large_region_blocks, UPDATE_LIFE_GLOBAL, PROP_DEATH_NOTES | PROP_REG_INFO); } + if (CHECK_DEAD_NOTES) + { + /* Remove all death notes from the subroutine. */ + for (rgn = 0; rgn < nr_regions; rgn++) + if (RGN_NR_BLOCKS (rgn) == 1) + { + int b; + + sbitmap_zero (blocks); + SET_BIT (blocks, rgn_bb_table[RGN_BLOCKS (rgn)]); + + if (deaths_in_region[rgn] + != count_or_remove_death_notes (blocks, 0)) + abort (); + } + free (deaths_in_region); + } + /* Reposition the prologue and epilogue notes in case we moved the prologue/epilogue insns. */ if (reload_completed) @@ -3001,7 +3026,5 @@ schedule_insns (dump_file) sbitmap_free (blocks); sbitmap_free (large_region_blocks); - - free (deaths_in_region); } #endif |