diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-07-23 14:08:12 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-07-23 14:08:12 +0000 |
commit | b08cd5843569977ca1c079e1dd269a55fdaa2995 (patch) | |
tree | 3dbb57e04c149a6d0f4908ed9c0351fc46670790 /gcc/gcse.c | |
parent | 4bfc3ff0532c344a3e605297432468d95e4e33c0 (diff) | |
download | gcc-b08cd5843569977ca1c079e1dd269a55fdaa2995.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44267 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r-- | gcc/gcse.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/gcc/gcse.c b/gcc/gcse.c index d9f106c27b8..7592204c11f 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -605,14 +605,14 @@ static void compute_cprop_data PARAMS ((void)); static void find_used_regs PARAMS ((rtx *, void *)); static int try_replace_reg PARAMS ((rtx, rtx, rtx)); static struct expr *find_avail_set PARAMS ((int, rtx)); -static int cprop_jump PARAMS ((rtx, rtx, rtx)); +static int cprop_jump PARAMS ((basic_block, rtx, rtx, rtx)); #ifdef HAVE_cc0 -static int cprop_cc0_jump PARAMS ((rtx, struct reg_use *, rtx)); +static int cprop_cc0_jump PARAMS ((basic_block, rtx, struct reg_use *, rtx)); #endif static void mems_conflict_for_gcse_p PARAMS ((rtx, rtx, void *)); static int load_killed_in_block_p PARAMS ((basic_block, int, rtx, int)); static void canon_list_insert PARAMS ((rtx, rtx, void *)); -static int cprop_insn PARAMS ((rtx, int)); +static int cprop_insn PARAMS ((basic_block, rtx, int)); static int cprop PARAMS ((int)); static int one_cprop_pass PARAMS ((int, int)); static void alloc_pre_mem PARAMS ((int, int)); @@ -4015,10 +4015,11 @@ find_avail_set (regno, insn) nonzero if a change was made. We know INSN has just a SET. */ static int -cprop_jump (insn, from, src) +cprop_jump (bb, insn, from, src) rtx insn; rtx from; rtx src; + basic_block bb; { rtx set = PATTERN (insn); rtx new = simplify_replace_rtx (SET_SRC (set), from, src); @@ -4059,6 +4060,7 @@ cprop_jump (insn, from, src) print_rtl (gcse_file, src); fprintf (gcse_file, "\n"); } + purge_dead_edges (bb); return 1; } @@ -4072,7 +4074,8 @@ cprop_jump (insn, from, src) Returns nonzero if a change was made. */ static int -cprop_cc0_jump (insn, reg_used, src) +cprop_cc0_jump (bb, insn, reg_used, src) + basic_block bb; rtx insn; struct reg_use *reg_used; rtx src; @@ -4083,7 +4086,7 @@ cprop_cc0_jump (insn, reg_used, src) rtx new_src = simplify_replace_rtx (SET_SRC (PATTERN (insn)), reg_used->reg_rtx, src); - if (! cprop_jump (jump, cc0_rtx, new_src)) + if (! cprop_jump (bb, jump, cc0_rtx, new_src)) return 0; /* If we succeeded, delete the cc0 setter. */ @@ -4099,7 +4102,8 @@ cprop_cc0_jump (insn, reg_used, src) The result is non-zero if a change was made. */ static int -cprop_insn (insn, alter_jumps) +cprop_insn (bb, insn, alter_jumps) + basic_block bb; rtx insn; int alter_jumps; { @@ -4183,7 +4187,7 @@ cprop_insn (insn, alter_jumps) && GET_CODE (insn) == JUMP_INSN && condjump_p (insn) && ! simplejump_p (insn)) - changed |= cprop_jump (insn, reg_used->reg_rtx, src); + changed |= cprop_jump (bb, insn, reg_used->reg_rtx, src); #ifdef HAVE_cc0 /* Similar code for machines that use a pair of CC0 setter and @@ -4252,7 +4256,7 @@ cprop (alter_jumps) insn = NEXT_INSN (insn)) if (INSN_P (insn)) { - changed |= cprop_insn (insn, alter_jumps); + changed |= cprop_insn (BASIC_BLOCK (bb), insn, alter_jumps); /* Keep track of everything modified by this insn. */ /* ??? Need to be careful w.r.t. mods done to INSN. Don't |