]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/sched-int.h
* MAINTAINERS: Update my affiliation/email.
[thirdparty/gcc.git] / gcc / sched-int.h
CommitLineData
1708fd40
BS
1/* Instruction scheduling pass. This file contains definitions used
2 internally in the scheduler.
23a5b65a 3 Copyright (C) 1992-2014 Free Software Foundation, Inc.
1708fd40 4
1322177d 5This file is part of GCC.
1708fd40 6
1322177d
LB
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
9dcd6f09 9Software Foundation; either version 3, or (at your option) any later
1322177d 10version.
1708fd40 11
1322177d
LB
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
1708fd40
BS
14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15for more details.
16
17You should have received a copy of the GNU General Public License
9dcd6f09
NC
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
1708fd40 20
59587b18
JQ
21#ifndef GCC_SCHED_INT_H
22#define GCC_SCHED_INT_H
23
c46f6580
SB
24#include "insn-attr.h"
25
a750daa2
MK
26#ifdef INSN_SCHEDULING
27
6fb5fa3c 28#include "df.h"
e855c69d
AB
29#include "basic-block.h"
30
e855c69d
AB
31/* Identificator of a scheduler pass. */
32enum sched_pass_id_t { SCHED_PASS_UNKNOWN, SCHED_RGN_PASS, SCHED_EBB_PASS,
33 SCHED_SMS_PASS, SCHED_SEL_PASS };
34
c881de02
RS
35/* The algorithm used to implement -fsched-pressure. */
36enum sched_pressure_algorithm
37{
38 SCHED_PRESSURE_NONE,
39 SCHED_PRESSURE_WEIGHTED,
40 SCHED_PRESSURE_MODEL
41};
42
9771b263
DN
43typedef vec<basic_block> bb_vec_t;
44typedef vec<rtx> insn_vec_t;
45typedef vec<rtx> rtx_vec_t;
e855c69d
AB
46
47extern void sched_init_bbs (void);
48
a95b23b4
BS
49extern void sched_extend_luids (void);
50extern void sched_init_insn_luid (rtx);
51extern void sched_init_luids (bb_vec_t);
e855c69d
AB
52extern void sched_finish_luids (void);
53
54extern void sched_extend_target (void);
55
a95b23b4 56extern void haifa_init_h_i_d (bb_vec_t);
e855c69d
AB
57extern void haifa_finish_h_i_d (void);
58
59/* Hooks that are common to all the schedulers. */
60struct common_sched_info_def
61{
62 /* Called after blocks were rearranged due to movement of jump instruction.
63 The first parameter - index of basic block, in which jump currently is.
64 The second parameter - index of basic block, in which jump used
65 to be.
66 The third parameter - index of basic block, that follows the second
67 parameter. */
68 void (*fix_recovery_cfg) (int, int, int);
69
70 /* Called to notify frontend, that new basic block is being added.
71 The first parameter - new basic block.
72 The second parameter - block, after which new basic block is being added,
6626665f 73 or the exit block, if recovery block is being added,
e855c69d
AB
74 or NULL, if standalone block is being added. */
75 void (*add_block) (basic_block, basic_block);
76
77 /* Estimate number of insns in the basic block. */
78 int (*estimate_number_of_insns) (basic_block);
79
80 /* Given a non-insn (!INSN_P (x)) return
81 -1 - if this rtx don't need a luid.
82 0 - if it should have the same luid as the previous insn.
83 1 - if it needs a separate luid. */
84 int (*luid_for_non_insn) (rtx);
85
86 /* Scheduler pass identifier. It is preferably used in assertions. */
87 enum sched_pass_id_t sched_pass_id;
88};
89
90extern struct common_sched_info_def *common_sched_info;
91
92extern const struct common_sched_info_def haifa_common_sched_info;
93
94/* Return true if selective scheduling pass is working. */
95static inline bool
96sel_sched_p (void)
97{
98 return common_sched_info->sched_pass_id == SCHED_SEL_PASS;
99}
100
101/* Returns maximum priority that an insn was assigned to. */
102extern int get_rgn_sched_max_insns_priority (void);
103
104/* Increases effective priority for INSN by AMOUNT. */
105extern void sel_add_to_insn_priority (rtx, int);
106
107/* True if during selective scheduling we need to emulate some of haifa
108 scheduler behaviour. */
109extern int sched_emulate_haifa_p;
110
111/* Mapping from INSN_UID to INSN_LUID. In the end all other per insn data
112 structures should be indexed by luid. */
9771b263
DN
113extern vec<int> sched_luids;
114#define INSN_LUID(INSN) (sched_luids[INSN_UID (INSN)])
115#define LUID_BY_UID(UID) (sched_luids[UID])
e855c69d
AB
116
117#define SET_INSN_LUID(INSN, LUID) \
9771b263 118(sched_luids[INSN_UID (INSN)] = (LUID))
e855c69d
AB
119
120/* The highest INSN_LUID. */
121extern int sched_max_luid;
122
123extern int insn_luid (rtx);
124
125/* This list holds ripped off notes from the current block. These notes will
126 be attached to the beginning of the block when its scheduling is
127 finished. */
128extern rtx note_list;
129
130extern void remove_notes (rtx, rtx);
131extern rtx restore_other_notes (rtx, basic_block);
132extern void sched_insns_init (rtx);
133extern void sched_insns_finish (void);
134
135extern void *xrecalloc (void *, size_t, size_t, size_t);
e855c69d
AB
136
137extern void reemit_notes (rtx);
138
e855c69d
AB
139/* Functions in haifa-sched.c. */
140extern int haifa_classify_insn (const_rtx);
141
142/* Functions in sel-sched-ir.c. */
143extern void sel_find_rgns (void);
144extern void sel_mark_hard_insn (rtx);
145
146extern size_t dfa_state_size;
147
148extern void advance_state (state_t);
149
150extern void setup_sched_dump (void);
151extern void sched_init (void);
152extern void sched_finish (void);
153
154extern bool sel_insn_is_speculation_check (rtx);
155
156/* Describe the ready list of the scheduler.
157 VEC holds space enough for all insns in the current region. VECLEN
158 says how many exactly.
159 FIRST is the index of the element with the highest priority; i.e. the
160 last one in the ready list, since elements are ordered by ascending
161 priority.
b5b8b0ac
AO
162 N_READY determines how many insns are on the ready list.
163 N_DEBUG determines how many debug insns are on the ready list. */
e855c69d
AB
164struct ready_list
165{
166 rtx *vec;
167 int veclen;
168 int first;
169 int n_ready;
b5b8b0ac 170 int n_debug;
e855c69d
AB
171};
172
173extern char *ready_try;
174extern struct ready_list ready;
175
894fd6f2 176extern int max_issue (struct ready_list *, int, state_t, bool, int *);
e855c69d 177
aef0e7a8 178extern void ebb_compute_jump_reg_dependencies (rtx, regset);
e855c69d 179
0fd4b31d 180extern edge find_fallthru_edge_from (basic_block);
e855c69d
AB
181
182extern void (* sched_init_only_bb) (basic_block, basic_block);
183extern basic_block (* sched_split_block) (basic_block, rtx);
184extern basic_block sched_split_block_1 (basic_block, rtx);
185extern basic_block (* sched_create_empty_bb) (basic_block);
186extern basic_block sched_create_empty_bb_1 (basic_block);
187
188extern basic_block sched_create_recovery_block (basic_block *);
189extern void sched_create_recovery_edges (basic_block, basic_block,
190 basic_block);
59587b18 191
fae15c93
VM
192/* Pointer to data describing the current DFA state. */
193extern state_t curr_state;
194
c7ec5472 195/* Type to represent status of a dependence. */
8e90de43
SB
196typedef unsigned int ds_t;
197#define BITS_PER_DEP_STATUS HOST_BITS_PER_INT
ddbd5439
MK
198
199/* Type to represent weakness of speculative dependence. */
8e90de43 200typedef unsigned int dw_t;
ddbd5439 201
b198261f
MK
202extern enum reg_note ds_to_dk (ds_t);
203extern ds_t dk_to_ds (enum reg_note);
204
1a83e602
BS
205/* Describe a dependency that can be broken by making a replacement
206 in one of the patterns. LOC is the location, ORIG and NEWVAL the
207 two alternative contents, and INSN the instruction that must be
208 changed. */
209struct dep_replacement
210{
211 rtx *loc;
212 rtx orig;
213 rtx newval;
214 rtx insn;
215};
216
b198261f
MK
217/* Information about the dependency. */
218struct _dep
219{
220 /* Producer. */
221 rtx pro;
222
223 /* Consumer. */
224 rtx con;
225
1a83e602
BS
226 /* If nonnull, holds a pointer to information about how to break the
227 dependency by making a replacement in one of the insns. There is
228 only one such dependency for each insn that must be modified in
229 order to break such a dependency. */
230 struct dep_replacement *replace;
b198261f
MK
231
232 /* Dependency status. This field holds all dependency types and additional
233 information for speculative dependencies. */
234 ds_t status;
a19af9c4 235
1a83e602
BS
236 /* Dependency major type. This field is superseded by STATUS above.
237 Though, it is still in place because some targets use it. */
238 ENUM_BITFIELD(reg_note) type:6;
239
240 unsigned nonreg:1;
241 unsigned multiple:1;
242
243 /* Cached cost of the dependency. Make sure to update UNKNOWN_DEP_COST
244 when changing the size of this field. */
245 int cost:20;
b198261f 246};
e2f6ff94 247
1a83e602
BS
248#define UNKNOWN_DEP_COST (-1<<19)
249
e2f6ff94
MK
250typedef struct _dep dep_def;
251typedef dep_def *dep_t;
b198261f
MK
252
253#define DEP_PRO(D) ((D)->pro)
254#define DEP_CON(D) ((D)->con)
e2f6ff94 255#define DEP_TYPE(D) ((D)->type)
b198261f 256#define DEP_STATUS(D) ((D)->status)
a19af9c4 257#define DEP_COST(D) ((D)->cost)
1a83e602
BS
258#define DEP_NONREG(D) ((D)->nonreg)
259#define DEP_MULTIPLE(D) ((D)->multiple)
260#define DEP_REPLACE(D) ((D)->replace)
b198261f
MK
261
262/* Functions to work with dep. */
263
e2f6ff94 264extern void init_dep_1 (dep_t, rtx, rtx, enum reg_note, ds_t);
b198261f
MK
265extern void init_dep (dep_t, rtx, rtx, enum reg_note);
266
e2f6ff94
MK
267extern void sd_debug_dep (dep_t);
268
b198261f
MK
269/* Definition of this struct resides below. */
270struct _dep_node;
e2f6ff94 271typedef struct _dep_node *dep_node_t;
b198261f
MK
272
273/* A link in the dependency list. This is essentially an equivalent of a
274 single {INSN, DEPS}_LIST rtx. */
275struct _dep_link
276{
277 /* Dep node with all the data. */
e2f6ff94 278 dep_node_t node;
b198261f
MK
279
280 /* Next link in the list. For the last one it is NULL. */
281 struct _dep_link *next;
282
283 /* Pointer to the next field of the previous link in the list.
284 For the first link this points to the deps_list->first.
285
286 With help of this field it is easy to remove and insert links to the
287 list. */
288 struct _dep_link **prev_nextp;
289};
290typedef struct _dep_link *dep_link_t;
291
292#define DEP_LINK_NODE(N) ((N)->node)
293#define DEP_LINK_NEXT(N) ((N)->next)
294#define DEP_LINK_PREV_NEXTP(N) ((N)->prev_nextp)
295
296/* Macros to work dep_link. For most usecases only part of the dependency
297 information is need. These macros conveniently provide that piece of
298 information. */
299
300#define DEP_LINK_DEP(N) (DEP_NODE_DEP (DEP_LINK_NODE (N)))
301#define DEP_LINK_PRO(N) (DEP_PRO (DEP_LINK_DEP (N)))
302#define DEP_LINK_CON(N) (DEP_CON (DEP_LINK_DEP (N)))
e2f6ff94 303#define DEP_LINK_TYPE(N) (DEP_TYPE (DEP_LINK_DEP (N)))
b198261f
MK
304#define DEP_LINK_STATUS(N) (DEP_STATUS (DEP_LINK_DEP (N)))
305
6fb5fa3c 306/* A list of dep_links. */
b198261f
MK
307struct _deps_list
308{
e2f6ff94 309 /* First element. */
b198261f 310 dep_link_t first;
e2f6ff94
MK
311
312 /* Total number of elements in the list. */
313 int n_links;
b198261f
MK
314};
315typedef struct _deps_list *deps_list_t;
316
317#define DEPS_LIST_FIRST(L) ((L)->first)
e2f6ff94 318#define DEPS_LIST_N_LINKS(L) ((L)->n_links)
b198261f 319
9f5ed61a
KH
320/* Suppose we have a dependence Y between insn pro1 and con1, where pro1 has
321 additional dependents con0 and con2, and con1 is dependent on additional
b198261f
MK
322 insns pro0 and pro1:
323
324 .con0 pro0
325 . ^ |
326 . | |
327 . | |
328 . X A
329 . | |
330 . | |
331 . | V
332 .pro1--Y-->con1
333 . | ^
334 . | |
335 . | |
336 . Z B
337 . | |
338 . | |
339 . V |
340 .con2 pro2
341
342 This is represented using a "dep_node" for each dependence arc, which are
343 connected as follows (diagram is centered around Y which is fully shown;
344 other dep_nodes shown partially):
345
346 . +------------+ +--------------+ +------------+
347 . : dep_node X : | dep_node Y | : dep_node Z :
348 . : : | | : :
349 . : : | | : :
350 . : forw : | forw | : forw :
351 . : +--------+ : | +--------+ | : +--------+ :
352 forw_deps : |dep_link| : | |dep_link| | : |dep_link| :
353 +-----+ : | +----+ | : | | +----+ | | : | +----+ | :
354 |first|----->| |next|-+------+->| |next|-+--+----->| |next|-+--->NULL
355 +-----+ : | +----+ | : | | +----+ | | : | +----+ | :
356 . ^ ^ : | ^ | : | | ^ | | : | | :
357 . | | : | | | : | | | | | : | | :
358 . | +--<----+--+ +--+---<--+--+--+ +--+--+--<---+--+ | :
359 . | : | | | : | | | | | : | | | :
360 . | : | +----+ | : | | +----+ | | : | +----+ | :
361 . | : | |prev| | : | | |prev| | | : | |prev| | :
362 . | : | |next| | : | | |next| | | : | |next| | :
363 . | : | +----+ | : | | +----+ | | : | +----+ | :
364 . | : | | :<-+ | | | |<-+ : | | :<-+
365 . | : | +----+ | : | | | +----+ | | | : | +----+ | : |
366 . | : | |node|-+----+ | | |node|-+--+--+ : | |node|-+----+
367 . | : | +----+ | : | | +----+ | | : | +----+ | :
368 . | : | | : | | | | : | | :
369 . | : +--------+ : | +--------+ | : +--------+ :
370 . | : : | | : :
371 . | : SAME pro1 : | +--------+ | : SAME pro1 :
372 . | : DIFF con0 : | |dep | | : DIFF con2 :
373 . | : : | | | | : :
374 . | | | +----+ | |
375 .RTX<------------------------+--+-|pro1| | |
376 .pro1 | | +----+ | |
377 . | | | |
378 . | | +----+ | |
379 .RTX<------------------------+--+-|con1| | |
380 .con1 | | +----+ | |
381 . | | | | |
382 . | | | +----+ | |
383 . | | | |kind| | |
384 . | | | +----+ | |
385 . | : : | | |stat| | | : :
386 . | : DIFF pro0 : | | +----+ | | : DIFF pro2 :
387 . | : SAME con1 : | | | | : SAME con1 :
388 . | : : | +--------+ | : :
389 . | : : | | : :
390 . | : back : | back | : back :
391 . v : +--------+ : | +--------+ | : +--------+ :
392 back_deps : |dep_link| : | |dep_link| | : |dep_link| :
393 +-----+ : | +----+ | : | | +----+ | | : | +----+ | :
394 |first|----->| |next|-+------+->| |next|-+--+----->| |next|-+--->NULL
395 +-----+ : | +----+ | : | | +----+ | | : | +----+ | :
396 . ^ : | ^ | : | | ^ | | : | | :
397 . | : | | | : | | | | | : | | :
398 . +--<----+--+ +--+---<--+--+--+ +--+--+--<---+--+ | :
399 . : | | | : | | | | | : | | | :
400 . : | +----+ | : | | +----+ | | : | +----+ | :
401 . : | |prev| | : | | |prev| | | : | |prev| | :
402 . : | |next| | : | | |next| | | : | |next| | :
403 . : | +----+ | : | | +----+ | | : | +----+ | :
404 . : | | :<-+ | | | |<-+ : | | :<-+
405 . : | +----+ | : | | | +----+ | | | : | +----+ | : |
406 . : | |node|-+----+ | | |node|-+--+--+ : | |node|-+----+
407 . : | +----+ | : | | +----+ | | : | +----+ | :
408 . : | | : | | | | : | | :
409 . : +--------+ : | +--------+ | : +--------+ :
410 . : : | | : :
411 . : dep_node A : | dep_node Y | : dep_node B :
412 . +------------+ +--------------+ +------------+
413*/
414
415struct _dep_node
416{
417 /* Backward link. */
418 struct _dep_link back;
419
420 /* The dep. */
421 struct _dep dep;
422
423 /* Forward link. */
424 struct _dep_link forw;
425};
b198261f
MK
426
427#define DEP_NODE_BACK(N) (&(N)->back)
428#define DEP_NODE_DEP(N) (&(N)->dep)
429#define DEP_NODE_FORW(N) (&(N)->forw)
430
e855c69d
AB
431/* The following enumeration values tell us what dependencies we
432 should use to implement the barrier. We use true-dependencies for
433 TRUE_BARRIER and anti-dependencies for MOVE_BARRIER. */
434enum reg_pending_barrier_mode
435{
436 NOT_A_BARRIER = 0,
437 MOVE_BARRIER,
438 TRUE_BARRIER
439};
440
24b97832
ILT
441/* Whether a register movement is associated with a call. */
442enum post_call_group
443{
444 not_post_call,
445 post_call,
446 post_call_initial
447};
448
449/* Insns which affect pseudo-registers. */
450struct deps_reg
451{
452 rtx uses;
453 rtx sets;
ce18efcb 454 rtx implicit_sets;
e2724e63 455 rtx control_uses;
24b97832
ILT
456 rtx clobbers;
457 int uses_length;
458 int clobbers_length;
459};
460
16f6ece6 461/* Describe state of dependencies used during sched_analyze phase. */
88302d54 462struct deps_desc
16f6ece6
BS
463{
464 /* The *_insns and *_mems are paired lists. Each pending memory operation
465 will have a pointer to the MEM rtx on one list and a pointer to the
466 containing insn on the other list in the same place in the list. */
467
468 /* We can't use add_dependence like the old code did, because a single insn
469 may have multiple memory accesses, and hence needs to be on the list
470 once for each memory access. Add_dependence won't let you add an insn
471 to a list more than once. */
472
473 /* An INSN_LIST containing all insns with pending read operations. */
474 rtx pending_read_insns;
475
476 /* An EXPR_LIST containing all MEM rtx's which are pending reads. */
477 rtx pending_read_mems;
478
479 /* An INSN_LIST containing all insns with pending write operations. */
480 rtx pending_write_insns;
481
482 /* An EXPR_LIST containing all MEM rtx's which are pending writes. */
483 rtx pending_write_mems;
484
e2724e63
BS
485 /* An INSN_LIST containing all jump insns. */
486 rtx pending_jump_insns;
487
bdbf40a5
MK
488 /* We must prevent the above lists from ever growing too large since
489 the number of dependencies produced is at least O(N*N),
490 and execution time is at least O(4*N*N), as a function of the
491 length of these pending lists. */
492
493 /* Indicates the length of the pending_read list. */
494 int pending_read_list_length;
495
496 /* Indicates the length of the pending_write list. */
497 int pending_write_list_length;
16f6ece6 498
e2724e63
BS
499 /* Length of the pending memory flush list plus the length of the pending
500 jump insn list. Large functions with no calls may build up extremely
501 large lists. */
4a121cc3
AM
502 int pending_flush_length;
503
16f6ece6
BS
504 /* The last insn upon which all memory references must depend.
505 This is an insn which flushed the pending lists, creating a dependency
506 between it and all previously pending memory references. This creates
507 a barrier (or a checkpoint) which no memory reference is allowed to cross.
508
509 This includes all non constant CALL_INSNs. When we do interprocedural
510 alias analysis, this restriction can be relaxed.
511 This may also be an INSN that writes memory if the pending lists grow
512 too large. */
513 rtx last_pending_memory_flush;
514
37a0f8a5
RH
515 /* A list of the last function calls we have seen. We use a list to
516 represent last function calls from multiple predecessor blocks.
517 Used to prevent register lifetimes from expanding unnecessarily. */
16f6ece6
BS
518 rtx last_function_call;
519
1098d3a5
JJ
520 /* A list of the last function calls that may not return normally
521 we have seen. We use a list to represent last function calls from
522 multiple predecessor blocks. Used to prevent moving trapping insns
523 across such calls. */
524 rtx last_function_call_may_noreturn;
525
37a0f8a5
RH
526 /* A list of insns which use a pseudo register that does not already
527 cross a call. We create dependencies between each of those insn
528 and the next call insn, to ensure that they won't cross a call after
529 scheduling is done. */
530 rtx sched_before_next_call;
531
7b4ef662
RH
532 /* Similarly, a list of insns which should not cross a branch. */
533 rtx sched_before_next_jump;
534
2067c116 535 /* Used to keep post-call pseudo/hard reg movements together with
16f6ece6 536 the call. */
24b97832 537 enum post_call_group in_post_call_group_p;
16f6ece6 538
b5b8b0ac
AO
539 /* The last debug insn we've seen. */
540 rtx last_debug_insn;
541
76df831f
RH
542 /* The last insn bearing REG_ARGS_SIZE that we've seen. */
543 rtx last_args_size;
544
4ba478b8
RH
545 /* The maximum register number for the following arrays. Before reload
546 this is max_reg_num; after reload it is FIRST_PSEUDO_REGISTER. */
547 int max_reg;
548
16f6ece6
BS
549 /* Element N is the next insn that sets (hard or pseudo) register
550 N within the current basic block; or zero, if there is no
551 such insn. Needed for new registers which may be introduced
552 by splitting insns. */
24b97832 553 struct deps_reg *reg_last;
4ba478b8 554
0e9e1e0a 555 /* Element N is set for each register that has any nonzero element
4ba478b8
RH
556 in reg_last[N].{uses,sets,clobbers}. */
557 regset_head reg_last_in_use;
5a257872 558
e855c69d
AB
559 /* Shows the last value of reg_pending_barrier associated with the insn. */
560 enum reg_pending_barrier_mode last_reg_pending_barrier;
561
b8698a0f 562 /* True when this context should be treated as a readonly by
e855c69d
AB
563 the analysis. */
564 BOOL_BITFIELD readonly : 1;
16f6ece6
BS
565};
566
88302d54 567typedef struct deps_desc *deps_t;
e855c69d 568
1708fd40
BS
569/* This structure holds some state of the current scheduling pass, and
570 contains some function pointers that abstract out some of the non-generic
571 functionality from functions such as schedule_block or schedule_insn.
572 There is one global variable, current_sched_info, which points to the
573 sched_info structure currently in use. */
e855c69d 574struct haifa_sched_info
1708fd40
BS
575{
576 /* Add all insns that are initially ready to the ready list. Called once
577 before scheduling a set of insns. */
63f54b1a 578 void (*init_ready_list) (void);
1708fd40
BS
579 /* Called after taking an insn from the ready list. Returns nonzero if
580 this insn can be scheduled, nonzero if we should silently discard it. */
f55ade6e 581 int (*can_schedule_ready_p) (rtx);
1708fd40 582 /* Return nonzero if there are more insns that should be scheduled. */
f55ade6e 583 int (*schedule_more_p) (void);
b8698a0f 584 /* Called after an insn has all its hard dependencies resolved.
496d7bb0
MK
585 Adjusts status of instruction (which is passed through second parameter)
586 to indicate if instruction should be moved to the ready list or the
587 queue, or if it should silently discard it (until next resolved
588 dependence). */
589 ds_t (*new_ready) (rtx, ds_t);
1708fd40
BS
590 /* Compare priority of two insns. Return a positive number if the second
591 insn is to be preferred for scheduling, and a negative one if the first
592 is to be preferred. Zero if they are equally good. */
f55ade6e 593 int (*rank) (rtx, rtx);
1708fd40
BS
594 /* Return a string that contains the insn uid and optionally anything else
595 necessary to identify this insn in an output. It's valid to use a
596 static buffer for this. The ALIGNED parameter should cause the string
597 to be formatted so that multiple output lines will line up nicely. */
e855c69d 598 const char *(*print_insn) (const_rtx, int);
18e720b3
BS
599 /* Return nonzero if an insn should be included in priority
600 calculations. */
f55ade6e 601 int (*contributes_to_priority) (rtx, rtx);
1708fd40 602
356c23b3
MK
603 /* Return true if scheduling insn (passed as the parameter) will trigger
604 finish of scheduling current block. */
605 bool (*insn_finishes_block_p) (rtx);
606
1708fd40
BS
607 /* The boundaries of the set of insns to be scheduled. */
608 rtx prev_head, next_tail;
609
610 /* Filled in after the schedule is finished; the first and last scheduled
611 insns. */
612 rtx head, tail;
613
614 /* If nonzero, enables an additional sanity check in schedule_block. */
4b6c5340 615 unsigned int queue_must_finish_empty:1;
79ae11c4
DN
616
617 /* Maximum priority that has been assigned to an insn. */
618 int sched_max_insns_priority;
ddbd5439 619
496d7bb0
MK
620 /* Hooks to support speculative scheduling. */
621
622 /* Called to notify frontend that instruction is being added (second
b8698a0f 623 parameter == 0) or removed (second parameter == 1). */
496d7bb0
MK
624 void (*add_remove_insn) (rtx, int);
625
86014d07
BS
626 /* Called to notify the frontend that instruction INSN is being
627 scheduled. */
628 void (*begin_schedule_ready) (rtx insn);
629
630 /* Called to notify the frontend that an instruction INSN is about to be
631 moved to its correct place in the final schedule. This is done for all
632 insns in order of the schedule. LAST indicates the last scheduled
633 instruction. */
634 void (*begin_move_insn) (rtx insn, rtx last);
496d7bb0 635
496d7bb0
MK
636 /* If the second parameter is not NULL, return nonnull value, if the
637 basic block should be advanced.
638 If the second parameter is NULL, return the next basic block in EBB.
639 The first parameter is the current basic block in EBB. */
640 basic_block (*advance_target_bb) (basic_block, rtx);
641
26965010
BS
642 /* Allocate memory, store the frontend scheduler state in it, and
643 return it. */
644 void *(*save_state) (void);
645 /* Restore frontend scheduler state from the argument, and free the
646 memory. */
647 void (*restore_state) (void *);
648
ddbd5439
MK
649 /* ??? FIXME: should use straight bitfields inside sched_info instead of
650 this flag field. */
651 unsigned int flags;
1708fd40
BS
652};
653
496d7bb0
MK
654/* This structure holds description of the properties for speculative
655 scheduling. */
656struct spec_info_def
657{
658 /* Holds types of allowed speculations: BEGIN_{DATA|CONTROL},
659 BE_IN_{DATA_CONTROL}. */
660 int mask;
661
662 /* A dump file for additional information on speculative scheduling. */
663 FILE *dump;
664
665 /* Minimal cumulative weakness of speculative instruction's
666 dependencies, so that insn will be scheduled. */
e855c69d
AB
667 dw_t data_weakness_cutoff;
668
669 /* Minimal usefulness of speculative instruction to be considered for
670 scheduling. */
671 int control_weakness_cutoff;
496d7bb0
MK
672
673 /* Flags from the enum SPEC_SCHED_FLAGS. */
674 int flags;
675};
676typedef struct spec_info_def *spec_info_t;
677
e855c69d
AB
678extern spec_info_t spec_info;
679
680extern struct haifa_sched_info *current_sched_info;
16f6ece6 681
ce18efcb
VM
682/* Do register pressure sensitive insn scheduling if the flag is set
683 up. */
60867e8c 684extern enum sched_pressure_algorithm sched_pressure;
ce18efcb 685
1756cb66 686/* Map regno -> its pressure class. The map defined only when
ce18efcb 687 SCHED_PRESSURE_P is true. */
1756cb66 688extern enum reg_class *sched_regno_pressure_class;
ce18efcb 689
16f6ece6
BS
690/* Indexed by INSN_UID, the collection of all data associated with
691 a single instruction. */
692
e855c69d 693struct _haifa_deps_insn_data
16f6ece6 694{
e855c69d
AB
695 /* The number of incoming edges in the forward dependency graph.
696 As scheduling proceeds, counts are decreased. An insn moves to
697 the ready queue when its counter reaches zero. */
698 int dep_count;
699
700 /* Nonzero if instruction has internal dependence
701 (e.g. add_dependence was invoked with (insn == elem)). */
702 unsigned int has_internal_dep;
703
704 /* NB: We can't place 'struct _deps_list' here instead of deps_list_t into
705 h_i_d because when h_i_d extends, addresses of the deps_list->first
706 change without updating deps_list->first->next->prev_nextp. Thus
707 BACK_DEPS and RESOLVED_BACK_DEPS are allocated on the heap and FORW_DEPS
708 list is allocated on the obstack. */
b198261f 709
e2f6ff94 710 /* A list of hard backward dependencies. The insn is a consumer of all the
b198261f 711 deps mentioned here. */
e2f6ff94
MK
712 deps_list_t hard_back_deps;
713
714 /* A list of speculative (weak) dependencies. The insn is a consumer of all
715 the deps mentioned here. */
716 deps_list_t spec_back_deps;
b198261f
MK
717
718 /* A list of insns which depend on the instruction. Unlike 'back_deps',
ff7cc307 719 it represents forward dependencies. */
b198261f 720 deps_list_t forw_deps;
16f6ece6 721
63f54b1a 722 /* A list of scheduled producers of the instruction. Links are being moved
b198261f
MK
723 from 'back_deps' to 'resolved_back_deps' while scheduling. */
724 deps_list_t resolved_back_deps;
e2f6ff94
MK
725
726 /* A list of scheduled consumers of the instruction. Links are being moved
727 from 'forw_deps' to 'resolved_forw_deps' while scheduling to fasten the
728 search in 'forw_deps'. */
729 deps_list_t resolved_forw_deps;
e855c69d 730
b0bd15f7
BS
731 /* If the insn is conditional (either through COND_EXEC, or because
732 it is a conditional branch), this records the condition. NULL
733 for insns that haven't been seen yet or don't have a condition;
734 const_true_rtx to mark an insn without a condition, or with a
735 condition that has been clobbered by a subsequent insn. */
736 rtx cond;
737
e2724e63
BS
738 /* For a conditional insn, a list of insns that could set the condition
739 register. Used when generating control dependencies. */
740 rtx cond_deps;
741
b0bd15f7
BS
742 /* True if the condition in 'cond' should be reversed to get the actual
743 condition. */
744 unsigned int reverse_cond : 1;
745
e855c69d
AB
746 /* Some insns (e.g. call) are not allowed to move across blocks. */
747 unsigned int cant_move : 1;
748};
749
8e90de43 750\f
ce18efcb
VM
751/* Bits used for storing values of the fields in the following
752 structure. */
753#define INCREASE_BITS 8
754
755/* The structure describes how the corresponding insn increases the
1756cb66 756 register pressure for each pressure class. */
ce18efcb
VM
757struct reg_pressure_data
758{
759 /* Pressure increase for given class because of clobber. */
760 unsigned int clobber_increase : INCREASE_BITS;
761 /* Increase in register pressure for given class because of register
762 sets. */
763 unsigned int set_increase : INCREASE_BITS;
764 /* Pressure increase for given class because of unused register
765 set. */
766 unsigned int unused_set_increase : INCREASE_BITS;
767 /* Pressure change: #sets - #deaths. */
768 int change : INCREASE_BITS;
769};
770
771/* The following structure describes usage of registers by insns. */
772struct reg_use_data
773{
774 /* Regno used in the insn. */
775 int regno;
776 /* Insn using the regno. */
777 rtx insn;
778 /* Cyclic list of elements with the same regno. */
779 struct reg_use_data *next_regno_use;
780 /* List of elements with the same insn. */
781 struct reg_use_data *next_insn_use;
782};
783
784/* The following structure describes used sets of registers by insns.
1756cb66 785 Registers are pseudos whose pressure class is not NO_REGS or hard
ce18efcb
VM
786 registers available for allocations. */
787struct reg_set_data
788{
789 /* Regno used in the insn. */
790 int regno;
791 /* Insn setting the regno. */
792 rtx insn;
793 /* List of elements with the same insn. */
794 struct reg_set_data *next_insn_set;
795};
796
e855c69d
AB
797struct _haifa_insn_data
798{
799 /* We can't place 'struct _deps_list' into h_i_d instead of deps_list_t
800 because when h_i_d extends, addresses of the deps_list->first
801 change without updating deps_list->first->next->prev_nextp. */
802
16f6ece6
BS
803 /* Logical uid gives the original ordering of the insns. */
804 int luid;
805
806 /* A priority for each insn. */
807 int priority;
808
16f6ece6
BS
809 /* The minimum clock tick at which the insn becomes ready. This is
810 used to note timing constraints for the insns in the pending list. */
811 int tick;
812
26965010
BS
813 /* For insns that are scheduled at a fixed difference from another,
814 this records the tick in which they must be ready. */
815 int exact_tick;
816
63f54b1a
MK
817 /* INTER_TICK is used to adjust INSN_TICKs of instructions from the
818 subsequent blocks in a region. */
819 int inter_tick;
b8698a0f 820
26965010
BS
821 /* Used temporarily to estimate an INSN_TICK value for an insn given
822 current knowledge. */
823 int tick_estimate;
824
63f54b1a
MK
825 /* See comment on QUEUE_INDEX macro in haifa-sched.c. */
826 int queue_index;
827
16f6ece6
BS
828 short cost;
829
7a1aca9c
RS
830 /* '> 0' if priority is valid,
831 '== 0' if priority was not yet computed,
832 '< 0' if priority in invalid and should be recomputed. */
833 signed char priority_status;
834
f5143c46 835 /* Set if there's DEF-USE dependence between some speculatively
16f6ece6
BS
836 moved load insn and this one. */
837 unsigned int fed_by_spec_load : 1;
838 unsigned int is_load_insn : 1;
26965010
BS
839 /* Nonzero if this insn has negative-cost forward dependencies against
840 an already scheduled insn. */
841 unsigned int feeds_backtrack_insn : 1;
842
843 /* Nonzero if this insn is a shadow of another, scheduled after a fixed
844 delay. We only emit shadows at the end of a cycle, with no other
845 real insns following them. */
846 unsigned int shadow_p : 1;
21e4c9a8 847
e2724e63
BS
848 /* Used internally in unschedule_insns_until to mark insns that must have
849 their TODO_SPEC recomputed. */
850 unsigned int must_recompute_spec : 1;
851
917f1b7e 852 /* What speculations are necessary to apply to schedule the instruction. */
496d7bb0 853 ds_t todo_spec;
e855c69d 854
496d7bb0 855 /* What speculations were already applied. */
b8698a0f 856 ds_t done_spec;
e855c69d 857
496d7bb0
MK
858 /* What speculations are checked by this instruction. */
859 ds_t check_spec;
860
861 /* Recovery block for speculation checks. */
862 basic_block recovery_block;
863
864 /* Original pattern of the instruction. */
865 rtx orig_pat;
ce18efcb 866
e2724e63
BS
867 /* For insns with DEP_CONTROL dependencies, the predicated pattern if it
868 was ever successfully constructed. */
869 rtx predicated_pat;
870
ce18efcb
VM
871 /* The following array contains info how the insn increases register
872 pressure. There is an element for each cover class of pseudos
873 referenced in insns. */
874 struct reg_pressure_data *reg_pressure;
875 /* The following array contains maximal reg pressure between last
876 scheduled insn and given insn. There is an element for each
1756cb66 877 pressure class of pseudos referenced in insns. This info updated
ce18efcb
VM
878 after scheduling each insn for each insn between the two
879 mentioned insns. */
880 int *max_reg_pressure;
881 /* The following list contains info about used pseudos and hard
882 registers available for allocation. */
883 struct reg_use_data *reg_use_list;
884 /* The following list contains info about set pseudos and hard
885 registers available for allocation. */
886 struct reg_set_data *reg_set_list;
887 /* Info about how scheduling the insn changes cost of register
888 pressure excess (between source and target). */
889 int reg_pressure_excess_cost_change;
7a1aca9c 890 int model_index;
16f6ece6
BS
891};
892
e855c69d
AB
893typedef struct _haifa_insn_data haifa_insn_data_def;
894typedef haifa_insn_data_def *haifa_insn_data_t;
895
e855c69d 896
9771b263 897extern vec<haifa_insn_data_def> h_i_d;
e855c69d 898
9771b263 899#define HID(INSN) (&h_i_d[INSN_UID (INSN)])
16f6ece6 900
b4ead7d4
BS
901/* Accessor macros for h_i_d. There are more in haifa-sched.c and
902 sched-rgn.c. */
e855c69d 903#define INSN_PRIORITY(INSN) (HID (INSN)->priority)
ce18efcb
VM
904#define INSN_REG_PRESSURE(INSN) (HID (INSN)->reg_pressure)
905#define INSN_MAX_REG_PRESSURE(INSN) (HID (INSN)->max_reg_pressure)
906#define INSN_REG_USE_LIST(INSN) (HID (INSN)->reg_use_list)
907#define INSN_REG_SET_LIST(INSN) (HID (INSN)->reg_set_list)
908#define INSN_REG_PRESSURE_EXCESS_COST_CHANGE(INSN) \
909 (HID (INSN)->reg_pressure_excess_cost_change)
e855c69d 910#define INSN_PRIORITY_STATUS(INSN) (HID (INSN)->priority_status)
7a1aca9c 911#define INSN_MODEL_INDEX(INSN) (HID (INSN)->model_index)
e855c69d
AB
912
913typedef struct _haifa_deps_insn_data haifa_deps_insn_data_def;
914typedef haifa_deps_insn_data_def *haifa_deps_insn_data_t;
915
e855c69d 916
9771b263 917extern vec<haifa_deps_insn_data_def> h_d_i_d;
e855c69d 918
9771b263 919#define HDID(INSN) (&h_d_i_d[INSN_LUID (INSN)])
e855c69d
AB
920#define INSN_DEP_COUNT(INSN) (HDID (INSN)->dep_count)
921#define HAS_INTERNAL_DEP(INSN) (HDID (INSN)->has_internal_dep)
922#define INSN_FORW_DEPS(INSN) (HDID (INSN)->forw_deps)
923#define INSN_RESOLVED_BACK_DEPS(INSN) (HDID (INSN)->resolved_back_deps)
924#define INSN_RESOLVED_FORW_DEPS(INSN) (HDID (INSN)->resolved_forw_deps)
925#define INSN_HARD_BACK_DEPS(INSN) (HDID (INSN)->hard_back_deps)
926#define INSN_SPEC_BACK_DEPS(INSN) (HDID (INSN)->spec_back_deps)
f0898307 927#define INSN_CACHED_COND(INSN) (HDID (INSN)->cond)
b0bd15f7 928#define INSN_REVERSE_COND(INSN) (HDID (INSN)->reverse_cond)
e2724e63 929#define INSN_COND_DEPS(INSN) (HDID (INSN)->cond_deps)
e855c69d 930#define CANT_MOVE(INSN) (HDID (INSN)->cant_move)
9771b263 931#define CANT_MOVE_BY_LUID(LUID) (h_d_i_d[LUID].cant_move)
e855c69d
AB
932
933
934#define INSN_PRIORITY(INSN) (HID (INSN)->priority)
935#define INSN_PRIORITY_STATUS(INSN) (HID (INSN)->priority_status)
916fa4f0 936#define INSN_PRIORITY_KNOWN(INSN) (INSN_PRIORITY_STATUS (INSN) > 0)
e855c69d
AB
937#define TODO_SPEC(INSN) (HID (INSN)->todo_spec)
938#define DONE_SPEC(INSN) (HID (INSN)->done_spec)
939#define CHECK_SPEC(INSN) (HID (INSN)->check_spec)
940#define RECOVERY_BLOCK(INSN) (HID (INSN)->recovery_block)
941#define ORIG_PAT(INSN) (HID (INSN)->orig_pat)
e2724e63 942#define PREDICATED_PAT(INSN) (HID (INSN)->predicated_pat)
ddbd5439 943
d7bfd907 944/* INSN is either a simple or a branchy speculation check. */
e855c69d
AB
945#define IS_SPECULATION_CHECK_P(INSN) \
946 (sel_sched_p () ? sel_insn_is_speculation_check (INSN) : RECOVERY_BLOCK (INSN) != NULL)
d7bfd907
MK
947
948/* INSN is a speculation check that will simply reexecute the speculatively
73d1943a 949 scheduled instruction if the speculation fails. */
d7bfd907 950#define IS_SPECULATION_SIMPLE_CHECK_P(INSN) \
fefa31b5 951 (RECOVERY_BLOCK (INSN) == EXIT_BLOCK_PTR_FOR_FN (cfun))
d7bfd907 952
7ea84dc4 953/* INSN is a speculation check that will branch to RECOVERY_BLOCK if the
73d1943a 954 speculation fails. Insns in that block will reexecute the speculatively
f63645be 955 scheduled code and then will return immediately after INSN thus preserving
7ea84dc4
MK
956 semantics of the program. */
957#define IS_SPECULATION_BRANCHY_CHECK_P(INSN) \
fefa31b5
DM
958 (RECOVERY_BLOCK (INSN) != NULL \
959 && RECOVERY_BLOCK (INSN) != EXIT_BLOCK_PTR_FOR_FN (cfun))
7ea84dc4 960
8e90de43
SB
961\f
962/* Dep status (aka ds_t) of the link encapsulates all information for a given
963 dependency, including everything that is needed for speculative scheduling.
964
965 The lay-out of a ds_t is as follows:
966
967 1. Integers corresponding to the probability of the dependence to *not*
968 exist. This is the probability that overcoming this dependence will
969 not be followed by execution of the recovery code. Note that however
970 high this probability is, the recovery code should still always be
971 generated to preserve semantics of the program.
972
973 The probability values can be set or retrieved using the functions
974 the set_dep_weak() and get_dep_weak() in sched-deps.c. The values
975 are always in the range [0, MAX_DEP_WEAK].
976
977 BEGIN_DATA : BITS_PER_DEP_WEAK
978 BE_IN_DATA : BITS_PER_DEP_WEAK
979 BEGIN_CONTROL : BITS_PER_DEP_WEAK
980 BE_IN_CONTROL : BITS_PER_DEP_WEAK
981
982 The basic type of DS_T is a host int. For a 32-bits int, the values
983 will each take 6 bits.
984
985 2. The type of dependence. This supercedes the old-style REG_NOTE_KIND
986 values. TODO: Use this field instead of DEP_TYPE, or make DEP_TYPE
987 extract the dependence type from here.
ddbd5439 988
8e90de43 989 dep_type : 4 => DEP_{TRUE|OUTPUT|ANTI|CONTROL}
ddbd5439 990
8e90de43
SB
991 3. Various flags:
992
993 HARD_DEP : 1 => Set if an instruction has a non-speculative
994 dependence. This is an instruction property
995 so this bit can only appear in the TODO_SPEC
996 field of an instruction.
997 DEP_POSTPONED : 1 => Like HARD_DEP, but the hard dependence may
998 still be broken by adjusting the instruction.
999 DEP_CANCELLED : 1 => Set if a dependency has been broken using
1000 some form of speculation.
1001 RESERVED : 1 => Reserved for use in the delay slot scheduler.
1002
1003 See also: check_dep_status () in sched-deps.c . */
1004
1005/* The number of bits per weakness probability. There are 4 weakness types
1006 and we need 8 bits for other data in a DS_T. */
1007#define BITS_PER_DEP_WEAK ((BITS_PER_DEP_STATUS - 8) / 4)
ddbd5439
MK
1008
1009/* Mask of speculative weakness in dep_status. */
1010#define DEP_WEAK_MASK ((1 << BITS_PER_DEP_WEAK) - 1)
1011
1012/* This constant means that dependence is fake with 99.999...% probability.
1013 This is the maximum value, that can appear in dep_status.
1014 Note, that we don't want MAX_DEP_WEAK to be the same as DEP_WEAK_MASK for
1015 debugging reasons. Though, it can be set to DEP_WEAK_MASK, and, when
1016 done so, we'll get fast (mul for)/(div by) NO_DEP_WEAK. */
1017#define MAX_DEP_WEAK (DEP_WEAK_MASK - 1)
1018
1019/* This constant means that dependence is 99.999...% real and it is a really
1020 bad idea to overcome it (though this can be done, preserving program
1021 semantics). */
1022#define MIN_DEP_WEAK 1
1023
1024/* This constant represents 100% probability.
8e90de43
SB
1025 E.g. it is used to represent weakness of dependence, that doesn't exist.
1026 This value never appears in a ds_t, it is only used for computing the
1027 weakness of a dependence. */
ddbd5439
MK
1028#define NO_DEP_WEAK (MAX_DEP_WEAK + MIN_DEP_WEAK)
1029
1030/* Default weakness of speculative dependence. Used when we can't say
1031 neither bad nor good about the dependence. */
1032#define UNCERTAIN_DEP_WEAK (MAX_DEP_WEAK - MAX_DEP_WEAK / 4)
1033
1034/* Offset for speculative weaknesses in dep_status. */
1035enum SPEC_TYPES_OFFSETS {
1036 BEGIN_DATA_BITS_OFFSET = 0,
1037 BE_IN_DATA_BITS_OFFSET = BEGIN_DATA_BITS_OFFSET + BITS_PER_DEP_WEAK,
1038 BEGIN_CONTROL_BITS_OFFSET = BE_IN_DATA_BITS_OFFSET + BITS_PER_DEP_WEAK,
1039 BE_IN_CONTROL_BITS_OFFSET = BEGIN_CONTROL_BITS_OFFSET + BITS_PER_DEP_WEAK
1040};
1041
8e90de43
SB
1042/* The following defines provide numerous constants used to distinguish
1043 between different types of speculative dependencies. They are also
1044 used as masks to clear/preserve the bits corresponding to the type
1045 of dependency weakness. */
ddbd5439 1046
917f1b7e 1047/* Dependence can be overcome with generation of new data speculative
ddbd5439
MK
1048 instruction. */
1049#define BEGIN_DATA (((ds_t) DEP_WEAK_MASK) << BEGIN_DATA_BITS_OFFSET)
1050
1051/* This dependence is to the instruction in the recovery block, that was
1052 formed to recover after data-speculation failure.
917f1b7e 1053 Thus, this dependence can overcome with generating of the copy of
ddbd5439
MK
1054 this instruction in the recovery block. */
1055#define BE_IN_DATA (((ds_t) DEP_WEAK_MASK) << BE_IN_DATA_BITS_OFFSET)
1056
917f1b7e 1057/* Dependence can be overcome with generation of new control speculative
ddbd5439
MK
1058 instruction. */
1059#define BEGIN_CONTROL (((ds_t) DEP_WEAK_MASK) << BEGIN_CONTROL_BITS_OFFSET)
1060
1061/* This dependence is to the instruction in the recovery block, that was
1062 formed to recover after control-speculation failure.
75c40d56 1063 Thus, this dependence can be overcome with generating of the copy of
ddbd5439
MK
1064 this instruction in the recovery block. */
1065#define BE_IN_CONTROL (((ds_t) DEP_WEAK_MASK) << BE_IN_CONTROL_BITS_OFFSET)
1066
917f1b7e 1067/* A few convenient combinations. */
ddbd5439
MK
1068#define BEGIN_SPEC (BEGIN_DATA | BEGIN_CONTROL)
1069#define DATA_SPEC (BEGIN_DATA | BE_IN_DATA)
1070#define CONTROL_SPEC (BEGIN_CONTROL | BE_IN_CONTROL)
1071#define SPECULATIVE (DATA_SPEC | CONTROL_SPEC)
1072#define BE_IN_SPEC (BE_IN_DATA | BE_IN_CONTROL)
1073
1074/* Constants, that are helpful in iterating through dep_status. */
1075#define FIRST_SPEC_TYPE BEGIN_DATA
1076#define LAST_SPEC_TYPE BE_IN_CONTROL
1077#define SPEC_TYPE_SHIFT BITS_PER_DEP_WEAK
1078
1079/* Dependence on instruction can be of multiple types
1080 (e.g. true and output). This fields enhance REG_NOTE_KIND information
1081 of the dependence. */
1082#define DEP_TRUE (((ds_t) 1) << (BE_IN_CONTROL_BITS_OFFSET + BITS_PER_DEP_WEAK))
1083#define DEP_OUTPUT (DEP_TRUE << 1)
1084#define DEP_ANTI (DEP_OUTPUT << 1)
e2724e63 1085#define DEP_CONTROL (DEP_ANTI << 1)
ddbd5439 1086
e2724e63 1087#define DEP_TYPES (DEP_TRUE | DEP_OUTPUT | DEP_ANTI | DEP_CONTROL)
ddbd5439
MK
1088
1089/* Instruction has non-speculative dependence. This bit represents the
1090 property of an instruction - not the one of a dependence.
8e90de43 1091 Therefore, it can appear only in the TODO_SPEC field of an instruction. */
e2724e63
BS
1092#define HARD_DEP (DEP_CONTROL << 1)
1093
8e90de43
SB
1094/* Like HARD_DEP, but dependencies can perhaps be broken by modifying
1095 the instructions. This is used for example to change:
1096
1097 rn++ => rm=[rn + 4]
1098 rm=[rn] rn++
1099
1100 For instructions that have this bit set, one of the dependencies of
1101 the instructions will have a non-NULL REPLACE field in its DEP_T.
1102 Just like HARD_DEP, this bit is only ever set in TODO_SPEC. */
1a83e602
BS
1103#define DEP_POSTPONED (HARD_DEP << 1)
1104
8e90de43 1105/* Set if a dependency is cancelled via speculation. */
1a83e602 1106#define DEP_CANCELLED (DEP_POSTPONED << 1)
ddbd5439 1107
8e90de43 1108\f
b8698a0f 1109/* This represents the results of calling sched-deps.c functions,
e2f6ff94 1110 which modify dependencies. */
ddbd5439 1111enum DEPS_ADJUST_RESULT {
e2f6ff94
MK
1112 /* No dependence needed (e.g. producer == consumer). */
1113 DEP_NODEP,
1114 /* Dependence is already present and wasn't modified. */
1115 DEP_PRESENT,
1116 /* Existing dependence was modified to include additional information. */
1117 DEP_CHANGED,
1118 /* New dependence has been created. */
1119 DEP_CREATED
ddbd5439
MK
1120};
1121
b8698a0f 1122/* Represents the bits that can be set in the flags field of the
ddbd5439
MK
1123 sched_info structure. */
1124enum SCHED_FLAGS {
1125 /* If set, generate links between instruction as DEPS_LIST.
1126 Otherwise, generate usual INSN_LIST links. */
1127 USE_DEPS_LIST = 1,
1128 /* Perform data or control (or both) speculation.
1129 Results in generation of data and control speculative dependencies.
1130 Requires USE_DEPS_LIST set. */
496d7bb0 1131 DO_SPECULATION = USE_DEPS_LIST << 1,
26965010 1132 DO_BACKTRACKING = DO_SPECULATION << 1,
e2724e63 1133 DO_PREDICATION = DO_BACKTRACKING << 1,
1a83e602
BS
1134 DONT_BREAK_DEPENDENCIES = DO_PREDICATION << 1,
1135 SCHED_RGN = DONT_BREAK_DEPENDENCIES << 1,
496d7bb0 1136 SCHED_EBB = SCHED_RGN << 1,
e855c69d
AB
1137 /* Scheduler can possibly create new basic blocks. Used for assertions. */
1138 NEW_BBS = SCHED_EBB << 1,
1139 SEL_SCHED = NEW_BBS << 1
496d7bb0
MK
1140};
1141
1142enum SPEC_SCHED_FLAGS {
1143 COUNT_SPEC_IN_CRITICAL_PATH = 1,
1144 PREFER_NON_DATA_SPEC = COUNT_SPEC_IN_CRITICAL_PATH << 1,
e855c69d
AB
1145 PREFER_NON_CONTROL_SPEC = PREFER_NON_DATA_SPEC << 1,
1146 SEL_SCHED_SPEC_DONT_CHECK_CONTROL = PREFER_NON_CONTROL_SPEC << 1
ddbd5439 1147};
b4ead7d4 1148
a38e7aa5 1149#define NOTE_NOT_BB_P(NOTE) (NOTE_P (NOTE) && (NOTE_KIND (NOTE) \
496d7bb0
MK
1150 != NOTE_INSN_BASIC_BLOCK))
1151
16f6ece6 1152extern FILE *sched_dump;
b4ead7d4 1153extern int sched_verbose;
16f6ece6 1154
e2f6ff94
MK
1155extern spec_info_t spec_info;
1156extern bool haifa_recovery_bb_ever_added_p;
1157
15aab9c0
VM
1158/* Exception Free Loads:
1159
1160 We define five classes of speculative loads: IFREE, IRISKY,
1161 PFREE, PRISKY, and MFREE.
1162
1163 IFREE loads are loads that are proved to be exception-free, just
1164 by examining the load insn. Examples for such loads are loads
1165 from TOC and loads of global data.
1166
1167 IRISKY loads are loads that are proved to be exception-risky,
1168 just by examining the load insn. Examples for such loads are
1169 volatile loads and loads from shared memory.
1170
1171 PFREE loads are loads for which we can prove, by examining other
1172 insns, that they are exception-free. Currently, this class consists
1173 of loads for which we are able to find a "similar load", either in
1174 the target block, or, if only one split-block exists, in that split
1175 block. Load2 is similar to load1 if both have same single base
1176 register. We identify only part of the similar loads, by finding
1177 an insn upon which both load1 and load2 have a DEF-USE dependence.
1178
1179 PRISKY loads are loads for which we can prove, by examining other
1180 insns, that they are exception-risky. Currently we have two proofs for
1181 such loads. The first proof detects loads that are probably guarded by a
1182 test on the memory address. This proof is based on the
1183 backward and forward data dependence information for the region.
1184 Let load-insn be the examined load.
1185 Load-insn is PRISKY iff ALL the following hold:
1186
1187 - insn1 is not in the same block as load-insn
1188 - there is a DEF-USE dependence chain (insn1, ..., load-insn)
1189 - test-insn is either a compare or a branch, not in the same block
1190 as load-insn
1191 - load-insn is reachable from test-insn
1192 - there is a DEF-USE dependence chain (insn1, ..., test-insn)
1193
1194 This proof might fail when the compare and the load are fed
1195 by an insn not in the region. To solve this, we will add to this
1196 group all loads that have no input DEF-USE dependence.
1197
1198 The second proof detects loads that are directly or indirectly
1199 fed by a speculative load. This proof is affected by the
1200 scheduling process. We will use the flag fed_by_spec_load.
1201 Initially, all insns have this flag reset. After a speculative
1202 motion of an insn, if insn is either a load, or marked as
1203 fed_by_spec_load, we will also mark as fed_by_spec_load every
1204 insn1 for which a DEF-USE dependence (insn, insn1) exists. A
1205 load which is fed_by_spec_load is also PRISKY.
1206
1207 MFREE (maybe-free) loads are all the remaining loads. They may be
1208 exception-free, but we cannot prove it.
1209
1210 Now, all loads in IFREE and PFREE classes are considered
1211 exception-free, while all loads in IRISKY and PRISKY classes are
1212 considered exception-risky. As for loads in the MFREE class,
1213 these are considered either exception-free or exception-risky,
1214 depending on whether we are pessimistic or optimistic. We have
1215 to take the pessimistic approach to assure the safety of
1216 speculative scheduling, but we can take the optimistic approach
1217 by invoking the -fsched_spec_load_dangerous option. */
1218
1219enum INSN_TRAP_CLASS
1220{
1221 TRAP_FREE = 0, IFREE = 1, PFREE_CANDIDATE = 2,
1222 PRISKY_CANDIDATE = 3, IRISKY = 4, TRAP_RISKY = 5
1223};
1224
1225#define WORST_CLASS(class1, class2) \
1226((class1 > class2) ? class1 : class2)
1227
1708fd40
BS
1228#ifndef __GNUC__
1229#define __inline
1230#endif
1231
1232#ifndef HAIFA_INLINE
1233#define HAIFA_INLINE __inline
1234#endif
16f6ece6 1235
e855c69d
AB
1236struct sched_deps_info_def
1237{
1238 /* Called when computing dependencies for a JUMP_INSN. This function
1239 should store the set of registers that must be considered as set by
1240 the jump in the regset. */
aef0e7a8 1241 void (*compute_jump_reg_dependencies) (rtx, regset);
e855c69d
AB
1242
1243 /* Start analyzing insn. */
1244 void (*start_insn) (rtx);
1245
1246 /* Finish analyzing insn. */
1247 void (*finish_insn) (void);
1248
1249 /* Start analyzing insn LHS (Left Hand Side). */
1250 void (*start_lhs) (rtx);
1251
1252 /* Finish analyzing insn LHS. */
1253 void (*finish_lhs) (void);
1254
1255 /* Start analyzing insn RHS (Right Hand Side). */
1256 void (*start_rhs) (rtx);
1257
1258 /* Finish analyzing insn RHS. */
1259 void (*finish_rhs) (void);
1260
1261 /* Note set of the register. */
1262 void (*note_reg_set) (int);
1263
1264 /* Note clobber of the register. */
1265 void (*note_reg_clobber) (int);
1266
1267 /* Note use of the register. */
1268 void (*note_reg_use) (int);
1269
1270 /* Note memory dependence of type DS between MEM1 and MEM2 (which is
1271 in the INSN2). */
1272 void (*note_mem_dep) (rtx mem1, rtx mem2, rtx insn2, ds_t ds);
1273
1274 /* Note a dependence of type DS from the INSN. */
1275 void (*note_dep) (rtx insn, ds_t ds);
1276
1277 /* Nonzero if we should use cselib for better alias analysis. This
1278 must be 0 if the dependency information is used after sched_analyze
1279 has completed, e.g. if we're using it to initialize state for successor
1280 blocks in region scheduling. */
1281 unsigned int use_cselib : 1;
1282
1283 /* If set, generate links between instruction as DEPS_LIST.
1284 Otherwise, generate usual INSN_LIST links. */
1285 unsigned int use_deps_list : 1;
1286
1287 /* Generate data and control speculative dependencies.
1288 Requires USE_DEPS_LIST set. */
1289 unsigned int generate_spec_deps : 1;
1290};
1291
1292extern struct sched_deps_info_def *sched_deps_info;
1293
1294
16f6ece6 1295/* Functions in sched-deps.c. */
e2724e63 1296extern rtx sched_get_reverse_condition_uncached (const_rtx);
9678086d 1297extern bool sched_insns_conditions_mutex_p (const_rtx, const_rtx);
c275297b 1298extern bool sched_insn_is_legitimate_for_speculation_p (const_rtx, ds_t);
ddbd5439 1299extern void add_dependence (rtx, rtx, enum reg_note);
88302d54
JH
1300extern void sched_analyze (struct deps_desc *, rtx, rtx);
1301extern void init_deps (struct deps_desc *, bool);
1302extern void init_deps_reg_last (struct deps_desc *);
1303extern void free_deps (struct deps_desc *);
46c5ad27
AJ
1304extern void init_deps_global (void);
1305extern void finish_deps_global (void);
88302d54
JH
1306extern void deps_analyze_insn (struct deps_desc *, rtx);
1307extern void remove_from_deps (struct deps_desc *, rtx);
19ac7892 1308extern void init_insn_reg_pressure_info (rtx);
e855c69d 1309
496d7bb0 1310extern dw_t get_dep_weak (ds_t, ds_t);
ddbd5439 1311extern ds_t set_dep_weak (ds_t, ds_t, dw_t);
e855c69d 1312extern dw_t estimate_dep_weak (rtx, rtx);
496d7bb0 1313extern ds_t ds_merge (ds_t, ds_t);
e855c69d
AB
1314extern ds_t ds_full_merge (ds_t, ds_t, rtx, rtx);
1315extern ds_t ds_max_merge (ds_t, ds_t);
1316extern dw_t ds_weak (ds_t);
1317extern ds_t ds_get_speculation_types (ds_t);
1318extern ds_t ds_get_max_dep_weak (ds_t);
1319
1320extern void sched_deps_init (bool);
1321extern void sched_deps_finish (void);
1322
1323extern void haifa_note_reg_set (int);
1324extern void haifa_note_reg_clobber (int);
1325extern void haifa_note_reg_use (int);
1326
1327extern void maybe_extend_reg_info_p (void);
1328
88302d54 1329extern void deps_start_bb (struct deps_desc *, rtx);
e855c69d
AB
1330extern enum reg_note ds_to_dt (ds_t);
1331
1332extern bool deps_pools_are_empty_p (void);
1333extern void sched_free_deps (rtx, rtx, bool);
1334extern void extend_dependency_caches (int, bool);
1335
e2f6ff94 1336extern void debug_ds (ds_t);
16f6ece6 1337
ce18efcb 1338
16f6ece6 1339/* Functions in haifa-sched.c. */
f20f2613
VM
1340extern void initialize_live_range_shrinkage (void);
1341extern void finish_live_range_shrinkage (void);
ce18efcb 1342extern void sched_init_region_reg_pressure_info (void);
c4cd7435 1343extern void free_global_sched_pressure_data (void);
9678086d 1344extern int haifa_classify_insn (const_rtx);
496d7bb0 1345extern void get_ebb_head_tail (basic_block, basic_block, rtx *, rtx *);
9678086d 1346extern int no_real_insns_p (const_rtx, const_rtx);
b4ead7d4 1347
b198261f 1348extern int insn_cost (rtx);
e855c69d 1349extern int dep_cost_1 (dep_t, dw_t);
b198261f 1350extern int dep_cost (dep_t);
46c5ad27 1351extern int set_priorities (rtx, rtx);
b4ead7d4 1352
ce18efcb 1353extern void sched_setup_bb_reg_pressure_info (basic_block, rtx);
975ccf22 1354extern bool schedule_block (basic_block *, state_t);
e855c69d
AB
1355
1356extern int cycle_issued_insns;
1357extern int issue_rate;
1358extern int dfa_lookahead;
1359
1360extern void ready_sort (struct ready_list *);
1361extern rtx ready_element (struct ready_list *, int);
1362extern rtx *ready_lastpos (struct ready_list *);
b4ead7d4 1363
63f54b1a 1364extern int try_ready (rtx);
e855c69d
AB
1365extern void sched_extend_ready_list (int);
1366extern void sched_finish_ready_list (void);
1367extern void sched_change_pattern (rtx, rtx);
1368extern int sched_speculate_insn (rtx, ds_t, rtx *);
496d7bb0
MK
1369extern void unlink_bb_notes (basic_block, basic_block);
1370extern void add_block (basic_block, basic_block);
d3b30e42 1371extern rtx bb_note (basic_block);
e855c69d 1372extern void concat_note_lists (rtx, rtx *);
9dcc2e87 1373extern rtx sched_emit_insn (rtx);
7942e47e
RY
1374extern rtx get_ready_element (int);
1375extern int number_in_ready (void);
e855c69d 1376\f
7043b893 1377/* Types and functions in sched-ebb.c. */
496d7bb0 1378
7043b893
BS
1379extern basic_block schedule_ebb (rtx, rtx, bool);
1380extern void schedule_ebbs_init (void);
1381extern void schedule_ebbs_finish (void);
1382\f
e855c69d 1383/* Types and functions in sched-rgn.c. */
e2f6ff94 1384
e855c69d
AB
1385/* A region is the main entity for interblock scheduling: insns
1386 are allowed to move between blocks in the same region, along
1387 control flow graph edges, in the 'up' direction. */
84562394 1388struct region
e855c69d
AB
1389{
1390 /* Number of extended basic blocks in region. */
1391 int rgn_nr_blocks;
1392 /* cblocks in the region (actually index in rgn_bb_table). */
1393 int rgn_blocks;
1394 /* Dependencies for this region are already computed. Basically, indicates,
1395 that this is a recovery block. */
1396 unsigned int dont_calc_deps : 1;
1397 /* This region has at least one non-trivial ebb. */
1398 unsigned int has_real_ebb : 1;
84562394 1399};
e855c69d
AB
1400
1401extern int nr_regions;
1402extern region *rgn_table;
1403extern int *rgn_bb_table;
1404extern int *block_to_bb;
1405extern int *containing_rgn;
1406
b0de17ef
SB
1407/* Often used short-hand in the scheduler. The rest of the compiler uses
1408 BLOCK_FOR_INSN(INSN) and an indirect reference to get the basic block
1409 number ("index"). For historical reasons, the scheduler does not. */
1410#define BLOCK_NUM(INSN) (BLOCK_FOR_INSN (INSN)->index + 0)
1411
e855c69d
AB
1412#define RGN_NR_BLOCKS(rgn) (rgn_table[rgn].rgn_nr_blocks)
1413#define RGN_BLOCKS(rgn) (rgn_table[rgn].rgn_blocks)
1414#define RGN_DONT_CALC_DEPS(rgn) (rgn_table[rgn].dont_calc_deps)
1415#define RGN_HAS_REAL_EBB(rgn) (rgn_table[rgn].has_real_ebb)
1416#define BLOCK_TO_BB(block) (block_to_bb[block])
1417#define CONTAINING_RGN(block) (containing_rgn[block])
1418
1419/* The mapping from ebb to block. */
1420extern int *ebb_head;
1421#define BB_TO_BLOCK(ebb) (rgn_bb_table[ebb_head[ebb]])
06e28de2
DM
1422#define EBB_FIRST_BB(ebb) BASIC_BLOCK_FOR_FN (cfun, BB_TO_BLOCK (ebb))
1423#define EBB_LAST_BB(ebb) \
1424 BASIC_BLOCK_FOR_FN (cfun, rgn_bb_table[ebb_head[ebb + 1] - 1])
e855c69d
AB
1425#define INSN_BB(INSN) (BLOCK_TO_BB (BLOCK_NUM (INSN)))
1426
1427extern int current_nr_blocks;
1428extern int current_blocks;
1429extern int target_bb;
26965010 1430extern bool sched_no_dce;
e855c69d 1431
06d7e8e7
BS
1432extern void set_modulo_params (int, int, int, int);
1433extern void record_delay_slot_pair (rtx, rtx, int, int);
e2724e63 1434extern rtx real_insn_for_shadow (rtx);
06d7e8e7 1435extern void discard_delay_pairs_above (int);
26965010
BS
1436extern void free_delay_pairs (void);
1437extern void add_delay_dependencies (rtx);
e855c69d
AB
1438extern bool sched_is_disabled_for_current_region_p (void);
1439extern void sched_rgn_init (bool);
1440extern void sched_rgn_finish (void);
1441extern void rgn_setup_region (int);
1442extern void sched_rgn_compute_dependencies (int);
1443extern void sched_rgn_local_init (int);
1444extern void sched_rgn_local_finish (void);
1445extern void sched_rgn_local_free (void);
1446extern void extend_regions (void);
1447extern void rgn_make_new_region_out_of_new_block (basic_block);
1448
1449extern void compute_priorities (void);
1450extern void increase_insn_priority (rtx, int);
1451extern void debug_rgn_dependencies (int);
b640bd8f 1452extern void debug_dependencies (rtx, rtx);
b8698a0f 1453extern void free_rgn_deps (void);
e855c69d
AB
1454extern int contributes_to_priority (rtx, rtx);
1455extern void extend_rgns (int *, int *, sbitmap, int *);
88302d54 1456extern void deps_join (struct deps_desc *, struct deps_desc *);
e855c69d
AB
1457
1458extern void rgn_setup_common_sched_info (void);
1459extern void rgn_setup_sched_infos (void);
1460
1461extern void debug_regions (void);
1462extern void debug_region (int);
1463extern void dump_region_dot (FILE *, int);
1464extern void dump_region_dot_file (const char *, int);
1465
1466extern void haifa_sched_init (void);
1467extern void haifa_sched_finish (void);
b640bd8f 1468
1a83e602
BS
1469extern void find_modifiable_mems (rtx, rtx);
1470
e2f6ff94
MK
1471/* sched-deps.c interface to walk, add, search, update, resolve, delete
1472 and debug instruction dependencies. */
1473
1474/* Constants defining dependences lists. */
1475
1476/* No list. */
1477#define SD_LIST_NONE (0)
1478
1479/* hard_back_deps. */
1480#define SD_LIST_HARD_BACK (1)
1481
1482/* spec_back_deps. */
1483#define SD_LIST_SPEC_BACK (2)
1484
1485/* forw_deps. */
1486#define SD_LIST_FORW (4)
1487
1488/* resolved_back_deps. */
1489#define SD_LIST_RES_BACK (8)
1490
1491/* resolved_forw_deps. */
1492#define SD_LIST_RES_FORW (16)
1493
1494#define SD_LIST_BACK (SD_LIST_HARD_BACK | SD_LIST_SPEC_BACK)
1495
1496/* A type to hold above flags. */
1497typedef int sd_list_types_def;
1498
9678086d 1499extern void sd_next_list (const_rtx, sd_list_types_def *, deps_list_t *, bool *);
e2f6ff94
MK
1500
1501/* Iterator to walk through, resolve and delete dependencies. */
1502struct _sd_iterator
1503{
1504 /* What lists to walk. Can be any combination of SD_LIST_* flags. */
1505 sd_list_types_def types;
1506
1507 /* Instruction dependencies lists of which will be walked. */
1508 rtx insn;
1509
1510 /* Pointer to the next field of the previous element. This is not
1511 simply a pointer to the next element to allow easy deletion from the
1512 list. When a dep is being removed from the list the iterator
1513 will automatically advance because the value in *linkp will start
15dc95cb 1514 referring to the next element. */
e2f6ff94
MK
1515 dep_link_t *linkp;
1516
1517 /* True if the current list is a resolved one. */
1518 bool resolved_p;
1519};
1520
1521typedef struct _sd_iterator sd_iterator_def;
1522
1523/* ??? We can move some definitions that are used in below inline functions
1524 out of sched-int.h to sched-deps.c provided that the below functions will
1525 become global externals.
1526 These definitions include:
1527 * struct _deps_list: opaque pointer is needed at global scope.
1528 * struct _dep_link: opaque pointer is needed at scope of sd_iterator_def.
1529 * struct _dep_node: opaque pointer is needed at scope of
1530 struct _deps_link. */
1531
1532/* Return initialized iterator. */
1533static inline sd_iterator_def
1534sd_iterator_start (rtx insn, sd_list_types_def types)
1535{
1536 /* Some dep_link a pointer to which will return NULL. */
1537 static dep_link_t null_link = NULL;
1538
1539 sd_iterator_def i;
1540
1541 i.types = types;
1542 i.insn = insn;
1543 i.linkp = &null_link;
1544
1545 /* Avoid 'uninitialized warning'. */
1546 i.resolved_p = false;
1547
1548 return i;
1549}
1550
1551/* Return the current element. */
1552static inline bool
1553sd_iterator_cond (sd_iterator_def *it_ptr, dep_t *dep_ptr)
1554{
1555 dep_link_t link = *it_ptr->linkp;
1556
1557 if (link != NULL)
1558 {
1559 *dep_ptr = DEP_LINK_DEP (link);
1560 return true;
1561 }
1562 else
1563 {
1564 sd_list_types_def types = it_ptr->types;
1565
1566 if (types != SD_LIST_NONE)
1567 /* Switch to next list. */
1568 {
1569 deps_list_t list;
1570
1571 sd_next_list (it_ptr->insn,
1572 &it_ptr->types, &list, &it_ptr->resolved_p);
1573
1574 it_ptr->linkp = &DEPS_LIST_FIRST (list);
1575
b5b8b0ac
AO
1576 if (list)
1577 return sd_iterator_cond (it_ptr, dep_ptr);
e2f6ff94
MK
1578 }
1579
1580 *dep_ptr = NULL;
1581 return false;
1582 }
1583}
1584
1585/* Advance iterator. */
1586static inline void
1587sd_iterator_next (sd_iterator_def *it_ptr)
1588{
1589 it_ptr->linkp = &DEP_LINK_NEXT (*it_ptr->linkp);
1590}
1591
1592/* A cycle wrapper. */
1593#define FOR_EACH_DEP(INSN, LIST_TYPES, ITER, DEP) \
1594 for ((ITER) = sd_iterator_start ((INSN), (LIST_TYPES)); \
1595 sd_iterator_cond (&(ITER), &(DEP)); \
1596 sd_iterator_next (&(ITER)))
1597
7942e47e
RY
1598#define IS_DISPATCH_ON 1
1599#define IS_CMP 2
1600#define DISPATCH_VIOLATION 3
1601#define FITS_DISPATCH_WINDOW 4
1602#define DISPATCH_INIT 5
1603#define ADD_TO_DISPATCH_WINDOW 6
1604
9678086d
KG
1605extern int sd_lists_size (const_rtx, sd_list_types_def);
1606extern bool sd_lists_empty_p (const_rtx, sd_list_types_def);
e2f6ff94
MK
1607extern void sd_init_insn (rtx);
1608extern void sd_finish_insn (rtx);
1609extern dep_t sd_find_dep_between (rtx, rtx, bool);
1610extern void sd_add_dep (dep_t, bool);
1611extern enum DEPS_ADJUST_RESULT sd_add_or_update_dep (dep_t, bool);
1612extern void sd_resolve_dep (sd_iterator_def);
26965010 1613extern void sd_unresolve_dep (sd_iterator_def);
e2f6ff94
MK
1614extern void sd_copy_back_deps (rtx, rtx, bool);
1615extern void sd_delete_dep (sd_iterator_def);
1616extern void sd_debug_lists (rtx, sd_list_types_def);
1617
a750daa2
MK
1618#endif /* INSN_SCHEDULING */
1619
59587b18 1620#endif /* GCC_SCHED_INT_H */
e2724e63 1621