GCC Middle and Back End API Reference
sched-rgn.c File Reference

Data Structures

struct  bblst
struct  candidate
struct  edgelst

Typedefs

typedef sbitmap edgeset

Functions

static int is_cfg_nonregular (void)
static void find_single_block_region (bool)
static void find_rgns (void)
static bool too_large (int, int *, int *)
static void extract_edgelst (sbitmap, edgelst *)
static void split_edges (int, int, edgelst *)
static void compute_trg_info (int)
void debug_candidate (int)
void debug_candidates (int)
static int check_live_1 (int, rtx)
static void update_live_1 (int, rtx)
static int is_pfree (rtx, int, int)
static int find_conditional_protection (rtx, int)
static int is_conditionally_protected (rtx, int, int)
static int is_prisky (rtx, int, int)
static int is_exception_free (rtx, int, int)
static bool sets_likely_spilled (rtx)
static void sets_likely_spilled_1 (rtx, const_rtx, void *)
static void add_branch_dependences (rtx, rtx)
static void compute_block_dependences (int)
static void schedule_region (int)
static void concat_insn_mem_list (rtx, rtx, rtx *, rtx *)
static void propagate_deps (int, struct deps_desc *)
static void free_pending_lists (void)
static void extract_edgelst ()
DEBUG_FUNCTION void debug_regions ()
DEBUG_FUNCTION void debug_region ()
static bool bb_in_region_p ()
void dump_region_dot ()
void dump_region_dot_file ()
static void find_single_block_region ()
static int rgn_estimate_number_of_insns ()
static bool too_large ()
static void haifa_find_rgns ()
static int gather_region_statistics (int **)
static void print_region_statistics (int *, int, int *, int)
static int gather_region_statistics ()
static void print_region_statistics ()
void extend_rgns ()
static void compute_dom_prob_ps ()
static void split_edges ()
static void compute_trg_info ()
static void free_trg_info ()
DEBUG_FUNCTION void debug_candidate ()
DEBUG_FUNCTION void debug_candidates ()
static int check_live_1 ()
static void update_live_1 ()
static int check_live ()
static void update_live ()
static void set_spec_fed ()
static int find_conditional_protection ()
static int is_conditionally_protected ()
static int is_pfree ()
static int is_prisky ()
static int is_exception_free ()
static void init_ready_list (void)
static int can_schedule_ready_p (rtx)
static void begin_schedule_ready (rtx)
static ds_t new_ready (rtx, ds_t)
static int schedule_more_p (void)
static const char * rgn_print_insn (const_rtx, int)
static int rgn_rank (rtx, rtx)
static void compute_jump_reg_dependencies (rtx, regset)
static void rgn_add_remove_insn (rtx, int)
static void rgn_add_block (basic_block, basic_block)
static void rgn_fix_recovery_cfg (int, int, int)
static basic_block advance_target_bb (basic_block, rtx)
static int can_schedule_ready_p ()
static void begin_schedule_ready ()
static ds_t new_ready ()
static const char * rgn_print_insn ()
static int rgn_rank ()
int contributes_to_priority ()
static bool rgn_insn_finishes_block_p ()
int get_rgn_sched_max_insns_priority ()
static bool sets_likely_spilled ()
static void sets_likely_spilled_1 ()
static void add_branch_dependences ()
void deps_join ()
static void propagate_deps ()
static void compute_block_dependences ()
static void free_block_dependencies ()
DEBUG_FUNCTION void debug_rgn_dependencies ()
void debug_dependencies (rtx head, rtx tail)
bool sched_is_disabled_for_current_region_p ()
void free_rgn_deps ()
void compute_priorities ()
static void realloc_bb_state_array ()
static void free_bb_state_array ()
static void schedule_region ()
void sched_rgn_init ()
void sched_rgn_finish ()
void rgn_setup_region ()
void sched_rgn_compute_dependencies ()
void sched_rgn_local_init ()
void sched_rgn_local_free ()
void sched_rgn_local_finish ()
void rgn_setup_common_sched_info ()
void rgn_setup_sched_infos ()
void schedule_insns ()
static void rgn_add_remove_insn ()
void extend_regions ()
void rgn_make_new_region_out_of_new_block ()
static void rgn_add_block ()
static void rgn_fix_recovery_cfg ()
static basic_block advance_target_bb ()
static bool gate_handle_sched ()
static unsigned int rest_of_handle_sched ()
static bool gate_handle_sched2 ()
static unsigned int rest_of_handle_sched2 ()
rtl_opt_passmake_pass_sched ()
rtl_opt_passmake_pass_sched2 ()

Variables

static int nr_inter
static int nr_spec
int nr_regions = 0
regionrgn_table = NULL
int * rgn_bb_table = NULL
int * block_to_bb = NULL
int * containing_rgn = NULL
int * ebb_head = NULL
static int min_spec_prob
int current_nr_blocks
int current_blocks
static basic_blockbblst_table
static int bblst_size
static int bblst_last
static char * bb_state_array = NULL
static state_tbb_state = NULL
static candidatecandidate_table
int target_bb
static edgeedgelst_table
static int edgelst_last
static sbitmapdom
static int * prob
static int rgn_nr_edges
static edgergn_edges
static edgesetpot_split
static edgesetancestor_edges
static bitmap_head not_in_df
static int sched_target_n_insns
static int target_n_insns
static int sched_n_insns
static struct common_sched_info_def rgn_common_sched_info
static struct sched_deps_info_def rgn_sched_deps_info
static struct sched_deps_info_def rgn_const_sched_deps_info
static struct sched_deps_info_def rgn_const_sel_sched_deps_info
static struct haifa_sched_info rgn_const_sched_info
static struct haifa_sched_info rgn_sched_info
static sbitmap insn_referenced
static struct deps_descbb_deps
static int rgn_n_insns

Typedef Documentation

typedef sbitmap edgeset
Bit-set of edges, where bit i stands for edge i.   

Function Documentation

static void add_branch_dependences ( rtx  ,
rtx   
)
static
static void add_branch_dependences ( )
static
static basic_block advance_target_bb ( basic_block  ,
rtx   
)
static
static basic_block advance_target_bb ( )
static
Return next block in ebb chain.  For parameter meaning please refer to
   sched-int.h: struct sched_info: advance_target_bb.   

References basic_block_def::index, basic_block_def::next_bb, and target_bb.

static bool bb_in_region_p ( )
static
True when a bb with index BB_INDEX contained in region RGN.   

References current_blocks, rgn_bb_table, and region::rgn_nr_blocks.

Referenced by dump_region_dot().

static void begin_schedule_ready ( rtx  )
static
static void begin_schedule_ready ( )
static
Updates counter and other information.  Split from can_schedule_ready_p ()
   because when we schedule insn speculatively then insn passed to
   can_schedule_ready_p () differs from the one passed to
   begin_schedule_ready ().   

References check_live(), nr_inter, nr_spec, sched_n_insns, sched_target_n_insns, set_spec_fed(), target_bb, and update_live().

static int can_schedule_ready_p ( rtx  )
static
static int can_schedule_ready_p ( )
static
Called after taking INSN from the ready list.  Returns nonzero if this
   insn can be scheduled, nonzero if we should silently discard it.   

References check_live(), and target_bb.

static int check_live ( )
static
Return 1 if insn can be speculatively moved from block src to trg,
   otherwise return 0.  Called before first insertion of insn to
   ready-list or before the scheduling.   

References check_live_1(), and SET.

Referenced by begin_schedule_ready(), can_schedule_ready_p(), and new_ready().

static int check_live_1 ( int  ,
rtx   
)
static
Speculative scheduling functions.   

Referenced by check_live(), and check_live_1().

static int check_live_1 ( )
static
Return 0 if x is a set of a register alive in the beginning of one
   of the split-blocks of src, otherwise return 1.   

References bitmap_bit_p(), check_live_1(), df_get_live_in(), bblst::first_member, global_regs, basic_block_def::index, bblst::nr_members, and candidate::split_bbs.

