GCC Middle and Back End API Reference
|
Data Structures | |
struct | sloc |
Typedefs | |
typedef struct sloc * | sloc_t |
|
static |
Process recursively X of INSN and add REG_INC notes if necessary.
References add_reg_note(), and auto_inc_p().
Referenced by add_auto_inc_notes(), reload(), and update_inc_notes().
|
static |
This page contains code dealing with info about registers in insns.
Process X of insn UID recursively and add info (operand type is given by TYPE, flag of that it is early clobber is EARLY_CLOBBER) about registers in X to the insn DATA.
References bitmap_set_bit(), lra_insn_reg::early_clobber, eliminable_regset, expand_reg_info(), lra_no_alloc_regs, new_insn_reg(), lra_insn_reg::next, OP_IN, OP_INOUT, OP_OUT, lra_insn_reg::regno, lra_insn_recog_data::regs, SET, and lra_insn_reg::subreg_p.
Referenced by lra_update_insn_regno_info().
|
static |
Expand, if necessary, LRA data about insns.
References lra_insn_recog_data_len.
Referenced by lra_set_insn_recog_data(), lra_set_used_insn_alternative_by_uid(), and lra_update_insn_recog_data().
|
static |
Function checks RTL for correctness. If FINAL_P is true, it is done at the end of LRA and the check is more rigorous.
References asm_noperands(), constrain_operands(), extract_insn(), insn_invalid_p(), lra_get_insn_recog_data(), reload_completed, and RTX_AUTOINC.
Referenced by lra().
|
staticread |
Recursively process X and collect info about registers, which are not the insn operands, in X with TYPE (in/out/inout) and flag that it is early clobbered in the insn (EARLY_CLOBBER) and add the info to LIST. X is a part of insn given by DATA. Return the result list.
References lra_insn_recog_data::dup_loc, lra_insn_reg::early_clobber, eliminable_regset, lra_insn_recog_data::insn_static_data, last, lra_no_alloc_regs, lra_static_insn_data::n_dups, lra_static_insn_data::n_operands, new_insn_reg(), lra_insn_reg::next, OP_IN, OP_INOUT, OP_OUT, lra_insn_recog_data::operand_loc, lra_insn_reg::regno, SET, and lra_insn_reg::subreg_p.
Referenced by lra_set_insn_recog_data().
|
static |
Emit insn x = x + y. Return the insn. We use gen_add2_insn as the last resort.
References emit_add3_insn(), emit_insn(), and gen_add2_insn().
Referenced by lra_emit_add().
|
static |
Emit insn x = y + z. Return NULL if we failed to do it. Otherwise, return the insn. We don't use gen_add3_insn as it might clobber CC.
References delete_insns_since(), emit_insn(), get_last_insn(), last, and recog_memoized().
Referenced by emit_add2_insn(), and lra_emit_add().
|
static |
Expand all regno related info needed for LRA.
References expand_reg_info(), ira_expand_reg_equiv(), and resize_reg_info().
Referenced by lra_create_new_reg_with_unique_value(), lra_emit_add(), and lra_emit_move().
|
static |
Expand common reg info if it is necessary.
References initialize_lra_reg_info_element(), max_reg_num(), and reg_info_size.
Referenced by add_regs_to_insn_regno_info(), expand_reg_data(), and lra().
|
static |
Called once per compiler work to finalize some LRA data related to insns.
References free().
Referenced by lra_finish_once().
|
static |
Finish LRA data about all insns.
References finish_insn_regs(), free(), free_insn_recog_data(), and lra_insn_recog_data_len.
Referenced by lra().
|
static |
Finish pool for insn reg info.
References free_alloc_pool().
Referenced by finish_insn_recog_data().
|
static |
Finish common reg info and copies.
References bitmap_clear(), free(), free_alloc_pool(), lra_reg::insn_bitmap, and reg_info_size.
Referenced by lra().
|
static |
Finish LRA DATA about insn.
References lra_insn_recog_data::alternative_enabled_p, lra_insn_recog_data::arg_hard_regs, lra_insn_recog_data::dup_loc, free(), free_insn_regs(), lra_static_insn_data::hard_regs, lra_insn_recog_data::icode, lra_insn_recog_data::insn, lra_insn_recog_data::insn_static_data, lra_static_insn_data::operand_alternative, lra_insn_recog_data::operand_loc, and lra_insn_recog_data::regs.
Referenced by finish_insn_recog_data(), and invalidate_insn_recog_data().
|
static |
Free insn reg info IR.
References pool_free().
Referenced by free_insn_regs(), and invalidate_insn_data_regno_info().
|
static |
Free insn reg info list IR.
References free_insn_reg(), and lra_insn_reg::next.
Referenced by free_insn_recog_data().
|
static |
Referenced by lra_invalidate_insn_regno_info(), lra_update_insn_recog_data(), and lra_update_insn_regno_info().
|
static |
Return execution frequency of INSN.
|
static |
Return info about insn give by UID. The info should be already set up.
Referenced by lra_get_insn_regs().
|
static |
Return new register value.
References last_reg_value.
Referenced by initialize_lra_reg_info_element(), and lra_set_regno_unique_value().
|
staticread |
Return static insn data, allocate and setup if necessary. Although dup_num is static data (it depends only on icode), to set it up we need to extract insn first. So recog_data should be valid for normal insn (ICODE >= 0) before the call.
References lra_operand_data::constraint, insn_operand_data::constraint, lra_static_insn_data::dup_num, recog_data_d::dup_num, insn_data, lra_operand_data::is_address, lra_operand_data::is_operator, insn_operand_data::is_operator, lra_static_insn_data::n_alternatives, lra_static_insn_data::n_dups, lra_static_insn_data::n_operands, OP_IN, OP_INOUT, OP_OUT, lra_static_insn_data::operand, insn_data_d::operand, recog_data, lra_operand_data::strict_low, and insn_operand_data::strict_low.
Referenced by lra_set_insn_recog_data().
|
static |
Determine if the current function has an exception receiver block that reaches the exit block via non-exceptional edges
References edge_def::flags, basic_block_def::flags, free(), basic_block_def::preds, edge_def::src, and worklist.
Referenced by lra().
|
static |
Called once per compiler work to initialize some LRA data related to insns.
References memset().
Referenced by lra_init_once().
|
static |
Initialize LRA data about insns.
References init_insn_regs(), and lra_insn_recog_data_len.
Referenced by lra().
|
static |
Initiate pool for insn reg info.
References create_alloc_pool().
Referenced by init_insn_recog_data().
|
static |
Initialize LRA info about operands in insn alternatives.
References free().
Referenced by lra_init().
|
static |
Initialize common reg info and copies.
References create_alloc_pool(), initialize_lra_reg_info_element(), last_reg_value, max_reg_num(), and reg_info_size.
Referenced by lra().
|
inlinestatic |
Initialize I-th element of lra_reg_info.
References lra_reg::biggest_mode, lra_reg::conflict_hard_regs, lra_reg::copies, lra_reg::freq, get_new_reg_value(), lra_reg::insn_bitmap, lra_reg::last_reload, lra_reg::live_ranges, lra_reg::no_stack_p, lra_reg::nrefs, lra_reg::offset, lra_reg::preferred_hard_regno1, lra_reg::preferred_hard_regno2, lra_reg::preferred_hard_regno_profit1, lra_reg::preferred_hard_regno_profit2, reg_obstack, lra_reg::restore_regno, and lra_reg::val.
Referenced by expand_reg_info(), and init_reg_info().
|
static |
Invalidate all reg info of INSN with DATA and execution frequency FREQ. Update common info about the invalidated registers.
References bitmap_clear_bit(), free_insn_reg(), lra_reg::freq, lra_insn_reg::next, lra_reg::nrefs, lra_insn_reg::regno, and lra_insn_recog_data::regs.
Referenced by lra_invalidate_insn_regno_info(), lra_update_insn_recog_data(), and lra_update_insn_regno_info().
|
static |
Referenced by lra_invalidate_insn_data(), and lra_update_insn_recog_data().
|
static |
Invalidate all info about insn given by its UID.
References free_insn_recog_data().
void lra | ( | ) |
Major LRA entry function. F is a file should be used to dump LRA debug info.
References assign_stack_local(), bitmap_clear(), bitmap_ones(), caller_save_needed, function::can_throw_non_call_exceptions, cfun, check_rtl(), commit_edge_insertions(), DF_NO_INSN_RESCAN, df_set_flags(), df_set_regs_ever_live(), emit_note(), expand_reg_info(), find_many_sub_basic_blocks(), finish_insn_recog_data(), finish_reg_info(), fixup_abnormal_edges(), get_frame_size(), get_insns(), get_last_insn(), get_max_uid(), has_nonexceptional_receiver(), function::has_nonlocal_label, init_insn_recog_data(), init_reg_info(), lra_assign(), lra_clear_live_ranges(), lra_coalesce(), lra_coalesce_iter, lra_constraint_iter, lra_constraint_iter_after_spill, lra_constraint_new_insn_uid_start, lra_constraint_new_regno_start, lra_constraints(), lra_constraints_finish(), lra_constraints_init(), lra_create_live_ranges(), lra_curr_reload_num, lra_dump_file, lra_eliminate(), lra_final_code_change(), lra_in_progress, lra_inheritance(), lra_inheritance_iter, lra_live_range_iter, lra_live_ranges_finish(), lra_live_ranges_init(), lra_need_for_spills_p(), lra_new_regno_start, lra_no_alloc_regs, lra_reg_spill_p, lra_simple_p, lra_spill(), lra_undo_inheritance(), lra_undo_inheritance_iter, max_reg_num(), push_insns(), reg_obstack, regstat_free_n_sets_and_refs(), regstat_free_ri(), reload_completed, remove_scratches(), restore_scratches(), sbitmap_alloc(), sbitmap_free(), setup_reg_spill_flag(), timevar_pop(), timevar_push(), unshare_all_rtl_again(), and update_inc_notes().
Referenced by do_reload().
void lra_create_copy | ( | ) |
Create copy of two pseudos REGNO1 and REGNO2. The copy execution frequency is FREQ.
References lra_reg::copies, lra_copy::freq, lra_reg::freq, lra_dump_file, pool_alloc(), lra_copy::regno1, lra_copy::regno1_dest_p, lra_copy::regno1_next, lra_copy::regno2, and lra_copy::regno2_next.
rtx lra_create_new_reg | ( | enum machine_mode | md_mode, |
rtx | original, | ||
enum reg_class | rclass, | ||
const char * | title | ||
) |
Analogous to the previous function but also inherits value of ORIGINAL.
References lra_assign_reg_val(), and lra_create_new_reg_with_unique_value().
Referenced by base_plus_disp_to_reg(), curr_insn_transform(), emit_inc(), get_reload_reg(), inherit_reload_reg(), process_address(), remove_scratches(), and split_reg().
rtx lra_create_new_reg_with_unique_value | ( | enum machine_mode | md_mode, |
rtx | original, | ||
enum reg_class | rclass, | ||
const char * | title | ||
) |
Create and return a new reg of ORIGINAL mode. If ORIGINAL is NULL or of VOIDmode, use MD_MODE for the new reg. Initialize its register class to RCLASS. Print message about assigning class RCLASS containing new register name TITLE unless it is NULL. Use attributes of ORIGINAL if it is a register. The created register will have unique held value.
References expand_reg_data(), gen_reg_rtx(), lra_dump_file, reg_class_names, and setup_reg_classes().
Referenced by check_and_process_move(), get_reload_reg(), lra_create_new_reg(), match_reload(), and process_addr_reg().
void lra_delete_dead_insn | ( | ) |
Delete an unneeded INSN and any previous insns who sole purpose is loading data that is dead in INSN.
References find_regno_note(), lra_delete_dead_insn(), lra_set_insn_deleted(), prev_real_insn(), reg_mentioned_p(), SET, and side_effects_p().
void lra_emit_add | ( | ) |
Target checks operands through operand predicates to recognize an insn. We should have a special precaution to generate add insns which are frequent results of elimination. Emit insns for x = y + z. X can be used to store intermediate values and should be not in Y and Z when we use X to store an intermediate value. Y + Z should form [base] [+ index[ * scale]] [ + disp] where base and index are registers, disp and scale are constants. Y should contain base if it is present, Z should contain disp if any. index[*scale] can be part of Y or Z.
References delete_insns_since(), emit_add2_insn(), emit_add3_insn(), emit_move_insn(), expand_reg_data(), get_last_insn(), last, max_reg_num(), and recog_memoized().
void lra_emit_move | ( | ) |
Emit x := y, processing special case when y = u + v or y = u + v * scale + w through emit_add (Y can be an address which is base + index reg * scale + displacement in general case). X may be used as intermediate result therefore it should be not in Y.
References emit_move_insn(), expand_reg_data(), lra_reg::last_reload, lra_curr_reload_num, lra_emit_add(), lra_reg_info, max_reg_num(), and rtx_equal_p().
void lra_finish_once | ( | void | ) |
Called once per compiler to finish LRA data which are initialize once.
References finish_insn_code_data_once().
Referenced by ira_finish_once().
bool lra_former_scratch_operand_p | ( | ) |
Return true if the operand NOP of INSN is a former scratch.
References bitmap_bit_p().
bool lra_former_scratch_p | ( | ) |
Return true if pseudo REGNO is made of SCRATCH.
References bitmap_bit_p().
void lra_free_copies | ( | void | ) |
Free all copies.
References lra_reg::copies, pool_free(), lra_copy::regno1, and lra_copy::regno2.
Referenced by lra_create_live_ranges().
lra_copy_t lra_get_copy | ( | ) |
Return N-th (0, 1, ...) copy. If there is no copy, return NULL.
|
read |
Return reg info of insn given by it UID.
References get_insn_recog_data_by_uid(), and lra_insn_recog_data::regs.
void lra_init | ( | void | ) |
Initialize LRA whenever register-related information is changed.
References init_op_alt_data().
Referenced by ira_init().
void lra_init_once | ( | void | ) |
Called once per compiler to initialize LRA data once.
References init_insn_code_data_once().
Referenced by ira_init_once().
unsigned int lra_insn_stack_length | ( | void | ) |
Return the current size of the insn stack.
Referenced by lra_constraints().
void lra_invalidate_insn_data | ( | ) |
Invalidate INSN related info used by LRA.
References invalidate_insn_recog_data(), and lra_invalidate_insn_regno_info().
void lra_invalidate_insn_regno_info | ( | ) |
Invalidate all reg info of INSN. Update common info about the invalidated registers.
References get_insn_freq(), invalidate_insn_data_regno_info(), and lra_get_insn_recog_data().
rtx lra_pop_insn | ( | void | ) |
Take the last-inserted insns off the stack and return it.
References bitmap_clear_bit().
Referenced by lra_constraints().
void lra_process_new_insns | ( | ) |
Emit insns BEFORE before INSN and insns AFTER after INSN. Put the insns onto the stack. Print about emitting the insns with TITLE.
References dump_insn_slim(), dump_rtl_slim(), emit_insn_after(), emit_insn_before(), last, lra_dump_file, and push_insns().
void lra_push_insn | ( | ) |
Put INSN on the stack.
References lra_push_insn_1().
|
inlinestatic |
Put INSN on the stack. If ALWAYS_UPDATE is true, always update the reg info for INSN, otherwise only update it if INSN is not already on the stack.
References bitmap_bit_p(), bitmap_set_bit(), lra_update_insn_regno_info(), and sbitmap_resize().
Referenced by lra_push_insn(), and lra_push_insn_and_update_insn_regno_info().
void lra_push_insn_and_update_insn_regno_info | ( | ) |
Put INSN on the stack and update its reg info.
References lra_push_insn_1().
void lra_push_insn_by_uid | ( | ) |
Put insn with UID on the stack.
References lra_push_insn().
void lra_set_insn_deleted | ( | ) |
Mark INSN deleted and invalidate the insn related info used by LRA.
References lra_invalidate_insn_data().
lra_insn_recog_data_t lra_set_insn_recog_data | ( | ) |
Set up and return info about INSN. Set up the info if it is not set up yet.
References lra_insn_recog_data::alternative_enabled_p, lra_insn_recog_data::arg_hard_regs, asm_noperands(), check_and_expand_insn_recog_data(), collect_non_operand_hard_regs(), lra_operand_data::constraint, recog_data_d::constraints, constraints, debug_insn_static_data, decode_asm_operands(), recog_data_d::dup_loc, lra_insn_recog_data::dup_loc, get_static_insn_data(), lra_static_insn_data::hard_regs, lra_insn_recog_data::icode, lra_insn_recog_data::insn, recog_data_d::insn, insn_data, insn_extract(), lra_insn_recog_data::insn_static_data, lra_operand_data::is_address, lra_operand_data::is_operator, memcpy(), n_alternatives(), lra_static_insn_data::n_alternatives, lra_static_insn_data::n_dups, n_operands, lra_static_insn_data::n_operands, OP_IN, OP_INOUT, OP_OUT, lra_static_insn_data::operand, recog_data_d::operand_loc, lra_insn_recog_data::operand_loc, recog_data, recog_memoized(), lra_insn_recog_data::regs, SET, setup_operand_alternative(), lra_operand_data::strict_low, lra_insn_recog_data::used_insn_alternative, and which_alternative.
void lra_set_regno_unique_value | ( | ) |
Set up for REGNO unique hold value.
References get_new_reg_value(), lra_reg_info, and lra_reg::val.
void lra_set_used_insn_alternative | ( | ) |
Set up that INSN is using alternative ALT now.
References lra_get_insn_recog_data(), and lra_insn_recog_data::used_insn_alternative.
void lra_set_used_insn_alternative_by_uid | ( | ) |
Set up that insn with UID is using alternative ALT now. The insn info should be already set up.
References check_and_expand_insn_recog_data(), and lra_insn_recog_data::used_insn_alternative.
void lra_update_dups | ( | ) |
Update insn operands which are duplication of operands whose numbers are in array of NOPS (with end marker -1). The insn is represented by its LRA internal representation ID.
References lra_static_insn_data::dup_num, and lra_static_insn_data::n_dups.
lra_insn_recog_data_t lra_update_insn_recog_data | ( | ) |
Update all the insn info about INSN. It is usually called when something in the insn was changed. Return the updated info.
References lra_insn_recog_data::alternative_enabled_p, asm_noperands(), check_and_expand_insn_recog_data(), lra_operand_data::constraint, constraints, decode_asm_operands(), recog_data_d::dup_loc, lra_insn_recog_data::dup_loc, get_insn_freq(), lra_insn_recog_data::icode, recog_data_d::insn, insn_extract(), lra_insn_recog_data::insn_static_data, invalidate_insn_data_regno_info(), invalidate_insn_recog_data(), lra_operand_data::is_operator, lra_get_insn_recog_data(), memcpy(), lra_static_insn_data::n_alternatives, lra_static_insn_data::n_dups, lra_static_insn_data::n_operands, OP_IN, OP_INOUT, OP_OUT, lra_static_insn_data::operand, recog_data_d::operand_loc, lra_insn_recog_data::operand_loc, recog_data, lra_insn_recog_data::used_insn_alternative, and which_alternative.
void lra_update_insn_regno_info | ( | ) |
Set up insn reg info of INSN. Update common reg info from reg info of INSN.
References add_regs_to_insn_regno_info(), lra_operand_data::early_clobber, get_insn_freq(), lra_insn_recog_data::insn_static_data, invalidate_insn_data_regno_info(), lra_get_insn_recog_data(), lra_static_insn_data::n_operands, OP_IN, OP_OUT, lra_static_insn_data::operand, lra_insn_recog_data::operand_loc, and setup_insn_reg_info().
|
staticread |
Create LRA insn related info about referenced REGNO with TYPE (in/out/inout), biggest reference mode MODE, flag that it is reference through subreg (SUBREG_P), flag that is early clobbered in the insn (EARLY_CLOBBER), and reference to the next insn reg info (NEXT).
References lra_insn_reg::early_clobber, lra_reg_info, lra_insn_reg::next, pool_alloc(), lra_insn_reg::regno, lra_insn_reg::subreg_p, and type().
Referenced by add_regs_to_insn_regno_info(), and collect_non_operand_hard_regs().
|
static |
Push insns FROM to TO (excluding it) going in reverse order.
References lra_push_insn().
Referenced by lra(), and lra_process_new_insns().
|
static |
Change scratches onto pseudos and save their location.
References add_reg_note(), bitmap_set_bit(), df_insn_rescan(), get_max_uid(), sloc::insn, lra_create_new_reg(), lra_dump_file, lra_get_insn_recog_data(), lra_update_dup(), lra_static_insn_data::n_operands, sloc::nop, lra_static_insn_data::operand, lra_insn_recog_data::operand_loc, and reg_obstack.
Referenced by lra().
|
static |
Changes pseudos created by function remove_scratches onto scratches.
References bitmap_clear(), free(), sloc::insn, last, lra_dump_file, lra_former_scratch_p(), lra_get_insn_recog_data(), lra_get_regno_hard_regno(), lra_update_dup(), sloc::nop, and lra_insn_recog_data::operand_loc.
Referenced by lra().
|
static |
Update common reg info from reg info of insn given by its DATA and execution frequency FREQ.
References lra_reg::freq, lra_insn_reg::next, lra_reg::nrefs, lra_insn_reg::regno, and lra_insn_recog_data::regs.
Referenced by lra_update_insn_regno_info().
|
static |
Setup info about operands in alternatives of LRA DATA of insn.
References operand_alternative::anything_ok, base_reg_class(), operand_alternative::cl, lra_static_insn_data::commutative, operand_alternative::constraint, lra_operand_data::constraint, operand_alternative::decmem_ok, lra_operand_data::early_clobber, operand_alternative::earlyclobber, lra_insn_recog_data::icode, operand_alternative::incmem_ok, lra_insn_recog_data::insn_static_data, operand_alternative::is_address, lra_operand_data::is_address, operand_alternative::matched, operand_alternative::matches, operand_alternative::memory_ok, memset(), lra_static_insn_data::n_alternatives, lra_static_insn_data::n_operands, operand_alternative::nonoffmem_ok, operand_alternative::offmem_ok, lra_static_insn_data::operand, lra_static_insn_data::operand_alternative, and operand_alternative::reject.
Referenced by lra_set_insn_recog_data().
|
static |
|
static |
Remove all REG_DEAD and REG_UNUSED notes and regenerate REG_INC. We change pseudos by hard registers without notification of DF and that can make the notes obsolete. DF-infrastructure does not deal with REG_INC notes -- so we should regenerate them here.
References add_auto_inc_notes().
Referenced by lra().
|
static |
Pools for copies.
|
static |
Vec referring to pseudo copies.
|
static |
The following data are used as static insn data for all debug insns. If structure lra_static_insn_data is changed, the initializer should be changed too.
Referenced by lra_set_insn_recog_data().
|
static |
Debug insns are represented as a special insn with one input operand which is RTL expression in var_location.
The following data are used as static insn operand data for all debug insns. If structure lra_operand_data is changed, the initializer should be changed too.
struct target_lra_int default_target_lra_int |
This page contains code dealing LRA insn info (or in other words LRA internal insn representation).
struct lra_static_insn_data* insn_code_data[LAST_INSN_CODE] |
Map INSN_CODE -> the static insn data. This info is valid during all translation unit.
|
static |
This page contains code dealing with info about registers in the insns.
Pools for insn reg info.
|
static |
Last register value.
Referenced by get_new_reg_value(), and init_reg_info().
|
static |
This page contains code dealing with stack of the insns which should be processed by the next constraint pass.
Bitmap used to put an insn on the stack only in one exemplar.
int lra_constraint_new_insn_uid_start |
First UID of insns generated before a new spill pass.
Referenced by lra().
int lra_constraint_new_regno_start |
Start of reload pseudo regnos before the new spill pass.
Referenced by assign_by_spills(), create_live_range_start_chains(), find_hard_regno_for(), improve_inheritance(), inherit_in_ebb(), init_live_reload_and_inheritance_pseudos(), init_regno_assign_info(), lra(), lra_constraints(), lra_inheritance(), lra_setup_reload_pseudo_preferenced_hard_reg(), process_bb_lives(), process_copy_to_form_thread(), pseudo_prefix_title(), reload_pseudo_compare_func(), and spill_for().
int lra_curr_reload_num |
The number of emitted reload insns so far.
Referenced by lra(), lra_constraints(), and lra_emit_move().
FILE* lra_dump_file |
File used for output of LRA debug information.
Referenced by assign_by_spills(), assign_spill_hard_regs(), change_class(), check_and_process_move(), compress_live_ranges(), curr_insn_transform(), equiv_address_substitution(), get_reload_reg(), improve_inheritance(), inherit_in_ebb(), inherit_reload_reg(), lra(), lra_coalesce(), lra_constraints(), lra_create_copy(), lra_create_live_ranges(), lra_create_new_reg_with_unique_value(), lra_eliminate(), lra_inheritance(), lra_process_new_insns(), lra_setup_reg_renumber(), lra_setup_reload_pseudo_preferenced_hard_reg(), lra_spill(), lra_undo_inheritance(), process_addr_reg(), process_alt_operands(), process_bb_lives(), remove_inheritance_pseudos(), remove_scratches(), remove_some_program_points_and_update_live_ranges(), restore_scratches(), setup_live_pseudos_and_spill_after_risky_transforms(), spill_for(), spill_pseudos(), split_reg(), undo_optional_reloads(), update_ebb_live_info(), and update_reg_eliminate().
int lra_in_progress |
Set to 1 while in lra.
Referenced by emit_move_insn_1(), gen_rtx_REG(), general_operand(), lra(), register_operand(), scratch_operand(), simplify_subreg_regno(), true_regnum(), and validate_subreg().
bitmap_head lra_inheritance_pseudos |
Inheritance pseudo regnos before the new spill pass.
Referenced by assign_by_spills(), improve_inheritance(), inherit_reload_reg(), lra_undo_inheritance(), pseudo_prefix_title(), remove_inheritance_pseudos(), and spill_for().
Map INSN_UID -> the insn recog data (NULL if unknown).
int lra_insn_recog_data_len |
The current length of the following array.
Referenced by check_and_expand_insn_recog_data(), finish_insn_recog_data(), and init_insn_recog_data().
int lra_new_regno_start |
Start of pseudo regnos before the LRA.
Referenced by lra(), and match_reload().
HARD_REG_SET lra_no_alloc_regs |
@verbatim LRA (local register allocator) driver and LRA utilities.
Copyright (C) 2010-2013 Free Software Foundation, Inc. Contributed by Vladimir Makarov vmaka. rov@ redha t.co m
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/.
The Local Register Allocator (LRA) is a replacement of former reload pass. It is focused to simplify code solving the reload pass tasks, to make the code maintenance easier, and to implement new perspective optimizations. The major LRA design solutions are: o division small manageable, separated sub-tasks o reflection of all transformations and decisions in RTL as more as possible o insn constraints as a primary source of the info (minimizing number of target-depended macros/hooks) In brief LRA works by iterative insn process with the final goal is to satisfy all insn and address constraints: o New reload insns (in brief reloads) and reload pseudos might be generated; o Some pseudos might be spilled to assign hard registers to new reload pseudos; o Changing spilled pseudos to stack memory or their equivalences; o Allocation stack memory changes the address displacement and new iteration is needed. Here is block diagram of LRA passes: ------------------------ --------------- | Undo inheritance for | --------------- | Memory-memory | | spilled pseudos, | | New (and old) | | move coalesce |<---| splits for pseudos got |<-- | pseudos | --------------- | the same hard regs, | | assignment | Start | | and optional reloads | --------------- | | ------------------------ ^ V | ---------------- | ----------- V | Update virtual | | | Remove |----> ------------>| register | | | scratches | ^ | displacements | | ----------- | ---------------- | | | | | V New | ---------------- No ------------ pseudos ------------------- | Spilled pseudo | change |Constraints:| or insns | Inheritance/split | | to memory |<-------| RTL |--------->| transformations | | substitution | | transfor- | | in EBB scope | ---------------- | mations | ------------------- | ------------ V ------------------------- | Hard regs substitution, | | devirtalization, and |------> Finish | restoring scratches got | | memory | ------------------------- To speed up the process: o We process only insns affected by changes on previous iterations; o We don't use DFA-infrastructure because it results in much slower compiler speed than a special IR described below does; o We use a special insn representation for quick access to insn info which is always *synchronized* with the current RTL; o Insn IR is minimized by memory. It is divided on three parts: o one specific for each insn in RTL (only operand locations); o one common for all insns in RTL with the same insn code (different operand attributes from machine descriptions); o one oriented for maintenance of live info (list of pseudos). o Pseudo data: o all insns where the pseudo is referenced; o live info (conflicting hard regs, live ranges, # of references etc); o data used for assigning (preferred hard regs, costs etc). This file contains LRA driver, LRA utility functions and data, and code for dealing with scratches.
Hard registers currently not available for allocation. It can changed after some hard registers become not eliminable.
Referenced by add_regs_to_insn_regno_info(), assign_spill_hard_regs(), collect_non_operand_hard_regs(), contains_reg_p(), find_hard_regno_for(), in_class_p(), inherit_in_ebb(), lra(), lra_eliminate_reg_if_possible(), make_hard_regno_born(), make_hard_regno_dead(), need_for_split_p(), process_alt_operands(), process_bb_lives(), setup_live_pseudos_and_spill_after_risky_transforms(), spill_pseudos(), and update_reg_eliminate().
bitmap_head lra_optional_reload_pseudos |
Reload pseudo regnos before the new assignmnet pass which still can be spilled after the assinment pass as memory is also accepted in insns for the reload pseudos.
Referenced by assign_by_spills(), curr_insn_transform(), pseudo_prefix_title(), spill_for(), and undo_optional_reloads().
struct lra_reg* lra_reg_info |
Common info about each register.
Referenced by add_pseudo_to_slot(), assign_by_spills(), assign_hard_regno(), assign_mem_slot(), assign_spill_hard_regs(), assign_stack_slot_num_and_sort_pseudos(), assign_temporarily(), check_pseudos_live_through_calls(), create_live_range_start_chains(), curr_insn_transform(), find_hard_regno_for(), fix_bb_live_info(), improve_inheritance(), inherit_reload_reg(), init_live_reload_and_inheritance_pseudos(), init_regno_assign_info(), insert_in_live_range_start_chain(), lra_assign(), lra_clear_live_ranges(), lra_coalesce(), lra_constraints(), lra_create_live_ranges(), lra_eliminate(), lra_emit_move(), lra_final_code_change(), lra_need_for_spills_p(), lra_set_regno_unique_value(), lra_setup_reg_renumber(), lra_setup_reload_pseudo_preferenced_hard_reg(), lra_spill(), lra_undo_inheritance(), make_hard_regno_born(), mark_pseudo_dead(), mark_pseudo_live(), merge_pseudos(), multi_block_pseudo_p(), need_for_split_p(), new_insn_reg(), print_pseudo_live_ranges(), process_alt_operands(), process_bb_lives(), pseudo_compare_func(), pseudo_reg_slot_compare(), regno_freq_compare(), reload_pseudo_compare_func(), remove_inheritance_pseudos(), remove_some_program_points_and_update_live_ranges(), setup_live_pseudos_and_spill_after_risky_transforms(), spill_for(), spill_pseudos(), split_reg(), undo_optional_reloads(), update_hard_regno_preference(), update_lives(), and update_reg_eliminate().
bool lra_reg_spill_p |
True if we should try spill into registers of different classes instead of memory.
Referenced by assign_spill_hard_regs(), lra(), setup_reg_spill_flag(), and spill_pseudos().
bool lra_simple_p |
True if the current function is too big to use regular algorithms in LRA. In other words, we should use simpler and faster algorithms in LRA. It also means we should not worry about generation code for caller saves. The value is set up in IRA.
Referenced by assign_by_spills(), curr_insn_transform(), ira(), and lra().
bitmap_head lra_split_regs |
Split regnos before the new spill pass.
Referenced by assign_by_spills(), lra_undo_inheritance(), pseudo_prefix_title(), remove_inheritance_pseudos(), spill_for(), and split_reg().
bitmap_head lra_subreg_reload_pseudos |
Pseudo regnos used for subreg reloads before the new assignment pass. Such pseudos still can be spilled after the assinment pass.
Referenced by assign_by_spills(), pseudo_prefix_title(), simplify_operand_subreg(), and spill_for().
|
static |
This page contains code dealing with common register info and pseudo copies.
The size of the following array.
Referenced by expand_reg_info(), finish_reg_info(), and init_reg_info().
|
static |
Bitmap of scratch regnos.
|
static |
Bitmap of scratch operands.
struct target_lra_int* this_target_lra_int = &default_target_lra_int |