Commit 1b786838 by J"orn Rennecke Committed by Joern Rennecke

loop.c (strength_reduce): Insert sets of derived givs at every biv increment,…

loop.c (strength_reduce): Insert sets of derived givs at every biv increment, even if it's the only one.

	* loop.c (strength_reduce): Insert sets of derived givs at every
	biv increment, even if it's the only one.

From-SVN: r27549
parent 4e61a969
Wed Jun 16 19:44:33 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
* loop.c (strength_reduce): Insert sets of derived givs at every
biv increment, even if it's the only one.
Wed Jun 16 10:33:02 1999 Jason Merrill <jason@yorick.cygnus.com> Wed Jun 16 10:33:02 1999 Jason Merrill <jason@yorick.cygnus.com>
* dwarfout.c (add_incomplete_type): New fn. * dwarfout.c (add_incomplete_type): New fn.
......
...@@ -4768,21 +4768,29 @@ strength_reduce (scan_start, end, loop_top, insn_count, ...@@ -4768,21 +4768,29 @@ strength_reduce (scan_start, end, loop_top, insn_count,
= replace_rtx (PATTERN (v->insn), d->dest_reg, d->new_reg); = replace_rtx (PATTERN (v->insn), d->dest_reg, d->new_reg);
PATTERN (v->insn) PATTERN (v->insn)
= replace_rtx (PATTERN (v->insn), v->dest_reg, v->new_reg); = replace_rtx (PATTERN (v->insn), v->dest_reg, v->new_reg);
if (bl->biv_count != 1) /* For each place where the biv is incremented, add an
insn to set the new, reduced reg for the giv.
We used to do this only for biv_count != 1, but
this fails when there is a giv after a single biv
increment, e.g. when the last giv was expressed as
pre-decrement. */
for (tv = bl->biv; tv; tv = tv->next_iv)
{ {
/* For each place where the biv is incremented, add an /* We always emit reduced giv increments before the
insn to set the new, reduced reg for the giv. */ biv increment when bl->biv_count != 1. So by
for (tv = bl->biv; tv; tv = tv->next_iv) emitting the add insns for derived givs after the
{ biv increment, they pick up the updated value of
/* We always emit reduced giv increments before the the reduced giv.
biv increment when bl->biv_count != 1. So by If the reduced giv is processed with
emitting the add insns for derived givs after the auto_inc_opt == 1, then it is incremented earlier
biv increment, they pick up the updated value of than the biv, hence we'll still pick up the right
the reduced giv. */ value.
emit_insn_after (copy_rtx (PATTERN (v->insn)), If it's processed with auto_inc_opt == -1,
tv->insn); that implies that the biv increment is before the
first reduced giv's use. The derived giv's lifetime
} is after the reduced giv's lifetime, hence in this
case, the biv increment doesn't matter. */
emit_insn_after (copy_rtx (PATTERN (v->insn)), tv->insn);
} }
continue; continue;
} }
......
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