static void compute_block_dependences ( int  )
static
static void compute_block_dependences ( )
static
Compute dependences inside bb.  In a multiple blocks region:
   (1) a bb is analyzed after its predecessors, and (2) the lists in
   effect at the end of bb (after analyzing for bb) are inherited by
   bb's successors.

   Specifically for reg-reg data dependences, the block insns are
   scanned by sched_analyze () top-to-bottom.  Three lists are
   maintained by sched_analyze (): reg_last[].sets for register DEFs,
   reg_last[].implicit_sets for implicit hard register DEFs, and
   reg_last[].uses for register USEs.

   When analysis is completed for bb, we update for its successors:
   ;  - DEFS[succ] = Union (DEFS [succ], DEFS [bb])
   ;  - IMPLICIT_DEFS[succ] = Union (IMPLICIT_DEFS [succ], IMPLICIT_DEFS [bb])
   ;  - USES[succ] = Union (USES [succ], DEFS [bb])

   The mechanism for computing mem-mem data dependence is very
   similar, and the result is interblock dependences in the region.   

References add_branch_dependences(), current_nr_blocks, free_deps(), get_ebb_head_tail(), propagate_deps(), sched_analyze(), sel_sched_p(), and targetm.

static void compute_dom_prob_ps ( )
static
Functions for regions scheduling information.   
Compute dominators, probability, and potential-split-edges of bb.
   Assume that these values were already computed for bb's predecessors.   

References bitmap_and(), bitmap_and_compl(), bitmap_ior(), bitmap_ones(), bitmap_set_bit(), combine_probabilities(), current_blocks, ebb_head, basic_block_def::index, prob, edge_def::probability, sched_dump, sched_verbose, edge_def::src, and basic_block_def::succs.

Referenced by sched_rgn_local_init().

static void compute_jump_reg_dependencies ( rtx  insn,
regset  used 
)
static
INSN is a JUMP_INSN.  Store the set of registers that must be
   considered as used by this jump in USED.   
void compute_priorities ( void  )
static void compute_trg_info ( int  )
static

Referenced by init_ready_list().

static void compute_trg_info ( )
static
static void concat_insn_mem_list ( rtx  copy_insns,
rtx  copy_mems,
rtx old_insns_p,
rtx old_mems_p 
)
static

References alloc_EXPR_LIST(), and alloc_INSN_LIST().

Referenced by deps_join().

int contributes_to_priority ( )
NEXT is an instruction that depends on INSN (a backward dependence);
   return nonzero if we should include this dependence in priority
   calculations.   
void debug_candidate ( int  )

Referenced by debug_candidates().

DEBUG_FUNCTION void debug_candidate ( )
Print candidates info, for debugging purposes.  Callable from debugger.   

References bblst::first_member, basic_block_def::index, bblst::nr_members, sched_dump, candidate::split_bbs, and candidate::update_bbs.

void debug_candidates ( int  )
DEBUG_FUNCTION void debug_candidates ( )
Print candidates info, for debugging purposes.  Callable from debugger.   

References current_nr_blocks, debug_candidate(), and sched_dump.

void debug_dependencies ( rtx  head,
rtx  tail 
)
Print dependencies information for instructions between HEAD and TAIL.
   ??? This function would probably fit best in haifa-sched.c.   

References insn_cost(), recog_memoized(), sched_dump, sched_emulate_haifa_p, sd_lists_size(), and sel_sched_p().

Referenced by debug_ebb_dependencies(), and debug_rgn_dependencies().

DEBUG_FUNCTION void debug_region ( )
Print the region's basic blocks.   

References current_blocks, dump_bb(), rgn_bb_table, and region::rgn_nr_blocks.

DEBUG_FUNCTION void debug_regions ( void  )
Functions for the construction of regions.   
Print the regions, for debugging purposes.  Callable from debugger.   

References current_blocks, nr_regions, rgn_bb_table, region::rgn_nr_blocks, and sched_dump.

Referenced by sched_rgn_init().

DEBUG_FUNCTION void debug_rgn_dependencies ( )
Print dependences for debugging starting from FROM_BB.
   Callable from debugger.   
Print dependences for debugging starting from FROM_BB.
   Callable from debugger.   

References current_nr_blocks, debug_dependencies(), get_ebb_head_tail(), and sched_dump.

void dump_region_dot ( )
void dump_region_dot_file ( )
The same, but first open a file specified by FNAME.   

References dump_region_dot().

void extend_regions ( void  )
Extend internal data structures.   

References block_to_bb, containing_rgn, and rgn_bb_table.

Referenced by rgn_add_block(), and sched_rgn_init().

void extend_rgns ( )
Extend regions.
   DEGREE - Array of incoming edge count, considering only
   the edges, that don't have their sources in formed regions yet.
   IDXP - pointer to the next available index in rgn_bb_table.
   HEADER - set of all region heads.
   LOOP_HDR - mapping from block to the containing loop
   (two blocks can reside within one region if they have
   the same loop header).   

