aboutsummaryrefslogtreecommitdiff
path: root/gcc/sched-rgn.c
diff options
context:
space:
mode:
authorBernd Schmidt <bernds@redhat.co.uk>2000-12-19 17:41:20 +0000
committerBernd Schmidt <bernds@gcc.gnu.org>2000-12-19 17:41:20 +0000
commit79c2ffde686279bf867bc890584da1990a42899e (patch)
tree013277f950b7f201ce69219bf4e5634032099790 /gcc/sched-rgn.c
parent288c2c9e631f700809d885eef05a4d3fce212d86 (diff)
downloadgcc-79c2ffde686279bf867bc890584da1990a42899e.zip
gcc-79c2ffde686279bf867bc890584da1990a42899e.tar.gz
gcc-79c2ffde686279bf867bc890584da1990a42899e.tar.bz2
More scheduler infrastructure.
From-SVN: r38381
Diffstat (limited to 'gcc/sched-rgn.c')
-rw-r--r--gcc/sched-rgn.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index 46a7905..9e1bfd9 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -2032,6 +2032,8 @@ static int sched_target_n_insns;
static int target_n_insns;
/* The number of insns from the entire region scheduled so far. */
static int sched_n_insns;
+/* Nonzero if the last scheduled insn was a jump. */
+static int last_was_jump;
/* Implementations of the sched_info functions for region scheduling. */
static void init_ready_list PARAMS ((struct ready_list *));
@@ -2046,7 +2048,7 @@ static int rgn_rank PARAMS ((rtx, rtx));
static int
schedule_more_p ()
{
- return sched_target_n_insns < target_n_insns;
+ return ! last_was_jump && sched_target_n_insns < target_n_insns;
}
/* Add all insns that are initially ready to the ready list READY. Called
@@ -2064,6 +2066,7 @@ init_ready_list (ready)
target_n_insns = 0;
sched_target_n_insns = 0;
sched_n_insns = 0;
+ last_was_jump = 0;
/* Print debugging information. */
if (sched_verbose >= 5)
@@ -2155,6 +2158,9 @@ static int
can_schedule_ready_p (insn)
rtx insn;
{
+ if (GET_CODE (insn) == JUMP_INSN)
+ last_was_jump = 1;
+
/* An interblock motion? */
if (INSN_BB (insn) != target_bb)
{
@@ -2589,10 +2595,9 @@ compute_block_backward_dependences (bb)
/* Free up the INSN_LISTs. */
free_deps (&tmp_deps);
- /* Assert that we won't need bb_reg_last_* for this block anymore. */
- free (bb_deps[bb].reg_last_uses);
- free (bb_deps[bb].reg_last_sets);
- free (bb_deps[bb].reg_last_clobbers);
+ /* Assert that we won't need bb_reg_last_* for this block anymore.
+ The vectors we're zeroing out have just been freed by the call to
+ free_deps. */
bb_deps[bb].reg_last_uses = 0;
bb_deps[bb].reg_last_sets = 0;
bb_deps[bb].reg_last_clobbers = 0;
@@ -2726,7 +2731,12 @@ schedule_region (rgn)
/* Set priorities. */
for (bb = 0; bb < current_nr_blocks; bb++)
- rgn_n_insns += set_priorities (BB_TO_BLOCK (bb));
+ {
+ rtx head, tail;
+ get_block_head_tail (BB_TO_BLOCK (bb), &head, &tail);
+
+ rgn_n_insns += set_priorities (head, tail);
+ }
/* Compute interblock info: probabilities, split-edges, dominators, etc. */
if (current_nr_blocks > 1)
@@ -2788,8 +2798,8 @@ schedule_region (rgn)
if (write_symbols != NO_DEBUG)
{
- save_line_notes (b);
- rm_line_notes (b);
+ save_line_notes (b, head, tail);
+ rm_line_notes (head, tail);
}
/* rm_other_notes only removes notes which are _inside_ the
@@ -2855,7 +2865,11 @@ schedule_region (rgn)
if (write_symbols != NO_DEBUG)
{
for (bb = 0; bb < current_nr_blocks; bb++)
- restore_line_notes (BB_TO_BLOCK (bb));
+ {
+ rtx head, tail;
+ get_block_head_tail (BB_TO_BLOCK (bb), &head, &tail);
+ restore_line_notes (BB_TO_BLOCK (bb), head, tail);
+ }
}
/* Done with this region. */