GCC Middle and Back End API Reference
recog.h File Reference
#include "tree.h"
#include "insn-codes.h"
Include dependency graph for recog.h:

Go to the source code of this file.

Data Structures

struct  operand_alternative
 
class  insn_propagation
 
class  temporary_volatile_ok
 
struct  recog_data_d
 
class  recog_data_saver
 
struct  insn_gen_fn
 
struct  insn_operand_data
 
struct  insn_data_d
 
struct  target_recog
 
class  insn_change_watermark
 

Macros

#define MAX_RECOG_ALTERNATIVES   35
 
#define ALL_ALTERNATIVES   ((alternative_mask) -1)
 
#define ALTERNATIVE_BIT(X)   ((alternative_mask) 1 << (X))
 
#define memory_address_p(mode, addr)    memory_address_addr_space_p ((mode), (addr), ADDR_SPACE_GENERIC)
 
#define strict_memory_address_p(mode, addr)    strict_memory_address_addr_space_p ((mode), (addr), ADDR_SPACE_GENERIC)
 
#define offsettable_address_p(strict, mode, addr)
 
#define INSN_OUTPUT_FORMAT_NONE   0 /* abort @endverbatim */
 
#define INSN_OUTPUT_FORMAT_SINGLE   1 /* const char * @endverbatim */
 
#define INSN_OUTPUT_FORMAT_MULTI   2 /* const char * const * @endverbatim */
 
#define INSN_OUTPUT_FORMAT_FUNCTION   3 /* const char * (*)(...) @endverbatim */
 
#define this_target_recog   (&default_target_recog)
 

Typedefs

typedef uint64_t alternative_mask
 
typedef bool(* insn_operand_predicate_fn) (rtx, machine_mode)
 
typedef const char *(* insn_output_fn) (rtx *, rtx_insn *)
 

Enumerations

enum  op_type { OP_IN , OP_OUT , OP_INOUT }
 
enum  bool_attr { BA_ENABLED , BA_PREFERRED_FOR_SPEED , BA_PREFERRED_FOR_SIZE , BA_LAST = BA_PREFERRED_FOR_SIZE }
 

Functions

enum reg_class alternative_class (const operand_alternative *alt, int i)
 
unsigned int alternative_register_filters (const operand_alternative *alt, int i)
 
void init_recog (void)
 
void init_recog_no_volatile (void)
 
bool check_asm_operands (rtx)
 
int asm_operand_ok (rtx, const char *, const char **)
 
bool validate_change (rtx, rtx *, rtx, bool)
 
bool validate_unshare_change (rtx, rtx *, rtx, bool)
 
bool validate_change_xveclen (rtx, rtx *, int, bool)
 
bool canonicalize_change_group (rtx_insn *insn, rtx x)
 
bool insn_invalid_p (rtx_insn *, bool)
 
bool verify_changes (int)
 
void confirm_change_group (void)
 
bool apply_change_group (void)
 
int num_validated_changes (void)
 
void cancel_changes (int)
 
void temporarily_undo_changes (int)
 
void redo_changes (int)
 
bool constrain_operands (int, alternative_mask)
 
bool constrain_operands_cached (rtx_insn *, int)
 
bool memory_address_addr_space_p (machine_mode, rtx, addr_space_t, code_helper=ERROR_MARK)
 
bool strict_memory_address_addr_space_p (machine_mode, rtx, addr_space_t, code_helper=ERROR_MARK)
 
bool validate_replace_rtx_subexp (rtx, rtx, rtx_insn *, rtx *)
 
bool validate_replace_rtx (rtx, rtx, rtx_insn *)
 
bool validate_replace_rtx_part (rtx, rtx, rtx *, rtx_insn *)
 
bool validate_replace_rtx_part_nosimplify (rtx, rtx, rtx *, rtx_insn *)
 
void validate_replace_rtx_group (rtx, rtx, rtx_insn *)
 
