GCC Middle and Back End API Reference
|
Data Structures | |
struct | mem_inc_info |
Variables | |
struct sched_deps_info_def * | sched_deps_info |
vec< haifa_deps_insn_data_def > | h_d_i_d = vNULL |
static int | dump_dep_flags = (DUMP_DEP_PRO | DUMP_DEP_CON) |
static alloc_pool | dn_pool |
static int | dn_pool_diff = 0 |
static alloc_pool | dl_pool |
static int | dl_pool_diff = 0 |
static regset | reg_pending_sets |
static regset | reg_pending_clobbers |
static regset | reg_pending_uses |
static regset | reg_pending_control_uses |
static enum reg_pending_barrier_mode | reg_pending_barrier |
static HARD_REG_SET | implicit_reg_pending_clobbers |
static HARD_REG_SET | implicit_reg_pending_uses |
static bitmap_head * | true_dependency_cache = NULL |
static bitmap_head * | output_dependency_cache = NULL |
static bitmap_head * | anti_dependency_cache = NULL |
static bitmap_head * | control_dependency_cache = NULL |
static bitmap_head * | spec_dependency_cache = NULL |
static int | cache_size |
static bool | mark_as_hard |
static rtx | cur_insn = NULL_RTX |
static struct reg_pressure_data | reg_pressure_info [N_REG_CLASSES] |
static bool | can_start_lhs_rhs_p |
void add_dependence | ( | ) |
A wrapper around add_dependence_1, to add a dependence of CON on PRO, with type DEP_TYPE. This function implements special handling for REG_DEP_CONTROL dependencies. For these, we optionally promote the type to REG_DEP_ANTI if we can determine that predication is impossible; otherwise we add additional true dependencies on the INSN_COND_DEPS list of the jump (which PRO must be).
References add_dependence_1(), add_dependence_list(), const_true_rtx, current_sched_info, DO_PREDICATION, haifa_sched_info::flags, note_uses(), real_insn_for_shadow(), record_hard_reg_uses(), sched_dump, sched_get_reverse_condition_uncached(), and sched_verbose.
Referenced by add_branch_dependences(), add_delay_dependencies(), add_dependence_list(), add_deps_for_risky_insns(), chain_to_prev_insn(), process_replaceable(), sched_analyze_2(), and sched_analyze_insn().
Referenced by add_dependence(), and find_inc().
|
static |
Add or update backward dependence between INSN and ELEM with type DEP_TYPE. This function can handle same INSN and ELEM (INSN == ELEM). It is a convenience wrapper.
References cur_insn, and note_dep().
|
static |
A convenience wrapper to operate on an entire list. HARD should be true if DEP_NONREG should be set on newly created dependencies.
References add_dependence(), mark_as_hard, and sched_insns_conditions_mutex_p().
Referenced by add_dependence(), add_dependence_list_and_free(), sched_analyze_1(), sched_analyze_insn(), and sched_analyze_reg().
|
static |
Similar, but free *LISTP at the same time, when the context is not readonly. HARD should be true if DEP_NONREG should be set on newly created dependencies.
References add_dependence_list(), free_INSN_LIST_list(), and deps_desc::readonly.
Referenced by deps_analyze_insn(), flush_pending_lists(), and sched_analyze_insn().
|
static |
Process an insn's memory dependencies. There are four kinds of dependencies: (0) read dependence: read follows read (1) true dependence: read follows write (2) output dependence: write follows write (3) anti dependence: write follows read We are careful to build only dependencies which actually exist, and use transitivity to avoid building too many links.
Add an INSN and MEM reference pair to a pending INSN_LIST and MEM_LIST. The MEM is a memory reference contained within INSN, which we are saving so that we can do memory aliasing on it.
References alloc_EXPR_LIST(), alloc_INSN_LIST(), canon_rtx(), cselib_subst_to_values_from_insn(), deps_desc::pending_read_insns, deps_desc::pending_read_list_length, deps_desc::pending_read_mems, deps_desc::pending_write_insns, deps_desc::pending_write_list_length, deps_desc::pending_write_mems, deps_desc::readonly, and sched_deps_info_def::use_cselib.
Referenced by sched_analyze_1(), and sched_analyze_2().
|
static |
Add or update a dependence described by DEP. MEM1 and MEM2, if non-null, correspond to memory locations in case of data speculation. The function returns a value indicating if an old entry has been changed or a new entry has been added to insn's backward deps or nothing has been updated at all.
References ask_dependency_caches(), check_dep(), DEP_CHANGED, DEP_CREATED, DEP_PRESENT, estimate_dep_weak(), sched_deps_info_def::generate_spec_deps, sd_add_dep(), sd_find_dep_between_no_cache(), set_dep_weak(), and update_dep().
Referenced by maybe_add_or_update_dep_1(), and sd_add_or_update_dep().
|
static |
Add dep_link LINK to deps_list L.
References attach_dep_link(), and depl_on_debug_p().
Referenced by move_dep_link(), and sd_add_dep().
|
static |
Ask dependency caches what needs to be done for dependence DEP. Return DEP_CREATED if new dependence should be created and there is no need to try to find one searching the dependencies lists. Return DEP_PRESENT if there already is a dependence described by DEP and hence nothing is to be done. Return DEP_CHANGED if there already is a dependence, but it should be updated to incorporate additional information from DEP.
References bitmap_bit_p(), current_sched_info, DEP_CHANGED, DEP_CREATED, DEP_PRESENT, DO_SPECULATION, haifa_sched_info::flags, insn_luid(), and USE_DEPS_LIST.
Referenced by add_or_update_dep_1().
|
static |
Functions to operate with a single link from the dependencies lists - dep_link_t.
Attach L to appear after link X whose &DEP_LINK_NEXT (X) is given by PREV_NEXT_P.
Referenced by add_to_deps_list().
|
static |
Verify that the memory location described in MII can be replaced with one using NEW_ADDR. Return the new memory reference or NULL_RTX. The insn remains unchanged by this function.
References mem_inc_info::mem_insn, mem_inc_info::mem_loc, replace_equiv_address_nv(), sched_dump, sched_verbose, and validate_change().
Referenced by find_inc().
|
static |
Return TRUE if INSN might not always return normally (e.g. call exit, longjmp, loop forever, ...).
FIXME: Why can't this function just use flags_from_decl_or_type and test for ECF_NORETURN?
References BUILT_IN_NORMAL, and get_call_rtx_from().
Referenced by deps_analyze_insn().
|
static |
Referenced by deps_analyze_insn().
|
static |
All insns in a scheduling group except the first should only have dependencies on the previous insn in the group. So we find the first instruction in the scheduling group by walking the dependence chains backwards. Then we add the dependencies for the group to the previous nonnote insn.
References add_dependence(), delete_all_dependences(), prev_nonnote_insn(), prev_nonnote_nondebug_insn(), and sched_insns_conditions_mutex_p().
|
static |
Return true if INSN should be made dependent on the previous instruction group, and if all INSN's dependencies should be moved to the first instruction of that group.
References prev_nonnote_nondebug_insn(), and set_of().
Referenced by deps_analyze_insn().
|
static |
Convert a dependence pointed to by SD_IT to be non-speculative.
References bitmap_clear_bit(), _sd_iterator::linkp, and move_dep_link().
Referenced by sched_analyze_insn(), and update_dep().
|
static |
Referenced by add_or_update_dep_1(), and sd_add_dep().
|
static |
Verify that dependence type and status are consistent. If RELAXED_P is true, then skip dep_weakness checks.
References current_sched_info, haifa_sched_info::flags, sched_deps_info_def::generate_spec_deps, get_dep_weak(), and USE_DEPS_LIST.
|
static |
Referenced by sched_insns_conditions_mutex_p().
|
static |
Return nonzero if conditions COND1 and COND2 can never be both true.
References reversed_comparison_code(), and rtx_equal_p().
|
static |
Make a copy of FROM in TO.
References memcpy().
Referenced by sd_add_dep(), and sd_copy_back_deps().
|
static |
|
static |
|
staticread |
Allocate and return reg_set_data structure for REGNO and INSN.
References reg_set_data::insn, and reg_set_data::regno.
Referenced by mark_insn_hard_regno_birth(), and mark_insn_pseudo_birth().
|
staticread |
Functions for computation of info needed for register pressure sensitive insn scheduling.
Allocate and return reg_use_data structure for REGNO and INSN.
References reg_use_data::insn, reg_use_data::next_insn_use, and reg_use_data::regno.
Referenced by setup_insn_reg_uses().
DEBUG_FUNCTION void debug_ds | ( | ) |
References dump_ds().
|
static |
Referenced by chain_to_prev_insn().
|
static |
Clear all dependencies for an insn.
References sd_delete_dep(), sd_iterator_cond(), and sd_iterator_start().
|
static |
Delete dep_node N. N must not be connected to any deps_list.
References dep_link_is_detached_p(), dn_pool_diff, and pool_free().
Referenced by delete_dep_nodes_in_back_deps(), and sd_delete_dep().
|
static |
Helper for sched_free_deps (). Delete INSN's (RESOLVED_P) backward dependencies.
References delete_dep_node(), get_back_and_forw_lists(), _sd_iterator::linkp, remove_from_deps_list(), sd_iterator_cond(), and sd_iterator_start().
Referenced by sched_free_deps().
|
static |
Return true of LINK is not attached to any list.
Referenced by delete_dep_node().
|
static |
Decide whether a dependency should be treated as a hard or a speculative dependency.
References current_sched_info, DO_PREDICATION, DO_SPECULATION, and haifa_sched_info::flags.
Referenced by get_back_and_forw_lists(), sd_resolve_dep(), sd_unresolve_dep(), and update_dep().
|
inlinestatic |
Determine whether DEP is a dependency link of a non-debug insn on a debug insn.
Referenced by add_to_deps_list(), and remove_from_deps_list().
void deps_analyze_insn | ( | ) |
Analyze INSN with DEPS as a context.
References add_dependence_list_and_free(), alloc_INSN_LIST(), call_may_noreturn_p(), chain_to_prev_insn(), chain_to_prev_insn_p(), deps_reg::clobbers, concat_INSN_LIST(), cselib_process_insn(), current_sched_info, DO_PREDICATION, find_reg_note(), sched_deps_info_def::finish_insn, haifa_sched_info::flags, flush_pending_lists(), free_INSN_LIST_list(), global_regs, implicit_reg_pending_uses, deps_reg::implicit_sets, deps_desc::in_post_call_group_p, deps_desc::last_function_call, deps_desc::last_function_call_may_noreturn, MOVE_BARRIER, deps_desc::pending_flush_length, deps_desc::pending_jump_insns, post_call, deps_desc::readonly, deps_desc::reg_last, reg_pending_barrier, reload_completed, sched_analyze_insn(), deps_desc::sched_before_next_call, deps_desc::sched_before_next_jump, sched_get_condition_with_rev(), sel_insn_is_speculation_check(), sel_sched_p(), deps_reg::sets, sched_deps_info_def::start_insn, and sched_deps_info_def::use_cselib.
Referenced by sched_analyze().
|
static |
Functions to operate with dependences lists - deps_list_t.
Return true if list L is empty.
Referenced by free_deps_list(), and sd_lists_empty_p().
|
static |
Referenced by sched_analyze_2().
|
static |
Return nonzero if a load of the memory reference MEM can cause a trap.
References get_reg_known_value(), and rtx_addr_can_trap_p().
bool deps_pools_are_empty_p | ( | void | ) |
Return true if there is no dep_nodes and deps_lists out there. After the region is scheduled all the dependency nodes and lists should [generally] be returned to pool.
References dl_pool_diff, and dn_pool_diff.
Referenced by sched_deps_finish(), schedule_ebb(), and schedule_region().
void deps_start_bb | ( | ) |
Initialize DEPS for the new block beginning with HEAD.
References deps_desc::in_post_call_group_p, post_call_initial, prev_nonnote_nondebug_insn(), deps_desc::readonly, and reload_completed.
Referenced by sched_analyze().
|
static |
Detach dep_link L from the list.
Referenced by remove_from_deps_list().
ds_t dk_to_ds | ( | ) |
Return equivalent dep_status.
Referenced by init_dep().
ds_t ds_full_merge | ( | ) |
Return the join of two dep_statuses DS1 and DS2.
References ds_merge(), estimate_dep_weak(), and set_dep_weak().
ds_t ds_get_max_dep_weak | ( | ) |
Return a dep status that contains maximal weakness for each speculation type present in DS.
References set_dep_weak().
Referenced by create_speculation_check().
ds_t ds_get_speculation_types | ( | ) |
Return a dep status that contains all speculation types of DS.
Referenced by get_spec_check_type_for_insn().
ds_t ds_max_merge | ( | ) |
Return the join of DS1 and DS2. Use maximum instead of multiplying probabilities.
References ds_merge_1().
ds_t ds_merge | ( | ) |
Return the join of two dep_statuses DS1 and DS2. This function assumes that both DS1 and DS2 contain speculative bits.
References ds_merge_1().
Referenced by ds_full_merge(), recompute_todo_spec(), and update_dep().
|
static |
Return the join of two dep_statuses DS1 and DS2. If MAX_P is true then choose the greater probability, otherwise multiply probabilities. This function assumes that both DS1 and DS2 contain speculative bits.
References get_dep_weak(), and set_dep_weak().
Referenced by ds_max_merge(), and ds_merge().
enum reg_note ds_to_dk | ( | ) |
Return the major type present in the DS.
enum reg_note ds_to_dt | ( | ) |
Return corresponding to DS reg_note.
Referenced by haifa_note_dep(), and haifa_note_mem_dep().
dw_t ds_weak | ( | ) |
Return the probability of speculation success for the speculation status DS.
References get_dep_weak().
Referenced by can_speculate_dep_p(), process_insn_forw_deps_be_in_spec(), process_spec_exprs(), rank_for_schedule(), recompute_todo_spec(), and sel_rank_for_schedule().
|
static |
Dump DEP to DUMP. FLAGS is a bit mask specifying what information about DEP needs to be printed. If FLAGS has the very first bit set, then dump all information about DEP and propagate this bit into the callee dump functions.
References current_sched_info, dump_ds(), haifa_sched_info::flags, and USE_DEPS_LIST.
Referenced by dump_lists(), and sd_debug_dep().
|
static |
Referenced by debug_ds(), and dump_dep().
|
static |
Dump information about the dependence status S.
References get_dep_weak_1().
|
static |
Dump deps_lists of INSN specified by TYPES to DUMP. FLAGS is a bit mask specifying what information about the lists needs to be printed. If FLAGS has the very first bit set, then dump all information about the lists and propagate this bit into the callee dump functions.
References dump_dep(), dump_dep_flags, and sd_lists_size().
Referenced by sd_debug_lists().
dw_t estimate_dep_weak | ( | ) |
Estimate the weakness of dependence between MEM1 and MEM2.
Referenced by add_or_update_dep_1(), ds_full_merge(), and update_dep().
void extend_dependency_caches | ( | ) |
Create or extend (depending on CREATE_P) dependency caches to size N.
References cache_size, current_sched_info, DO_SPECULATION, and haifa_sched_info::flags.
Referenced by haifa_init_insn(), and sched_deps_init().
|
static |
Extend reg info for the deps context DEPS given that we have just generated a register numbered REGNO.
References deps_desc::max_reg, max_regno, memset(), deps_desc::readonly, deps_desc::reg_last, and reload_completed.
Referenced by sched_analyze_reg().
|
static |
Once a suitable mem reference has been found and the corresponding data in MII has been filled in, this function is called to find a suitable add or inc insn involving the register we found in the memory reference.
References add_dependence_1(), attempt_change(), mem_inc_info::inc_constant, mem_inc_info::inc_input, mem_inc_info::inc_insn, dep_replacement::insn, _sd_iterator::linkp, dep_replacement::loc, mem_inc_info::mem_constant, mem_inc_info::mem_index, mem_inc_info::mem_insn, mem_inc_info::mem_loc, mem_inc_info::mem_reg0, move_dep_link(), dep_replacement::newval, dep_replacement::orig, parse_add_or_inc(), plus_constant(), reg_overlap_mentioned_p(), sched_dump, sched_verbose, sd_iterator_cond(), sd_iterator_next(), and sd_iterator_start().
Referenced by find_mem().
|
static |
A recursive function that walks ADDRESS_OF_X to find memory references which could be modified during scheduling. We call find_inc for each one we find that has a recognizable form. MII holds information about the pair of memory/increment instructions. We ensure that every instruction with a memory reference (which will be the location of the replacement) is assigned at most one breakable dependency.
References find_inc(), mem_inc_info::mem_constant, mem_inc_info::mem_index, mem_inc_info::mem_insn, mem_inc_info::mem_loc, mem_inc_info::mem_reg0, reg_overlap_mentioned_p(), sched_dump, and sched_verbose.
Referenced by find_modifiable_mems().
void find_modifiable_mems | ( | ) |
Examine the instructions between HEAD and TAIL and try to find dependencies that can be broken by modifying one of the patterns.
References find_mem(), dep_replacement::insn, mem_inc_info::mem_insn, sched_dump, and sched_verbose.
Referenced by schedule_block().
void finish_deps_global | ( | void | ) |
Free everything used by the dependency analysis code.
Referenced by build_intra_loop_deps(), sched_rgn_compute_dependencies(), schedule_ebb(), and sel_region_finish().
|
static |
Make a dependency between every memory reference on the pending lists and INSN, thus flushing the pending lists. FOR_READ is true if emitting dependencies for a read operation, similarly with FOR_WRITE.
References add_dependence_list_and_free(), alloc_INSN_LIST(), free_EXPR_LIST_list(), free_INSN_LIST_list(), deps_desc::last_pending_memory_flush, mark_as_hard, deps_desc::pending_flush_length, deps_desc::pending_jump_insns, deps_desc::pending_read_insns, deps_desc::pending_read_list_length, deps_desc::pending_read_mems, deps_desc::pending_write_insns, deps_desc::pending_write_list_length, deps_desc::pending_write_mems, and deps_desc::readonly.
Referenced by deps_analyze_insn(), sched_analyze_1(), sched_analyze_2(), and sched_analyze_insn().
void free_deps | ( | ) |
Free insn lists found in DEPS.
References deps_reg::clobbers, deps_reg::control_uses, free(), free_EXPR_LIST_list(), free_INSN_LIST_list(), deps_reg::implicit_sets, deps_desc::last_pending_memory_flush, deps_desc::max_reg, deps_desc::pending_read_insns, deps_desc::pending_read_mems, deps_desc::pending_write_insns, deps_desc::pending_write_mems, deps_desc::reg_last, deps_desc::reg_last_in_use, deps_reg::sets, and deps_reg::uses.
Referenced by build_intra_loop_deps(), compute_block_dependences(), and schedule_ebb().
|
static |
Free deps_list L.
References deps_list_empty_p(), dl_pool_diff, and pool_free().
Referenced by sd_finish_insn().
|
static |
Initialize BACK_LIST_PTR with consumer's backward list and FORW_LIST_PTR with producer's forward list. If RESOLVED_P is true initialize with lists that hold resolved deps.
References dep_spec_p().
Referenced by delete_dep_nodes_in_back_deps(), sd_add_dep(), and sd_delete_dep().
dw_t get_dep_weak | ( | ) |
Return weakness of speculative type TYPE in the dep_status DS.
References get_dep_weak_1().
Referenced by check_dep(), create_check_block_twin(), ds_merge_1(), and ds_weak().
|
static |
Return weakness of speculative type TYPE in the dep_status DS, without checking to prevent ICEs on malformed input.
References BE_IN_CONTROL_BITS_OFFSET, BE_IN_DATA_BITS_OFFSET, BEGIN_CONTROL_BITS_OFFSET, BEGIN_DATA_BITS_OFFSET, and type().
Referenced by dump_ds(), and get_dep_weak().
|
static |
References cur_insn.
Referenced by init_deps_global().
|
static |
References cur_insn, ds_to_dt(), init_dep(), mark_as_hard, and maybe_add_or_update_dep_1().
Referenced by init_deps_global().
|
static |
References cur_insn, current_sched_info, ds_to_dt(), haifa_sched_info::flags, init_dep_1(), maybe_add_or_update_dep_1(), and USE_DEPS_LIST.
Referenced by init_deps_global().
void haifa_note_reg_clobber | ( | ) |
Referenced by init_deps_global().
void haifa_note_reg_set | ( | ) |
Referenced by init_deps_global().
void haifa_note_reg_use | ( | ) |
Referenced by init_deps_global().
|
static |
void init_dep | ( | ) |
Init DEP with the arguments. While most of the scheduler (including targets) only need the major type of the dependency, it is convenient to hide full dep_status from them.
References current_sched_info, dk_to_ds(), haifa_sched_info::flags, init_dep_1(), and USE_DEPS_LIST.
Referenced by add_deps_for_risky_insns(), add_jump_dependencies(), add_to_speculative_block(), create_check_block_twin(), create_ddg_dep_no_link(), haifa_note_dep(), and priority().
void init_dep_1 | ( | ) |
Functions to operate with dependence information container - dep_t.
Init DEP with the arguments.
References type().
Referenced by create_check_block_twin(), haifa_note_mem_dep(), init_dep(), and process_insn_forw_deps_be_in_spec().
void init_deps | ( | ) |
Initialize variables for region data dependence analysis. When LAZY_REG_LAST is true, do not allocate reg_last array of struct deps_desc immediately.
References deps_desc::in_post_call_group_p, deps_desc::last_debug_insn, deps_desc::last_function_call, deps_desc::last_function_call_may_noreturn, deps_desc::last_pending_memory_flush, deps_desc::last_reg_pending_barrier, deps_desc::max_reg, max_reg_num(), NOT_A_BARRIER, not_post_call, deps_desc::pending_flush_length, deps_desc::pending_jump_insns, deps_desc::pending_read_insns, deps_desc::pending_read_list_length, deps_desc::pending_read_mems, deps_desc::pending_write_insns, deps_desc::pending_write_list_length, deps_desc::pending_write_mems, deps_desc::readonly, deps_desc::reg_last, deps_desc::reg_last_in_use, reload_completed, deps_desc::sched_before_next_call, and deps_desc::sched_before_next_jump.
Referenced by build_intra_loop_deps(), sched_rgn_compute_dependencies(), and schedule_ebb().
|
static |
void init_deps_global | ( | void | ) |
Initialize some global variables needed by the dependency analysis code.
References sched_deps_info_def::finish_insn, haifa_finish_insn(), haifa_note_dep(), haifa_note_mem_dep(), haifa_note_reg_clobber(), haifa_note_reg_set(), haifa_note_reg_use(), haifa_start_insn(), implicit_reg_pending_clobbers, implicit_reg_pending_uses, NOT_A_BARRIER, sched_deps_info_def::note_dep, sched_deps_info_def::note_mem_dep, sched_deps_info_def::note_reg_clobber, sched_deps_info_def::note_reg_set, sched_deps_info_def::note_reg_use, reg_obstack, reg_pending_barrier, sched_emulate_haifa_p, sel_sched_p(), and sched_deps_info_def::start_insn.
Referenced by build_intra_loop_deps(), sched_rgn_compute_dependencies(), schedule_ebb(), and sel_region_init().
void init_deps_reg_last | ( | ) |
Init only reg_last field of DEPS, which was not allocated before as we inited DEPS lazily.
References deps_desc::max_reg, and deps_desc::reg_last.
void init_insn_reg_pressure_info | ( | ) |
Set up reg pressure info related to INSN.
References reg_pressure_data::change, reg_pressure_data::clobber_increase, len, mark_insn_reg_clobber(), mark_insn_reg_store(), mark_reg_death(), note_stores(), reg_pressure_info, sched_pressure, SCHED_PRESSURE_NONE, SCHED_PRESSURE_WEIGHTED, reg_pressure_data::set_increase, and reg_pressure_data::unused_set_increase.
Referenced by haifa_init_insn(), and sched_analyze_insn().
|
static |
Return TRUE if INSN has the use structure for REGNO.
References reg_use_data::next_insn_use, and reg_use_data::regno.
Referenced by mark_insn_hard_regno_birth(), and mark_insn_pseudo_birth().
|
static |
Like mark_pseudo_death except that NREGS saying how many hard registers involved in the death.
References reg_pressure_data::change, last, reg_pressure_info, reg_use_data::regno, and sched_regno_pressure_class.
Referenced by mark_reg_death().
|
static |
Like mark_insn_pseudo_regno_birth except that NREGS saying how many hard registers involved in the birth.
References reg_pressure_data::change, reg_pressure_data::clobber_increase, create_insn_reg_set(), insn_use_p(), last, reg_pressure_info, reg_use_data::regno, sched_regno_pressure_class, reg_pressure_data::set_increase, and reg_pressure_data::unused_set_increase.
Referenced by mark_insn_reg_birth().
|
static |
Update the register pressure info after birth of pseudo register REGNO in INSN. Arguments CLOBBER_P and UNUSED_P say correspondingly that the register is in clobber or unused after the insn.
References reg_pressure_data::change, reg_pressure_data::clobber_increase, create_insn_reg_set(), insn_use_p(), reg_pressure_info, reg_use_data::regno, sched_regno_pressure_class, reg_pressure_data::set_increase, and reg_pressure_data::unused_set_increase.
Referenced by mark_insn_reg_birth().
|
static |
Update the register pressure info after birth of pseudo or hard register REG in INSN. Arguments CLOBBER_P and UNUSED_P say correspondingly that the register is in clobber or unused after the insn.
References mark_insn_hard_regno_birth(), mark_insn_pseudo_birth(), and reg_use_data::regno.
Referenced by mark_insn_reg_clobber(), and mark_insn_reg_store().
|
static |
Like mark_insn_reg_store except notice just CLOBBERs; ignore SETs.
References mark_insn_reg_birth().
Referenced by init_insn_reg_pressure_info().
|
static |
Process SETTER of REG. DATA is an insn containing the setter.
References find_reg_note(), mark_insn_reg_birth(), and SET.
Referenced by init_insn_reg_pressure_info().
|
static |
Update the register pressure info after death of pseudo register REGNO.
References reg_pressure_data::change, reg_pressure_info, reg_use_data::regno, and sched_regno_pressure_class.
Referenced by mark_reg_death().
|
static |
Update the register pressure info after death of pseudo or hard register REG.
References mark_hard_regno_death(), mark_pseudo_death(), and reg_use_data::regno.
Referenced by init_insn_reg_pressure_info().
|
static |
Referenced by haifa_note_dep(), and haifa_note_mem_dep().
|
static |
Add or update a dependence described by DEP. MEM1 and MEM2, if non-null, correspond to memory locations in case of data speculation. The function returns a value indicating if an old entry has been changed or a new entry has been added to insn's backward deps. This function merely checks if producer and consumer is the same insn and doesn't create a dep in this case. Actual manipulation of dependence data structures is performed in add_or_update_dep_1.
References add_or_update_dep_1(), DEP_NODEP, and sched_deps_info_def::generate_spec_deps.
void maybe_extend_reg_info_p | ( | void | ) |
Extends REG_INFO_P if needed.
References max_regno, reg_info_p, reg_info_p_size, reload_completed, sel_sched_p(), and xrecalloc().
Referenced by choose_best_pseudo_reg(), implicit_clobber_conflict_p(), and sched_analyze_reg().
|
static |
Move link LINK from list FROM to list TO.
References add_to_deps_list(), and remove_from_deps_list().
Referenced by change_spec_dep_to_hard(), find_inc(), sd_resolve_dep(), and sd_unresolve_dep().
|
static |
References sched_deps_info_def::note_dep.
Referenced by add_dependence_1(), and sched_analyze_2().
|
static |
References sched_deps_info_def::note_mem_dep.
Referenced by sched_analyze_1(), and sched_analyze_2().
|
static |
References sched_deps_info_def::note_reg_clobber.
Referenced by sched_analyze_reg().
|
static |
References sched_deps_info_def::note_reg_set.
Referenced by sched_analyze_reg().
|
static |
References sched_deps_info_def::note_reg_use.
Referenced by sched_analyze_reg().
|
static |
Return true if INSN is of a form "a = b op c" where a and b are regs. op is + if c is a reg and +|- if c is a const. Fill in informantion in MII about what is found. BEFORE_MEM indicates whether the increment is found before or after a corresponding memory reference.
References mem_inc_info::inc_constant, mem_inc_info::inc_input, mem_inc_info::inc_insn, mem_inc_info::mem_reg0, and rtx_equal_p().
Referenced by find_inc().
|
static |
Same as above, but process two lists at once.
References remove_free_EXPR_LIST_node(), and remove_free_INSN_LIST_node().
Referenced by remove_from_deps().
|
static |
Remove all occurrences of INSN from LIST. Return the number of occurrences removed.
References remove_free_INSN_LIST_node().
Referenced by remove_from_deps().
void remove_from_deps | ( | ) |
Remove INSN from dependence contexts DEPS.
References deps_reg::clobbers, deps_reg::implicit_sets, deps_desc::last_function_call, deps_desc::last_function_call_may_noreturn, deps_desc::last_pending_memory_flush, deps_desc::pending_flush_length, deps_desc::pending_jump_insns, deps_desc::pending_read_insns, deps_desc::pending_read_list_length, deps_desc::pending_read_mems, deps_desc::pending_write_insns, deps_desc::pending_write_list_length, deps_desc::pending_write_mems, deps_desc::reg_last, deps_desc::reg_last_in_use, remove_from_both_dependence_lists(), remove_from_dependence_list(), deps_desc::sched_before_next_call, deps_reg::sets, and deps_reg::uses.
Referenced by advance_one_cycle().
|
static |
Remove link LINK from list LIST.
References depl_on_debug_p(), and detach_dep_link().
Referenced by clear_deps_list(), delete_dep_nodes_in_back_deps(), move_dep_link(), and sd_delete_dep().
void sched_analyze | ( | ) |
Analyze every insn between HEAD and TAIL inclusive, creating backward dependencies for each insn.
References cselib_finish(), cselib_init(), CSELIB_RECORD_MEMORY, deps_analyze_insn(), deps_start_bb(), sd_init_insn(), and sched_deps_info_def::use_cselib.
Referenced by build_intra_loop_deps(), compute_block_dependences(), and schedule_ebb().
Referenced by sched_analyze_1(), sched_analyze_2(), and sched_analyze_insn().
|
static |
Analyze a single SET, CLOBBER, PRE_DEC, POST_DEC, PRE_INC or POST_INC rtx, X, creating all dependencies generated by the write to the destination of X, and reads of everything mentioned.
References add_dependence_list(), add_insn_mem_dependence(), add_to_hard_reg_set(), anti_dependence(), can_start_lhs_rhs_p, canon_rtx(), cselib_lookup_from_insn(), cselib_subst_to_values_from_insn(), df_read_modify_subreg_p(), sched_deps_info_def::finish_lhs, flush_pending_lists(), get_address_mode(), implicit_reg_pending_uses, deps_desc::last_pending_memory_flush, note_mem_dep(), output_dependence(), deps_desc::pending_jump_insns, deps_desc::pending_read_insns, deps_desc::pending_read_list_length, deps_desc::pending_read_mems, deps_desc::pending_write_insns, deps_desc::pending_write_list_length, deps_desc::pending_write_mems, deps_desc::readonly, sched_analyze_1(), sched_analyze_2(), sched_analyze_reg(), sched_insns_conditions_mutex_p(), SET, sched_deps_info_def::start_lhs, and sched_deps_info_def::use_cselib.
Referenced by sched_analyze_1(), sched_analyze_2(), sched_analyze_insn(), and sched_analyze_reg().
|
static |
Analyze the uses of memory and registers in rtx X in INSN.
References add_dependence(), add_insn_mem_dependence(), can_start_lhs_rhs_p, canon_rtx(), cselib_lookup_from_insn(), cselib_subst_to_values_from_insn(), deps_may_trap_p(), sched_deps_info_def::finish_rhs, flush_pending_lists(), gen_rtx_MEM(), sched_deps_info_def::generate_spec_deps, get_address_mode(), deps_desc::last_pending_memory_flush, spec_info_def::mask, note_dep(), note_mem_dep(), deps_desc::pending_jump_insns, deps_desc::pending_read_insns, deps_desc::pending_read_list_length, deps_desc::pending_read_mems, deps_desc::pending_write_insns, deps_desc::pending_write_list_length, deps_desc::pending_write_mems, prev_nonnote_insn(), read_dependence(), deps_desc::readonly, reg_pending_barrier, sched_analyze_1(), sched_analyze_2(), sched_analyze_reg(), sched_insns_conditions_mutex_p(), sel_sched_p(), SET, set_dep_weak(), spec_info, sched_deps_info_def::start_rhs, TRUE_BARRIER, true_dependence(), and sched_deps_info_def::use_cselib.
Referenced by deps_analyze_insn().
|
static |
Analyze an INSN with pattern X to find all dependencies.
References add_dependence(), add_dependence_list(), add_dependence_list_and_free(), alloc_INSN_LIST(), bitmap_ior(), can_start_lhs_rhs_p, can_throw_internal(), change_spec_dep_to_hard(), deps_reg::clobbers, deps_reg::clobbers_length, sched_deps_info_def::compute_jump_reg_dependencies, const_true_rtx, control_flow_insn_p(), deps_reg::control_uses, current_sched_info, DO_SPECULATION, extract_insn(), find_reg_note(), haifa_sched_info::flags, flush_pending_lists(), implicit_reg_pending_clobbers, implicit_reg_pending_uses, deps_reg::implicit_sets, deps_desc::in_post_call_group_p, init_insn_reg_pressure_info(), ira_implicitly_set_insn_hard_regs(), deps_desc::last_debug_insn, deps_desc::last_function_call, deps_desc::last_function_call_may_noreturn, deps_desc::last_pending_memory_flush, deps_desc::last_reg_pending_barrier, deps_desc::max_reg, may_trap_p(), MOVE_BARRIER, next_nonnote_nondebug_insn(), NOT_A_BARRIER, not_post_call, 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, post_call, post_call_initial, preprocess_constraints(), deps_desc::readonly, refers_to_regno_p(), deps_desc::reg_last, deps_desc::reg_last_in_use, reg_pending_barrier, reload_completed, sched_analyze_1(), sched_analyze_2(), deps_desc::sched_before_next_jump, sched_emulate_haifa_p, sched_has_condition_p(), sched_insn_is_legitimate_for_speculation_p(), sched_insns_conditions_mutex_p(), sched_pressure, SCHED_PRESSURE_NONE, sd_iterator_cond(), sd_iterator_start(), sel_insn_is_speculation_check(), sel_mark_hard_insn(), sel_sched_p(), SET, deps_reg::sets, setup_insn_reg_uses(), targetm, TRUE_BARRIER, deps_reg::uses, and deps_reg::uses_length.
|
static |
Analyze a single reference to register (reg:MODE REGNO) in INSN. The type of the reference is specified by REF and can be SET, CLOBBER, PRE_DEC, POST_DEC, PRE_INC, POST_INC or USE.
References add_dependence_list(), alloc_INSN_LIST(), extend_deps_reg_info(), get_reg_known_equiv_p(), get_reg_known_value(), deps_desc::last_function_call, deps_desc::max_reg, max_reg_num(), maybe_extend_reg_info_p(), note_reg_clobber(), note_reg_set(), note_reg_use(), deps_desc::readonly, reload_completed, sched_analyze_2(), deps_desc::sched_before_next_call, sel_sched_p(), and SET.
Referenced by sched_analyze_1(), and sched_analyze_2().
void sched_deps_finish | ( | void | ) |
Finalize dependency information for the whole function.
References bitmap_clear(), cache_size, deps_pools_are_empty_p(), free(), free_alloc_pool_if_empty(), sched_deps_info_def::generate_spec_deps, and h_d_i_d.
Referenced by haifa_sched_finish(), and sel_global_finish().
void sched_deps_init | ( | ) |
If it is profitable to use them, initialize or extend (depending on GLOBAL_P) dependency data.
References cache_size, create_alloc_pool(), extend_dependency_caches(), init_deps_data_vector(), sched_max_luid, and sel_sched_p().
Referenced by haifa_init_insn(), haifa_sched_init(), sel_global_init(), and sel_region_init().
void sched_free_deps | ( | ) |
Delete (RESOLVED_P) dependencies between HEAD and TAIL together with deps_lists.
References clear_deps_list(), delete_dep_nodes_in_back_deps(), and sd_finish_insn().
Referenced by build_intra_loop_deps(), free_block_dependencies(), free_rgn_deps(), and schedule_ebb().
|
static |
Caching variant of sched_get_condition_with_rev_uncached. We only do actual work the first time we come here for an insn; the results are cached in INSN_CACHED_COND and INSN_REVERSE_COND.
References const_true_rtx, and sched_get_condition_with_rev_uncached().
Referenced by deps_analyze_insn(), sched_has_condition_p(), and sched_insns_conditions_mutex_p().
|
static |
Find the condition under which INSN is executed. If REV is not NULL, it is set to TRUE when the returned comparison should be reversed to get the actual condition.
References any_condjump_p(), onlyjump_p(), pc_rtx, pc_set(), and reversed_comparison_code().
Referenced by sched_get_condition_with_rev(), and sched_get_reverse_condition_uncached().
rtx sched_get_reverse_condition_uncached | ( | ) |
Return the condition under which INSN does not execute (i.e. the not-taken condition for a conditional branch), or NULL if we cannot find such a condition. The caller should make a copy of the condition before using it.
References reversed_comparison_code(), and sched_get_condition_with_rev_uncached().
Referenced by add_dependence(), and recompute_todo_spec().
|
static |
Referenced by sched_analyze_insn(), and sched_insn_is_legitimate_for_speculation_p().
|
static |
True when we can find a condition under which INSN is executed.
References sched_get_condition_with_rev().
bool sched_insn_is_legitimate_for_speculation_p | ( | ) |
Return true if INSN can potentially be speculated with type DS.
References may_trap_or_fault_p(), sched_has_condition_p(), and side_effects_p().
Referenced by new_ready(), process_insn_forw_deps_be_in_spec(), sched_analyze_insn(), sched_speculate_insn(), and sd_add_dep().
bool sched_insns_conditions_mutex_p | ( | ) |
Return true if insn1 and insn2 can never depend on one another because the conditions under which they are executed are mutually exclusive.
References conditions_mutex_p(), modified_in_p(), and sched_get_condition_with_rev().
Referenced by add_branch_dependences(), add_dependence_list(), add_deps_for_risky_insns(), chain_to_prev_insn(), fur_orig_expr_not_found(), move_cond_jump(), moveup_expr(), sched_analyze_1(), sched_analyze_2(), sched_analyze_insn(), and undo_transformations().
void sd_add_dep | ( | ) |
Add dependence described by DEP. If RESOLVED_P is true treat the dependence as a resolved one.
References add_to_deps_list(), check_dep(), copy_dep(), create_dep_node(), current_sched_info, DO_SPECULATION, haifa_sched_info::flags, get_back_and_forw_lists(), sched_insn_is_legitimate_for_speculation_p(), and set_dependency_caches().
Referenced by add_jump_dependencies(), add_or_update_dep_1(), add_to_speculative_block(), create_check_block_twin(), process_insn_forw_deps_be_in_spec(), and sd_copy_back_deps().
enum DEPS_ADJUST_RESULT sd_add_or_update_dep | ( | ) |
Add or update backward dependence between INSN and ELEM with given type DEP_TYPE and dep_status DS. This function is a convenience wrapper.
References add_or_update_dep_1().
Referenced by add_deps_for_risky_insns().
void sd_copy_back_deps | ( | ) |
Make TO depend on all the FROM's producers. If RESOLVED_P is true add dependencies to the resolved lists.
References copy_dep(), and sd_add_dep().
Referenced by add_to_speculative_block(), and create_check_block_twin().
void sd_debug_dep | ( | ) |
Dump all fields of DEP to STDERR.
References dump_dep().
void sd_debug_lists | ( | ) |
Dump all information about deps_lists of INSN specified by TYPES to STDERR.
References dump_lists().
void sd_delete_dep | ( | ) |
Remove a dependency referred to by SD_IT. SD_IT will point to the next dependence after removal.
References bitmap_clear_bit(), current_sched_info, delete_dep_node(), DO_SPECULATION, haifa_sched_info::flags, get_back_and_forw_lists(), insn_luid(), _sd_iterator::linkp, remove_from_deps_list(), and _sd_iterator::resolved_p.
Referenced by add_to_speculative_block(), create_check_block_twin(), delete_all_dependences(), fix_recovery_deps(), and schedule_insn().
dep_t sd_find_dep_between | ( | ) |
Find a dependency between producer PRO and consumer CON. Use dependency [if available] to check if dependency is present at all. Search through resolved dependency lists if RESOLVED_P is true. If the dependency or NULL if none found.
References bitmap_bit_p(), insn_luid(), and sd_find_dep_between_no_cache().
Referenced by add_branch_dependences(), ok_for_early_queue_removal(), and rank_for_schedule().
|
static |
Find a dependency between producer PRO and consumer CON. Search through resolved dependency lists if RESOLVED_P is true. If no such dependency is found return NULL, otherwise return the dependency and initialize SD_IT_PTR [if it is nonnull] with an iterator pointing to it.
References sd_lists_size().
Referenced by add_or_update_dep_1(), and sd_find_dep_between().
void sd_finish_insn | ( | ) |
Free data for INSN.
References free_deps_list().
Referenced by sched_free_deps(), and sched_remove_insn().
void sd_init_insn | ( | ) |
Initialize data for INSN.
References create_deps_list().
Referenced by haifa_init_insn(), and sched_analyze().
bool sd_lists_empty_p | ( | ) |
Return true if INSN's lists defined by LIST_TYPES are all empty.
References deps_list_empty_p(), and sd_next_list().
Referenced by add_jump_dependencies(), fix_tick_ready(), is_prisky(), recompute_todo_spec(), resolve_dependencies(), restore_pattern(), schedule_insn(), and unschedule_insns_until().
int sd_lists_size | ( | ) |
Return the summary size of INSN's lists defined by LIST_TYPES.
References sd_next_list().
Referenced by debug_dependencies(), dep_list_size(), dump_lists(), and sd_find_dep_between_no_cache().
void sd_next_list | ( | const_rtx | insn, |
sd_list_types_def * | types_ptr, | ||
deps_list_t * | list_ptr, | ||
bool * | resolved_p_ptr | ||
) |
Initialize LIST_PTR to point to one of the lists present in TYPES_PTR, initialize RESOLVED_P_PTR with true if that list consists of resolved deps, and remove the type of returned [through LIST_PTR] list from TYPES_PTR. This function is used to switch sd_iterator to the next list. !!! For internal use only. Might consider moving it to sched-int.h.
Referenced by sd_iterator_cond(), sd_lists_empty_p(), and sd_lists_size().
void sd_resolve_dep | ( | ) |
Resolved dependence pointed to by SD_IT. SD_IT will advance to the next element.
References dep_spec_p(), _sd_iterator::linkp, and move_dep_link().
Referenced by resolve_dependencies(), and schedule_insn().
void sd_unresolve_dep | ( | ) |
Perform the inverse operation of sd_resolve_dep. Restore the dependence pointed to by SD_IT to unresolved state.
References dep_spec_p(), _sd_iterator::linkp, and move_dep_link().
Referenced by unschedule_insns_until().
ds_t set_dep_weak | ( | ) |
Return the dep_status, which has the same parameters as DS, except for speculative type TYPE, that will have weakness DW.
References BE_IN_CONTROL_BITS_OFFSET, BE_IN_DATA_BITS_OFFSET, BEGIN_CONTROL_BITS_OFFSET, and BEGIN_DATA_BITS_OFFSET.
Referenced by add_deps_for_risky_insns(), add_or_update_dep_1(), create_check_block_twin(), ds_full_merge(), ds_get_max_dep_weak(), ds_merge_1(), new_ready(), sched_analyze_2(), and update_dep().
|
static |
Set dependency caches according to DEP.
References bitmap_set_bit(), current_sched_info, DO_SPECULATION, haifa_sched_info::flags, insn_luid(), and USE_DEPS_LIST.
Referenced by sd_add_dep(), and update_dependency_caches().
|
static |
Set up insn register uses for INSN and dependency context DEPS.
References create_insn_reg_use(), find_regno_note(), reg_use_data::next_regno_use, deps_desc::reg_last, and deps_reg::uses.
Referenced by sched_analyze_insn().
|
static |
Update DEP to incorporate information from NEW_DEP. SD_IT points to DEP in case it should be moved to another list. MEM1 and MEM2, if nonnull, correspond to memory locations in case if data-speculative dependence should be updated.
References change_spec_dep_to_hard(), current_sched_info, DEP_CHANGED, DEP_PRESENT, dep_spec_p(), ds_merge(), estimate_dep_weak(), haifa_sched_info::flags, set_dep_weak(), update_dependency_caches(), and USE_DEPS_LIST.
Referenced by add_or_update_dep_1().
|
static |
Type of dependence DEP have changed from OLD_TYPE. Update dependency caches accordingly.
References bitmap_clear_bit(), current_sched_info, haifa_sched_info::flags, insn_luid(), set_dependency_caches(), and USE_DEPS_LIST.
Referenced by update_dep().
|
static |
|
static |
Referenced by extend_dependency_caches(), sched_deps_finish(), and sched_deps_init().
|
static |
Internal variable for sched_analyze_[12] () functions. If it is nonzero, this means that sched_analyze_[12] looks at the most toplevel SET.
Referenced by sched_analyze_1(), sched_analyze_2(), and sched_analyze_insn().
|
static |
|
static |
Instruction which dependencies we are analyzing.
Referenced by add_dependence_1(), compute_av_set_inside_bb(), fix_crossing_unconditional_branches(), haifa_finish_insn(), haifa_note_dep(), haifa_note_mem_dep(), haifa_start_insn(), sel_dump_cfg_2(), and set_columns_for_row().
|
static |
Pool to hold dependencies lists (deps_list_t).
|
static |
Number of deps_lists out there.
Referenced by create_deps_list(), deps_pools_are_empty_p(), and free_deps_list().
|
static |
Pool to hold all dependency nodes (dep_node_t).
|
static |
Number of dep_nodes out there.
Referenced by create_dep_node(), delete_dep_node(), and deps_pools_are_empty_p().
|
static |
Default flags for dump_dep ().
Referenced by dump_lists().
vec<haifa_deps_insn_data_def> h_d_i_d = vNULL |
The data is specific to the Haifa scheduler.
Referenced by init_deps_data_vector(), sched_deps_finish(), and sel_region_finish().
|
static |
Hard registers implicitly clobbered or used (or may be implicitly clobbered or used) by the currently analyzed insn. For example, insn in its constraint has one register class. Even if there is currently no hard register in the insn, the particular hard register will be in the insn after reload pass because the constraint requires it.
Referenced by init_deps_global(), and sched_analyze_insn().
|
static |
Referenced by deps_analyze_insn(), init_deps_global(), sched_analyze_1(), and sched_analyze_insn().
|
static |
True if we should mark added dependencies as a non-register deps.
Referenced by add_dependence_list(), flush_pending_lists(), and haifa_note_dep().
|
static |
|
static |
Referenced by deps_analyze_insn(), init_deps_global(), sched_analyze_2(), and sched_analyze_insn().
|
static |
|
static |
|
static |
|
static |
|
static |
Register pressure info for the currently processed insn.
Referenced by init_insn_reg_pressure_info(), mark_hard_regno_death(), mark_insn_hard_regno_birth(), mark_insn_pseudo_birth(), and mark_pseudo_death().
struct sched_deps_info_def* sched_deps_info |
Holds current parameters for the dependency analyzer.
Referenced by contributes_to_priority_p(), haifa_sched_init(), haifa_speculate_insn(), new_ready(), rgn_setup_sched_infos(), schedule_ebbs_init(), and setup_sched_infos().
|
static |
|
static |
To speed up the test for duplicate dependency links we keep a record of dependencies created by add_dependence when the average number of instructions in a basic block is very large. Studies have shown that there is typically around 5 instructions between branches for typical C code. So we can make a guess that the average basic block is approximately 5 instructions long; we will choose 100X the average size as a very large basic block. Each insn has associated bitmaps for its dependencies. Each bitmap has enough entries to represent a dependency on any other insn in the insn chain. All bitmap for true dependencies cache is allocated then the rest two ones are also allocated.