References bitmap_bit_p(), bitmap_set_bit(), edge_def::dest, free(), gather_region_statistics(), basic_block_def::index, nr_regions, order, post_order_compute(), print_region_statistics(), rgn_bb_table, sched_dump, sched_verbose, edge_def::src, and too_large().

static void extract_edgelst ( sbitmap  ,
edgelst  
)
static

Referenced by split_edges().

static void extract_edgelst ( )
static
Extract list of edges from a bitmap containing EDGE_TO_BIT bits.   

References edgelst_last, edgelst::first_member, and edgelst::nr_members.

static int find_conditional_protection ( rtx  ,
int   
)
static
static int find_conditional_protection ( )
static
@verbatim On the path from the insn to load_insn_bb, find a conditional

branch depending on insn, that guards the speculative load.

References find_conditional_protection().

static void find_rgns ( )
static
Wrapper function.
   If FLAG_SEL_SCHED_PIPELINING is set, then use custom function to form
   regions.  Otherwise just call find_rgns_haifa.   

References haifa_find_rgns(), sel_find_rgns(), and sel_sched_p().

Referenced by sched_rgn_init().

static void find_single_block_region ( bool  )
static

Referenced by sched_rgn_init().

static void find_single_block_region ( )
static
Build a single block region for each basic block in the function.
   This allows for using the same code for interblock and basic block
   scheduling.   

References find_fallthru_edge(), basic_block_def::index, basic_block_def::next_bb, nr_regions, edge_def::probability, probability_cutoff, profile_info, rgn_bb_table, and basic_block_def::succs.

static void free_bb_state_array ( )
static
Free the arrays of DFA states at the end of each basic block.   

References bb_state_array, and free().

Referenced by sched_rgn_finish().

static void free_block_dependencies ( )
static
Free dependencies of instructions inside BB.   

References get_ebb_head_tail(), no_real_insns_p(), and sched_free_deps().

Referenced by schedule_region().

static void free_pending_lists ( )
static
Remove all INSN_LISTs and EXPR_LISTs from the pending lists and add
   them to the unused_*_list variables, so that they can be reused.   

References current_nr_blocks, free_EXPR_LIST_list(), free_INSN_LIST_list(), deps_desc::pending_jump_insns, deps_desc::pending_read_insns, deps_desc::pending_read_mems, deps_desc::pending_write_insns, and deps_desc::pending_write_mems.

Referenced by sched_rgn_compute_dependencies().

void free_rgn_deps ( void  )
Free all region dependencies saved in INSN_BACK_DEPS and
   INSN_RESOLVED_BACK_DEPS.  The Haifa scheduler does this on the fly
   when scheduling, so this function is supposed to be called from
   the selective scheduling only.   

References current_nr_blocks, get_ebb_head_tail(), and sched_free_deps().

Referenced by sel_compute_priorities().

static void free_trg_info ( )
static
Free the computed target info.   

References free().

Referenced by schedule_region().

static bool gate_handle_sched ( )
static

References dbg_cnt().

static bool gate_handle_sched2 ( )
static

References dbg_cnt(), and targetm.

static int gather_region_statistics ( int **  )
static

Referenced by extend_rgns().

static int gather_region_statistics ( )
static
Calculate the histogram that shows the number of regions having the
   given number of basic blocks, and store it in the RSP array.  Return
   the size of this array.   

References nr_regions.

int get_rgn_sched_max_insns_priority ( void  )
Returns maximum priority that an insn was assigned to.   

References rgn_sched_info, and haifa_sched_info::sched_max_insns_priority.

static void haifa_find_rgns ( )
static
Find regions for interblock scheduling.

   A region for scheduling can be:

     * A loop-free procedure, or

     * A reducible inner loop, or

     * A basic block not contained in any other region.

   ?!? In theory we could build other regions based on extended basic
   blocks or reverse extended basic blocks.  Is it worth the trouble?

   Loop blocks that form a region are put into the region's block list
   in topological order.

   This procedure stores its results into the following global (ick) variables

     * rgn_nr
     * rgn_table
     * rgn_bb_table
     * block_to_bb
     * containing region

   We use dominator relationships to avoid making regions out of non-reducible
   loops.

   This procedure needs to be converted to work on pred/succ lists instead
   of edge tables.  That would simplify it somewhat.   

