Commit 6382ae03 by Jim Wilson

(reemit_notes): New function.

(schedule_block): Call reemit_notes twice.  Reorganize code for
handling SCHED_GROUP_P insns, so that reemit_notes works.

From-SVN: r9814
parent 20b04867
...@@ -3103,6 +3103,33 @@ finish_sometimes_live (regs_sometimes_live, sometimes_max) ...@@ -3103,6 +3103,33 @@ finish_sometimes_live (regs_sometimes_live, sometimes_max)
} }
} }
/* Search INSN for fake REG_DEAD notes for NOTE_INSN_SETJMP,
NOTE_INSN_LOOP_BEG, and NOTE_INSN_LOOP_END; and convert them back
into NOTEs. LAST is the last instruction output by the instruction
scheduler. Return the new value of LAST. */
static rtx
reemit_notes (insn, last)
rtx insn;
rtx last;
{
rtx note;
for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
{
if (REG_NOTE_KIND (note) == REG_DEAD
&& GET_CODE (XEXP (note, 0)) == CONST_INT)
{
if (INTVAL (XEXP (note, 0)) == NOTE_INSN_SETJMP)
emit_note_after (INTVAL (XEXP (note, 0)), insn);
else
last = emit_note_before (INTVAL (XEXP (note, 0)), last);
remove_note (insn, note);
}
}
return last;
}
/* Use modified list scheduling to rearrange insns in basic block /* Use modified list scheduling to rearrange insns in basic block
B. FILE, if nonzero, is where we dump interesting output about B. FILE, if nonzero, is where we dump interesting output about
this pass. */ this pass. */
...@@ -3858,22 +3885,7 @@ schedule_block (b, file) ...@@ -3858,22 +3885,7 @@ schedule_block (b, file)
last = insn; last = insn;
/* Check to see if we need to re-emit any notes here. */ /* Check to see if we need to re-emit any notes here. */
{ last = reemit_notes (insn, last);
rtx note;
for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
{
if (REG_NOTE_KIND (note) == REG_DEAD
&& GET_CODE (XEXP (note, 0)) == CONST_INT)
{
if (INTVAL (XEXP (note, 0)) == NOTE_INSN_SETJMP)
emit_note_after (INTVAL (XEXP (note, 0)), insn);
else
last = emit_note_before (INTVAL (XEXP (note, 0)), last);
remove_note (insn, note);
}
}
}
/* Everything that precedes INSN now either becomes "ready", if /* Everything that precedes INSN now either becomes "ready", if
it can execute immediately before INSN, or "pending", if it can execute immediately before INSN, or "pending", if
...@@ -3888,7 +3900,8 @@ schedule_block (b, file) ...@@ -3888,7 +3900,8 @@ schedule_block (b, file)
/* Schedule all prior insns that must not be moved. */ /* Schedule all prior insns that must not be moved. */
if (SCHED_GROUP_P (insn)) if (SCHED_GROUP_P (insn))
{ {
/* Disable these insns from being launched. */ /* Disable these insns from being launched, in case one of the
insns in the group has a dependency on an earlier one. */
link = insn; link = insn;
while (SCHED_GROUP_P (link)) while (SCHED_GROUP_P (link))
{ {
...@@ -3897,17 +3910,22 @@ schedule_block (b, file) ...@@ -3897,17 +3910,22 @@ schedule_block (b, file)
INSN_REF_COUNT (link) = 0; INSN_REF_COUNT (link) = 0;
} }
/* None of these insns can move forward into delay slots. */ /* Now handle each group insn like the main insn was handled
above. */
while (SCHED_GROUP_P (insn)) while (SCHED_GROUP_P (insn))
{ {
insn = PREV_INSN (insn); insn = PREV_INSN (insn);
new_ready = schedule_insn (insn, ready, new_ready, clock);
INSN_PRIORITY (insn) = DONE_PRIORITY;
sched_n_insns += 1; sched_n_insns += 1;
NEXT_INSN (insn) = last; NEXT_INSN (insn) = last;
PREV_INSN (last) = insn; PREV_INSN (last) = insn;
last = insn; last = insn;
last = reemit_notes (insn, last);
/* ??? Why don't we set LAUNCH_PRIORITY here? */
new_ready = schedule_insn (insn, ready, new_ready, clock);
INSN_PRIORITY (insn) = DONE_PRIORITY;
} }
} }
} }
......
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