Commit 0aa487d5 by J"orn Rennecke Committed by Joern Rennecke

loop.c (recombine_givs): Set ix field after sorting.

	* loop.c (recombine_givs): Set ix field after sorting.
	(recombine_givs): Remove bogus index / giv lockstep looping.

From-SVN: r28757
parent dfe2b0b3
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.
Wed Aug 18 18:20:40 1999 Bernd Schmidt <bernds@cygnus.co.uk> Wed Aug 18 18:20:40 1999 Bernd Schmidt <bernds@cygnus.co.uk>
* expmed.c (emit_store_flag): If UNSIGNEDP, call unsigned_condition * expmed.c (emit_store_flag): If UNSIGNEDP, call unsigned_condition
......
...@@ -7218,16 +7218,18 @@ recombine_givs (bl, loop_start, loop_end, unroll_p) ...@@ -7218,16 +7218,18 @@ recombine_givs (bl, loop_start, loop_end, unroll_p)
for (p = v->insn; INSN_UID (p) >= max_uid_for_loop; ) for (p = v->insn; INSN_UID (p) >= max_uid_for_loop; )
p = PREV_INSN (p); p = PREV_INSN (p);
stats[i].start_luid = INSN_LUID (p); stats[i].start_luid = INSN_LUID (p);
v->ix = i;
i++; i++;
} }
qsort (stats, giv_count, sizeof(*stats), cmp_recombine_givs_stats); qsort (stats, giv_count, sizeof(*stats), cmp_recombine_givs_stats);
/* Do the actual most-recently-used recombination. */ /* 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--) for (last_giv = 0, i = giv_count - 1; i >= 0; i--)
{ {
v = giv_array[stats[i].giv_number]; v = giv_array[stats[i].giv_number];
v->ix = i;
if (v->same) if (v->same)
{ {
struct induction *old_same = v->same; struct induction *old_same = v->same;
...@@ -7273,8 +7275,9 @@ recombine_givs (bl, loop_start, loop_end, unroll_p) ...@@ -7273,8 +7275,9 @@ recombine_givs (bl, loop_start, loop_end, unroll_p)
ends_need_computing = 0; ends_need_computing = 0;
/* For each DEST_REG giv, compute lifetime starts, and try to compute /* For each DEST_REG giv, compute lifetime starts, and try to compute
lifetime ends from regscan info. */ lifetime ends from regscan info. */
for (i = 0, v = bl->giv; v; v = v->next_iv) for (i = giv_count - 1; i >= 0; i--)
{ {
v = giv_array[stats[i].giv_number];
if (v->ignore) if (v->ignore)
continue; continue;
if (v->giv_type == DEST_ADDR) if (v->giv_type == DEST_ADDR)
...@@ -7343,7 +7346,6 @@ recombine_givs (bl, loop_start, loop_end, unroll_p) ...@@ -7343,7 +7346,6 @@ recombine_givs (bl, loop_start, loop_end, unroll_p)
} }
} }
} }
i++;
} }
/* If the regscan information was unconclusive for one or more DEST_REG /* If the regscan information was unconclusive for one or more DEST_REG
...@@ -7367,21 +7369,22 @@ recombine_givs (bl, loop_start, loop_end, unroll_p) ...@@ -7367,21 +7369,22 @@ recombine_givs (bl, loop_start, loop_end, unroll_p)
/* Set start_luid back to the last insn that sets the giv. This allows /* Set start_luid back to the last insn that sets the giv. This allows
more combinations. */ more combinations. */
for (i = 0, v = bl->giv; v; v = v->next_iv) for (i = giv_count - 1; i >= 0; i--)
{ {
v = giv_array[stats[i].giv_number];
if (v->ignore) if (v->ignore)
continue; continue;
if (INSN_UID (v->insn) < max_uid_for_loop) if (INSN_UID (v->insn) < max_uid_for_loop)
stats[i].start_luid = INSN_LUID (v->insn); stats[i].start_luid = INSN_LUID (v->insn);
i++;
} }
/* Now adjust lifetime ends by taking combined givs into account. */ /* Now adjust lifetime ends by taking combined givs into account. */
for (i = 0, v = bl->giv; v; v = v->next_iv) for (i = giv_count - 1; i >= 0; i--)
{ {
unsigned luid; unsigned luid;
int j; int j;
v = giv_array[stats[i].giv_number];
if (v->ignore) if (v->ignore)
continue; continue;
if (v->same && ! v->same->ignore) if (v->same && ! v->same->ignore)
...@@ -7393,7 +7396,6 @@ recombine_givs (bl, loop_start, loop_end, unroll_p) ...@@ -7393,7 +7396,6 @@ recombine_givs (bl, loop_start, loop_end, unroll_p)
> (unsigned) stats[j].end_luid - stats[j].start_luid) > (unsigned) stats[j].end_luid - stats[j].start_luid)
stats[j].end_luid = luid; stats[j].end_luid = luid;
} }
i++;
} }
qsort (stats, giv_count, sizeof(*stats), cmp_recombine_givs_stats); qsort (stats, giv_count, sizeof(*stats), cmp_recombine_givs_stats);
......
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