aboutsummaryrefslogtreecommitdiff
path: root/gcc/unroll.c
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1995-01-20 18:12:01 -0800
committerJim Wilson <wilson@gcc.gnu.org>1995-01-20 18:12:01 -0800
commit3fc347fa0d8064c6c7558648af4a51d1d476f834 (patch)
tree4d863102585eba6bd2323d9126410ea5c2142a4e /gcc/unroll.c
parentf415f7bed7fbb4d07a67879d2eddd1dc6e8fdc2a (diff)
downloadgcc-3fc347fa0d8064c6c7558648af4a51d1d476f834.zip
gcc-3fc347fa0d8064c6c7558648af4a51d1d476f834.tar.gz
gcc-3fc347fa0d8064c6c7558648af4a51d1d476f834.tar.bz2
(copy_loop_body): When check for shared address givs, use new same_insn field.
(copy_loop_body): When check for shared address givs, use new same_insn field. (find_splittable_givs): New variable v2. Scan givs to set new same_insn field. Use same_insn to indentify address givs to be shared. From-SVN: r8786
Diffstat (limited to 'gcc/unroll.c')
-rw-r--r--gcc/unroll.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/gcc/unroll.c b/gcc/unroll.c
index 787bda8..784e09a 100644
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -1547,8 +1547,7 @@ copy_loop_body (copy_start, copy_end, map, exit_label, last_iteration,
/* Check for shared address givs, and avoid
incrementing the shared psuedo reg more than
once. */
- if (! (tv != v && tv->insn == v->insn
- && tv->new_reg == v->new_reg))
+ if (! tv->same_insn)
{
/* tv->dest_reg may actually be a (PLUS (REG)
(CONST)) here, so we must call plus_constant
@@ -2449,11 +2448,19 @@ find_splittable_givs (bl, unroll_type, loop_start, loop_end, increment,
rtx increment;
int unroll_number;
{
- struct induction *v;
+ struct induction *v, *v2;
rtx final_value;
rtx tem;
int result = 0;
+ /* Scan the list of givs, and set the same_insn field when there are
+ multiple identical givs in the same insn. */
+ for (v = bl->giv; v; v = v->next_iv)
+ for (v2 = v->next_iv; v2; v2 = v2->next_iv)
+ if (v->insn == v2->insn && rtx_equal_p (v->new_reg, v2->new_reg)
+ && ! v2->same_insn)
+ v2->same_insn = v;
+
for (v = bl->giv; v; v = v->next_iv)
{
rtx giv_inc, value;
@@ -2629,14 +2636,13 @@ find_splittable_givs (bl, unroll_type, loop_start, loop_end, increment,
v->const_adjust = 0;
- if (v->same && v->same->insn == v->insn
- && v->new_reg == v->same->new_reg)
+ if (v->same_insn)
{
- v->dest_reg = v->same->dest_reg;
+ v->dest_reg = v->same_insn->dest_reg;
if (loop_dump_stream)
fprintf (loop_dump_stream,
- "Sharing address givs with reg %d\n",
- REGNO (v->dest_reg));
+ "Sharing address givs in insn %d\n",
+ INSN_UID (v->insn));
}
else if (unroll_type != UNROLL_COMPLETELY)
{