Try to separate region-specific code from generic parts in the scheuler.
[platform/upstream/gcc.git] / gcc / sched-int.h
1 /* Instruction scheduling pass.  This file contains definitions used
2    internally in the scheduler.
3    Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
4    1999, 2000 Free Software Foundation, Inc.
5
6 This file is part of GNU CC.
7
8 GNU CC is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the
10 Free Software Foundation; either version 2, or (at your option) any
11 later version.
12
13 GNU CC is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16 for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING.  If not, write to the Free
20 the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
21 02111-1307, USA.  */
22
23 /* Forward declaration.  */
24 struct ready_list;
25
26 /* This structure holds some state of the current scheduling pass, and
27    contains some function pointers that abstract out some of the non-generic
28    functionality from functions such as schedule_block or schedule_insn.
29    There is one global variable, current_sched_info, which points to the
30    sched_info structure currently in use.  */
31 struct sched_info
32 {
33   /* Add all insns that are initially ready to the ready list.  Called once
34      before scheduling a set of insns.  */
35   void (*init_ready_list) PARAMS ((struct ready_list *));
36   /* Called after taking an insn from the ready list.  Returns nonzero if
37      this insn can be scheduled, nonzero if we should silently discard it.  */
38   int (*can_schedule_ready_p) PARAMS ((rtx));
39   /* Return nonzero if there are more insns that should be scheduled.  */
40   int (*schedule_more_p) PARAMS ((void));
41   /* Called after an insn has all its dependencies resolved.  Return nonzero
42      if it should be moved to the ready list or the queue, or zero if we
43      should silently discard it.  */
44   int (*new_ready) PARAMS ((rtx));
45   /* Compare priority of two insns.  Return a positive number if the second
46      insn is to be preferred for scheduling, and a negative one if the first
47      is to be preferred.  Zero if they are equally good.  */
48   int (*rank) PARAMS ((rtx, rtx));
49   /* Return a string that contains the insn uid and optionally anything else
50      necessary to identify this insn in an output.  It's valid to use a
51      static buffer for this.  The ALIGNED parameter should cause the string
52      to be formatted so that multiple output lines will line up nicely.  */
53   const char *(*print_insn) PARAMS ((rtx, int));
54
55   /* The boundaries of the set of insns to be scheduled.  */
56   rtx prev_head, next_tail;
57
58   /* Filled in after the schedule is finished; the first and last scheduled
59      insns.  */
60   rtx head, tail;
61
62   /* If nonzero, enables an additional sanity check in schedule_block.  */
63   int queue_must_finish_empty;
64 };
65
66 #ifndef __GNUC__
67 #define __inline
68 #endif
69
70 #ifndef HAIFA_INLINE
71 #define HAIFA_INLINE __inline
72 #endif