Commit 7221f080 by J"orn Rennecke Committed by Joern Rennecke

(recombine_givs): Don't use a giv that's likely to be dead to derive others.

	* (recombine_givs): Don't use a giv that's likely to be dead to
	derive others.
	* loop.c (recombine_givs): Fix test for lifetime overlaps / loop
	wrap around when deriving givs.

From-SVN: r24967
parent e77dbc56
Tue Feb 2 19:48:29 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
* (recombine_givs): Don't use a giv that's likely to be dead to
derive others.
* loop.c (recombine_givs): Fix test for lifetime overlaps / loop
wrap around when deriving givs.
Mon Feb 1 20:00:40 1999 Richard Henderson <rth@cygnus.com> Mon Feb 1 20:00:40 1999 Richard Henderson <rth@cygnus.com>
* recog.c (check_asm_operands): Treat indeterminate operand ok * recog.c (check_asm_operands): Treat indeterminate operand ok
......
...@@ -7293,16 +7293,28 @@ recombine_givs (bl, loop_start, loop_end, unroll_p) ...@@ -7293,16 +7293,28 @@ recombine_givs (bl, loop_start, loop_end, unroll_p)
continue; continue;
if (! last_giv) if (! last_giv)
{ {
last_giv = v; /* Don't use a giv that's likely to be dead to derive
life_start = stats[i].start_luid; others - that would be likely to keep that giv alive. */
life_end = stats[i].end_luid; if (! v->maybe_dead || v->combined_with)
{
last_giv = v;
life_start = stats[i].start_luid;
life_end = stats[i].end_luid;
}
continue; continue;
} }
/* Use unsigned arithmetic to model loop wrap around. */ /* Use unsigned arithmetic to model loop wrap around. */
if (((unsigned) stats[i].start_luid - life_start if (((unsigned) stats[i].start_luid - life_start
>= (unsigned) life_end - life_start) >= (unsigned) life_end - life_start)
&& ((unsigned) stats[i].end_luid - life_start && ((unsigned) stats[i].end_luid - life_start
>= (unsigned) life_end - life_start) > (unsigned) life_end - life_start)
/* Check that the giv insn we're about to use for deriving
precedes all uses of that giv. Note that initializing the
derived giv would defeat the purpose of reducing register
pressure.
??? We could arrange to move the insn. */
&& ((unsigned) stats[i].end_luid - INSN_LUID (loop_start)
> (unsigned) stats[i].start_luid - INSN_LUID (loop_start))
&& rtx_equal_p (last_giv->mult_val, v->mult_val) && rtx_equal_p (last_giv->mult_val, v->mult_val)
/* ??? Could handle libcalls, but would need more logic. */ /* ??? Could handle libcalls, but would need more logic. */
&& ! find_reg_note (v->insn, REG_RETVAL, NULL_RTX) && ! find_reg_note (v->insn, REG_RETVAL, NULL_RTX)
...@@ -7312,7 +7324,11 @@ recombine_givs (bl, loop_start, loop_end, unroll_p) ...@@ -7312,7 +7324,11 @@ recombine_givs (bl, loop_start, loop_end, unroll_p)
don't have this detailed control flow information. don't have this detailed control flow information.
N.B. since last_giv will be reduced, it is valid N.B. since last_giv will be reduced, it is valid
anywhere in the loop, so we don't need to check the anywhere in the loop, so we don't need to check the
validity of last_giv. */ validity of last_giv.
We rely here on the fact that v->always_executed implies that
there is no jump to someplace else in the loop before the
giv insn, and hence any insn that is executed before the
giv insn in the loop will have a lower luid. */
&& (v->always_executed || ! v->combined_with) && (v->always_executed || ! v->combined_with)
&& (sum = express_from (last_giv, v)) && (sum = express_from (last_giv, v))
/* Make sure we don't make the add more expensive. ADD_COST /* Make sure we don't make the add more expensive. ADD_COST
......
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