diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-04-24 08:23:08 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-04-24 08:23:08 +0000 |
commit | 2cbea1dc8a8cd9862b787628d0b420ffb510929e (patch) | |
tree | 05b581c0420b15c7150120e112621f282ac4f44b | |
parent | f3fe93b08b0892aaed78b91ab75dad84f7d4adb7 (diff) | |
download | gcc-2cbea1dc8a8cd9862b787628d0b420ffb510929e.tar.gz |
* loop.c (strength_reduce): Simplify test to INSN_P.
(record_giv): Attempt to simplify the add value, use CONSTANT_P
expressions instead of CONST_INT.
(express_from_1): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33375 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/loop.c | 29 |
2 files changed, 26 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 935f71d8902..253a559d8ab 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +Mon Apr 24 10:19:48 MET DST 2000 Jan Hubicka <jh@suse.cz> + + * loop.c (strength_reduce): Simplify test to INSN_P. + (record_giv): Attempt to simplify the add value, use CONSTANT_P + expressions instead of CONST_INT. + (express_from_1): Likewise. + 2000-04-24 Mark Mitchell <mark@codesourcery.com> * regs.h (reg_n_max): Don't declare. diff --git a/gcc/loop.c b/gcc/loop.c index 7d7151ee1f6..3a9398824ec 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -3977,8 +3977,7 @@ strength_reduce (loop, insn_count, unroll_p, bct_p) if (GET_CODE (p) == CALL_INSN) call_seen = 1; - if (GET_CODE (p) == INSN || GET_CODE (p) == JUMP_INSN - || GET_CODE (p) == CALL_INSN) + if (INSN_P (p)) note_stores (PATTERN (p), record_initial, NULL); /* Record any test of a biv that branches around the loop if no store @@ -4124,13 +4123,13 @@ strength_reduce (loop, insn_count, unroll_p, bct_p) for (next = NEXT_INSN (dominator); ; next = NEXT_INSN (next)) { - if ((GET_RTX_CLASS (GET_CODE (next)) == 'i' + if ((INSN_P (next) && (reg_mentioned_p (giv, PATTERN (next)) || reg_set_p (bl2->biv->src_reg, next))) || GET_CODE (next) == JUMP_INSN) break; #ifdef HAVE_cc0 - if (GET_RTX_CLASS (GET_CODE (next)) != 'i' + if (INSN_P (next) || ! sets_cc0_p (PATTERN (next))) #endif dominator = next; @@ -4283,7 +4282,7 @@ strength_reduce (loop, insn_count, unroll_p, bct_p) p != next->insn; p = next_insn_in_loop (loop, p)) { - if (GET_RTX_CLASS (GET_CODE (p)) != 'i') + if (!INSN_P (p)) continue; if (reg_mentioned_p (old_reg, PATTERN (p))) { @@ -5445,6 +5444,12 @@ record_giv (loop, v, insn, src_reg, dest_reg, mult_val, add_val, benefit, struct induction *b; struct iv_class *bl; rtx set = single_set (insn); + rtx temp; + + /* Attempt to prove constantness of the values. */ + temp = simplify_rtx (add_val); + if (temp) + add_val = temp; v->insn = insn; v->src_reg = src_reg; @@ -5603,11 +5608,11 @@ record_giv (loop, v, insn, src_reg, dest_reg, mult_val, add_val, benefit, v->no_const_addval = 1; if (tem == const0_rtx) ; - else if (GET_CODE (tem) == CONST_INT) + else if (CONSTANT_P (add_val)) v->no_const_addval = 0; - else if (GET_CODE (tem) == PLUS) + if (GET_CODE (tem) == PLUS) { - while (1) + while (1) { if (GET_CODE (XEXP (tem, 0)) == PLUS) tem = XEXP (tem, 0); @@ -5616,8 +5621,8 @@ record_giv (loop, v, insn, src_reg, dest_reg, mult_val, add_val, benefit, else break; } - if (GET_CODE (XEXP (tem, 1)) == CONST_INT) - v->no_const_addval = 0; + if (CONSTANT_P (XEXP (tem, 1))) + v->no_const_addval = 0; } } @@ -6869,6 +6874,10 @@ express_from_1 (a, b, mult) { return plus_constant (b, -INTVAL (a) * INTVAL (mult)); } + else if (CONSTANT_P (a)) + { + return simplify_gen_binary (MINUS, GET_MODE (b), const0_rtx, a); + } else if (GET_CODE (b) == PLUS) { if (rtx_equal_p (a, XEXP (b, 0))) |