diff options
author | Jeffrey A Law <law@cygnus.com> | 1998-04-11 00:28:07 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1998-04-10 18:28:07 -0600 |
commit | c6a26dc45d18eb53a4e10b31e3514c4d2ae2208c (patch) | |
tree | 1b6526c46b39473c92ee7cd2b70a7e002cbcfd90 | |
parent | 112bd748e3ff5bc3ae7010d8f233056b5c278cfd (diff) | |
download | gcc-c6a26dc45d18eb53a4e10b31e3514c4d2ae2208c.zip gcc-c6a26dc45d18eb53a4e10b31e3514c4d2ae2208c.tar.gz gcc-c6a26dc45d18eb53a4e10b31e3514c4d2ae2208c.tar.bz2 |
cse.c (count_reg_usage): Correctly handle REG_NONNEG notes.
* cse.c (count_reg_usage): Correctly handle REG_NONNEG notes.
(delete_trivially_dead_insns): Renamed from delete_dead_from_cse.
* toplev.c (rest_of_compilation): Call delete_trivially_dead_insns
instead of delete_dead_from_cse. Also call delete_trivially_dead_insns
between loop optimization passes.
* rtl.h: Updated appropriately.
From-SVN: r19100
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cse.c | 12 | ||||
-rw-r--r-- | gcc/rtl.h | 2 | ||||
-rw-r--r-- | gcc/toplev.c | 13 |
4 files changed, 25 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1c15d1d..b002afa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +Sat Apr 11 01:24:28 1998 Jeffrey A Law (law@cygnus.com) + + * cse.c (count_reg_usage): Correctly handle REG_NONNEG notes. + (delete_trivially_dead_insns): Renamed from delete_dead_from_cse. + * toplev.c (rest_of_compilation): Call delete_trivially_dead_insns instead of delete_dead_from_cse. Also call delete_trivially_dead_insns + between loop optimization passes. + * rtl.h: Updated appropriately. + Fri Apr 10 22:28:32 1998 Jeffrey A Law (law@cygnus.com) Reinstall this patch from Jason. @@ -8731,7 +8731,7 @@ count_reg_usage (x, counts, dest, incr) case EXPR_LIST: case INSN_LIST: if (REG_NOTE_KIND (x) == REG_EQUAL - || GET_CODE (XEXP (x,0)) == USE) + || (REG_NOTE_KIND (x) != REG_NONNEG && GET_CODE (XEXP (x,0)) == USE)) count_reg_usage (XEXP (x, 0), counts, NULL_RTX, incr); count_reg_usage (XEXP (x, 1), counts, NULL_RTX, incr); return; @@ -8754,13 +8754,13 @@ count_reg_usage (x, counts, dest, incr) /* Scan all the insns and delete any that are dead; i.e., they store a register that is never used or they copy a register to itself. - This is used to remove insns made obviously dead by cse. It improves the - heuristics in loop since it won't try to move dead invariants out of loops - or make givs for dead quantities. The remaining passes of the compilation - are also sped up. */ + This is used to remove insns made obviously dead by cse, loop or other + optimizations. It improves the heuristics in loop since it won't try to + move dead invariants out of loops or make givs for dead quantities. The + remaining passes of the compilation are also sped up. */ void -delete_dead_from_cse (insns, nreg) +delete_trivially_dead_insns (insns, nreg) rtx insns; int nreg; { @@ -1115,7 +1115,7 @@ extern int read_skip_spaces PROTO ((FILE *)); /* In cse.c */ struct cse_basic_block_data; extern int rtx_cost PROTO ((rtx, enum rtx_code)); -extern void delete_dead_from_cse PROTO ((rtx, int)); +extern void delete_trivially_dead_insns PROTO ((rtx, int)); #ifdef BUFSIZ extern int cse_main PROTO ((rtx, int, int, FILE *)); #endif diff --git a/gcc/toplev.c b/gcc/toplev.c index 90cc6f4..b841b2c 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -3211,7 +3211,7 @@ rest_of_compilation (decl) TIMEVAR (cse_time, tem = cse_main (insns, max_reg_num (), 0, rtl_dump_file)); - TIMEVAR (cse_time, delete_dead_from_cse (insns, max_reg_num ())); + TIMEVAR (cse_time, delete_trivially_dead_insns (insns, max_reg_num ())); if (tem || optimize > 1) TIMEVAR (jump_time, jump_optimize (insns, 0, 0, 0)); @@ -3244,8 +3244,15 @@ rest_of_compilation (decl) loop_optimize (insns, rtl_dump_file, 0); - /* The regscan pass may not be necessary, but let's - be safe until we can prove otherwise. */ + + /* The first call to loop_optimize makes some instructions + trivially dead. We delete those instructions now in the + hope that doing so will make the heuristics in loop work + better and possibly speed up compilation. */ + delete_trivially_dead_insns (insns, max_reg_num ()); + + /* The regscan pass is currently necessary as the alias + analysis code depends on this information. */ reg_scan (insns, max_reg_num (), 1); } loop_optimize (insns, rtl_dump_file, flag_unroll_loops); |