21 #ifndef GCC_SCHED_INT_H
22 #define GCC_SCHED_INT_H
24 #include "insn-attr.h"
26 #ifdef INSN_SCHEDULING
32 enum sched_pass_id_t { SCHED_PASS_UNKNOWN, SCHED_RGN_PASS, SCHED_EBB_PASS,
33 SCHED_SMS_PASS, SCHED_SEL_PASS };
36 enum sched_pressure_algorithm
39 SCHED_PRESSURE_WEIGHTED,
47 extern void sched_init_bbs (
void);
49 extern void sched_extend_luids (
void);
50 extern void sched_init_insn_luid (
rtx);
51 extern void sched_init_luids (bb_vec_t);
52 extern void sched_finish_luids (
void);
54 extern void sched_extend_target (
void);
56 extern void haifa_init_h_i_d (bb_vec_t);
57 extern void haifa_finish_h_i_d (
void);
60 struct common_sched_info_def
68 void (*fix_recovery_cfg) (int, int, int);
84 int (*luid_for_non_insn) (
rtx);
87 enum sched_pass_id_t sched_pass_id;
90 extern struct common_sched_info_def *common_sched_info;
92 extern const struct common_sched_info_def haifa_common_sched_info;
98 return common_sched_info->sched_pass_id == SCHED_SEL_PASS;
102 extern int get_rgn_sched_max_insns_priority (
void);
105 extern void sel_add_to_insn_priority (
rtx,
int);
109 extern int sched_emulate_haifa_p;
114 #define INSN_LUID(INSN) (sched_luids[INSN_UID (INSN)])
115 #define LUID_BY_UID(UID) (sched_luids[UID])
117 #define SET_INSN_LUID(INSN, LUID) \
118 (sched_luids[INSN_UID (INSN)] = (LUID))
121 extern int sched_max_luid;
123 extern int insn_luid (
rtx);
128 extern rtx note_list;
130 extern void remove_notes (
rtx,
rtx);
132 extern void sched_insns_init (
rtx);
133 extern void sched_insns_finish (
void);
135 extern void *xrecalloc (
void *,
size_t,
size_t,
size_t);
137 extern void reemit_notes (
rtx);
140 extern int haifa_classify_insn (
const_rtx);
143 extern void sel_find_rgns (
void);
144 extern void sel_mark_hard_insn (
rtx);
146 extern size_t dfa_state_size;
148 extern void advance_state (
state_t);
150 extern void setup_sched_dump (
void);
151 extern void sched_init (
void);
152 extern void sched_finish (
void);
154 extern bool sel_insn_is_speculation_check (
rtx);
173 extern char *ready_try;
174 extern struct ready_list ready;
176 extern int max_issue (
struct ready_list *,
int,
state_t,
bool,
int *);
178 extern void ebb_compute_jump_reg_dependencies (
rtx,
regset);
196 typedef unsigned int ds_t;
197 #define BITS_PER_DEP_STATUS HOST_BITS_PER_INT
200 typedef unsigned int dw_t;
202 extern enum reg_note ds_to_dk (ds_t);
203 extern ds_t dk_to_ds (
enum reg_note);
209 struct dep_replacement
230 struct dep_replacement *replace;
248 #define UNKNOWN_DEP_COST (-1<<19)
250 typedef struct _dep dep_def;
251 typedef dep_def *dep_t;
253 #define DEP_PRO(D) ((D)->pro)
254 #define DEP_CON(D) ((D)->con)
255 #define DEP_TYPE(D) ((D)->type)
256 #define DEP_STATUS(D) ((D)->status)
257 #define DEP_COST(D) ((D)->cost)
258 #define DEP_NONREG(D) ((D)->nonreg)
259 #define DEP_MULTIPLE(D) ((D)->multiple)
260 #define DEP_REPLACE(D) ((D)->replace)
267 extern void sd_debug_dep (dep_t);
271 typedef struct _dep_node *dep_node_t;
281 struct _dep_link *next;
288 struct _dep_link **prev_nextp;
290 typedef struct _dep_link *dep_link_t;
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)
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)))
303 #define DEP_LINK_TYPE(N) (DEP_TYPE (DEP_LINK_DEP (N)))
304 #define DEP_LINK_STATUS(N) (DEP_STATUS (DEP_LINK_DEP (N)))
315 typedef struct _deps_list *deps_list_t;
317 #define DEPS_LIST_FIRST(L) ((L)->first)
318 #define DEPS_LIST_N_LINKS(L) ((L)->n_links)
418 struct _dep_link back;
424 struct _dep_link forw;
427 #define DEP_NODE_BACK(N) (&(N)->back)
428 #define DEP_NODE_DEP(N) (&(N)->dep)
429 #define DEP_NODE_FORW(N) (&(N)->forw)
434 enum reg_pending_barrier_mode
474 rtx pending_read_insns;
477 rtx pending_read_mems;
480 rtx pending_write_insns;
483 rtx pending_write_mems;
486 rtx pending_jump_insns;
494 int pending_read_list_length;
497 int pending_write_list_length;
502 int pending_flush_length;
513 rtx last_pending_memory_flush;
518 rtx last_function_call;
524 rtx last_function_call_may_noreturn;
530 rtx sched_before_next_call;
533 rtx sched_before_next_jump;
537 enum post_call_group in_post_call_group_p;
550 struct deps_reg *reg_last;
557 enum reg_pending_barrier_mode last_reg_pending_barrier;
564 typedef struct deps_desc *deps_t;
571 struct haifa_sched_info
575 void (*init_ready_list) (void);
578 int (*can_schedule_ready_p) (
rtx);
580 int (*schedule_more_p) (void);
586 ds_t (*new_ready) (
rtx, ds_t);
595 const char *(*print_insn) (
const_rtx, int);
598 int (*contributes_to_priority) (
rtx,
rtx);
602 bool (*insn_finishes_block_p) (
rtx);
605 rtx prev_head, next_tail;
612 unsigned int queue_must_finish_empty:1;
615 int sched_max_insns_priority;
621 void (*add_remove_insn) (
rtx, int);
625 void (*begin_schedule_ready) (
rtx insn);
641 void *(*save_state) (void);
644 void (*restore_state) (
void *);
664 dw_t data_weakness_cutoff;
668 int control_weakness_cutoff;
673 typedef struct spec_info_def *spec_info_t;
675 extern spec_info_t spec_info;
681 extern enum sched_pressure_algorithm sched_pressure;
685 extern enum reg_class *sched_regno_pressure_class;
690 struct _haifa_deps_insn_data
699 unsigned int has_internal_dep;
709 deps_list_t hard_back_deps;
713 deps_list_t spec_back_deps;
717 deps_list_t forw_deps;
721 deps_list_t resolved_back_deps;
726 deps_list_t resolved_forw_deps;
741 unsigned int reverse_cond : 1;
744 unsigned int cant_move : 1;
750 #define INCREASE_BITS 8
754 struct reg_pressure_data
757 unsigned int clobber_increase : INCREASE_BITS;
760 unsigned int set_increase : INCREASE_BITS;
763 unsigned int unused_set_increase : INCREASE_BITS;
765 int change : INCREASE_BITS;
776 struct reg_use_data *next_regno_use;
778 struct reg_use_data *next_insn_use;
791 struct reg_set_data *next_insn_set;
794 struct _haifa_insn_data
830 signed char priority_status;
834 unsigned int fed_by_spec_load : 1;
835 unsigned int is_load_insn : 1;
838 unsigned int feeds_backtrack_insn : 1;
843 unsigned int shadow_p : 1;
847 unsigned int must_recompute_spec : 1;
871 struct reg_pressure_data *reg_pressure;
877 int *max_reg_pressure;
880 struct reg_use_data *reg_use_list;
883 struct reg_set_data *reg_set_list;
886 int reg_pressure_excess_cost_change;
890 typedef struct _haifa_insn_data haifa_insn_data_def;
891 typedef haifa_insn_data_def *haifa_insn_data_t;
896 #define HID(INSN) (&h_i_d[INSN_UID (INSN)])
900 #define INSN_PRIORITY(INSN) (HID (INSN)->priority)
901 #define INSN_REG_PRESSURE(INSN) (HID (INSN)->reg_pressure)
902 #define INSN_MAX_REG_PRESSURE(INSN) (HID (INSN)->max_reg_pressure)
903 #define INSN_REG_USE_LIST(INSN) (HID (INSN)->reg_use_list)
904 #define INSN_REG_SET_LIST(INSN) (HID (INSN)->reg_set_list)
905 #define INSN_REG_PRESSURE_EXCESS_COST_CHANGE(INSN) \
906 (HID (INSN)->reg_pressure_excess_cost_change)
907 #define INSN_PRIORITY_STATUS(INSN) (HID (INSN)->priority_status)
908 #define INSN_MODEL_INDEX(INSN) (HID (INSN)->model_index)
910 typedef struct _haifa_deps_insn_data haifa_deps_insn_data_def;
911 typedef haifa_deps_insn_data_def *haifa_deps_insn_data_t;
916 #define HDID(INSN) (&h_d_i_d[INSN_LUID (INSN)])
917 #define INSN_DEP_COUNT(INSN) (HDID (INSN)->dep_count)
918 #define HAS_INTERNAL_DEP(INSN) (HDID (INSN)->has_internal_dep)
919 #define INSN_FORW_DEPS(INSN) (HDID (INSN)->forw_deps)
920 #define INSN_RESOLVED_BACK_DEPS(INSN) (HDID (INSN)->resolved_back_deps)
921 #define INSN_RESOLVED_FORW_DEPS(INSN) (HDID (INSN)->resolved_forw_deps)
922 #define INSN_HARD_BACK_DEPS(INSN) (HDID (INSN)->hard_back_deps)
923 #define INSN_SPEC_BACK_DEPS(INSN) (HDID (INSN)->spec_back_deps)
924 #define INSN_CACHED_COND(INSN) (HDID (INSN)->cond)
925 #define INSN_REVERSE_COND(INSN) (HDID (INSN)->reverse_cond)
926 #define INSN_COND_DEPS(INSN) (HDID (INSN)->cond_deps)
927 #define CANT_MOVE(INSN) (HDID (INSN)->cant_move)
928 #define CANT_MOVE_BY_LUID(LUID) (h_d_i_d[LUID].cant_move)
931 #define INSN_PRIORITY(INSN) (HID (INSN)->priority)
932 #define INSN_PRIORITY_STATUS(INSN) (HID (INSN)->priority_status)
933 #define INSN_PRIORITY_KNOWN(INSN) (INSN_PRIORITY_STATUS (INSN) > 0)
934 #define TODO_SPEC(INSN) (HID (INSN)->todo_spec)
935 #define DONE_SPEC(INSN) (HID (INSN)->done_spec)
936 #define CHECK_SPEC(INSN) (HID (INSN)->check_spec)
937 #define RECOVERY_BLOCK(INSN) (HID (INSN)->recovery_block)
938 #define ORIG_PAT(INSN) (HID (INSN)->orig_pat)
939 #define PREDICATED_PAT(INSN) (HID (INSN)->predicated_pat)
942 #define IS_SPECULATION_CHECK_P(INSN) \
943 (sel_sched_p () ? sel_insn_is_speculation_check (INSN) : RECOVERY_BLOCK (INSN) != NULL)
947 #define IS_SPECULATION_SIMPLE_CHECK_P(INSN) \
948 (RECOVERY_BLOCK (INSN) == EXIT_BLOCK_PTR)
954 #define IS_SPECULATION_BRANCHY_CHECK_P(INSN) \
955 (RECOVERY_BLOCK (INSN) != NULL && RECOVERY_BLOCK (INSN) != EXIT_BLOCK_PTR)
1003 #define BITS_PER_DEP_WEAK ((BITS_PER_DEP_STATUS - 8) / 4)
1006 #define DEP_WEAK_MASK ((1 << BITS_PER_DEP_WEAK) - 1)
1013 #define MAX_DEP_WEAK (DEP_WEAK_MASK - 1)
1018 #define MIN_DEP_WEAK 1
1024 #define NO_DEP_WEAK (MAX_DEP_WEAK + MIN_DEP_WEAK)
1028 #define UNCERTAIN_DEP_WEAK (MAX_DEP_WEAK - MAX_DEP_WEAK / 4)
1031 enum SPEC_TYPES_OFFSETS {
1032 BEGIN_DATA_BITS_OFFSET = 0,
1033 BE_IN_DATA_BITS_OFFSET = BEGIN_DATA_BITS_OFFSET + BITS_PER_DEP_WEAK,
1034 BEGIN_CONTROL_BITS_OFFSET = BE_IN_DATA_BITS_OFFSET + BITS_PER_DEP_WEAK,
1035 BE_IN_CONTROL_BITS_OFFSET = BEGIN_CONTROL_BITS_OFFSET + BITS_PER_DEP_WEAK
1045 #define BEGIN_DATA (((ds_t) DEP_WEAK_MASK) << BEGIN_DATA_BITS_OFFSET)
1051 #define BE_IN_DATA (((ds_t) DEP_WEAK_MASK) << BE_IN_DATA_BITS_OFFSET)
1055 #define BEGIN_CONTROL (((ds_t) DEP_WEAK_MASK) << BEGIN_CONTROL_BITS_OFFSET)
1061 #define BE_IN_CONTROL (((ds_t) DEP_WEAK_MASK) << BE_IN_CONTROL_BITS_OFFSET)
1064 #define BEGIN_SPEC (BEGIN_DATA | BEGIN_CONTROL)
1065 #define DATA_SPEC (BEGIN_DATA | BE_IN_DATA)
1066 #define CONTROL_SPEC (BEGIN_CONTROL | BE_IN_CONTROL)
1067 #define SPECULATIVE (DATA_SPEC | CONTROL_SPEC)
1068 #define BE_IN_SPEC (BE_IN_DATA | BE_IN_CONTROL)
1071 #define FIRST_SPEC_TYPE BEGIN_DATA
1072 #define LAST_SPEC_TYPE BE_IN_CONTROL
1073 #define SPEC_TYPE_SHIFT BITS_PER_DEP_WEAK
1078 #define DEP_TRUE (((ds_t) 1) << (BE_IN_CONTROL_BITS_OFFSET + BITS_PER_DEP_WEAK))
1079 #define DEP_OUTPUT (DEP_TRUE << 1)
1080 #define DEP_ANTI (DEP_OUTPUT << 1)
1081 #define DEP_CONTROL (DEP_ANTI << 1)
1083 #define DEP_TYPES (DEP_TRUE | DEP_OUTPUT | DEP_ANTI | DEP_CONTROL)
1088 #define HARD_DEP (DEP_CONTROL << 1)
1099 #define DEP_POSTPONED (HARD_DEP << 1)
1102 #define DEP_CANCELLED (DEP_POSTPONED << 1)
1107 enum DEPS_ADJUST_RESULT {
1127 DO_SPECULATION = USE_DEPS_LIST << 1,
1128 DO_BACKTRACKING = DO_SPECULATION << 1,
1129 DO_PREDICATION = DO_BACKTRACKING << 1,
1130 DONT_BREAK_DEPENDENCIES = DO_PREDICATION << 1,
1131 SCHED_RGN = DONT_BREAK_DEPENDENCIES << 1,
1132 SCHED_EBB = SCHED_RGN << 1,
1134 NEW_BBS = SCHED_EBB << 1,
1135 SEL_SCHED = NEW_BBS << 1
1138 enum SPEC_SCHED_FLAGS {
1139 COUNT_SPEC_IN_CRITICAL_PATH = 1,
1140 PREFER_NON_DATA_SPEC = COUNT_SPEC_IN_CRITICAL_PATH << 1,
1141 PREFER_NON_CONTROL_SPEC = PREFER_NON_DATA_SPEC << 1,
1142 SEL_SCHED_SPEC_DONT_CHECK_CONTROL = PREFER_NON_CONTROL_SPEC << 1
1145 #define NOTE_NOT_BB_P(NOTE) (NOTE_P (NOTE) && (NOTE_KIND (NOTE) \
1146 != NOTE_INSN_BASIC_BLOCK))
1148 extern FILE *sched_dump;
1149 extern int sched_verbose;
1151 extern spec_info_t spec_info;
1152 extern bool haifa_recovery_bb_ever_added_p;
1215 enum INSN_TRAP_CLASS
1217 TRAP_FREE = 0, IFREE = 1, PFREE_CANDIDATE = 2,
1218 PRISKY_CANDIDATE = 3, IRISKY = 4, TRAP_RISKY = 5
1221 #define WORST_CLASS(class1, class2) \
1222 ((class1 > class2) ? class1 : class2)
1228 #ifndef HAIFA_INLINE
1229 #define HAIFA_INLINE __inline
1232 struct sched_deps_info_def
1237 void (*compute_jump_reg_dependencies) (
rtx,
regset);
1240 void (*start_insn) (
rtx);
1243 void (*finish_insn) (void);
1246 void (*start_lhs) (
rtx);
1249 void (*finish_lhs) (void);
1252 void (*start_rhs) (
rtx);
1255 void (*finish_rhs) (void);
1258 void (*note_reg_set) (int);
1261 void (*note_reg_clobber) (int);
1264 void (*note_reg_use) (int);
1268 void (*note_mem_dep) (
rtx mem1,
rtx mem2,
rtx insn2, ds_t ds);
1271 void (*note_dep) (
rtx insn, ds_t ds);
1277 unsigned int use_cselib : 1;
1281 unsigned int use_deps_list : 1;
1285 unsigned int generate_spec_deps : 1;
1288 extern struct sched_deps_info_def *sched_deps_info;
1292 extern rtx sched_get_reverse_condition_uncached (
const_rtx);
1294 extern bool sched_insn_is_legitimate_for_speculation_p (
const_rtx, ds_t);
1296 extern void sched_analyze (
struct deps_desc *,
rtx,
rtx);
1297 extern void init_deps (
struct deps_desc *,
bool);
1298 extern void init_deps_reg_last (
struct deps_desc *);
1299 extern void free_deps (
struct deps_desc *);
1300 extern void init_deps_global (
void);
1301 extern void finish_deps_global (
void);
1302 extern void deps_analyze_insn (
struct deps_desc *,
rtx);
1303 extern void remove_from_deps (
struct deps_desc *,
rtx);
1304 extern void init_insn_reg_pressure_info (
rtx);
1306 extern dw_t get_dep_weak (ds_t, ds_t);
1307 extern ds_t set_dep_weak (ds_t, ds_t, dw_t);
1308 extern dw_t estimate_dep_weak (
rtx,
rtx);
1309 extern ds_t ds_merge (ds_t, ds_t);
1310 extern ds_t ds_full_merge (ds_t, ds_t,
rtx,
rtx);
1311 extern ds_t ds_max_merge (ds_t, ds_t);
1312 extern dw_t ds_weak (ds_t);
1313 extern ds_t ds_get_speculation_types (ds_t);
1314 extern ds_t ds_get_max_dep_weak (ds_t);
1316 extern void sched_deps_init (
bool);
1317 extern void sched_deps_finish (
void);
1319 extern void haifa_note_reg_set (
int);
1320 extern void haifa_note_reg_clobber (
int);
1321 extern void haifa_note_reg_use (
int);
1323 extern void maybe_extend_reg_info_p (
void);
1325 extern void deps_start_bb (
struct deps_desc *,
rtx);
1326 extern enum reg_note ds_to_dt (ds_t);
1328 extern bool deps_pools_are_empty_p (
void);
1329 extern void sched_free_deps (
rtx,
rtx,
bool);
1330 extern void extend_dependency_caches (
int,
bool);
1332 extern void debug_ds (ds_t);
1336 extern void sched_init_region_reg_pressure_info (
void);
1337 extern int haifa_classify_insn (
const_rtx);
1341 extern int insn_cost (
rtx);
1342 extern int dep_cost_1 (dep_t, dw_t);
1343 extern int dep_cost (dep_t);
1344 extern int set_priorities (
rtx,
rtx);
1349 extern int cycle_issued_insns;
1351 extern int dfa_lookahead;
1353 extern void ready_sort (
struct ready_list *);
1354 extern rtx ready_element (
struct ready_list *,
int);
1355 extern rtx *ready_lastpos (
struct ready_list *);
1357 extern int try_ready (
rtx);
1358 extern void sched_extend_ready_list (
int);
1359 extern void sched_finish_ready_list (
void);
1360 extern void sched_change_pattern (
rtx,
rtx);
1361 extern int sched_speculate_insn (
rtx, ds_t,
rtx *);
1365 extern void concat_note_lists (
rtx,
rtx *);
1366 extern rtx sched_emit_insn (
rtx);
1367 extern rtx get_ready_element (
int);
1368 extern int number_in_ready (
void);
1373 extern void schedule_ebbs_init (
void);
1374 extern void schedule_ebbs_finish (
void);
1389 unsigned int dont_calc_deps : 1;
1391 unsigned int has_real_ebb : 1;
1395 extern int nr_regions;
1396 extern region *rgn_table;
1397 extern int *rgn_bb_table;
1398 extern int *block_to_bb;
1399 extern int *containing_rgn;
1404 #define BLOCK_NUM(INSN) (BLOCK_FOR_INSN (INSN)->index + 0)
1406 #define RGN_NR_BLOCKS(rgn) (rgn_table[rgn].rgn_nr_blocks)
1407 #define RGN_BLOCKS(rgn) (rgn_table[rgn].rgn_blocks)
1408 #define RGN_DONT_CALC_DEPS(rgn) (rgn_table[rgn].dont_calc_deps)
1409 #define RGN_HAS_REAL_EBB(rgn) (rgn_table[rgn].has_real_ebb)
1410 #define BLOCK_TO_BB(block) (block_to_bb[block])
1411 #define CONTAINING_RGN(block) (containing_rgn[block])
1414 extern int *ebb_head;
1415 #define BB_TO_BLOCK(ebb) (rgn_bb_table[ebb_head[ebb]])
1416 #define EBB_FIRST_BB(ebb) BASIC_BLOCK (BB_TO_BLOCK (ebb))
1417 #define EBB_LAST_BB(ebb) BASIC_BLOCK (rgn_bb_table[ebb_head[ebb + 1] - 1])
1418 #define INSN_BB(INSN) (BLOCK_TO_BB (BLOCK_NUM (INSN)))
1420 extern int current_nr_blocks;
1421 extern int current_blocks;
1422 extern int target_bb;
1423 extern bool sched_no_dce;
1425 extern void set_modulo_params (
int,
int,
int,
int);
1426 extern void record_delay_slot_pair (
rtx,
rtx,
int,
int);
1427 extern rtx real_insn_for_shadow (
rtx);
1428 extern void discard_delay_pairs_above (
int);
1429 extern void free_delay_pairs (
void);
1430 extern void add_delay_dependencies (
rtx);
1431 extern bool sched_is_disabled_for_current_region_p (
void);
1432 extern void sched_rgn_init (
bool);
1433 extern void sched_rgn_finish (
void);
1434 extern void rgn_setup_region (
int);
1435 extern void sched_rgn_compute_dependencies (
int);
1436 extern void sched_rgn_local_init (
int);
1437 extern void sched_rgn_local_finish (
void);
1438 extern void sched_rgn_local_free (
void);
1439 extern void extend_regions (
void);
1440 extern void rgn_make_new_region_out_of_new_block (
basic_block);
1442 extern void compute_priorities (
void);
1443 extern void increase_insn_priority (
rtx,
int);
1444 extern void debug_rgn_dependencies (
int);
1445 extern void debug_dependencies (
rtx,
rtx);
1446 extern void free_rgn_deps (
void);
1447 extern int contributes_to_priority (
rtx,
rtx);
1448 extern void extend_rgns (
int *,
int *,
sbitmap,
int *);
1449 extern void deps_join (
struct deps_desc *,
struct deps_desc *);
1451 extern void rgn_setup_common_sched_info (
void);
1452 extern void rgn_setup_sched_infos (
void);
1454 extern void debug_regions (
void);
1455 extern void debug_region (
int);
1456 extern void dump_region_dot (FILE *,
int);
1457 extern void dump_region_dot_file (
const char *,
int);
1459 extern void haifa_sched_init (
void);
1460 extern void haifa_sched_finish (
void);
1462 extern void find_modifiable_mems (
rtx,
rtx);
1470 #define SD_LIST_NONE (0)
1473 #define SD_LIST_HARD_BACK (1)
1476 #define SD_LIST_SPEC_BACK (2)
1479 #define SD_LIST_FORW (4)
1482 #define SD_LIST_RES_BACK (8)
1485 #define SD_LIST_RES_FORW (16)
1487 #define SD_LIST_BACK (SD_LIST_HARD_BACK | SD_LIST_SPEC_BACK)
1490 typedef int sd_list_types_def;
1492 extern void sd_next_list (
const_rtx, sd_list_types_def *, deps_list_t *,
bool *);
1498 sd_list_types_def types;
1514 typedef struct _sd_iterator sd_iterator_def;
1526 static inline sd_iterator_def
1527 sd_iterator_start (
rtx insn, sd_list_types_def types)
1530 static dep_link_t null_link =
NULL;
1536 i.linkp = &null_link;
1539 i.resolved_p =
false;
1546 sd_iterator_cond (sd_iterator_def *it_ptr, dep_t *dep_ptr)
1548 dep_link_t
link = *it_ptr->linkp;
1552 *dep_ptr = DEP_LINK_DEP (link);
1557 sd_list_types_def types = it_ptr->types;
1559 if (types != SD_LIST_NONE)
1564 sd_next_list (it_ptr->insn,
1565 &it_ptr->types, &list, &it_ptr->resolved_p);
1567 it_ptr->linkp = &DEPS_LIST_FIRST (list);
1570 return sd_iterator_cond (it_ptr, dep_ptr);
1580 sd_iterator_next (sd_iterator_def *it_ptr)
1582 it_ptr->linkp = &DEP_LINK_NEXT (*it_ptr->linkp);
1586 #define FOR_EACH_DEP(INSN, LIST_TYPES, ITER, DEP) \
1587 for ((ITER) = sd_iterator_start ((INSN), (LIST_TYPES)); \
1588 sd_iterator_cond (&(ITER), &(DEP)); \
1589 sd_iterator_next (&(ITER)))
1591 #define IS_DISPATCH_ON 1
1593 #define DISPATCH_VIOLATION 3
1594 #define FITS_DISPATCH_WINDOW 4
1595 #define DISPATCH_INIT 5
1596 #define ADD_TO_DISPATCH_WINDOW 6
1598 extern int sd_lists_size (
const_rtx, sd_list_types_def);
1599 extern bool sd_lists_empty_p (
const_rtx, sd_list_types_def);
1600 extern void sd_init_insn (
rtx);
1601 extern void sd_finish_insn (
rtx);
1602 extern dep_t sd_find_dep_between (
rtx,
rtx,
bool);
1603 extern void sd_add_dep (dep_t,
bool);
1604 extern enum DEPS_ADJUST_RESULT sd_add_or_update_dep (dep_t,
bool);
1605 extern void sd_resolve_dep (sd_iterator_def);
1606 extern void sd_unresolve_dep (sd_iterator_def);
1607 extern void sd_copy_back_deps (
rtx,
rtx,
bool);
1608 extern void sd_delete_dep (sd_iterator_def);
1609 extern void sd_debug_lists (
rtx, sd_list_types_def);