Commit 2f9ba5a9 by Jeff Law

reorg.c (fill_simple_delay_slots): Always try to fill empty delay slots with…

reorg.c (fill_simple_delay_slots): Always try to fill empty delay slots with insns from beyond the delay insn...

	* reorg.c (fill_simple_delay_slots): Always try to fill empty
	delay slots with insns from beyond the delay insn, even if
	optimize_skip was attempted.
	(fill_simple_delay_slots): When filling with insns from after the
	delay insn, make sure to always account for sets and references
	in the delay insn.

From-SVN: r1931
parent 415f583e
...@@ -2342,14 +2342,12 @@ fill_simple_delay_slots (first, non_jumps_p) ...@@ -2342,14 +2342,12 @@ fill_simple_delay_slots (first, non_jumps_p)
mark_referenced_resources (trial, &needed, 1); mark_referenced_resources (trial, &needed, 1);
} }
if (slots_filled == slots_to_fill)
/* happy. */ ;
/* If all needed slots haven't been filled, we come here. */ /* If all needed slots haven't been filled, we come here. */
/* Try to optimize case of jumping around a single insn. */ /* Try to optimize case of jumping around a single insn. */
#if defined(ANNUL_IFFALSE_SLOTS) || defined(ANNUL_IFTRUE_SLOTS) #if defined(ANNUL_IFFALSE_SLOTS) || defined(ANNUL_IFTRUE_SLOTS)
else if (delay_list == 0 if (slots_filled != slots_to_fill
&& delay_list == 0
&& GET_CODE (insn) == JUMP_INSN && condjump_p (insn)) && GET_CODE (insn) == JUMP_INSN && condjump_p (insn))
{ {
delay_list = optimize_skip (insn); delay_list = optimize_skip (insn);
...@@ -2382,9 +2380,10 @@ fill_simple_delay_slots (first, non_jumps_p) ...@@ -2382,9 +2380,10 @@ fill_simple_delay_slots (first, non_jumps_p)
later unconditional jump branches to. In that case, we don't later unconditional jump branches to. In that case, we don't
care about the number of uses of our label. */ care about the number of uses of our label. */
else if (GET_CODE (insn) != JUMP_INSN if (slots_filled != slots_to_fill
&& (GET_CODE (insn) != JUMP_INSN
|| (condjump_p (insn) && ! simplejump_p (insn) || (condjump_p (insn) && ! simplejump_p (insn)
&& JUMP_LABEL (insn) != 0)) && JUMP_LABEL (insn) != 0)))
{ {
rtx target = 0; rtx target = 0;
int maybe_never = 0; int maybe_never = 0;
...@@ -2401,7 +2400,11 @@ fill_simple_delay_slots (first, non_jumps_p) ...@@ -2401,7 +2400,11 @@ fill_simple_delay_slots (first, non_jumps_p)
mark_referenced_resources (insn, &needed, 1); mark_referenced_resources (insn, &needed, 1);
maybe_never = 1; maybe_never = 1;
} }
else if (GET_CODE (insn) == JUMP_INSN) else
{
mark_set_resources (insn, &set, 0, 0);
mark_referenced_resources (insn, &needed, 0);
if (GET_CODE (insn) == JUMP_INSN)
{ {
/* Get our target and show how many more uses we want to /* Get our target and show how many more uses we want to
see before we hit the label. */ see before we hit the label. */
...@@ -2409,6 +2412,8 @@ fill_simple_delay_slots (first, non_jumps_p) ...@@ -2409,6 +2412,8 @@ fill_simple_delay_slots (first, non_jumps_p)
target_uses = LABEL_NUSES (target) - 1; target_uses = LABEL_NUSES (target) - 1;
} }
}
for (trial = next_nonnote_insn (insn); trial; trial = next_trial) for (trial = next_nonnote_insn (insn); trial; trial = next_trial)
{ {
rtx pat, trial_delay; rtx pat, trial_delay;
......
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