void validate_replace_src_group (rtx, rtx, rtx_insn *)
 
bool validate_simplify_insn (rtx_insn *insn)
 
int num_changes_pending (void)
 
bool reg_fits_class_p (const_rtx, reg_class_t, int, machine_mode)
 
bool valid_insn_p (rtx_insn *)
 
bool offsettable_memref_p (rtx)
 
bool offsettable_nonstrict_memref_p (rtx)
 
bool offsettable_address_addr_space_p (int, machine_mode, rtx, addr_space_t)
 
bool mode_dependent_address_p (rtx, addr_space_t)
 
int recog (rtx, rtx_insn *, int *)
 
int recog_memoized (rtx_insn *insn)
 
void add_clobbers (rtx, int)
 
bool added_clobbers_hard_reg_p (int)
 
void insn_extract (rtx_insn *)
 
void extract_insn (rtx_insn *)
 
void extract_constrain_insn (rtx_insn *insn)
 
void extract_constrain_insn_cached (rtx_insn *)
 
void extract_insn_cached (rtx_insn *)
 
void preprocess_constraints (int, int, const char **, operand_alternative *, rtx **)
 
const operand_alternativepreprocess_insn_constraints (unsigned int)
 
void preprocess_constraints (rtx_insn *)
 
rtx_insnpeep2_next_insn (int)
 
bool peep2_regno_dead_p (int, int)
 
bool peep2_reg_dead_p (int, rtx)
 
rtx_insnpeephole2_insns (rtx, rtx_insn *, int *)
 
bool store_data_bypass_p (rtx_insn *, rtx_insn *)
 
bool if_test_bypass_p (rtx_insn *, rtx_insn *)
 
void copy_frame_info_to_split_insn (rtx_insn *, rtx_insn *)
 
const charskip_alternative (const char *p)
 
const operand_alternativewhich_op_alt ()
 
alternative_mask get_enabled_alternatives (rtx_insn *)
 
alternative_mask get_preferred_alternatives (rtx_insn *)
 
alternative_mask get_preferred_alternatives (rtx_insn *, basic_block)
 
bool check_bool_attrs (rtx_insn *)
 
void recog_init ()
 

Variables

int volatile_ok
 
int which_alternative
 
struct recog_data_d recog_data
 
const operand_alternativerecog_op_alt
 
const struct insn_data_d insn_data []
 
int peep2_current_count
 
struct target_recog default_target_recog
 

Macro Definition Documentation

◆ ALL_ALTERNATIVES

◆ ALTERNATIVE_BIT

#define ALTERNATIVE_BIT ( X)    ((alternative_mask) 1 << (X))
A mask containing just alternative X.   

Referenced by ira_get_dup_out_num(), ira_setup_alts(), and process_alt_operands().

◆ INSN_OUTPUT_FORMAT_FUNCTION

#define INSN_OUTPUT_FORMAT_FUNCTION   3 /* const char * (*)(...) @endverbatim */

◆ INSN_OUTPUT_FORMAT_MULTI

#define INSN_OUTPUT_FORMAT_MULTI   2 /* const char * const * @endverbatim */

◆ INSN_OUTPUT_FORMAT_NONE

#define INSN_OUTPUT_FORMAT_NONE   0 /* abort @endverbatim */
Legal values for insn_data.output_format.  Indicate what type of data
is stored in insn_data.output.   

◆ INSN_OUTPUT_FORMAT_SINGLE

#define INSN_OUTPUT_FORMAT_SINGLE   1 /* const char * @endverbatim */

◆ MAX_RECOG_ALTERNATIVES

#define MAX_RECOG_ALTERNATIVES   35
Declarations for interface to insn recognizer and insn-output.cc.
   Copyright (C) 1987-2024 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/>.   
