GCC Middle and Back End API Reference
|
Data Structures | |
struct | cost_rtxes |
Enumerations | |
enum | classify_move_insn { NOT_SIMPLE_MOVE, DECOMPOSABLE_SIMPLE_MOVE, SIMPLE_MOVE } |
Functions | |
static int | shift_cost (bool speed_p, struct cost_rtxes *rtxes, enum rtx_code code, enum machine_mode mode, int op1) |
static void | compute_splitting_shift (bool speed_p, struct cost_rtxes *rtxes, bool *splitting, enum rtx_code code, int word_move_zero_cost, int word_move_cost) |
static void | compute_costs () |
void | init_lower_subreg () |
static bool | simple_move_operand () |
static rtx | simple_move () |
static bool | find_pseudo_copy () |
static void | propagate_pseudo_copies () |
static int | find_decomposable_subregs () |
static void | decompose_register () |
static rtx | simplify_subreg_concatn (enum machine_mode outermode, rtx op, unsigned int byte) |
static rtx | simplify_gen_subreg_concatn (enum machine_mode outermode, rtx op, enum machine_mode innermode, unsigned int byte) |
static bool | resolve_reg_p () |
static bool | resolve_subreg_p () |
static int | resolve_subreg_use () |
static int | adjust_decomposed_uses () |
static void | resolve_reg_notes () |
static bool | can_decompose_p () |
static rtx | resolve_simple_move () |
static bool | resolve_clobber () |
static bool | resolve_use () |
static void | resolve_debug () |
static bool | find_decomposable_shift_zext () |
static rtx | resolve_shift_zext () |
static void | dump_shift_choices () |
static void | dump_choices () |
static void | decompose_multiword_subregs () |
static bool | gate_handle_lower_subreg () |
static unsigned int | rest_of_handle_lower_subreg () |
static unsigned int | rest_of_handle_lower_subreg2 () |
rtl_opt_pass * | make_pass_lower_subreg () |
rtl_opt_pass * | make_pass_lower_subreg2 () |
Variables | |
static bitmap | decomposable_context |
static bitmap | non_decomposable_context |
static bitmap | subreg_context |
static vec< bitmap > | reg_copy_graph |
struct target_lower_subreg | default_target_lower_subreg |
struct target_lower_subreg * | this_target_lower_subreg = &default_target_lower_subreg |
enum classify_move_insn |
|
static |
This is called via for_each_rtx. Look for SUBREGs which can be decomposed and decomposed REGs that need copying.
References copy_rtx(), resolve_reg_p(), resolve_subreg_p(), and simplify_subreg_concatn().
Referenced by resolve_debug().
|
static |
Return whether X can be decomposed into subwords.
References bitmap_bit_p(), simplify_subreg_regno(), and word_mode.
Referenced by resolve_simple_move().
|
static |
Compute what we should do when optimizing for speed or size; SPEED_P selects which. Use RTXES for computing costs.
References compute_splitting_shift(), cost_rtxes::set, set_rtx_cost(), set_src_cost(), cost_rtxes::source, cost_rtxes::target, word_mode, and cost_rtxes::zext.
Referenced by init_lower_subreg().
|
static |
For each X in the range [0, BITS_PER_WORD), set SPLITTING[X] to true if it is profitable to split a double-word CODE shift of X + BITS_PER_WORD bits. SPEED_P says whether we are testing for speed or size profitability. Use the rtxes in RTXES to calculate costs. WORD_MOVE_ZERO_COST is the cost of moving zero into a word-mode register. WORD_MOVE_COST is the cost of moving between word registers.
References shift_cost(), and word_mode.
Referenced by compute_costs().
|
static |
Look for registers which are always accessed via word-sized SUBREGs or -if DECOMPOSE_COPIES is true- via copies. Decompose these registers into several word-sized pseudo-registers.
References apply_change_group(), bitmap_and_compl_into(), bitmap_clear(), bitmap_empty_p(), bitmap_set_bit(), can_throw_internal(), function::can_throw_non_call_exceptions, cfun, control_flow_insn_p(), DECOMPOSABLE_SIMPLE_MOVE, decompose_register(), edge_def::dest, df, DF_DEFER_INSN_RESCAN, df_set_flags(), dump_choices(), dump_file, recog_data_d::dup_loc, recog_data_d::dup_num, extract_insn(), find_decomposable_shift_zext(), find_decomposable_subregs(), find_pseudo_copy(), for_each_rtx(), basic_block_def::index, max_reg_num(), memset(), recog_data_d::n_dups, recog_data_d::n_operands, NOT_SIMPLE_MOVE, num_validated_changes(), recog_data_d::operand, recog_data_d::operand_loc, optimize_function_for_speed_p(), propagate_pseudo_copies(), recog_data, recog_memoized(), regno_reg_rtx, resolve_clobber(), resolve_debug(), resolve_reg_notes(), resolve_shift_zext(), resolve_simple_move(), resolve_subreg_use(), resolve_use(), rtl_make_eh_edge(), run_word_dce(), sbitmap_alloc(), sbitmap_free(), simple_move(), SIMPLE_MOVE, split_block(), and validate_unshare_change().
Referenced by rest_of_handle_lower_subreg(), and rest_of_handle_lower_subreg2().
|
static |
Decompose REGNO into word-sized components. We smash the REG node in place. This ensures that (1) something goes wrong quickly if we fail to make some replacement, and (2) the debug information inside the symbol table is automatically kept up to date.
References dump_file, gen_reg_rtx_offset(), regno_reg_rtx, rtvec_alloc(), and word_mode.
Referenced by decompose_multiword_subregs().
|
static |
Print to dump_file a description of what we're doing when optimizing for speed or size; SPEED_P says which. DESCRIPTION is a description of the SPEED_P choice.
References dump_file, and dump_shift_choices().
Referenced by decompose_multiword_subregs().
|
static |
Print to dump_file a description of what we're doing with shift code CODE. SPLITTING[X] is true if we are splitting shifts by X + BITS_PER_WORD.
References dump_file.
Referenced by dump_choices().
|
static |
Check if INSN is a decomposable multiword-shift or zero-extend and set the decomposable_context bitmap accordingly. SPEED_P is true if we are optimizing INSN for speed rather than size. Return true if INSN is decomposable.
References bitmap_set_bit(), and word_mode.
Referenced by decompose_multiword_subregs().
|
static |
This is called via for_each_rtx. If we find a SUBREG which we could use to decompose a pseudo-register, set a bit in DECOMPOSABLE_CONTEXT. If we find an unadorned register which is not a simple pseudo-register copy, DATA will point at the type of move, and we set a bit in DECOMPOSABLE_CONTEXT or NON_DECOMPOSABLE_CONTEXT as appropriate.
References bitmap_set_bit(), DECOMPOSABLE_SIMPLE_MOVE, for_each_rtx(), NOT_SIMPLE_MOVE, SIMPLE_MOVE, and word_mode.
Referenced by decompose_multiword_subregs().
|
static |
If SET is a copy from one multi-word pseudo-register to another, record that in reg_copy_graph. Return whether it is such a copy.
References bitmap_set_bit().
Referenced by decompose_multiword_subregs().
|
static |
Gate function for lower subreg pass.
void init_lower_subreg | ( | void | ) |
Do one-per-target initialisation. This involves determining which operations on the machine are profitable. If none are found, then the pass just returns when called.
References compute_costs(), gen_rtx_REG(), memset(), cost_rtxes::set, cost_rtxes::shift, cost_rtxes::source, cost_rtxes::target, this_target_lower_subreg, word_mode, and cost_rtxes::zext.
Referenced by backend_init_target().
rtl_opt_pass* make_pass_lower_subreg | ( | ) |
rtl_opt_pass* make_pass_lower_subreg2 | ( | ) |
|
static |
Look through the registers in DECOMPOSABLE_CONTEXT. For each case where they are copied to another register, add the register to which they are copied to DECOMPOSABLE_CONTEXT. Use NON_DECOMPOSABLE_CONTEXT to limit this--we don't bother to track copies of registers which are in NON_DECOMPOSABLE_CONTEXT.
References bitmap_and_compl(), bitmap_clear(), bitmap_copy(), bitmap_empty_p(), bitmap_ior_and_compl_into(), bitmap_ior_into(), propagate(), and queue.
Referenced by decompose_multiword_subregs().
|
static |
Change a CLOBBER of a decomposed register into a CLOBBER of the component registers. Return whether we changed something.
References df_insn_rescan(), emit_insn_after(), resolve_reg_notes(), resolve_reg_p(), resolve_subreg_p(), simplify_gen_subreg_concatn(), validate_change(), and word_mode.
Referenced by decompose_multiword_subregs().
|
static |
A VAR_LOCATION can be simplified.
References adjust_decomposed_uses(), df_insn_rescan(), for_each_rtx(), and resolve_reg_notes().
Referenced by decompose_multiword_subregs().
|
static |
Resolve any decomposed registers which appear in register notes on INSN.
References df_notes_rescan(), find_reg_equal_equiv_note(), for_each_rtx(), num_validated_changes(), remove_note(), resolve_reg_p(), and resolve_subreg_use().
Referenced by decompose_multiword_subregs(), resolve_clobber(), resolve_debug(), and resolve_use().
|
static |
Return whether we should resolve X into the registers into which it was decomposed.
Referenced by adjust_decomposed_uses(), resolve_clobber(), resolve_reg_notes(), resolve_shift_zext(), resolve_simple_move(), resolve_subreg_p(), resolve_subreg_use(), and resolve_use().
|
static |
Decompose a more than word wide shift (in INSN) of a multiword pseudo or a multiword zero-extend of a wordmode pseudo into a move and 'set to zero' insn. Return a pointer to the new insn when a replacement was done.
References copy_rtx(), delete_insn(), dump_file, emit_insn_before(), emit_move_insn(), end_sequence(), expand_shift(), get_insns(), resolve_reg_p(), simplify_gen_subreg_concatn(), start_sequence(), and word_mode.
Referenced by decompose_multiword_subregs().
|
static |
Decompose the registers used in a simple move SET within INSN. If we don't change anything, return INSN, otherwise return the start of the sequence of moves.
References apply_change_group(), can_decompose_p(), copy_reg_eh_region_note_forward(), copy_rtx(), delete_insn(), emit_clobber(), emit_insn_before(), emit_move_insn(), end_sequence(), for_each_rtx(), gen_reg_rtx(), get_insns(), in_sequence_p(), mode_for_size(), push_operand(), remove_insn(), resolve_reg_p(), resolve_subreg_p(), resolve_subreg_use(), side_effects_p(), simplify_gen_subreg(), simplify_gen_subreg_concatn(), start_sequence(), and word_mode.
Referenced by decompose_multiword_subregs().
|
static |
Return whether X is a SUBREG of a register which we need to resolve.
References resolve_reg_p().
Referenced by adjust_decomposed_uses(), resolve_clobber(), resolve_simple_move(), resolve_subreg_use(), and resolve_use().
|
static |
This is called via for_each_rtx. Look for SUBREGs which need to be decomposed.
References resolve_reg_p(), resolve_subreg_p(), simplify_subreg_concatn(), and validate_change().
Referenced by decompose_multiword_subregs(), resolve_reg_notes(), and resolve_simple_move().
|
static |
A USE of a decomposed register is no longer meaningful. Return whether we changed something.
References delete_insn(), resolve_reg_notes(), resolve_reg_p(), and resolve_subreg_p().
Referenced by decompose_multiword_subregs().
|
static |
Implement first lower subreg pass.
References decompose_multiword_subregs().
|
static |
Implement second lower subreg pass.
References decompose_multiword_subregs().
|
static |
Return the cost of a CODE shift in mode MODE by OP1 bits, using the rtxes in RTXES. SPEED_P selects between the speed and size cost.
References set_src_cost(), cost_rtxes::shift, and cost_rtxes::source.
Referenced by compute_splitting_shift().
|
static |
If INSN is a single set between two objects that we want to split, return the single set. SPEED_P says whether we are optimizing INSN for speed or size. INSN should have been passed to recog and extract_insn before this is called.
References mode_for_size(), recog_data_d::n_operands, recog_data_d::operand, recog_data, and simple_move_operand().
Referenced by decompose_multiword_subregs().
|
static |
References mode_dependent_address_p().
Referenced by simple_move().
|
static |
Wrapper around simplify_gen_subreg which handles CONCATN.
References simplify_gen_subreg(), and simplify_subreg_concatn().
Referenced by resolve_clobber(), resolve_shift_zext(), and resolve_simple_move().
|
static |
Get a SUBREG of a CONCATN.
References mode_for_size(), and simplify_gen_subreg().
Referenced by adjust_decomposed_uses(), resolve_subreg_use(), and simplify_gen_subreg_concatn().
|
static |
Bit N in this bitmap is set if regno N is used in a context in which we can decompose it.
struct target_lower_subreg default_target_lower_subreg |
|
static |
Bit N in this bitmap is set if regno N is used in a context in which it can not be decomposed.
Bit N in the bitmap in element M of this array is set if there is a copy from reg M to reg N.
|
static |
Bit N in this bitmap is set if regno N is used in a subreg which changes the mode but not the size. This typically happens when the register accessed as a floating-point value; we want to avoid generating accesses to its subwords in integer modes.
struct target_lower_subreg* this_target_lower_subreg = &default_target_lower_subreg |
Referenced by init_lower_subreg().