diff options
author | Jan Hubicka <jh@suse.cz> | 2001-07-23 16:08:12 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2001-07-23 14:08:12 +0000 |
commit | 0005550b5832aa6f0a3d7f343319c6b5b327dde8 (patch) | |
tree | 3dbb57e04c149a6d0f4908ed9c0351fc46670790 /gcc/combine.c | |
parent | 4edc91ae51a40b656c11d7dffbe74692be8d755e (diff) | |
download | gcc-0005550b5832aa6f0a3d7f343319c6b5b327dde8.zip gcc-0005550b5832aa6f0a3d7f343319c6b5b327dde8.tar.gz gcc-0005550b5832aa6f0a3d7f343319c6b5b327dde8.tar.bz2 |
basic-block.h (find_sub_basic_block): Declare.
* basic-block.h (find_sub_basic_block): Declare.
* flow.c (make_edges): New arguments MIN and MAX;
(find_sub_basic_blocks): Revamp to use make_edges
and purge_dead_edges.
(find_basic_blocks): Update call of find_sub_basic_block.
* recog.c (split_all_insns): Always expect CFG to be consistent;
call find_sub_basic_blocks in case something has changed.
* toplev.c (rest_of_compilation): Always call split_all_insns once CFG
has been built.
* basic-block.h (delete_noop_moves): Declare.
* combine.c (combine_instructions): Call it.
(recog_for_combine): Tolerate noop moves
(distribute_notes): Force refresh when register dies at noop move.
* flow.c (delete_noop_moves): Use BB structure; delete JUMP insns
too.
(life_analysis): Update delete_noop_moves call.
(set_noop_p): Move too ...
* rtlanal.c (noop_move_p): ... here.
* rtl.h (noop_move_p): Declare.
* basic-block.h (purge_all_dead_edges, purge_dead_edges): New functions.
* toplev.c (rest_of_compilation): Conditionally call purge_all_dead_edges
after combine.
* gcse.c (cprop_cc0_jump, cprop_insn): New argument "basic_block".
(cprop_jump): Likewise; call purge_dead_edges if substitution suceeded.
From-SVN: r44267
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 724e9ef..633d0ac 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -713,6 +713,8 @@ combine_instructions (f, nregs) } } + delete_noop_moves (f); + if (need_refresh) { compute_bb_for_insn (get_max_uid ()); @@ -9598,8 +9600,12 @@ recog_for_combine (pnewpat, insn, pnotes) old_notes = REG_NOTES (insn); REG_NOTES (insn) = 0; - /* Is the result of combination a valid instruction? */ - insn_code_number = recog (pat, insn, &num_clobbers_to_add); + /* Is the result of combination a valid instruction? + Recognize all noop sets, these will be killed by followup pass. */ + if (GET_CODE (pat) == SET && set_noop_p (pat)) + insn_code_number = INT_MAX; + else + insn_code_number = recog (pat, insn, &num_clobbers_to_add); /* If it isn't, there is the possibility that we previously had an insn that clobbered some register as a side effect, but the combined @@ -9624,7 +9630,11 @@ recog_for_combine (pnewpat, insn, pnotes) if (pos == 1) pat = XVECEXP (pat, 0, 0); - insn_code_number = recog (pat, insn, &num_clobbers_to_add); + /* Recognize all noop sets, these will be killed by followup pass. */ + if (GET_CODE (pat) == SET && set_noop_p (pat)) + insn_code_number = INT_MAX; + else + insn_code_number = recog (pat, insn, &num_clobbers_to_add); } REG_NOTES (insn) = old_notes; @@ -12325,10 +12335,16 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1) 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. Otherwise, we'll - need to do a global life update after combine. */ - if (REG_NOTE_KIND (note) == REG_DEAD && place == 0 - && REGNO_REG_SET_P (bb->global_live_at_start, - REGNO (XEXP (note, 0)))) + need to do a global life update after combine. + + Similary we need to update in case insn is an dead set + we are about to remove soon. + */ + if (REG_NOTE_KIND (note) == REG_DEAD + && ((place && noop_move_p (place)) + || (place == 0 + && REGNO_REG_SET_P (bb->global_live_at_start, + REGNO (XEXP (note, 0)))))) { SET_BIT (refresh_blocks, this_basic_block); need_refresh = 1; |