For enum tree_code ERROR_MARK.   
Random number that should be large enough for all purposes.  Also define
a type that has at least MAX_RECOG_ALTERNATIVES + 1 bits, with the extra
bit giving an invalid value that can be used to mean "uninitialized".   

Referenced by check_operand_nalternatives(), and extract_insn().

◆ memory_address_p

◆ offsettable_address_p

#define offsettable_address_p ( strict,
mode,
addr )
Value:
#define ADDR_SPACE_GENERIC
Definition coretypes.h:177
T * ggc_alloc(ALONE_CXX_MEM_STAT_INFO)
Definition ggc.h:184
bool offsettable_address_addr_space_p(int, machine_mode, rtx, addr_space_t)
Definition recog.cc:2446

◆ strict_memory_address_p

#define strict_memory_address_p ( mode,
addr )    strict_memory_address_addr_space_p ((mode), (addr), ADDR_SPACE_GENERIC)

◆ this_target_recog

Typedef Documentation

◆ alternative_mask

◆ insn_operand_predicate_fn

typedef bool(* insn_operand_predicate_fn) (rtx, machine_mode)
A table defined in insn-output.cc that give information about
each insn-code value.   

◆ insn_output_fn

typedef const char *(* insn_output_fn) (rtx *, rtx_insn *)

Enumeration Type Documentation

◆ bool_attr

An enum of boolean attributes that may only depend on the current
subtarget, not on things like operands or compiler phase.   
Enumerator
BA_ENABLED 
BA_PREFERRED_FOR_SPEED 
BA_PREFERRED_FOR_SIZE 
BA_LAST 

◆ op_type

Types of operands.   
Enumerator
OP_IN 
OP_OUT 
OP_INOUT 

Function Documentation

◆ add_clobbers()

void add_clobbers ( rtx ,
int  )
extern

◆ added_clobbers_hard_reg_p()

bool added_clobbers_hard_reg_p ( int )
extern

◆ alternative_class()

enum reg_class alternative_class ( const operand_alternative * alt,
int i )
inline
Return the class for operand I of alternative ALT, taking matching
constraints into account.   

References ggc_alloc(), and i.

Referenced by build_def_use(), check_and_make_def_conflict(), copyprop_hardreg_forward_1(), process_register_constraint_filters(), and record_out_operands().

◆ alternative_register_filters()

unsigned int alternative_register_filters ( const operand_alternative * alt,
int i )
inline
Return the mask of register filters that should be applied to operand I
of alternative ALT, taking matching constraints into account.   

References ggc_alloc(), i, and register_filters.

Referenced by process_register_constraint_filters().

◆ apply_change_group()

◆ asm_operand_ok()

int asm_operand_ok ( rtx op,
const char * constraint,
const char ** constraints )
extern

◆ cancel_changes()

◆ canonicalize_change_group()

bool canonicalize_change_group ( rtx_insn * insn,
rtx x )
extern
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, ggc_alloc(), swap_commutative_operands_p(), validate_unshare_change(), and XEXP.

Referenced by fold_rtx().

◆ check_asm_operands()

◆ check_bool_attrs()

bool check_bool_attrs ( rtx_insn * insn)
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().

◆ confirm_change_group()

void confirm_change_group ( void )
extern
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 changes, copy_rtx(), df_insn_rescan(), gcc_assert, ggc_alloc(), i, INSN_P, change_t::loc, NULL, num_changes, change_t::object, and temporarily_undone_changes.

Referenced by apply_change_group(), dead_or_predicable(), redirect_jump_2(), reload_as_needed(), try_fwprop_subst_notes(), and try_fwprop_subst_pattern().

◆ constrain_operands()

◆ constrain_operands_cached()

bool constrain_operands_cached ( rtx_insn * insn,
int strict )
extern
Do cached constrain_operands on INSN and complain about failures.   

References constrain_operands(), get_enabled_alternatives(), ggc_alloc(), validate_replace_src_data::insn, and which_alternative.

Referenced by final_scan_insn_1().

