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/rtlanal.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/rtlanal.c')
-rw-r--r-- | gcc/rtlanal.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 2f9696cc1fc..c9152ab0f8e 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -1020,6 +1020,45 @@ set_noop_p (set) return (GET_CODE (src) == REG && GET_CODE (dst) == REG && REGNO (src) == REGNO (dst)); } + +/* Return nonzero if an insn consists only of SETs, each of which only sets a + value to itself. */ + +int +noop_move_p (insn) + rtx insn; +{ + rtx pat = PATTERN (insn); + + /* Insns carrying these notes are useful later on. */ + if (find_reg_note (insn, REG_EQUAL, NULL_RTX)) + return 0; + + if (GET_CODE (pat) == SET && set_noop_p (pat)) + return 1; + + if (GET_CODE (pat) == PARALLEL) + { + int i; + /* If nothing but SETs of registers to themselves, + this insn can also be deleted. */ + for (i = 0; i < XVECLEN (pat, 0); i++) + { + rtx tem = XVECEXP (pat, 0, i); + + if (GET_CODE (tem) == USE + || GET_CODE (tem) == CLOBBER) + continue; + + if (GET_CODE (tem) != SET || ! set_noop_p (tem)) + return 0; + } + + return 1; + } + return 0; +} + /* Return the last thing that X was assigned from before *PINSN. If VALID_TO is not NULL_RTX then verify that the object is not modified up to VALID_TO. |