Commit 1708fd40 by Bernd Schmidt Committed by Bernd Schmidt

Try to separate region-specific code from generic parts in the scheuler.

From-SVN: r37973
parent 881bc7db
2000-12-03 Bernd Schmidt <bernds@redhat.co.uk>
* sched-int.h: New file.
* Makefile.in (haifa-sched.o): Depend on it.
* haifa-sched.c: Include it.
(no_real_insns_p): New function.
(current_sched_info): New static variable.
(__inline, HAIFA_INLINE): Moved to sched-int.h.
(get_block_head_tail): Minor cleanup.
(init_ready_list, can_schedule_ready_p, new_ready, schedule_more_p,
rgn_print_insn, rgn_rank): New functions, broken out of
rank_for_schedule, schedule_insn and schedule_block, where they
are now called through function pointers in current_sched_info.
(queue_insn, schedule_insn, queue_to_ready, debug_ready_list,
print_insn): To display uid and block number, call the print_insn
function pointer in current_schedule_info.
(region_sched_info): New static variable.
(sched_target_n_insns, sched_n_insns, target_n_insns): New global
variables, moved out of schedule_block.
(schedule_block): Return void. All callers changed.
Move some of the setup code into schedule_region. Get head/tail
from current_sched_info, and update it when done.
(schedule_region): Slightly rearranged, some code moved here from
schedule_block. Call no_real_insns_p to avoid doing work for a
block that consists only of notes and labels.
(schedule_insns): Initialize current_sched_info.
2000-12-03 Neil Booth <neilb@earthling.net> 2000-12-03 Neil Booth <neilb@earthling.net>
* cppmacro.c (funlike_invocation_p): Re-disable macros enabled * cppmacro.c (funlike_invocation_p): Re-disable macros enabled
......
...@@ -1452,7 +1452,7 @@ alias.o : alias.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h \ ...@@ -1452,7 +1452,7 @@ alias.o : alias.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h \
regmove.o : regmove.c $(CONFIG_H) system.h $(RTL_H) insn-config.h \ regmove.o : regmove.c $(CONFIG_H) system.h $(RTL_H) insn-config.h \
$(RECOG_H) output.h $(REGS_H) hard-reg-set.h flags.h function.h \ $(RECOG_H) output.h $(REGS_H) hard-reg-set.h flags.h function.h \
$(EXPR_H) insn-flags.h $(BASIC_BLOCK_H) toplev.h $(EXPR_H) insn-flags.h $(BASIC_BLOCK_H) toplev.h
haifa-sched.o : haifa-sched.c $(CONFIG_H) system.h $(RTL_H) \ haifa-sched.o : haifa-sched.c $(CONFIG_H) system.h $(RTL_H) sched-int.h \
$(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \ $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
$(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h
final.o : final.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h intl.h \ final.o : final.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h intl.h \
......
/* Instruction scheduling pass. This file contains definitions used
internally in the scheduler.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
GNU CC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to the Free
the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
/* Forward declaration. */
struct ready_list;
/* This structure holds some state of the current scheduling pass, and
contains some function pointers that abstract out some of the non-generic
functionality from functions such as schedule_block or schedule_insn.
There is one global variable, current_sched_info, which points to the
sched_info structure currently in use. */
struct sched_info
{
/* Add all insns that are initially ready to the ready list. Called once
before scheduling a set of insns. */
void (*init_ready_list) PARAMS ((struct ready_list *));
/* Called after taking an insn from the ready list. Returns nonzero if
this insn can be scheduled, nonzero if we should silently discard it. */
int (*can_schedule_ready_p) PARAMS ((rtx));
/* Return nonzero if there are more insns that should be scheduled. */
int (*schedule_more_p) PARAMS ((void));
/* Called after an 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. */
int (*new_ready) PARAMS ((rtx));
/* Compare priority of two insns. Return a positive number if the second
insn is to be preferred for scheduling, and a negative one if the first
is to be preferred. Zero if they are equally good. */
int (*rank) PARAMS ((rtx, rtx));
/* 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
to be formatted so that multiple output lines will line up nicely. */
const char *(*print_insn) PARAMS ((rtx, int));
/* The boundaries of the set of insns to be scheduled. */
rtx prev_head, next_tail;
/* Filled in after the schedule is finished; the first and last scheduled
insns. */
rtx head, tail;
/* If nonzero, enables an additional sanity check in schedule_block. */
int queue_must_finish_empty;
};
#ifndef __GNUC__
#define __inline
#endif
#ifndef HAIFA_INLINE
#define HAIFA_INLINE __inline
#endif
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