◆ copy_frame_info_to_split_insn()

void copy_frame_info_to_split_insn ( rtx_insn * old_insn,
rtx_insn * new_insn )
extern
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, ggc_alloc(), 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().

◆ extract_constrain_insn()

void extract_constrain_insn ( rtx_insn * insn)
extern
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().

◆ extract_constrain_insn_cached()

void extract_constrain_insn_cached ( rtx_insn * insn)
extern
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.

◆ extract_insn()

void extract_insn ( rtx_insn * insn)
extern
Analyze INSN and fill in recog_data.   

References asm_noperands(), insn_operand_data::constraint, recog_data_d::constraints, decode_asm_operands(), fatal_insn_not_found, gcc_assert, GET_CODE, GET_MODE, ggc_alloc(), i, validate_replace_src_data::insn, recog_data_d::insn, insn_data, insn_extract(), recog_data_d::is_asm, recog_data_d::is_operator, insn_operand_data::is_operator, MAX_RECOG_ALTERNATIVES, insn_operand_data::mode, recog_data_d::n_alternatives, insn_data_d::n_alternatives, recog_data_d::n_dups, insn_data_d::n_dups, recog_data_d::n_operands, insn_data_d::n_operands, NULL, OP_IN, OP_INOUT, OP_OUT, recog_data_d::operand, insn_data_d::operand, recog_data_d::operand_loc, recog_data_d::operand_mode, recog_data_d::operand_type, 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().

◆ extract_insn_cached()

void extract_insn_cached ( rtx_insn * insn)
extern
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, recog_data_d::insn, INSN_CODE, and recog_data.

Referenced by cleanup_subreg_operands(), and extract_constrain_insn_cached().

◆ get_enabled_alternatives()

◆ get_preferred_alternatives() [1/2]

alternative_mask get_preferred_alternatives ( rtx_insn * insn)

◆ get_preferred_alternatives() [2/2]

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().

◆ if_test_bypass_p()

bool if_test_bypass_p ( rtx_insn * out_insn,
rtx_insn * in_insn )
extern
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, ggc_alloc(), i, JUMP_P, PATTERN(), reg_mentioned_p(), SET, SET_DEST, SET_SRC, single_set(), XEXP, XVECEXP, and XVECLEN.

◆ init_recog()

◆ init_recog_no_volatile()

void init_recog_no_volatile ( void )
extern
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().

◆ insn_extract()

void insn_extract ( rtx_insn * )
extern

◆ insn_invalid_p()

bool insn_invalid_p ( rtx_insn * insn,
bool in_group )
extern
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(), ggc_alloc(), 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 prepare_copy_insn(), replace_read(), try_validate_parallel(), and verify_changes().

◆ memory_address_addr_space_p()

◆ mode_dependent_address_p()

bool mode_dependent_address_p ( rtx addr,
addr_space_t addrspace )
extern
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, ggc_alloc(), 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().

◆ num_changes_pending()

int num_changes_pending ( void )
extern
Return number of changes made and not validated yet.   

References num_changes.

Referenced by try_replace_reg(), and validate_simplify_insn().

◆ num_validated_changes()

◆ offsettable_address_addr_space_p()

bool offsettable_address_addr_space_p ( int strictp,
machine_mode mode,
rtx y,
addr_space_t as )
extern
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, ggc_alloc(), 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().

◆ offsettable_memref_p()

bool offsettable_memref_p ( rtx op)
extern
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().

◆ offsettable_nonstrict_memref_p()

bool offsettable_nonstrict_memref_p ( rtx op)
extern
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().

◆ peep2_next_insn()

rtx_insn * peep2_next_insn ( int n)
extern
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.

◆ peep2_reg_dead_p()

bool peep2_reg_dead_p ( int ofs,
rtx reg )
extern

◆ peep2_regno_dead_p()

