diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-02-28 18:32:12 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-02-28 18:32:12 +0000 |
commit | 0b9236907f81f02c4b87895496037afdcc1ead6c (patch) | |
tree | a5565c15b0b052513a333444454a04a0102ff0ab /gcc/haifa-sched.c | |
parent | d5819eb83b417c919656625c87c58d0bd5157f18 (diff) | |
download | gcc-0b9236907f81f02c4b87895496037afdcc1ead6c.tar.gz |
* haifa-sched.c (sched_emit_insn): New.
(schedule_block): Use last_scheduled_insn to track last insn.
* sched-int.h (sched_emit_insn): Prototype.
* config/ia64/ia64.c (last_issued): Remove.
(ia64_variable_issue): Don't set it.
(nop_cycles_until): Use sched_emit_insn.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50153 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/haifa-sched.c')
-rw-r--r-- | gcc/haifa-sched.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index 150cb093e1c..686369d418f 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -1617,6 +1617,18 @@ move_insn (insn, last) return retval; } +/* Called from backends from targetm.sched.reorder to emit stuff into + the instruction stream. */ + +rtx +sched_emit_insn (pat) + rtx pat; +{ + rtx insn = emit_insn_after (pat, last_scheduled_insn); + last_scheduled_insn = insn; + return insn; +} + /* Use forward list scheduling to rearrange insns of block B in region RGN, possibly bringing insns from subsequent blocks in the same region. */ @@ -1625,7 +1637,6 @@ schedule_block (b, rgn_n_insns) int b; int rgn_n_insns; { - rtx last; struct ready_list ready; int can_issue_more; @@ -1673,8 +1684,8 @@ schedule_block (b, rgn_n_insns) if (targetm.sched.md_init) (*targetm.sched.md_init) (sched_dump, sched_verbose, ready.veclen); - /* No insns scheduled in this block yet. */ - last_scheduled_insn = 0; + /* We start inserting insns after PREV_HEAD. */ + last_scheduled_insn = prev_head; /* Initialize INSN_QUEUE. Q_SIZE is the total number of insns in the queue. */ @@ -1686,9 +1697,6 @@ schedule_block (b, rgn_n_insns) /* Start just before the beginning of time. */ clock_var = -1; - /* We start inserting insns after PREV_HEAD. */ - last = prev_head; - /* Loop until all the insns in BB are scheduled. */ while ((*current_sched_info->schedule_more_p) ()) { @@ -1700,9 +1708,6 @@ schedule_block (b, rgn_n_insns) list. */ queue_to_ready (&ready); - if (sched_verbose && targetm.sched.cycle_display) - last = (*targetm.sched.cycle_display) (clock_var, last); - if (ready.n_ready == 0) abort (); @@ -1725,6 +1730,10 @@ schedule_block (b, rgn_n_insns) else can_issue_more = issue_rate; + if (sched_verbose && targetm.sched.cycle_display) + last_scheduled_insn + = (*targetm.sched.cycle_display) (clock_var, last_scheduled_insn); + if (sched_verbose) { fprintf (sched_dump, "\n;;\tReady list (t =%3d): ", clock_var); @@ -1749,8 +1758,7 @@ schedule_block (b, rgn_n_insns) if (! (*current_sched_info->can_schedule_ready_p) (insn)) goto next; - last_scheduled_insn = insn; - last = move_insn (insn, last); + last_scheduled_insn = move_insn (insn, last_scheduled_insn); if (targetm.sched.variable_issue) can_issue_more = @@ -1798,7 +1806,7 @@ schedule_block (b, rgn_n_insns) /* Update head/tail boundaries. */ head = NEXT_INSN (prev_head); - tail = last; + tail = last_scheduled_insn; /* Restore-other-notes: NOTE_LIST is the end of a chain of notes previously found among the insns. Insert them at the beginning |