References edge_def::aux, bitmap_bit_p(), bitmap_clear(), bitmap_clear_bit(), bitmap_ior(), bitmap_ones(), bitmap_set_bit(), CDI_DOMINATORS, common_sched_info, count, edge_def::dest, dominated_by_p(), ei_edge(), ei_next(), common_sched_info_def::estimate_number_of_insns, extend_rgns(), free(), basic_block_def::index, memcpy(), nr_regions, basic_block_def::preds, queue, rgn_bb_table, sbitmap_alloc(), sbitmap_free(), single_succ(), single_succ_p(), edge_def::src, stack, basic_block_def::succs, and too_large().

Referenced by find_rgns().

static void init_ready_list ( void  )
static
Implementations of the sched_info functions for region scheduling.   
Add all insns that are initially ready to the ready list READY.  Called
   once before scheduling a set of insns.   

References compute_trg_info(), current_nr_blocks, current_sched_info, debug_rgn_dependencies(), get_ebb_head_tail(), _sd_iterator::insn, haifa_sched_info::next_tail, haifa_sched_info::prev_head, sched_n_insns, sched_target_n_insns, sched_verbose, target_bb, target_n_insns, and try_ready().

static int is_cfg_nonregular ( )
static
Functions for construction of the control flow graph.   
Return 1 if control flow graph should not be constructed, 0 otherwise.

   We decide not to build the control flow graph if there is possibly more
   than one entry to the function, if computed branches exist, if we
   have nonlocal gotos, or if we have an unreachable loop.   

References computed_jump_p(), current_function_has_exception_handlers(), dead_or_set_p(), find_reg_note(), _sd_iterator::insn, next_nonnote_insn(), basic_block_def::preds, single_pred(), and single_pred_p().

Referenced by sched_rgn_init().

static int is_conditionally_protected ( rtx  ,
int  ,
int   
)
static
static int is_conditionally_protected ( )
static
Returns 1 if the same insn1 that participates in the computation
   of load_insn's address is feeding a conditional branch that is
   guarding on load_insn. This is true if we find two DEF-USE
   chains:
   insn1 -> ... -> conditional-branch
   insn1 -> ... -> load_insn,
   and if a flow path exists:
   insn1 -> ... -> conditional-branch -> ... -> load_insn,
   and if insn1 is on the path
   region-entry -> ... -> bb_trg -> ... load_insn.

   Locate insn1 by climbing on INSN_BACK_DEPS from load_insn.
   Locate the branch by following INSN_FORW_DEPS from insn1.   

References find_conditional_protection(), and is_conditionally_protected().

static int is_exception_free ( rtx  ,
int  ,
int   
)
static

Referenced by new_ready().

static int is_exception_free ( )
static
Insn is a candidate to be moved speculatively from bb_src to bb_trg.
   Return 1 if insn is exception-free (and the motion is valid)
   and 0 otherwise.   

References haifa_classify_insn(), IFREE, IRISKY, is_pfree(), is_prisky(), PFREE_CANDIDATE, PRISKY_CANDIDATE, TRAP_FREE, and TRAP_RISKY.

static int is_pfree ( rtx  ,
int  ,
int   
)
static

Referenced by is_exception_free().

static int is_pfree ( )
static
Returns 1 if a clue for "similar load" 'insn2' is found, and hence
   load_insn can move speculatively from bb_src to bb_trg.  All the
   following must hold:

   (1) both loads have 1 base register (PFREE_CANDIDATEs).
   (2) load_insn and load1 have a def-use dependence upon
   the same insn 'insn1'.
   (3) either load2 is in bb_trg, or:
   - there's only one split-block, and
   - load1 is on the escape path, and

   From all these we can conclude that the two loads access memory
   addresses that differ at most by a constant, and hence if moving
   load_insn would cause an exception, it would have been caused by
   load2 anyhow.   

References bblst::first_member, haifa_classify_insn(), bblst::nr_members, PFREE_CANDIDATE, and candidate::split_bbs.

static int is_prisky ( rtx  ,
int  ,
int   
)
static

Referenced by is_exception_free().

