summaryrefslogtreecommitdiff
path: root/gcc/sched-ebb.c
diff options
context:
space:
mode:
authormkuvyrkov <mkuvyrkov@138bc75d-0d04-0410-961f-82ee72b054a4>2006-03-16 05:23:21 +0000
committermkuvyrkov <mkuvyrkov@138bc75d-0d04-0410-961f-82ee72b054a4>2006-03-16 05:23:21 +0000
commite48970004af4707cf541fc319cb866638b29cb3a (patch)
tree2406ed9805b60255cb95efc06c870414886a802d /gcc/sched-ebb.c
parent4bfe0e7b4c07dacce91704084834209b211eab90 (diff)
downloadgcc-e48970004af4707cf541fc319cb866638b29cb3a.tar.gz
2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru>
* sched-int.h (struct haifa_insn_data): New fields: resolved_deps, inter_tick, queue_index. (struct sched_info): Change signature of init_ready_list field. Adjust all initializations. (RESOLVED_DEPS): New access macro. (ready_add): Remove prototype. (try_ready): Add prototype. * sched-rgn.c (init_ready_list): Use try_ready. (schedule_region): Initialize current_sched_info->{sched_max_insns_priority, queue_must_finish_empty}. * sched-ebb.c (new_ready): Remove. Adjust ebb_sched_info. (init_ready_list): Use try_ready. (schedule_ebb): Initialize current_sched_info->sched_max_insns_priority. * lists.c (remove_list_elem): Remove `static'. (remove_free_INSN_LIST_elem): New function. * rtl.h (remove_list_elem, remove_free_INSN_LIST_elem): Add prototypes. * haifa-sched.c (INTER_TICK, QUEUE_INDEX): New macros. (INVALID_TICK, MIN_TICK, QUEUE_SCHEDULED, QUEUE_NOWHERE, QUEUE_READY): New constants. (readyp): New variable. (queue_remove, ready_remove_insn, fix_inter_tick, fix_tick_ready, change_queue_index, resolve_dep): New static functions. (try_ready): New function. Adjust callers in sched-rgn.c and sched-ebb.c to use it instead of ready_add. (clock_var): Move at the begining of file. (rank_for_schedule): Fix typo. (queue_insn): Add assertion. Handle QUEUE_INDEX. (ready_lastpos): Enforce assertion. (ready_add): Make it static. Handle QUEUE_INDEX. Add new argument, update all callers. (ready_remove_first, ready_remove): Handle QUEUE_INDEX. (schedule_insn): Rewrite to use try_ready and resolve_dep. (queue_to_ready): Use free_INSN_LIST_list. (early_queue_to_ready): Fix typo. (schedule_block): Init readyp. Move init_ready_list call after the initialization of clock_var. Fix error in rejecting insn by targetm.sched.dfa_new_cycle. Add call to fix_inter_tick. Remove code that previously corrected INSN_TICKs. Add code for handling QUEUE_INDEX. (set_priorities): Fix typo. (sched_init): Initialize INSN_TICK, INTER_TICK and QUEUE_INDEX. Clarify comment and code that keeps current_sched_info->next_tail non-null. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112127 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sched-ebb.c')
-rw-r--r--gcc/sched-ebb.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/gcc/sched-ebb.c b/gcc/sched-ebb.c
index 2fa454df238..0b2e1bf193d 100644
--- a/gcc/sched-ebb.c
+++ b/gcc/sched-ebb.c
@@ -49,9 +49,8 @@ static int target_n_insns;
static int sched_n_insns;
/* Implementations of the sched_info functions for region scheduling. */
-static void init_ready_list (struct ready_list *);
+static void init_ready_list (void);
static int can_schedule_ready_p (rtx);
-static int new_ready (rtx);
static int schedule_more_p (void);
static const char *ebb_print_insn (rtx, int);
static int rank (rtx, rtx);
@@ -76,7 +75,7 @@ schedule_more_p (void)
once before scheduling a set of insns. */
static void
-init_ready_list (struct ready_list *ready)
+init_ready_list (void)
{
rtx prev_head = current_sched_info->prev_head;
rtx next_tail = current_sched_info->next_tail;
@@ -95,8 +94,7 @@ init_ready_list (struct ready_list *ready)
Count number of insns in the target block being scheduled. */
for (insn = NEXT_INSN (prev_head); insn != next_tail; insn = NEXT_INSN (insn))
{
- if (INSN_DEP_COUNT (insn) == 0)
- ready_add (ready, insn);
+ try_ready (insn);
target_n_insns++;
}
}
@@ -111,15 +109,6 @@ can_schedule_ready_p (rtx insn ATTRIBUTE_UNUSED)
return 1;
}
-/* Called after INSN has all its dependencies resolved. Return nonzero
- if it should be moved to the ready list or the queue, or zero if we
- should silently discard it. */
-static int
-new_ready (rtx next ATTRIBUTE_UNUSED)
-{
- return 1;
-}
-
/* Return a string that contains the insn uid and optionally anything else
necessary to identify this insn in an output. It's valid to use a
static buffer for this. The ALIGNED parameter should cause the string
@@ -197,7 +186,7 @@ static struct sched_info ebb_sched_info =
init_ready_list,
can_schedule_ready_p,
schedule_more_p,
- new_ready,
+ NULL,
rank,
ebb_print_insn,
contributes_to_priority,
@@ -524,7 +513,9 @@ schedule_ebb (rtx head, rtx tail)
targetm.sched.dependencies_evaluation_hook (head, tail);
/* Set priorities. */
+ current_sched_info->sched_max_insns_priority = 0;
n_insns = set_priorities (head, tail);
+ current_sched_info->sched_max_insns_priority++;
current_sched_info->prev_head = PREV_INSN (head);
current_sched_info->next_tail = NEXT_INSN (tail);