Commit c6a26dc4 by Jeffrey A Law Committed by Jeff Law

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
parent 112bd748
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
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment