_t);
extern void av_set_union_and_live (av_set_t *, av_set_t *, regset, regset, insn_t);
extern void av_set_clear (av_set_t *);
extern void av_set_leave_one_nonspec (av_set_t *);
extern expr_t av_set_element (av_set_t, int);
extern void av_set_substract_cond_branches (av_set_t *);
extern void av_set_split_usefulness (av_set_t, int, int);
extern void av_set_code_motion_filter (av_set_t *, av_set_t);

extern void sel_save_haifa_priorities (void);

extern void sel_init_global_and_expr (bb_vec_t);
extern void sel_finish_global_and_expr (void);

extern regset compute_live (insn_t);
extern bool register_unavailable_p (regset, rtx);

/* Dependence analysis functions.  */
extern void sel_clear_has_dependence (void);
extern ds_t has_dependence_p (expr_t, insn_t, ds_t **);

extern int tick_check_p (expr_t, deps_t, fence_t);

/* Functions to work with insns.  */
extern bool lhs_of_insn_equals_to_dest_p (insn_t, rtx);
extern bool insn_eligible_for_subst_p (insn_t);
extern void get_dest_and_mode (rtx, rtx *, machine_mode *);

extern bool bookkeeping_can_be_created_if_moved_through_p (insn_t);
extern bool sel_remove_insn (insn_t, bool, bool);
extern bool bb_header_p (insn_t);
extern void sel_init_invalid_data_sets (insn_t);
extern bool insn_at_boundary_p (insn_t);

/* Basic block and CFG functions.  */

extern rtx_insn *sel_bb_head (basic_block);
extern bool sel_bb_head_p (insn_t);
extern rtx_insn *sel_bb_end (basic_block);
extern bool sel_bb_end_p (insn_t);
extern bool sel_bb_empty_p (basic_block);

extern bool in_current_region_p (basic_block);
extern basic_block fallthru_bb_of_jump (const rtx_insn *);

extern void sel_init_bbs (bb_vec_t);
extern void sel_finish_bbs (void);

extern struct succs_info * compute_succs_info (insn_t, short);
extern void free_succs_info (struct succs_info *);
extern bool sel_insn_has_single_succ_p (insn_t, int);
extern bool sel_num_cfg_preds_gt_1 (insn_t);
extern int get_seqno_by_preds (rtx_insn *);

extern bool bb_ends_ebb_p (basic_block);
extern bool in_same_ebb_p (insn_t, insn_t);

extern bool tidy_control_flow (basic_block, bool);
extern void free_bb_note_pool (void);

extern void purge_empty_blocks (void);
extern basic_block sel_split_edge (edge);
extern basic_block sel_create_recovery_block (insn_t);
extern bool sel_redirect_edge_and_branch (edge, basic_block);
extern void sel_redirect_edge_and_branch_force (edge, basic_block);
extern void sel_init_pipelining (void);
extern void sel_finish_pipelining (void);
extern void sel_sched_region (int);
extern loop_p get_loop_nest_for_rgn (unsigned int);
extern bool considered_for_pipelining_p (struct loop *);
extern void make_region_from_loop_preheader (vec<basic_block> *&);
extern void sel_add_loop_preheaders (bb_vec_t *);
extern bool sel_is_loop_preheader_p (basic_block);
extern void clear_outdated_rtx_info (basic_block);
extern void free_data_sets (basic_block);
extern void exchange_data_sets (basic_block, basic_block);
extern void copy_data_sets (basic_block, basic_block);

extern void sel_register_cfg_hooks (void);
extern void sel_unregister_cfg_hooks (void);

/* Expression transformation routines.  */
extern rtx_insn *create_insn_rtx_from_pattern (rtx, rtx);
extern vinsn_t create_vinsn_from_insn_rtx (rtx_insn *, bool);
extern rtx_insn *create_copy_of_insn_rtx (rtx);
extern void change_vinsn_in_expr (expr_t, vinsn_t);

/* Various initialization functions.  */
extern void init_lv_sets (void);
extern void free_lv_sets (void);
extern void setup_nop_and_exit_insns (void);
extern void free_nop_and_exit_insns (void);
extern void free_data_for_scheduled_insn (insn_t);
extern void setup_nop_vinsn (void);
extern void free_nop_vinsn (void);
extern void sel_set_sched_flags (void);
extern void sel_setup_sched_infos (void);
extern void alloc_sched_pools (void);
extern void free_sched_pools (void);

#endif /* GCC_SEL_SCHED_IR_H */
