summaryrefslogtreecommitdiff
path: root/gcc/sched.c
diff options
context:
space:
mode:
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1995-05-25 01:41:18 +0000
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1995-05-25 01:41:18 +0000
commit3660c42371709b8a0805999a48e29c2597a6105c (patch)
tree5967f2c12217e696c181d95961d026f3158cf485 /gcc/sched.c
parent0b89dfaf116c28a68ca20f76779a7c6a524c4cad (diff)
downloadgcc-3660c42371709b8a0805999a48e29c2597a6105c.tar.gz
(reemit_notes): New function.
(schedule_block): Call reemit_notes twice. Reorganize code for handling SCHED_GROUP_P insns, so that reemit_notes works. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@9814 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sched.c')
-rw-r--r--gcc/sched.c58
1 files changed, 38 insertions, 20 deletions
diff --git a/gcc/sched.c b/gcc/sched.c
index 1632329ee52..97332280f40 100644
--- a/gcc/sched.c
+++ b/gcc/sched.c
@@ -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
B. FILE, if nonzero, is where we dump interesting output about
this pass. */
@@ -3858,22 +3885,7 @@ schedule_block (b, file)
last = insn;
/* Check to see if we need to re-emit any notes here. */
- {
- 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);
- }
- }
- }
+ last = reemit_notes (insn, last);
/* Everything that precedes INSN now either becomes "ready", if
it can execute immediately before INSN, or "pending", if
@@ -3888,7 +3900,8 @@ schedule_block (b, file)
/* Schedule all prior insns that must not be moved. */
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;
while (SCHED_GROUP_P (link))
{
@@ -3897,17 +3910,22 @@ schedule_block (b, file)
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))
{
insn = PREV_INSN (insn);
- new_ready = schedule_insn (insn, ready, new_ready, clock);
- INSN_PRIORITY (insn) = DONE_PRIORITY;
sched_n_insns += 1;
NEXT_INSN (insn) = last;
PREV_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;
}
}
}