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. */
+ /* 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;
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)
+ 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)
}
}
}
- i++;
}
/* If the regscan information was unconclusive for one or more DEST_REG
/* 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)
+ 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);
- i++;
}
/* 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;
int j;
+ v = giv_array[stats[i].giv_number];
if (v->ignore)
continue;
if (v->same && ! v->same->ignore)
> (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);