bool peep2_regno_dead_p ( int ofs,
int regno )
extern
Return true if REGNO is dead before the Nth non-note insn
after `current'.   

References gcc_assert, ggc_alloc(), peep2_insn_data::insn, peep2_insn_data::live_before, NULL_RTX, peep2_buf_position(), peep2_current, and REGNO_REG_SET_P.

◆ peephole2_insns()

rtx_insn * peephole2_insns ( rtx ,
rtx_insn * ,
int *  )
extern

Referenced by peephole2_optimize().

◆ preprocess_constraints() [1/2]

void preprocess_constraints ( int n_operands,
int n_alternatives,
const char ** constraints,
operand_alternative * op_alt_base,
rtx ** oploc )
extern
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(), base_reg_class(), operand_alternative::cl, constraints, end(), get_register_filter_id(), ggc_alloc(), i, n_alternatives(), n_operands, and reg_class_subunion.

Referenced by build_def_use(), copyprop_hardreg_forward_1(), ira_setup_alts(), lra_set_insn_recog_data(), preprocess_constraints(), and preprocess_insn_constraints().

◆ preprocess_constraints() [2/2]

void preprocess_constraints ( rtx_insn * insn)
extern
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, recog_data_d::constraints, ggc_alloc(), INSN_CODE, n_alternatives(), recog_data_d::n_alternatives, n_operands, recog_data_d::n_operands, NULL, preprocess_constraints(), preprocess_insn_constraints(), recog_data, and recog_op_alt.

◆ preprocess_insn_constraints()

const operand_alternative * preprocess_insn_constraints ( unsigned int icode)
extern
Return an array of operand_alternative instructions for
instruction ICODE.   

References constraints, gcc_checking_assert, ggc_alloc(), i, IN_RANGE, insn_data, MAX, n_alternatives(), n_operands, insn_data_d::n_operands, NULL, preprocess_constraints(), and this_target_recog.

Referenced by lra_set_insn_recog_data(), and preprocess_constraints().

◆ recog()

◆ recog_init()

void recog_init ( )
(Re)initialize the target information after a change in target.   

References free(), ggc_alloc(), i, and this_target_recog.

Referenced by backend_init_target(), and reinit_regs().

◆ recog_memoized()

◆ redo_changes()

void redo_changes ( int num)
extern
Redo the changes that were temporarily undone by:

  temporarily_undo_changes (NUM).   

References gcc_assert, i, num_changes, swap_change(), and temporarily_undone_changes.

Referenced by should_replace_address(), try_fwprop_subst_note(), and try_fwprop_subst_pattern().

◆ reg_fits_class_p()

bool reg_fits_class_p ( const_rtx operand,
reg_class_t cl,
int offset,
machine_mode mode )
extern
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 ggc_alloc(), HARD_REGISTER_NUM_P, in_hard_reg_set_p(), offset, reg_class_contents, and REGNO.

Referenced by constrain_operands(), find_reloads(), record_reg_classes(), and reload_cse_simplify_operands().

◆ skip_alternative()

const char * skip_alternative ( const char * p)
inline
Skip chars until the next ',' or the end of the string.  This is
useful to skip alternatives in a constraint string.   

References r.

Referenced by constrain_operands(), find_reloads(), and record_reg_classes().

◆ store_data_bypass_p()

bool store_data_bypass_p ( rtx_insn * out_insn,
rtx_insn * in_insn )
extern
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, ggc_alloc(), i, PATTERN(), SET, single_set(), store_data_bypass_p_1(), XVECEXP, and XVECLEN.

◆ strict_memory_address_addr_space_p()

bool strict_memory_address_addr_space_p ( machine_mode mode,
rtx addr,
addr_space_t as,
code_helper  )
extern
Return true if ADDR is a valid memory address for mode MODE
in address space AS, and check that each pseudo reg has the
proper kind of hard reg.   

References ADDR_SPACE_GENERIC_P, gcc_assert, ggc_alloc(), replacement::mode, and targetm.

Referenced by find_reloads_address(), find_reloads_subreg_address(), get_secondary_mem(), offsettable_address_addr_space_p(), operand_subword(), and reload().

◆ temporarily_undo_changes()

void temporarily_undo_changes ( int num)
extern
Temporarily undo all the changes numbered NUM and up, with a view
to reapplying them later.  The next call to the changes machinery
must be:

   redo_changes (NUM)

otherwise things will end up in an invalid state.   

References gcc_assert, i, num_changes, swap_change(), and temporarily_undone_changes.

Referenced by should_replace_address(), try_fwprop_subst_note(), and try_fwprop_subst_pattern().

◆ valid_insn_p()

bool valid_insn_p ( rtx_insn * insn)
extern
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().

◆ validate_change()

◆ validate_change_xveclen()

bool validate_change_xveclen ( rtx object,
rtx * loc,
int new_len,
bool in_group )
extern
Change XVECLEN (*LOC, 0) to NEW_LEN.  OBJECT, IN_GROUP and the return
value are as for validate_change_1.   

References ggc_alloc(), and validate_change_1().

◆ validate_replace_rtx()

bool validate_replace_rtx ( rtx from,
rtx to,
rtx_insn * insn )
extern
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().

◆ validate_replace_rtx_group()

void validate_replace_rtx_group ( rtx from,
rtx to,
rtx_insn * insn )
extern
Try replacing every occurrence of FROM in INSN with TO.  This also
will replace in REG_EQUAL and REG_EQUIV notes.   

References ggc_alloc(), PATTERN(), REG_NOTE_KIND, REG_NOTES, validate_replace_rtx_1(), and XEXP.

Referenced by expand_var_during_unrolling(), and reload_as_needed().

◆ validate_replace_rtx_part()

bool validate_replace_rtx_part ( rtx from,
rtx to,
rtx * where,
rtx_insn * insn )
extern
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().

◆ validate_replace_rtx_part_nosimplify()

bool validate_replace_rtx_part_nosimplify ( rtx from,
rtx to,
rtx * where,
rtx_insn * insn )
extern
Same as above, but do not simplify rtx afterwards.   

References apply_change_group(), and validate_replace_rtx_1().

◆ validate_replace_rtx_subexp()

bool validate_replace_rtx_subexp ( rtx from,
rtx to,
rtx_insn * insn,
rtx * loc )
extern
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().

◆ validate_replace_src_group()

void validate_replace_src_group ( rtx from,
rtx to,
rtx_insn * insn )
extern
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().

◆ validate_simplify_insn()

bool validate_simplify_insn ( rtx_insn * insn)
extern
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, ggc_alloc(), 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.

◆ validate_unshare_change()

◆ verify_changes()

◆ which_op_alt()

const operand_alternative * which_op_alt ( )
inline
Return a pointer to an array in which index OP describes the constraints
on operand OP of the current instruction alternative (which_alternative).
Only valid after calling preprocess_constraints and constrain_operands.   

References gcc_checking_assert, IN_RANGE, recog_data_d::n_alternatives, recog_data_d::n_operands, recog_data, recog_op_alt, and which_alternative.

Referenced by build_def_use(), copyprop_hardreg_forward_1(), hide_operands(), and record_out_operands().

Variable Documentation

◆ default_target_recog

struct target_recog default_target_recog
extern

◆ insn_data

◆ peep2_current_count

int peep2_current_count
extern
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().

◆ recog_data

◆ recog_op_alt

const operand_alternative* recog_op_alt
extern
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().

◆ volatile_ok

int volatile_ok
extern
Nonzero means volatile operands are recognized.   
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().

◆ which_alternative

int which_alternative
extern
Set by constrain_operands to the number of the alternative that
matched.   
On return from `constrain_operands', indicate which alternative
was satisfied.   

Referenced by 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().