static int is_prisky ( )
static
Return 1 if load_insn is prisky (i.e. if load_insn is fed by
   a load moved speculatively, or if load_insn is protected by
   a compare on load_insn's address).   

References is_conditionally_protected(), and sd_lists_empty_p().

rtl_opt_pass* make_pass_sched ( )
rtl_opt_pass* make_pass_sched2 ( )
static ds_t new_ready ( rtx  ,
ds_t   
)
static
static ds_t new_ready ( )
static
Called after INSN has all its hard dependencies resolved and the speculation
   of type TS is enough to overcome them all.
   Return nonzero if it should be moved to the ready list or the queue, or zero
   if we should silently discard it.   

References check_live(), curr_state, sched_deps_info_def::generate_spec_deps, is_exception_free(), spec_info_def::mask, recog_memoized(), sched_deps_info, sched_insn_is_legitimate_for_speculation_p(), set_dep_weak(), spec_info, and target_bb.

static void print_region_statistics ( int *  ,
int  ,
int *  ,
int   
)
static

Referenced by extend_rgns().

static void print_region_statistics ( )
static
Print regions statistics.  S1 and S2 denote the data before and after
   calling extend_rgns, respectively.   

References sched_dump.

static void propagate_deps ( int  ,
struct deps_desc  
)
static
static void propagate_deps ( )
static
After computing the dependencies for block BB, propagate the dependencies
   found in TMP_DEPS to the successors of the block.   

References deps_join(), edge_def::dest, basic_block_def::index, deps_desc::pending_jump_insns, deps_desc::pending_read_insns, deps_desc::pending_read_mems, deps_desc::pending_write_insns, deps_desc::pending_write_mems, and basic_block_def::succs.

static void realloc_bb_state_array ( )
static
(Re-)initialize the arrays of DFA states at the end of each basic block.

   SAVED_LAST_BASIC_BLOCK is the previous length of the arrays.  It must be
   zero for the first call to this function, to allocate the arrays for the
   first time.

   This function is called once during initialization of the scheduler, and
   called again to resize the arrays if new basic blocks have been created,
   for example for speculation recovery code.   

References bb_state_array, dfa_state_size, and sel_sched_p().

Referenced by sched_rgn_init(), and schedule_region().

static unsigned int rest_of_handle_sched ( )
static
static unsigned int rest_of_handle_sched2 ( )
static
Run second scheduling pass after reload.   

References maybe_skip_selective_scheduling(), run_selective_scheduling(), schedule_ebbs(), and schedule_insns().

static void rgn_add_block ( basic_block  ,
basic_block   
)
static
static void rgn_add_block ( )
static
static void rgn_add_remove_insn ( rtx  ,
int   
)
static
Functions for speculative scheduling.   
static void rgn_add_remove_insn ( )
static
INSN has been added to/removed from current region.   

References rgn_n_insns, target_bb, and target_n_insns.

static int rgn_estimate_number_of_insns ( )
static
Estimate number of the insns in the BB.   

References count, and _sd_iterator::insn.

Referenced by rgn_setup_common_sched_info().

static void rgn_fix_recovery_cfg ( int  ,
int  ,
int   
)
static
static void rgn_fix_recovery_cfg ( )
static
Fix internal data after interblock movement of jump instruction.
   For parameter meaning please refer to
   sched-int.h: struct sched_info: fix_recovery_cfg.   

References ebb_head, and rgn_bb_table.

static bool rgn_insn_finishes_block_p ( )
static
Return true if scheduling INSN will trigger finish of scheduling
   current block.   

References sched_target_n_insns, target_bb, and target_n_insns.

void rgn_make_new_region_out_of_new_block ( )
static const char* rgn_print_insn ( const_rtx  ,
int   
)
static
static const char* rgn_print_insn ( )
static
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.   

References current_nr_blocks, and target_bb.

static int rgn_rank ( rtx  ,
rtx   
)
static
static int rgn_rank ( )
static
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.   

References target_bb.

void rgn_setup_region ( )
Setup global variables like CURRENT_BLOCKS and CURRENT_NR_BLOCK to
   point to the region RGN.   

References current_blocks, current_nr_blocks, and ebb_head.

void rgn_setup_sched_infos ( void  )
Setup all *_sched_info structures (for the Haifa frontend
   and for the dependence analysis) in the interblock scheduler.   

References current_sched_info, memcpy(), rgn_sched_deps_info, rgn_sched_info, sched_deps_info, and sel_sched_p().

Referenced by schedule_insns(), and sel_region_init().

bool sched_is_disabled_for_current_region_p ( void  )
Returns true if all the basic blocks of the current region have
   NOTE_DISABLE_SCHED_OF_BLOCK which means not to schedule that region.   

References current_nr_blocks.

Referenced by schedule_region(), and sel_sched_region().

void sched_rgn_finish ( void  )
void sched_rgn_local_finish ( void  )
Free data computed for the finished region.   

References current_nr_blocks, sched_rgn_local_free(), and sel_sched_p().

Referenced by schedule_region().

void sched_rgn_local_free ( void  )
Free data computed for the finished region.   

References free(), prob, and sbitmap_vector_free().

Referenced by sched_rgn_local_finish().

void sched_rgn_local_init ( )
Init region data structures.  Returns true if this region should
   not be scheduled.   

References edge_def::aux, bitmap_vector_clear(), compute_dom_prob_ps(), current_nr_blocks, basic_block_def::index, prob, rgn_nr_edges, sbitmap_vector_alloc(), and basic_block_def::succs.

static int schedule_more_p ( void  )
static
Return nonzero if there are more insns that should be scheduled.   

References sched_target_n_insns, and target_n_insns.

static void schedule_region ( int  )
static

Referenced by schedule_insns().

static void set_spec_fed ( )
static
Turns on the fed_by_spec_load flag for insns fed by load_insn.   

Referenced by begin_schedule_ready().

static bool sets_likely_spilled ( rtx  )
static

Referenced by add_branch_dependences().

static bool sets_likely_spilled ( )
static
Determine if PAT sets a TARGET_CLASS_LIKELY_SPILLED_P register.   

References note_stores(), and sets_likely_spilled_1().

static void sets_likely_spilled_1 ( rtx  ,
const_rtx  ,
void *   
)
static

Referenced by sets_likely_spilled().

static void sets_likely_spilled_1 ( )
static

References SET, and targetm.

static void split_edges ( int  ,
int  ,
edgelst  
)
static
Target info functions.   

Referenced by compute_trg_info().

static void split_edges ( )
static
Functions for target info.   
Compute in BL the list of split-edges of bb_src relatively to bb_trg.
   Note that bb_trg dominates bb_src.   

References bitmap_and_compl(), bitmap_copy(), extract_edgelst(), sbitmap_alloc(), and sbitmap_free().

static bool too_large ( int  ,
int *  ,
int *   
)
static

Referenced by extend_rgns(), and haifa_find_rgns().

static bool too_large ( )
static
Update number of blocks and the estimate for number of insns
   in the region.  Return true if the region is "too large" for interblock
   scheduling (compile time considerations).   

References common_sched_info, and common_sched_info_def::estimate_number_of_insns.

static void update_live ( )
static
Update the live registers info after insn was moved speculatively from
   block src to trg.   

References SET, and update_live_1().

Referenced by begin_schedule_ready().

static void update_live_1 ( int  ,
rtx   
)
static

Referenced by update_live(), and update_live_1().

static void update_live_1 ( )
static
If x is a set of a register R, mark that R is alive in the beginning
   of every update-block of src.   

References bitmap_set_bit(), bitmap_set_range(), df_get_live_in(), bblst::first_member, global_regs, bblst::nr_members, candidate::update_bbs, and update_live_1().


Variable Documentation

edgeset* ancestor_edges
static
For every bb, a set of its ancestor edges.   
struct deps_desc* bb_deps
static
Data structures for the computation of data dependences in a regions.  We
   keep one `deps' structure for every basic block.  Before analyzing the
   data dependences for a bb, its variables are initialized as a function of
   the variables of its predecessors.  When the analysis for a bb completes,
   we save the contents to the corresponding bb_deps[bb] variable.   
state_t* bb_state = NULL
static

Referenced by print_rtl_with_bb().

char* bb_state_array = NULL
static
Arrays that hold the DFA state at the end of a basic block, to re-use
   as the initial state at the start of successor blocks.  The BB_STATE
   array holds the actual DFA state, and BB_STATE_ARRAY[I] is a pointer
   into BB_STATE for basic block I.  FIXME: This should be a vec.   

Referenced by free_bb_state_array(), and realloc_bb_state_array().

int bblst_last
static

Referenced by compute_trg_info().

int bblst_size
static

Referenced by compute_trg_info().

basic_block* bblst_table
static
A speculative motion requires checking live information on the path
   from 'source' to 'target'.  The split blocks are those to be checked.
   After a speculative motion, live information should be modified in
   the 'update' blocks.

   Lists of split and update blocks for each candidate of the current
   target are in array bblst_table.   
int* block_to_bb = NULL
Topological order of blocks in the region (if b2 is reachable from
   b1, block_to_bb[b2] > block_to_bb[b1]).  Note: A basic block is
   always referred to by either block or b, while its topological
   order name (in the region) is referred to by bb.   

Referenced by extend_regions(), and sched_rgn_finish().

candidate* candidate_table
static
int* containing_rgn = NULL
The number of the region containing a block.   

Referenced by extend_regions(), and sched_rgn_finish().

int* ebb_head = NULL
ebb_head [i] - is index in rgn_bb_table of the head basic block of i'th ebb.
   Currently we can get a ebb only through splitting of currently
   scheduling block, therefore, we don't need ebb_head array for every region,
   hence, its sufficient to hold it for current one only.   

Referenced by compute_dom_prob_ps(), rgn_add_block(), rgn_fix_recovery_cfg(), rgn_setup_region(), and sched_rgn_finish().

int edgelst_last
static
edge* edgelst_table
static
sbitmap insn_referenced
static
A bitmap to note insns that participate in any dependency.  Used in
   add_branch_dependences.   
int min_spec_prob
static
The minimum probability of reaching a source block so that it will be
   considered for speculative scheduling.   

Referenced by compute_trg_info(), and sched_rgn_init().

bitmap_head not_in_df
static
Functions for speculative scheduling.   
int nr_inter
static
nr_inter/spec counts interblock/speculative motion for the function.   

Referenced by begin_schedule_ready(), sched_rgn_finish(), and sched_rgn_init().

int nr_spec
static
edgeset* pot_split
static
The split edges of a source bb is different for each target
   bb.  In order to compute this efficiently, the 'potential-split edges'
   are computed for each bb prior to scheduling a region.  This is actually
   the split edges of each bb relative to the region entry.

   pot_split[bb] is the set of potential split edges of bb.   
struct common_sched_info_def rgn_common_sched_info
static
This variable holds common_sched_info hooks and data relevant to
   the interblock scheduler.   

Referenced by rgn_setup_common_sched_info().

struct sched_deps_info_def rgn_const_sched_deps_info
static
Initial value:
{
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
0, 0, 0
}
This holds constant data used for initializing the above structure
   for the Haifa scheduler.   
struct haifa_sched_info rgn_const_sched_info
static
Initial value:
Used in schedule_insns to initialize current_sched_info for scheduling
   regions (or single basic blocks).   
struct sched_deps_info_def rgn_const_sel_sched_deps_info
static
Initial value:
{
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
0, 0, 0
}
Same as above, but for the selective scheduler.   
edge* rgn_edges
static
Array of size rgn_nr_edges.   
int rgn_n_insns
static
int rgn_nr_edges
static
Number of edges in the region.   

Referenced by compute_trg_info(), and sched_rgn_local_init().

struct sched_deps_info_def rgn_sched_deps_info
static
This holds data for the dependence analysis relevant to
   the interblock scheduler.   

Referenced by rgn_setup_sched_infos().

struct haifa_sched_info rgn_sched_info
static
This variable holds the data and hooks needed to the Haifa scheduler backend
   for the interblock scheduler frontend.   

Referenced by get_rgn_sched_max_insns_priority(), and rgn_setup_sched_infos().

region* rgn_table = NULL
Table of region descriptions.   
int sched_n_insns
static
The number of insns from the entire region scheduled so far.   

Referenced by begin_schedule_ready(), init_ready_list(), and schedule_region().

int sched_target_n_insns
static
The number of insns from the current block scheduled so far.   

Referenced by begin_schedule_ready(), init_ready_list(), rgn_insn_finishes_block_p(), and schedule_more_p().

int target_n_insns
static
The number of insns from the current block to be scheduled in total.   

Referenced by init_ready_list(), rgn_add_remove_insn(), rgn_insn_finishes_block_p(), and schedule_more_p().