This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
patch checked into loop.c
- To: gcc-patches at gcc dot gnu dot org
- Subject: patch checked into loop.c
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Thu, 19 Aug 1999 00:00:11 +0100 (BST)
- Cc: amylaar at cygnus dot co dot uk
Reviewed by Mark Mitchell.
(I have posted this patch before, but it's quite some time ago, so you
may or may not have received the patch already.)
Wed Aug 18 23:31:57 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
* loop.c (recombine_givs): Set ix field after sorting.
(recombine_givs): Remove bogus index / giv lockstep looping.
Index: loop.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/loop.c,v
retrieving revision 1.171
diff -p -r1.171 loop.c
*** loop.c 1999/08/09 13:59:46 1.171
--- loop.c 1999/08/18 22:33:31
*************** recombine_givs (bl, loop_start, loop_end
*** 7218,7233 ****
for (p = v->insn; INSN_UID (p) >= max_uid_for_loop; )
p = PREV_INSN (p);
stats[i].start_luid = INSN_LUID (p);
- v->ix = i;
i++;
}
qsort (stats, giv_count, sizeof(*stats), cmp_recombine_givs_stats);
! /* Do the actual most-recently-used recombination. */
for (last_giv = 0, i = giv_count - 1; i >= 0; i--)
{
v = giv_array[stats[i].giv_number];
if (v->same)
{
struct induction *old_same = v->same;
--- 7218,7235 ----
for (p = v->insn; INSN_UID (p) >= max_uid_for_loop; )
p = PREV_INSN (p);
stats[i].start_luid = INSN_LUID (p);
i++;
}
qsort (stats, giv_count, sizeof(*stats), cmp_recombine_givs_stats);
! /* Set up the ix field for each giv in stats to name
! the corresponding index into stats, and
! do the actual most-recently-used recombination. */
for (last_giv = 0, i = giv_count - 1; i >= 0; i--)
{
v = giv_array[stats[i].giv_number];
+ v->ix = i;
if (v->same)
{
struct induction *old_same = v->same;
*************** recombine_givs (bl, loop_start, loop_end
*** 7273,7280 ****
ends_need_computing = 0;
/* For each DEST_REG giv, compute lifetime starts, and try to compute
lifetime ends from regscan info. */
! for (i = 0, v = bl->giv; v; v = v->next_iv)
{
if (v->ignore)
continue;
if (v->giv_type == DEST_ADDR)
--- 7275,7283 ----
ends_need_computing = 0;
/* For each DEST_REG giv, compute lifetime starts, and try to compute
lifetime ends from regscan info. */
! for (i = giv_count - 1; i >= 0; i--)
{
+ v = giv_array[stats[i].giv_number];
if (v->ignore)
continue;
if (v->giv_type == DEST_ADDR)
*************** recombine_givs (bl, loop_start, loop_end
*** 7343,7349 ****
}
}
}
- i++;
}
/* If the regscan information was unconclusive for one or more DEST_REG
--- 7346,7351 ----
*************** recombine_givs (bl, loop_start, loop_end
*** 7367,7387 ****
/* Set start_luid back to the last insn that sets the giv. This allows
more combinations. */
! for (i = 0, v = bl->giv; v; v = v->next_iv)
{
if (v->ignore)
continue;
if (INSN_UID (v->insn) < max_uid_for_loop)
stats[i].start_luid = INSN_LUID (v->insn);
- i++;
}
/* Now adjust lifetime ends by taking combined givs into account. */
! for (i = 0, v = bl->giv; v; v = v->next_iv)
{
unsigned luid;
int j;
if (v->ignore)
continue;
if (v->same && ! v->same->ignore)
--- 7369,7390 ----
/* Set start_luid back to the last insn that sets the giv. This allows
more combinations. */
! for (i = giv_count - 1; i >= 0; i--)
{
+ v = giv_array[stats[i].giv_number];
if (v->ignore)
continue;
if (INSN_UID (v->insn) < max_uid_for_loop)
stats[i].start_luid = INSN_LUID (v->insn);
}
/* Now adjust lifetime ends by taking combined givs into account. */
! for (i = giv_count - 1; i >= 0; i--)
{
unsigned luid;
int j;
+ v = giv_array[stats[i].giv_number];
if (v->ignore)
continue;
if (v->same && ! v->same->ignore)
*************** recombine_givs (bl, loop_start, loop_end
*** 7393,7399 ****
> (unsigned) stats[j].end_luid - stats[j].start_luid)
stats[j].end_luid = luid;
}
- i++;
}
qsort (stats, giv_count, sizeof(*stats), cmp_recombine_givs_stats);
--- 7396,7401 ----