diff options
author | Richard Henderson <rth@cygnus.com> | 1999-10-10 16:34:17 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 1999-10-10 16:34:17 -0700 |
commit | 715e7fbc831af02e80acc60be2fa19208ab62dfc (patch) | |
tree | ba7b0b84a68f9ed2f41f5b4352349cfa71aae6ad /gcc/combine.c | |
parent | 07b983cd7142b619b990d572a89a3370ae12f7a6 (diff) | |
download | gcc-715e7fbc831af02e80acc60be2fa19208ab62dfc.zip gcc-715e7fbc831af02e80acc60be2fa19208ab62dfc.tar.gz gcc-715e7fbc831af02e80acc60be2fa19208ab62dfc.tar.bz2 |
combine.c (refresh_blocks, [...]): New.
* combine.c (refresh_blocks, need_refresh): New.
(combine_instructions): Allocate refresh_blocks. Invoke
update_life_info if needed.
(distribute_notes): Mark refresh_blocks instead of installing
USE insns.
* flow.c (update_life_info): Remove notes if GLOBAL_RM_NOTES.
* basic_block.h (enum update_life_extent): Add GLOBAL_RM_NOTES.
* Makefile.in (recog.o): Depend on basic-block.h.
From-SVN: r29893
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 0e634ae..c63bf39 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -196,6 +196,12 @@ static rtx added_links_insn; /* Basic block number of the block in which we are performing combines. */ static int this_basic_block; + +/* A bitmap indicating which blocks had registers go dead at entry. + After combine, we'll need to re-do global life analysis with + those blocks as starting points. */ +static sbitmap refresh_blocks; +static int need_refresh; /* The next group of arrays allows the recording of the last value assigned to (hard or pseudo) register n. We use this information to see if a @@ -551,6 +557,10 @@ combine_instructions (f, nregs) setup_incoming_promotions (); + refresh_blocks = sbitmap_alloc (n_basic_blocks); + sbitmap_zero (refresh_blocks); + need_refresh = 0; + for (insn = f, i = 0; insn; insn = NEXT_INSN (insn)) { uid_cuid[INSN_UID (insn)] = ++i; @@ -685,6 +695,10 @@ combine_instructions (f, nregs) } } + if (need_refresh) + update_life_info (refresh_blocks, UPDATE_LIFE_GLOBAL_RM_NOTES); + sbitmap_free (refresh_blocks); + total_attempts += combine_attempts; total_merges += combine_merges; total_extras += combine_extras; @@ -11858,30 +11872,15 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1) /* We haven't found an insn for the death note and it is still a REG_DEAD note, but we have hit the beginning of the block. If the existing life info says the reg - was dead, there's nothing left to do. - - ??? If the register was live, we ought to mark for later - global life update. Cop out like the previous code and - just add a hook for the death note to live on. */ + was dead, there's nothing left to do. Otherwise, we'll + need to do a global life update after combine. */ if (REG_NOTE_KIND (note) == REG_DEAD && place == 0) { int regno = REGNO (XEXP (note, 0)); - if (REGNO_REG_SET_P (bb->global_live_at_start, regno)) { - rtx die = gen_rtx_USE (VOIDmode, XEXP (note, 0)); - - place = bb->head; - if (GET_CODE (place) != CODE_LABEL - && GET_CODE (place) != NOTE) - { - place = emit_insn_before (die, place); - bb->head = place; - } - else - { - place = emit_insn_after (die, place); - } + SET_BIT (refresh_blocks, this_basic_block); + need_refresh = 1; } } } |