diff options
author | Jeffrey A Law <law@cygnus.com> | 1998-09-30 17:32:15 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1998-09-30 11:32:15 -0600 |
commit | c5cbf81ecfef4b9a54e05a26d1ca9c37cb012a32 (patch) | |
tree | 5652067c84539e9918286170e9ff82d98cecd1ef /gcc | |
parent | c1daea12d528ddc803fe5710aaade0767abbe661 (diff) | |
download | gcc-c5cbf81ecfef4b9a54e05a26d1ca9c37cb012a32.zip gcc-c5cbf81ecfef4b9a54e05a26d1ca9c37cb012a32.tar.gz gcc-c5cbf81ecfef4b9a54e05a26d1ca9c37cb012a32.tar.bz2 |
loop.c (check_dbra_loop): Use a vanilla loop reversal if the biv is used to compute a giv or as some...
* loop.c (check_dbra_loop): Use a vanilla loop reversal if the biv is
used to compute a giv or as some other non-counting use.
From-SVN: r22684
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/loop.c | 12 |
2 files changed, 14 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5e224d7..81faece 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Wed Sep 30 18:29:26 1998 Jeffrey A Law (law@cygnus.com) + + * loop.c (check_dbra_loop): Use a vanilla loop reversal if the biv is + used to compute a giv or as some other non-counting use. + Wed Sep 30 18:19:27 1998 Michael Hayes <m.hayes@elec.canterbury.ac.nz> * regs.h (HARD_REGNO_CALLER_SAVE_MODE): New macro. @@ -6992,9 +6992,13 @@ check_dbra_loop (loop_end, insn_count, loop_start) if (initial_value == const0_rtx /* If we have a decrement_and_branch_on_count, prefer the NE test, since this will allow that instruction to - be generated. */ + be generated. Note that we must use a vanilla loop + reversal if the biv is used to calculate a giv or has + a non-counting use. */ #if ! defined (HAVE_decrement_and_branch_until_zero) && defined (HAVE_decrement_and_branch_on_count) - && (add_val != 1 || ! vtop) + && (! (add_val == 1 && vtop + && (bl->biv_count == 0 + || no_use_except_counting))) #endif && GET_CODE (comparison_value) == CONST_INT /* Now do postponed overflow checks on COMPARISON_VAL. */ @@ -7007,7 +7011,9 @@ check_dbra_loop (loop_end, insn_count, loop_start) nonneg = 1; cmp_code = GE; } - else if (add_val == 1 && vtop) + else if (add_val == 1 && vtop + && (bl->biv_count == 0 + || no_use_except_counting)) { add_adjust = 0; cmp_code = NE; |