GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "target.h"
#include "rtl.h"
#include "tree.h"
#include "cfghooks.h"
#include "df.h"
#include "memmodel.h"
#include "tm_p.h"
#include "insn-config.h"
#include "regs.h"
#include "emit-rtl.h"
#include "recog.h"
#include "insn-attr.h"
#include "addresses.h"
#include "cfgrtl.h"
#include "cfgbuild.h"
#include "cfgcleanup.h"
#include "reload.h"
#include "tree-pass.h"
#include "function-abi.h"
#include "rtl-iter.h"
Data Structures | |
struct | change_t |
struct | validate_replace_src_data |
struct | funny_match |
struct | peep2_insn_data |
Macros | |
#define | STACK_POP_CODE POST_DEC |
#define | PEEP2_EOB invalid_insn_rtx |
Variables | |
struct target_recog | default_target_recog |
int | volatile_ok |
struct recog_data_d | recog_data |
const operand_alternative * | recog_op_alt |
static operand_alternative | asm_op_alt [MAX_RECOG_OPERANDS *MAX_RECOG_ALTERNATIVES] |
int | which_alternative |
bool | raw_constraint_p |
int | reload_completed |
int | epilogue_completed |
static change_t * | changes |
static int | changes_allocated |
static int | num_changes = 0 |
static struct peep2_insn_data | peep2_insn_data [MAX_INSNS_PER_PEEP2+1] |
static int | peep2_current |
static bool | peep2_do_rebuild_jump_labels |
static bool | peep2_do_cleanup_cfg |
int | peep2_current_count |
static int | search_ofs |
#define PEEP2_EOB invalid_insn_rtx |
A marker indicating the last insn of the block. The live_before regset for this element is correct, indicating DF_LIVE_OUT for the block.
Referenced by peep2_reinit_state(), and peephole2_optimize().
#define STACK_POP_CODE POST_DEC |
Subroutines used by or related to instruction recognition. Copyright (C) 1987-2025 Free Software Foundation, Inc. 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/>.
Referenced by pop_operand().
Return true if OP is a valid memory address for a memory reference of mode MODE. The main use of this function is as a predicate in match_operand expressions in the machine description.
References GET_MODE, memory_address_p, and SCALAR_INT_MODE_P.
Referenced by asm_operand_ok(), preprocess_constraints(), and record_reg_classes().
bool apply_change_group | ( | void | ) |
Apply a group of changes previously issued with `validate_change'. If all changes are valid, call confirm_change_group and return true, otherwise, call cancel_changes and return false.
References cancel_changes(), confirm_change_group(), and verify_changes().
Referenced by apply_debug_insn_changes(), canonicalize_insn(), combine_reaching_defs(), cond_exec_process_if_block(), copyprop_hardreg_forward_1(), cse_change_cc_mode_insn(), cse_insn(), decompose_multiword_subregs(), expand_var_during_unrolling(), fold_rtx(), invert_jump(), move_invariant_reg(), redirect_jump(), regrename_do_replace(), reload_combine_recognize_pattern(), reload_cse_simplify(), reload_cse_simplify_operands(), replace_uses(), resolve_simple_move(), split_live_ranges_for_shrink_wrap(), try_apply_stack_adjustment(), try_back_substitute_reg(), try_eliminate_compare(), try_merge_compare(), try_replace_reg(), validate_change_1(), validate_replace_rtx(), validate_replace_rtx_part(), validate_replace_rtx_part_nosimplify(), validate_replace_rtx_subexp(), and validate_simplify_insn().
Return true if labels in asm operands BODY are LABEL_REFs.
References ASM_OPERANDS_LABEL, ASM_OPERANDS_LABEL_LENGTH, extract_asm_operands(), GET_CODE, i, and NULL_RTX.
Referenced by check_asm_operands().
int asm_noperands | ( | const_rtx | body | ) |
If BODY is an insn body that uses ASM_OPERANDS, return the number of operands (both input and output) in the insn. If BODY is an insn body that uses ASM_INPUT with CLOBBERS in PARALLEL, return 0. Otherwise return -1.
References ASM_OPERANDS_INPUT_LENGTH, ASM_OPERANDS_INPUT_VEC, ASM_OPERANDS_LABEL_LENGTH, CONST_CAST_RTX, extract_asm_operands(), GET_CODE, i, NULL, SET, SET_SRC, XVECEXP, and XVECLEN.
Referenced by adjust_insn(), insn_propagation::apply_to_rvalue_1(), arithmetic_flags_clobber_p(), build_def_use(), cheap_bb_rtx_cost_p(), check_asm_operands(), check_rtl(), combine_and_move_insns(), compute_regs_asm_clobbered(), copyprop_hardreg_forward_1(), create_log_links(), cselib_record_sets(), curr_insn_transform(), decrease_live_ranges_number(), delete_trivially_dead_insns(), do_local_cprop(), do_output_reload(), eliminate_regs_in_insn(), eliminate_regs_in_insn(), elimination_costs_in_insn(), emit_input_reload_insns(), extract_insn(), failed_reload(), fill_slots_from_thread(), final_scan_insn_1(), find_invariant_insn(), fix_crossing_unconditional_branches(), fix_up_fall_thru_edges(), get_attr_length_1(), insn_invalid_p(), instantiate_virtual_regs_in_insn(), lra_set_insn_recog_data(), lra_split_hard_reg_for(), lra_update_insn_recog_data(), match_reload(), maybe_fix_stack_asms(), maybe_reset_location_view(), need_fake_edge_p(), record_out_operands(), reload(), reload_as_needed(), reload_cse_simplify(), scan_loop(), shorten_branches(), spill_failure(), stop_search_p(), try_combine(), and verify_changes().
int asm_operand_ok | ( | rtx | op, |
const char * | constraint, | ||
const char ** | constraints ) |
Check if an asm_operand matches its constraints. Return > 0 if ok, = 0 if bad, < 0 if inconclusive.
References address_operand(), asm_operand_ok(), AUTO_INC_DEC, CONST_INT_P, constraints, end(), extract_mem_from_operand(), gcc_assert, general_operand(), GET_CODE, GET_MODE, INTVAL, MEM_P, memory_operand(), NULL, offsettable_nonstrict_memref_p(), raw_constraint_p, register_operand(), reload_completed, and XEXP.
Referenced by asm_operand_ok(), assemble_asm(), check_asm_operands(), and expand_asm_stmt().
void cancel_changes | ( | int | num | ) |
Retract the changes numbered NUM and up.
References changes, gcc_assert, i, INSN_CODE, undo_recog_changes::is_active(), MEM_P, num_changes, and XVECLEN.
Referenced by apply_change_group(), insn_propagation::apply_to_pattern(), insn_propagation::apply_to_rvalue(), insn_propagation::apply_to_rvalue_1(), combine_reaching_defs(), cond_exec_find_if_block(), cond_exec_process_if_block(), dead_or_predicable(), equiv_can_be_consumed_p(), pair_fusion_bb_info::fuse_pair(), inv_can_prop_to_addr_use(), invert_jump(), reload_as_needed(), try_fwprop_subst_pattern(), try_merge_compare(), pair_fusion::try_promote_writeback(), try_replace_reg(), vt_initialize(), and insn_change_watermark::~insn_change_watermark().
Keep X canonicalized if some changes have made it non-canonical; only modifies the operands of X, not (for example) its code. Simplifications are not the job of this routine. Return true if anything was changed.
References COMMUTATIVE_P, swap_commutative_operands_p(), validate_unshare_change(), and XEXP.
Referenced by fold_rtx().
Check that X is an insn-body for an `asm' with operands and that the operands mentioned in it are legitimate.
References asm_labels_ok(), asm_noperands(), asm_operand_ok(), constrain_operands(), constraints, decode_asm_operands(), extract_insn(), get_enabled_alternatives(), i, recog_data_d::insn, make_insn_raw(), NULL, reload_completed, and which_alternative.
Referenced by insn_invalid_p(), instantiate_virtual_regs_in_insn(), recog_for_combine(), recog_for_combine_1(), simplify_set(), and try_combine().
Assert that the cached boolean attributes for INSN are still accurate. The backend is required to define these attributes in a way that only depends on the current target (rather than operands, compiler phase, etc.).
References BA_LAST, gcc_assert, get_bool_attr_mask_uncached(), i, validate_replace_src_data::insn, INSN_CODE, and this_target_recog.
Referenced by lra_update_insn_recog_data().
Check if REG_INC argument in *data overlaps a stored REG.
References MEM_P, NULL_RTX, and reg_overlap_mentioned_p().
Referenced by insn_invalid_p().
Return true if this is a comparison operator. This allows the use of MATCH_OPERATOR to recognize all the branch insns.
References COMPARISON_P, and GET_MODE.
Referenced by write_test_expr().
void confirm_change_group | ( | void | ) |
A group of changes has previously been issued with validate_change and verified with verify_changes. Call df_insn_rescan for each of the insn changed and clear num_changes.
References as_a(), changes, copy_rtx(), df_insn_rescan(), gcc_assert, i, INSN_P, undo_recog_changes::is_active(), NULL, and num_changes.
Referenced by apply_change_group(), dead_or_predicable(), pair_fusion_bb_info::fuse_pair(), redirect_jump_2(), reload_as_needed(), try_fwprop_subst_notes(), try_fwprop_subst_pattern(), and pair_fusion::try_promote_writeback().
Return true if OP is an operand that is a constant integer or constant floating-point number of MODE.
References CONST_DOUBLE_P, CONST_INT_P, GET_MODE, and GET_MODE_CLASS.
Return true if OP is an operand that is a CONST_INT of mode MODE.
References CONST_INT_P, INTVAL, and trunc_int_for_mode().
bool constrain_operands | ( | int | strict, |
alternative_mask | alternatives ) |
References AUTO_INC_DEC, CONSTANT_P, constrain_operands(), constraints, end(), general_operand(), GET_CODE, GET_MODE, i, MEM_P, NULL, OP_OUT, operands_match_p(), funny_match::other, raw_constraint_p, recog_data, reg_equiv_mem, reg_fits_class_p(), REG_P, reg_renumber, REGNO, reload_in_progress, safe_from_earlyclobber(), SCALAR_INT_MODE_P, skip_alternative(), strict_memory_address_p, SUBREG_BYTE, SUBREG_REG, subreg_regno_offset(), targetm, TEST_BIT, TEST_HARD_REG_BIT, funny_match::this_op, which_alternative, and XEXP.
Referenced by assemble_asm(), can_reload_into(), check_asm_operands(), combine_reaching_defs(), constrain_operands(), constrain_operands_cached(), eliminate_partially_redundant_load(), emit_input_reload_insns(), emit_insn_if_valid_for_reload_1(), extract_constrain_insn(), extract_constrain_insn_cached(), fill_slots_from_thread(), gen_reload_chain_without_interm_reg_p(), inc_for_reload(), insn_invalid_p(), reg_save_code(), reload(), reload_as_needed(), setup_prohibited_mode_move_regs(), and valid_insn_p().
Do cached constrain_operands on INSN and complain about failures.
References constrain_operands(), get_enabled_alternatives(), validate_replace_src_data::insn, and which_alternative.
Referenced by final_scan_insn_1().
Copies frame related info of an insn (OLD_INSN) to the single insn (NEW_INSN) that was obtained by splitting OLD_INSN.
References add_reg_note(), gcc_assert, maybe_copy_prologue_epilogue_insn(), NULL, REG_NOTE_KIND, REG_NOTES, rtx_equal_p(), RTX_FRAME_RELATED_P, single_set(), and XEXP.
Referenced by peep2_attempt(), and try_split().
const char * decode_asm_operands | ( | rtx | body, |
rtx * | operands, | ||
rtx ** | operand_locs, | ||
const char ** | constraints, | ||
machine_mode * | modes, | ||
location_t * | loc ) |
Assuming BODY is an insn body that uses ASM_OPERANDS, copy its operands (both input and output) into the vector OPERANDS, the locations of the operands within the insn into the vector OPERAND_LOCS, and the constraints for the operands into CONSTRAINTS. Write the modes of the operands into MODES. Write the location info into LOC. Return the assembler-template. If BODY is an insn body that uses ASM_INPUT with CLOBBERS in PARALLEL, return the basic assembly string. If LOC, MODES, OPERAND_LOCS, CONSTRAINTS or OPERANDS is 0, we don't store that info.
References ASM_INPUT_SOURCE_LOCATION, ASM_OPERANDS_INPUT, ASM_OPERANDS_INPUT_CONSTRAINT, ASM_OPERANDS_INPUT_LENGTH, ASM_OPERANDS_INPUT_MODE, ASM_OPERANDS_LABEL, ASM_OPERANDS_LABEL_LENGTH, ASM_OPERANDS_OUTPUT_CONSTRAINT, ASM_OPERANDS_SOURCE_LOCATION, ASM_OPERANDS_TEMPLATE, constraints, gcc_assert, gcc_unreachable, GET_CODE, GET_MODE, i, modes, SET, SET_DEST, SET_SRC, XSTR, XVECEXP, and XVECLEN.
Referenced by asm_insn_count(), check_asm_operands(), extract_insn(), final_scan_insn_1(), lra_set_insn_recog_data(), lra_update_insn_recog_data(), and maybe_fix_stack_asms().
|
static |
If BODY is an insn body that uses ASM_OPERANDS, return it.
References GET_CODE, NULL, SET, SET_SRC, and XVECEXP.
Referenced by asm_labels_ok(), asm_noperands(), can_combine_p(), create_trace_edges(), fixup_reorder_chain(), force_nonfallthru_and_redirect(), instantiate_virtual_regs_in_insn(), ira_nullify_asm_goto(), make_edges(), mark_jump_label(), patch_jump_insn(), redirect_jump_1(), reorder_basic_blocks_simple(), and rtl_split_edge().
void extract_constrain_insn | ( | rtx_insn * | insn | ) |
Do uncached extract_insn, constrain_operands and complain about failures. This should be used when extracting a pre-existing constrained instruction if the caller wants to know which alternative was chosen.
References constrain_operands(), extract_insn(), fatal_insn_not_found, get_enabled_alternatives(), validate_replace_src_data::insn, and reload_completed.
Referenced by build_def_use(), check_rtl(), copyprop_hardreg_forward_1(), and reload_cse_simplify_operands().
void extract_constrain_insn_cached | ( | rtx_insn * | insn | ) |
Do cached extract_insn, constrain_operands and complain about failures. Used by insn_attrtab.
References constrain_operands(), extract_insn_cached(), fatal_insn_not_found, get_enabled_alternatives(), validate_replace_src_data::insn, reload_completed, and which_alternative.
void extract_insn | ( | rtx_insn * | insn | ) |
Analyze INSN and fill in recog_data.
References asm_noperands(), decode_asm_operands(), fatal_insn_not_found, gcc_assert, GET_CODE, GET_MODE, i, validate_replace_src_data::insn, insn_data, insn_extract(), MAX_RECOG_ALTERNATIVES, NULL, OP_IN, OP_INOUT, OP_OUT, PATTERN(), recog_data, recog_memoized(), SET, SET_SRC, which_alternative, and XVECEXP.
Referenced by can_reload_into(), check_asm_operands(), combine_reaching_defs(), decompose_multiword_subregs(), eliminate_partially_redundant_load(), eliminate_regs_in_insn(), elimination_costs_in_insn(), emit_input_reload_insns(), emit_insn_if_valid_for_reload_1(), extract_constrain_insn(), extract_insn_cached(), fill_slots_from_thread(), find_reloads(), gen_reload_chain_without_interm_reg_p(), inc_for_reload(), insn_invalid_p(), instantiate_virtual_regs_in_insn(), ira(), ira_remove_insn_scratches(), ira_restore_scratches(), ira_setup_alts(), reg_save_code(), reload(), reload_as_needed(), scan_one_insn(), setup_prohibited_mode_move_regs(), union_match_dups(), and valid_insn_p().
void extract_insn_cached | ( | rtx_insn * | insn | ) |
Like extract_insn, but save insn extracted and don't extract again, when called again for the same insn expecting that recog_data still contain the valid information. This is used primary by gen_attr infrastructure that often does extract insn again and again.
References extract_insn(), validate_replace_src_data::insn, INSN_CODE, and recog_data.
Referenced by cleanup_subreg_operands(), and extract_constrain_insn_cached().
Given an rtx *P, if it is a sum containing an integer constant term, return the location (type rtx *) of the pointer to that constant term. Otherwise, return a null pointer.
References CONSTANT_P, find_constant_term_loc(), GET_CODE, and XEXP.
Referenced by find_constant_term_loc(), offsettable_address_addr_space_p(), and plus_constant().
Return true if OP is a valid general operand for machine mode MODE. This is either a register reference, a memory reference, or a constant. In the case of a memory reference, the address is checked for general validity for the target machine. Register and memory references must have mode MODE in order to be valid, but some constants have no machine mode and are valid for any mode. If MODE is VOIDmode, OP is checked for validity for whatever mode it has. The main use of this function is as a predicate in match_operand expressions in the machine description.
References CONST_INT_P, CONSTANT_P, GET_CODE, GET_MODE, GET_MODE_CLASS, in_hard_reg_set_p(), INTVAL, LEGITIMATE_PIC_OPERAND_P, lra_in_progress, LRA_SUBREG_P, MEM_ADDR_SPACE, MEM_P, MEM_VOLATILE_P, memory_address_addr_space_p(), operand_reg_set, paradoxical_subreg_p(), REG_CAN_CHANGE_MODE_P, REG_P, REGNO, reload_completed, SCALAR_FLOAT_MODE_P, SUBREG_BYTE, SUBREG_REG, targetm, trunc_int_for_mode(), volatile_ok, XEXP, and y.
Referenced by asm_operand_ok(), can_assign_to_reg_without_clobbers_p(), combine_simplify_rtx(), constrain_operands(), copy_to_mode_reg(), copy_to_reg(), eliminate_partially_redundant_loads(), force_reg(), hash_scan_set(), indirect_operand(), is_just_move(), keep_with_call_p(), match_asm_constraints_1(), memory_operand(), noce_can_force_operand(), noce_emit_cmove(), noce_emit_store_flag(), noce_try_addcc(), noce_try_cmove_arith(), nonimmediate_operand(), prepare_copy_insn(), register_operand(), and scan_one_insn().
Return the value of ATTR for instruction INSN.
References BA_ENABLED, BA_PREFERRED_FOR_SIZE, BA_PREFERRED_FOR_SPEED, gcc_unreachable, and validate_replace_src_data::insn.
Referenced by get_bool_attr_mask_uncached().
|
static |
Return the mask of operand alternatives that are allowed for INSN by boolean attribute ATTR. This mask depends only on INSN and on the current target; it does not depend on things like the values of operands.
References ALL_ALTERNATIVES, get_bool_attr_mask_uncached(), have_bool_attr(), validate_replace_src_data::insn, INSN_CODE, and this_target_recog.
Referenced by get_enabled_alternatives(), get_preferred_alternatives(), and get_preferred_alternatives().
|
static |
Like get_bool_attr_mask, but don't use the cache.
References ALL_ALTERNATIVES, ALTERNATIVE_BIT, get_bool_attr(), i, validate_replace_src_data::insn, INSN_CODE, insn_data, n_alternatives(), recog_data, and which_alternative.
Referenced by check_bool_attrs(), and get_bool_attr_mask().
alternative_mask get_enabled_alternatives | ( | rtx_insn * | insn | ) |
Return the set of alternatives of INSN that are allowed by the current target.
References BA_ENABLED, get_bool_attr_mask(), and validate_replace_src_data::insn.
Referenced by can_reload_into(), check_asm_operands(), constrain_operands_cached(), emit_input_reload_insns(), emit_insn_if_valid_for_reload_1(), extract_constrain_insn(), extract_constrain_insn_cached(), find_reloads(), gen_reload_chain_without_interm_reg_p(), inc_for_reload(), reg_save_code(), reload(), reload_as_needed(), setup_prohibited_mode_move_regs(), and valid_insn_p().
alternative_mask get_preferred_alternatives | ( | rtx_insn * | insn | ) |
Return the set of alternatives of INSN that are allowed by the current target and are preferred for the current size/speed optimization choice.
References BA_PREFERRED_FOR_SIZE, BA_PREFERRED_FOR_SPEED, BLOCK_FOR_INSN(), get_bool_attr_mask(), validate_replace_src_data::insn, and optimize_bb_for_speed_p().
Referenced by can_use_same_reg_p(), combine_reaching_defs(), eliminate_partially_redundant_load(), fill_slots_from_thread(), insn_invalid_p(), ira_setup_alts(), lra_set_insn_recog_data(), record_reg_classes(), and reload_cse_simplify_operands().
alternative_mask get_preferred_alternatives | ( | rtx_insn * | insn, |
basic_block | bb ) |
Return the set of alternatives of INSN that are allowed by the current target and are preferred for the size/speed optimization choice associated with BB. Passing a separate BB is useful if INSN has not been emitted yet or if we are considering moving it to a different block.
References BA_PREFERRED_FOR_SIZE, BA_PREFERRED_FOR_SPEED, get_bool_attr_mask(), validate_replace_src_data::insn, and optimize_bb_for_speed_p().
void get_referenced_operands | ( | const char * | string, |
bool * | used, | ||
unsigned int | noperands ) |
Parse inline assembly string STRING and determine which operands are referenced by % markers. For the first NOPERANDS operands, set USED[I] to true if operand I is referenced. This is intended to distinguish barrier-like asms such as: asm ("" : "=m" (...)); from real references such as: asm ("sw\t$0, %0" : "=m" (...));
Return true if boolean attribute ATTR is supported.
References BA_ENABLED, BA_PREFERRED_FOR_SIZE, BA_PREFERRED_FOR_SPEED, and gcc_unreachable.
Referenced by get_bool_attr_mask().
True if the dependency between OUT_INSN and IN_INSN is in the IF_THEN_ELSE condition, and not the THEN or ELSE branch. OUT_INSN may be either a single or multiple set; IN_INSN should be single_set for truth, but for convenience of insn categorization may be any JUMP or CALL insn.
References CALL_P, exp(), gcc_assert, GET_CODE, i, JUMP_P, PATTERN(), reg_mentioned_p(), SET, SET_DEST, SET_SRC, single_set(), XEXP, XVECEXP, and XVECLEN.
Return true if OP is a valid immediate operand for mode MODE. The main use of this function is as a predicate in match_operand expressions in the machine description.
References CONST_INT_P, CONSTANT_P, GET_MODE, GET_MODE_CLASS, INTVAL, LEGITIMATE_PIC_OPERAND_P, targetm, and trunc_int_for_mode().
Referenced by nonmemory_operand().
Return true if OP is a valid indirect memory reference with mode MODE; that is, a memory reference whose address is a general_operand.
References general_operand(), GET_CODE, GET_MODE, known_eq, MEM_P, memory_operand(), reload_completed, strip_offset(), SUBREG_BYTE, SUBREG_REG, and XEXP.
void init_recog | ( | void | ) |
References volatile_ok.
Referenced by combine_instructions(), cse_main(), final_1(), find_costs_and_classes(), instantiate_virtual_regs(), and reload().
void init_recog_no_volatile | ( | void | ) |
Initialize data used by the function `recog'. This must be called once in the compilation of a function before any insn recognition may be done in the function.
References volatile_ok.
Referenced by combine_instructions(), expand_function_start(), and rest_of_clean_state().
This subroutine of apply_change_group verifies whether the changes to INSN were valid; i.e. whether INSN can still be recognized. If IN_GROUP is true clobbers which have to be added in order to match the instructions will be added to the current change group. Otherwise the changes will take effect immediately.
References add_clobbers(), added_clobbers_hard_reg_p(), asm_noperands(), check_asm_operands(), check_invalid_inc_dec(), constrain_operands(), extract_insn(), FIND_REG_INC_NOTE, GET_CODE, get_preferred_alternatives(), INSN_CODE, note_stores(), NULL_RTX, PATTERN(), recog(), REG_NOTE_KIND, reload_completed, reload_in_progress, rtvec_alloc(), SET, validate_change(), XEXP, and XVECEXP.
Referenced by equiv_can_be_consumed_p(), prepare_copy_insn(), replace_read(), try_validate_parallel(), and verify_changes().
rtl_opt_pass * make_pass_peephole2 | ( | gcc::context * | ctxt | ) |
rtl_opt_pass * make_pass_split_after_reload | ( | gcc::context * | ctxt | ) |
rtl_opt_pass * make_pass_split_all_insns | ( | gcc::context * | ctxt | ) |
rtl_opt_pass * make_pass_split_before_regstack | ( | gcc::context * | ctxt | ) |
rtl_opt_pass * make_pass_split_before_sched2 | ( | gcc::context * | ctxt | ) |
rtl_opt_pass * make_pass_split_for_shorten_branches | ( | gcc::context * | ctxt | ) |
bool memory_address_addr_space_p | ( | machine_mode | mode, |
rtx | addr, | ||
addr_space_t | as, | ||
code_helper | ch ) |
Return true if ADDR is a valid memory address for mode MODE in address space AS.
References ADDR_SPACE_GENERIC_P, gcc_assert, and targetm.
Referenced by addr_offset_valid_p(), address_cost(), adjust_address_1(), change_address_1(), emit_move_insn(), expand_expr_real_1(), find_split_point(), gen_lowpart_if_possible(), general_operand(), get_address_cost(), get_address_cost_ainc(), inv_can_prop_to_addr_use(), maybe_memory_address_addr_space_p(), memory_address_addr_space(), multiplier_allowed_in_address_p(), offset_address(), offsettable_address_addr_space_p(), try_replace_in_use(), valid_mem_ref_p(), validate_autoinc_and_mem_addr_p(), validize_mem(), and verify_changes().
Return true if OP is a valid memory reference with mode MODE, including a valid address. The main use of this function is as a predicate in match_operand expressions in the machine description.
References general_operand(), GET_CODE, GET_MODE, MEM_P, reload_completed, and SUBREG_REG.
Referenced by asm_operand_ok(), find_reloads_address_1(), indirect_operand(), init_eliminable_invariants(), and setup_reg_equiv().
bool mode_dependent_address_p | ( | rtx | addr, |
addr_space_t | addrspace ) |
Return true if ADDR is an address-expression whose effect depends on the mode of the memory reference it is used in. ADDRSPACE is the address space associated with the address. Autoincrement addressing is a typical example of mode-dependence because the amount of the increment depends on the mode.
References GET_CODE, and targetm.
Referenced by combine_simplify_rtx(), convert_mode_scalar(), find_reloads(), gen_lowpart_for_combine(), make_extraction(), offsettable_address_addr_space_p(), push_reload(), simple_move_operand(), simplify_shift_const_1(), simplify_context::simplify_subreg(), simplify_context::simplify_truncation(), simplify_context::simplify_unary_operation_1(), and simplify_while_replacing().
Return true if OP is a general operand that is not an immediate operand of mode MODE.
References CONSTANT_P, and general_operand().
Return true if OP is a register reference or immediate value of mode MODE.
References CONSTANT_P, immediate_operand(), and register_operand().
int num_changes_pending | ( | void | ) |
Return number of changes made and not validated yet.
References num_changes.
Referenced by try_replace_reg(), and validate_simplify_insn().
int num_validated_changes | ( | void | ) |
Return the number of changes so far in the current group.
References num_changes.
Referenced by insn_propagation::apply_to_mem_1(), insn_propagation::apply_to_pattern(), insn_propagation::apply_to_rvalue(), insn_propagation::apply_to_rvalue_1(), dead_or_predicable(), decompose_multiword_subregs(), insn_change_watermark::insn_change_watermark(), invert_jump_1(), insn_change_watermark::keep(), redirect_jump_1(), resolve_reg_notes(), and insn_change_watermark::~insn_change_watermark().
bool offsettable_address_addr_space_p | ( | int | strictp, |
machine_mode | mode, | ||
rtx | y, | ||
addr_space_t | as ) |
Return true if Y is a memory address which contains no side effects and would remain valid for address space AS after the addition of a positive integer less than the size of that mode. We assume that the original address is valid and do not check it. We do check that it is valid for narrower modes. If STRICTP is nonzero, we require a strictly valid address, for the sake of use in reload.cc.
References bool, CONSTANT_ADDRESS_P, find_constant_term_loc(), GET_CODE, GET_MODE, GET_MODE_ALIGNMENT, GET_MODE_SIZE(), GET_RTX_CLASS, known_eq, known_le, memory_address_addr_space_p(), mode_dependent_address_p(), plus_constant(), RTX_AUTOINC, strict_memory_address_addr_space_p(), targetm, XEXP, and y.
Referenced by offsettable_memref_p(), and offsettable_nonstrict_memref_p().
Return true if OP is a memory reference whose address contains no side effects and remains valid after the addition of a positive integer less than the size of the object being referenced. We assume that the original address is valid and do not check it. This uses strict_memory_address_p as a subroutine, so don't use it before reload.
References GET_MODE, MEM_ADDR_SPACE, MEM_P, offsettable_address_addr_space_p(), and XEXP.
Referenced by find_reloads().
Similar, but don't require a strictly valid mem ref: consider pseudo-regs valid as index or base regs.
References GET_MODE, MEM_ADDR_SPACE, MEM_P, offsettable_address_addr_space_p(), and XEXP.
Referenced by asm_operand_ok(), and find_reloads().
|
static |
While scanning basic block BB, we found a match of length MATCH_LEN + 1, starting at INSN. Perform the replacement, removing the old insns and replacing them with ATTEMPT. Returns the last insn emitted, or NULL if the replacement is rejected.
References active_insn_p(), add_auto_inc_notes(), add_reg_note(), AUTO_INC_DEC, BB_END, CALL_INSN_FUNCTION_USAGE, CALL_P, can_nonlocal_goto(), can_throw_internal(), copy_frame_info_to_split_insn(), copy_reg_eh_region_note_backward(), CROSSING_JUMP_P, delete_insn_chain(), emit_insn_after_setloc(), find_reg_note(), fixup_args_size_notes(), FOR_EACH_EDGE, gcc_assert, get_args_size(), i, peep2_insn_data::insn, INSN_LOCATION(), JUMP_P, last, make_edge(), next_active_insn(), NEXT_INSN(), NONDEBUG_INSN_P, nonlocal_goto_handler_labels, NULL, NULL_RTX, PATTERN(), peep2_buf_position(), peep2_current, peep2_do_cleanup_cfg, peep2_do_rebuild_jump_labels, PREV_INSN(), purge_dead_edges(), REG_NOTE_KIND, REG_NOTES, RTX_FRAME_RELATED_P, SIBLING_CALL_P, split_block(), basic_block_def::succs, and XEXP.
Referenced by peephole2_optimize().
|
static |
Wrap N to fit into the peep2_insn_data buffer.
Referenced by peep2_attempt(), peep2_fill_buffer(), peep2_find_free_register(), peep2_next_insn(), peep2_reg_dead_p(), peep2_regno_dead_p(), peep2_update_life(), and peephole2_optimize().
|
static |
Add INSN, which is in BB, at the end of the peep2 insn buffer if possible. Return true if we added it, false otherwise. The caller will try to match peepholes against the buffer if we return false; otherwise it will try to add more instructions to the buffer.
References COPY_REG_SET, df_simulate_one_insn_forwards(), peep2_insn_data::insn, peep2_insn_data::live_before, peep2_buf_position(), peep2_current, peep2_current_count, and RTX_FRAME_RELATED_P.
Referenced by peephole2_optimize().
rtx peep2_find_free_register | ( | int | from, |
int | to, | ||
const char * | class_str, | ||
machine_mode | mode, | ||
HARD_REG_SET * | reg_set ) |
Try to find a hard register of mode MODE, matching the register class in CLASS_STR, which is available at the beginning of insn CURRENT_INSN and remains available until the end of LAST_INSN. LAST_INSN may be NULL_RTX, in which case the only condition is that the register must be available before CURRENT_INSN. Registers that already have bits set in REG_SET will not be considered. If an appropriate register is available, it will be returned and the corresponding bit(s) in REG_SET will be set; otherwise, NULL_RTX is returned.
References add_to_hard_reg_set(), crtl, DF_REF_REGNO, df_regs_ever_live_p(), fixed_regs, FOR_EACH_INSN_DEF, frame_pointer_needed, gcc_assert, gen_rtx_REG(), global_regs, HARD_FRAME_POINTER_REGNUM, hard_regno_nregs(), i, peep2_insn_data::insn, peep2_insn_data::live_before, NULL_RTX, peep2_buf_position(), peep2_current, reg_alloc_order, reg_class_contents, REG_SET_TO_HARD_REG_SET, reload_completed, search_ofs, SET_HARD_REG_BIT, targetm, and TEST_HARD_REG_BIT.
rtx_insn * peep2_next_insn | ( | int | n | ) |
Return the Nth non-note insn after `current', or return NULL_RTX if it does not exist. Used by the recognizer to find the next insn to match in a multi-insn pattern.
References gcc_assert, peep2_insn_data::insn, peep2_buf_position(), peep2_current, and peep2_current_count.
Similarly for a REG.
References END_REGNO(), gcc_assert, peep2_insn_data::insn, peep2_insn_data::live_before, NULL_RTX, peep2_buf_position(), peep2_current, REGNO, and REGNO_REG_SET_P.
bool peep2_regno_dead_p | ( | int | ofs, |
int | regno ) |
Return true if REGNO is dead before the Nth non-note insn after `current'.
References gcc_assert, peep2_insn_data::insn, peep2_insn_data::live_before, NULL_RTX, peep2_buf_position(), peep2_current, and REGNO_REG_SET_P.
|
static |
Forget all currently tracked instructions, only remember current LIVE regset.
References COPY_REG_SET, i, peep2_insn_data::insn, peep2_insn_data::live_before, NULL, peep2_current, peep2_current_count, and PEEP2_EOB.
Referenced by peephole2_optimize().
|
static |
After performing a replacement in basic block BB, fix up the life information in our buffer. LAST is the last of the insns that we emitted as a replacement. PREV is the insn before the start of the replacement. MATCH_LEN + 1 is the number of instructions that were matched, and which now need to be replaced in the buffer.
References CLEAR_REG_SET, COPY_REG_SET, df_insn_rescan(), df_simulate_one_insn_backwards(), gcc_assert, i, INIT_REG_SET, peep2_insn_data::insn, INSN_P, last, peep2_insn_data::live_before, peep2_buf_position(), peep2_current, peep2_current_count, and PREV_INSN().
Referenced by peephole2_optimize().
|
static |
Perform the peephole2 optimization pass.
References BB_END, BB_HEAD, BITMAP_ALLOC, bitmap_copy(), BITMAP_FREE, cfun, cleanup_cfg(), CLEANUP_CFG_CHANGED, COPY_REG_SET, default_rtl_profile(), df_analyze(), DF_LR_IN, DF_LR_RUN_DCE, df_note_add_problem(), df_set_flags(), df_simulate_initialize_forwards(), FOR_EACH_BB_REVERSE_FN, get_insns(), i, peep2_insn_data::insn, last, peep2_insn_data::live_before, NEXT_INSN(), next_insn(), NONDEBUG_INSN_P, NULL, PATTERN(), peep2_attempt(), peep2_buf_position(), peep2_current, peep2_current_count, peep2_do_cleanup_cfg, peep2_do_rebuild_jump_labels, PEEP2_EOB, peep2_fill_buffer(), peep2_reinit_state(), peep2_update_life(), peephole2_insns(), PREV_INSN(), rebuild_jump_labels(), reg_obstack, rtl_profile_for_bb(), and search_ofs.
Referenced by rest_of_handle_peephole2().
Return true for a register in Pmode; ignore the tested mode.
References register_operand().
Return true if OP is a valid operand that stands for popping a value of mode MODE off the stack. The main use of this function is as a predicate in match_operand expressions in the machine description.
References GET_CODE, GET_MODE, MEM_P, stack_pointer_rtx, STACK_POP_CODE, and XEXP.
void preprocess_constraints | ( | int | n_operands, |
int | n_alternatives, | ||
const char ** | constraints, | ||
operand_alternative * | op_alt_base, | ||
rtx ** | oploc ) |
Fill in OP_ALT_BASE for an instruction that has N_OPERANDS operands, N_ALTERNATIVES alternatives and constraint strings CONSTRAINTS. OP_ALT_BASE has N_ALTERNATIVES * N_OPERANDS entries and CONSTRAINTS has N_OPERANDS entries. OPLOC should be passed in if the insn is an asm statement and preprocessing should take the asm operands into account, e.g. to determine whether they could be addresses in constraints that require addresses; it should then point to an array of pointers to each operand.
References ADDR_SPACE_GENERIC, address_operand(), operand_alternative::anything_ok, base_reg_class(), operand_alternative::cl, operand_alternative::constraint, constraints, operand_alternative::earlyclobber, end(), get_register_filter_id(), i, operand_alternative::is_address, operand_alternative::matched, operand_alternative::matches, operand_alternative::memory_ok, n_alternatives(), n_operands, reg_class_subunion, operand_alternative::register_filters, and operand_alternative::reject.
Referenced by build_def_use(), copyprop_hardreg_forward_1(), ira_setup_alts(), lra_set_insn_recog_data(), preprocess_constraints(), and preprocess_insn_constraints().
void preprocess_constraints | ( | rtx_insn * | insn | ) |
After calling extract_insn, you can use this function to extract some information from the constraint strings into a more usable form. The collected data is stored in recog_op_alt.
References asm_op_alt, INSN_CODE, n_alternatives(), n_operands, NULL, preprocess_constraints(), preprocess_insn_constraints(), recog_data, and recog_op_alt.
const operand_alternative * preprocess_insn_constraints | ( | unsigned int | icode | ) |
Return an array of operand_alternative instructions for instruction ICODE.
References constraints, gcc_checking_assert, i, IN_RANGE, insn_data, MAX, n_alternatives(), n_operands, NULL, preprocess_constraints(), and this_target_recog.
Referenced by lra_set_insn_recog_data(), and preprocess_constraints().
Return true if OP is a valid operand that stands for pushing a value of mode MODE onto the stack. The main use of this function is as a predicate in match_operand expressions in the machine description.
References GET_CODE, GET_MODE, GET_MODE_SIZE(), known_eq, MACRO_INT, MEM_P, poly_int_rtx_p(), STACK_GROWS_DOWNWARD, stack_pointer_rtx, STACK_PUSH_CODE, and XEXP.
Referenced by emit_move_change_mode(), emit_move_complex(), emit_move_insn(), emit_move_multi_word(), find_equiv_reg(), record_dead_and_set_regs_1(), record_last_set_info(), record_last_set_info(), and resolve_simple_move().
void recog_init | ( | ) |
(Re)initialize the target information after a change in target.
References free(), i, and this_target_recog.
Referenced by backend_init_target(), and reinit_regs().
bool reg_fits_class_p | ( | const_rtx | operand, |
reg_class_t | cl, | ||
int | offset, | ||
machine_mode | mode ) |
Return true iff OPERAND (assumed to be a REG rtx) is a hard reg in class CLASS when its regno is offset by OFFSET and changed to mode MODE. If REG occupies multiple hard regs, all of them must be in CLASS.
References HARD_REGISTER_NUM_P, in_hard_reg_set_p(), reg_class_contents, and REGNO.
Referenced by constrain_operands(), find_reloads(), record_reg_classes(), and reload_cse_simplify_operands().
Return true if OP is a register reference of mode MODE. If MODE is VOIDmode, accept a register in any mode. The main use of this function is as a predicate in match_operand expressions in the machine description.
References general_operand(), GET_CODE, MEM_P, REG_P, reload_completed, and SUBREG_REG.
Referenced by asm_operand_ok(), check_cond_move_block(), emit_move_complex(), expand_atomic_fetch_op(), expand_builtin(), expand_vec_perm_const(), find_split_point(), maybe_emit_compare_and_swap_exchange_loop(), noce_try_cmove(), nonmemory_operand(), and pmode_register_operand().
|
static |
References peephole2_optimize().
Return true if OP should match a MATCH_SCRATCH, i.e., if it is a SCRATCH or a hard register.
References GET_CODE, GET_MODE, lra_in_progress, REG_P, and REGNO.
|
static |
Reduce conditional compilation elsewhere.
A subroutine of validate_replace_rtx_1 that tries to simplify the resulting rtx.
References adjust_address_nv, as_a(), COMMUTATIVE_ARITH_P, const0_rtx, CONST_INT_P, CONST_SCALAR_INT_P, CONSTANT_P, gcc_assert, GEN_INT, GET_CODE, GET_MODE, GET_MODE_BITSIZE(), GET_MODE_PRECISION(), GET_MODE_SIZE(), GET_RTX_CLASS, insn_data, INTVAL, is_a(), MEM_ADDR_SPACE, MEM_P, MEM_VOLATILE_P, mode_dependent_address_p(), new_mode(), NULL_RTX, RTX_BIN_ARITH, RTX_COMM_ARITH, RTX_COMM_COMPARE, RTX_COMPARE, RTX_UNARY, simplify_binary_operation(), simplify_gen_binary(), simplify_gen_unary(), simplify_relational_operation(), simplify_subreg(), simplify_unary_operation(), SUBREG_BYTE, SUBREG_REG, swap_commutative_operands_p(), swap_condition(), SWAPPABLE_OPERANDS_P, targetm, validate_change(), validate_unshare_change(), word_mode, and XEXP.
Referenced by validate_replace_rtx_1().
void split_all_insns | ( | void | ) |
Split all insns in the function. If UPD_LIFE, update life info after.
References BB_END, BB_HEAD, bitmap_clear(), bitmap_set_bit, cfun, changed, checking_verify_flow_info(), cleanup_cfg(), default_rtl_profile(), delete_insn_and_edges(), find_many_sub_basic_blocks(), find_reg_note(), FOR_EACH_BB_REVERSE_FN, basic_block_def::index, INSN_P, last_basic_block_for_fn, NEXT_INSN(), NULL_RTX, reload_completed, rtl_profile_for_bb(), set_noop_p(), single_set(), and split_insn().
void split_all_insns_noflow | ( | void | ) |
Same as split_all_insns, but do not expect CFG to be available. Used by machine dependent reorg passes.
References delete_insn_and_edges(), get_insns(), INSN_P, NEXT_INSN(), reload_completed, set_noop_p(), single_set(), and split_insn().
Split single instruction. Helper function for split_all_insns and split_all_insns_noflow. Return last insn in the sequence if successful, or NULL if unsuccessful.
References cleanup_subreg_operands(), CONSTANT_P, copy_rtx(), find_reg_equal_equiv_note(), INSN_P, last, NEXT_INSN(), NULL, PATTERN(), PREV_INSN(), reload_completed, rtx_equal_p(), SET_DEST, SET_INSN_DELETED, SET_SRC, set_unique_reg_note(), single_set(), try_split(), and XEXP.
Referenced by split_all_insns(), and split_all_insns_noflow().
True if the dependency between OUT_INSN and IN_INSN is on the store data not the address operand(s) of the store. IN_INSN and OUT_INSN must be either a single_set or a PARALLEL with SETs inside.
References gcc_assert, GET_CODE, i, PATTERN(), SET, single_set(), store_data_bypass_p_1(), XVECEXP, and XVECLEN.
Common predicates for use with define_bypass.
Helper function for store_data_bypass_p, handle just a single SET IN_SET.
References gcc_assert, GET_CODE, i, MEM_P, PATTERN(), reg_mentioned_p(), SET, SET_DEST, single_set(), XVECEXP, and XVECLEN.
Referenced by store_data_bypass_p().
|
static |
Swap the status of change NUM from being applied to not being applied, or vice versa.
References changes, INSN_CODE, MEM_P, recog_data, and XVECLEN.
Referenced by undo_recog_changes::undo_recog_changes(), and undo_recog_changes::~undo_recog_changes().
Check whether INSN matches a specific alternative of an .md pattern.
References constrain_operands(), extract_insn(), get_enabled_alternatives(), validate_replace_src_data::insn, INSN_CODE, and recog_memoized().
Referenced by default_zero_call_used_regs(), and find_cond_trap().
Wrapper for validate_change_1 without the UNSHARE argument defaulting UNSHARE to false.
References validate_change_1().
Referenced by adjust_insn(), adjust_mem_stores(), adjust_mem_uses(), apply_debug_insn_changes(), insn_propagation::apply_to_rvalue_1(), attempt_change(), can_eliminate_compare(), canon_asm_operands(), canonicalize_insn(), combine_set_extension(), cond_exec_process_insns(), copyprop_hardreg_forward_1(), cse_change_cc_mode(), cse_insn(), cse_process_note_1(), eliminate_regs_in_insn(), eliminate_regs_in_insn(), ext_dce_try_optimize_insn(), find_moveable_pseudos(), fixup_debug_insns(), fold_rtx(), pair_fusion_bb_info::fuse_pair(), insn_invalid_p(), invert_exp_1(), maybe_select_cc_mode(), move2add_use_add2_insn(), move2add_use_add3_insn(), move_invariant_reg(), move_unallocated_pseudos(), pre_insert_copy_insn(), redirect_exp_1(), regrename_do_replace(), reload_combine_recognize_pattern(), reload_cse_move2add(), reload_cse_simplify_operands(), reload_cse_simplify_set(), replace_oldest_value_reg(), replace_read(), replace_uses(), reset_debug_uses_in_loop(), resolve_clobber(), resolve_subreg_use(), simplify_while_replacing(), split_iv(), split_live_ranges_for_shrink_wrap(), transform_ifelse(), try_apply_stack_adjustment(), try_back_substitute_reg(), try_eliminate_compare(), try_replace_in_use(), try_replace_reg(), update_reg_equal_equiv_notes(), validate_canon_reg(), validate_simplify_insn(), and verify_changes().
|
static |
Validate a proposed change to OBJECT. LOC is the location in the rtl at which NEW_RTX will be placed. If NEW_LEN is >= 0, XVECLEN (NEW_RTX, 0) will also be changed to NEW_LEN, which is no greater than the current XVECLEN. If OBJECT is zero, no validation is done, the change is simply made. Two types of objects are supported: If OBJECT is a MEM, memory_address_p will be called with the address and mode as parameters. If OBJECT is an INSN, CALL_INSN, or JUMP_INSN, the insn will be re-recognized with the change in place. IN_GROUP is nonzero if this is part of a group of changes that must be performed as a group. In that case, the changes will be stored. The function `apply_change_group' will validate and apply the changes. If IN_GROUP is zero, this is a single change. Try to recognize the insn or validate the memory reference with the change applied. If the result is not valid for the machine, suppress the change and return false. Otherwise, perform the change and return true.
References apply_change_group(), changes, changes_allocated, gcc_assert, GET_CODE, INSN_CODE, undo_recog_changes::is_active(), MEM_P, num_changes, rtx_equal_p(), XVECEXP, and XVECLEN.
Referenced by validate_change(), validate_change_xveclen(), and validate_unshare_change().
Change XVECLEN (*LOC, 0) to NEW_LEN. OBJECT, IN_GROUP and the return value are as for validate_change_1.
References validate_change_1().
Try replacing every occurrence of FROM in INSN with TO. After all changes have been made, validate by seeing if INSN is still valid.
References apply_change_group(), PATTERN(), and validate_replace_rtx_1().
Referenced by combine_and_move_insns(), decrease_live_ranges_number(), fill_slots_from_thread(), and indirect_jump_optimize().
|
static |
Replace every occurrence of FROM in X with TO. Mark each change with validate_change passing OBJECT.
References ASM_OPERANDS_INPUT_VEC, gcc_assert, GET_CODE, GET_MODE, GET_RTX_FORMAT, GET_RTX_LENGTH, i, num_changes, REG_P, REGNO, rtx_equal_p(), SET, SET_DEST, SET_SRC, simplify_while_replacing(), validate_replace_rtx_1(), validate_unshare_change(), XEXP, XVECEXP, and XVECLEN.
Referenced by validate_replace_rtx(), validate_replace_rtx_1(), validate_replace_rtx_group(), validate_replace_rtx_part(), validate_replace_rtx_part_nosimplify(), validate_replace_rtx_subexp(), and validate_replace_src_1().
Try replacing every occurrence of FROM in INSN with TO. This also will replace in REG_EQUAL and REG_EQUIV notes.
References PATTERN(), REG_NOTE_KIND, REG_NOTES, validate_replace_rtx_1(), and XEXP.
Referenced by expand_var_during_unrolling(), and reload_as_needed().
Try replacing every occurrence of FROM in WHERE with TO. Assume that WHERE is a part of INSN. After all changes have been made, validate by seeing if INSN is still valid. validate_replace_rtx (from, to, insn) is equivalent to validate_replace_rtx_part (from, to, &PATTERN (insn), insn).
References apply_change_group(), and validate_replace_rtx_1().
Same as above, but do not simplify rtx afterwards.
References apply_change_group(), and validate_replace_rtx_1().
Try replacing every occurrence of FROM in subexpression LOC of INSN with TO. After all changes have been made, validate by seeing if INSN is still valid.
References apply_change_group(), and validate_replace_rtx_1().
|
static |
References validate_replace_src_data::from, validate_replace_src_data::insn, validate_replace_src_data::to, and validate_replace_rtx_1().
Referenced by validate_replace_src_group().
Try replacing every occurrence of FROM in INSN with TO, avoiding SET_DESTs.
References validate_replace_src_data::from, validate_replace_src_data::insn, note_uses(), PATTERN(), validate_replace_src_data::to, and validate_replace_src_1().
Referenced by equiv_can_be_consumed_p(), and try_replace_reg().
Try simplify INSN. Invoke simplify_rtx () on every SET_SRC and SET_DEST inside the INSN's pattern and return true if something was simplified.
References apply_change_group(), GET_CODE, i, validate_replace_src_data::insn, NULL, num_changes_pending(), PATTERN(), rtx_equal_p(), SET, SET_DEST, SET_SRC, simplify_rtx(), validate_change(), XVECEXP, and XVECLEN.
Wrapper for validate_change_1 without the UNSHARE argument defaulting UNSHARE to true.
References validate_change_1().
Referenced by insn_propagation::apply_to_rvalue_1(), canonicalize_change_group(), copyprop_hardreg_forward_1(), cprop_jump(), cse_insn(), decompose_multiword_subregs(), fold_rtx(), pair_fusion_bb_info::fuse_pair(), inv_can_prop_to_addr_use(), reload_combine_recognize_pattern(), reload_cse_simplify_set(), simplify_while_replacing(), pair_fusion::try_promote_writeback(), and validate_replace_rtx_1().
bool verify_changes | ( | int | num | ) |
Tentatively apply the changes numbered NUM and up. Return true if all changes are valid, false otherwise.
References as_a(), asm_noperands(), changes, DEBUG_INSN_P, GET_CODE, GET_MODE, i, insn_invalid_p(), MEM_ADDR_SPACE, MEM_P, memory_address_addr_space_p(), NULL_RTX, num_changes, PATTERN(), REG_P, register_asm_p(), rtvec_alloc(), validate_change(), XEXP, XVECEXP, and XVECLEN.
Referenced by apply_change_group(), dead_or_predicable(), equiv_can_be_consumed_p(), inv_can_prop_to_addr_use(), and reload_as_needed().
|
static |
Used to provide recog_op_alt for asms.
Referenced by preprocess_constraints().
|
static |
Referenced by insn_propagation::apply_to_rvalue_1(), cancel_changes(), compute_branch_probabilities(), confirm_change_group(), pair_fusion_bb_info::fuse_pair(), optimize_range_tests_1(), solve_flow_graph(), swap_change(), pair_fusion::try_promote_writeback(), validate_change_1(), and verify_changes().
|
static |
Referenced by validate_change_1().
struct target_recog default_target_recog |
int epilogue_completed |
Nonzero after thread_prologue_and_epilogue_insns has run.
Referenced by cond_exec_find_if_block(), dead_or_predicable(), df_get_entry_block_def_set(), df_get_exit_block_use_set(), get_initial_register_offset(), redirect_jump(), rest_of_clean_state(), skip_pass(), and thread_prologue_and_epilogue_insns().
|
static |
|
static |
int peep2_current_count |
The number of instructions available to match a peep2.
Referenced by peep2_fill_buffer(), peep2_next_insn(), peep2_reinit_state(), peep2_update_life(), and peephole2_optimize().
|
static |
Referenced by peep2_attempt(), and peephole2_optimize().
|
static |
Referenced by peep2_attempt(), and peephole2_optimize().
|
static |
bool raw_constraint_p |
True for inline asm operands with - constraint modifier.
Referenced by asm_operand_ok(), and constrain_operands().
struct recog_data_d recog_data |
Referenced by add_insn_allocno_copies(), assemble_asm(), build_def_use(), can_reload_into(), can_use_same_reg_p(), check_and_make_def_conflict(), check_and_make_def_use_conflict(), cleanup_subreg_operands(), constrain_operands(), copyprop_hardreg_forward_1(), decompose_multiword_subregs(), eliminate_regs_in_insn(), elimination_costs_in_insn(), extract_insn(), extract_insn_cached(), final_scan_insn_1(), find_reloads(), find_reloads_subreg_address(), find_reloads_toplev(), get_bool_attr_mask_uncached(), get_insn_template(), get_static_insn_data(), hide_operands(), instantiate_virtual_regs_in_insn(), ira(), ira_get_dup_out_num(), ira_implicitly_set_insn_hard_regs(), ira_register_new_scratch_op(), ira_remove_insn_scratches(), ira_restore_scratches(), ira_setup_alts(), lra_set_insn_recog_data(), lra_update_insn_recog_data(), make_early_clobber_and_input_conflicts(), maybe_fix_stack_asms(), preprocess_constraints(), process_reg_shuffles(), process_register_constraint_filters(), process_single_reg_class_operands(), recog_data_saver::recog_data_saver(), record_operand_costs(), record_out_operands(), record_reg_classes(), reload_cse_simplify_operands(), restore_operands(), scan_one_insn(), scan_rtx_reg(), simple_move(), single_reg_class(), single_reg_operand_class(), swap_change(), union_match_dups(), which_op_alt(), and recog_data_saver::~recog_data_saver().
const operand_alternative* recog_op_alt |
Contains a vector of operand_alternative structures, such that operand OP of alternative A is at index A * n_operands + OP. Set up by preprocess_constraints.
Referenced by can_use_same_reg_p(), check_and_make_def_conflict(), ira_get_dup_out_num(), ira_setup_alts(), make_early_clobber_and_input_conflicts(), preprocess_constraints(), process_register_constraint_filters(), and which_op_alt().
int reload_completed |
Nonzero after end of reload pass. Set to 1 or 0 by toplev.cc. Controls the significance of (SUBREG (MEM)).
Referenced by active_insn_p(), asm_operand_ok(), assemble_asm(), can_combine_def_p(), can_move_insns_across(), can_replace_by(), cfg_layout_can_merge_blocks_p(), cfg_layout_finalize(), change_address_1(), check_asm_operands(), check_rtl(), cleanup_cfg(), compute_use_by_pseudos(), cond_exec_find_if_block(), cond_exec_process_insns(), cselib_invalidate_regno(), cselib_process_insn(), deletable_insn_p(), delete_trivially_dead_insns(), df_exit_block_uses_collect(), df_get_eh_block_artificial_uses(), df_get_entry_block_def_set(), df_get_exit_block_use_set(), df_get_regular_block_artificial_uses(), df_insn_delete(), df_lr_local_compute(), dump_reg_info(), emit_move_complex_parts(), emit_move_multi_word(), equal_different_set_p(), extract_constrain_insn(), extract_constrain_insn_cached(), find_cond_trap(), find_if_header(), fixup_fallthru_exit_predecessor(), flow_find_cross_jump(), gen_lowpart_general(), gen_rtx_REG(), general_operand(), pair_fusion::get_viable_bases(), hash_rtx(), indirect_operand(), init_alias_analysis(), insn_invalid_p(), insns_have_identical_cfa_notes(), lra(), memory_operand(), noce_emit_cmove(), noce_find_if_block(), old_insns_match_p(), operand_subword(), peep2_find_free_register(), prepare_operand(), pair_fusion::process_block(), record_store(), register_operand(), reload(), rest_of_clean_state(), rtl_can_merge_blocks(), rtl_for_decl_location(), scan_insn(), simplify_operand_subreg(), simplify_subreg_regno(), skip_pass(), split_all_insns(), split_all_insns_noflow(), split_insn(), thread_jump(), pair_fusion_bb_info::track_access(), try_crossjump_to_edge(), try_optimize_cfg(), try_redirect_by_replacing_jump(), try_split(), and verify_rtx_sharing().
|
static |
Regno offset to be used in the register search.
Referenced by peep2_find_free_register(), and peephole2_optimize().
int volatile_ok |
Nonzero means allow operands to be volatile. This should be 0 if you are generating rtl, such as if you are calling the functions in optabs.cc and expmed.cc (most of the time). This should be 1 if all valid insns need to be recognized, such as in reginfo.cc and final.cc and reload.cc. init_recog and init_recog_no_volatile are responsible for setting this.
Referenced by general_operand(), init_recog(), init_recog_no_volatile(), temporary_volatile_ok::temporary_volatile_ok(), and temporary_volatile_ok::~temporary_volatile_ok().
int which_alternative |
On return from `constrain_operands', indicate which alternative was satisfied.
Referenced by assemble_asm(), check_asm_operands(), constrain_operands(), constrain_operands_cached(), extract_constrain_insn_cached(), extract_insn(), get_bool_attr_mask_uncached(), get_insn_template(), output_asm_name(), reload_cse_simplify_operands(), validate_insn_alternatives(), and which_op_alt().