GCC Middle and Back End API Reference
genrecog.cc File Reference
#include "bconfig.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "rtl.h"
#include "errors.h"
#include "read-md.h"
#include "gensupport.h"
#include "rtl.def"
Include dependency graph for genrecog.cc:

Data Structures

struct  position
 
class  list_head< T >
 
class  list_head< T >::range
 
struct  acceptance_type
 
class  parameter
 
class  pattern_routine
 
class  pattern_use
 
class  rtx_test
 
class  int_set
 
class  transition
 
class  decision
 
class  state
 
class  known_conditions
 
class  stats
 
class  merge_pattern_transition
 
class  merge_pattern_info
 
class  merge_state_result
 
class  merge_state_info
 
struct  test_pattern_hasher
 
struct  create_pattern_info
 
struct  state_size
 
class  pattern_pos
 
class  output_state
 

Macros

#define INCLUDE_ALGORITHM
 
#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS)   TRUE_##ENUM,
 
#define NUM_TRUE_RTX_CODE   ((int) FIRST_GENERATOR_RTX_CODE)
 
#define GENERATOR_FILE   1
 

Typedefs

typedef std::pair< transition *, state_sizesubroutine_candidate
 

Enumerations

enum  true_rtx_doe { FIRST_GENERATOR_RTX_CODE }
 
enum  position_type { POS_PEEP2_INSN , POS_XEXP , POS_XVECEXP0 }
 
enum  routine_type { SUBPATTERN , RECOG , SPLIT , PEEPHOLE2 }
 
enum  exit_state { ES_RETURNED , ES_FALLTHROUGH }
 

Functions

static struct positionnext_position (struct position **next_ptr, struct position *base, enum position_type type, int arg)
 
static int compare_positions (struct position *pos1, struct position *pos2)
 
static struct positioncommon_position (struct position *pos1, struct position *pos2)
 
static rtx find_operand (rtx pattern, int n, rtx stop)
 
static rtx find_matching_operand (rtx pattern, int n)
 
static bool constraints_supported_in_insn_p (rtx insn)
 
static const charpredicate_name (rtx match_rtx)
 
static bool special_predicate_operand_p (rtx operand)
 
static void validate_pattern (rtx pattern, md_rtx_info *info, rtx set, int set_code)
 
bool operator== (const acceptance_type &a, const acceptance_type &b)
 
bool operator!= (const acceptance_type &a, const acceptance_type &b)
 
bool operator== (const parameter &param1, const parameter &param2)
 
bool operator!= (const parameter &param1, const parameter &param2)
 
bool operator== (const rtx_test &a, const rtx_test &b)
 
bool operator!= (const rtx_test &a, const rtx_test &b)
 
bool operator== (const int_set &a, const int_set &b)
 
bool operator!= (const int_set &a, const int_set &b)
 
static void add_decision (state *from, const rtx_test &test, transition *trans)
 
static stateadd_decision (state *from, const rtx_test &test, int_set labels, bool optional)
 
static decisioninsert_decision_before (state::range r, const rtx_test &test, const int_set &labels, bool optional)
 
static void collapse_optional_decisions (state *s)
 
static void simplify_tests (state *s)
 
static bool common_test_p (decision *d, transition *common, vec< transition * > *where)
 
static bool safe_to_hoist_p (decision *d, const rtx_test &test, known_conditions *kc)
 
static decisionfind_common_test (decision *outer, bool with_position_p, position *pos, bool worthwhile_single_p, known_conditions *kc, vec< transition * > *where)
 
static void cse_tests (position *pos, state *s, known_conditions *kc)
 
parameter::type_enum transition_parameter_type (rtx_test::kind_enum kind)
 
static void find_operand_positions (state *s, vec< int > &operand_pos)
 
static stats get_stats (state *s)
 
static void optimize_subroutine_group (const char *type, state *root)
 
static bool useful_pattern_p (merge_pattern_info *pat)
 
static bool same_pattern_p (merge_pattern_info *pat1, merge_pattern_info *pat2)
 
static bool valid_result_p (merge_pattern_info *pat, merge_state_info *sinfo)
 
static void prune_invalid_results (merge_state_info *sinfo)
 
static bool complete_result_p (merge_pattern_info *pat, merge_state_info *sinfo)
 
static void update_parameters (vec< parameter > &to, const vec< parameter > &from)
 
static bool compatible_tests_p (const rtx_test &a, const rtx_test &b, parameter *parama, parameter *paramb)
 
static bool set_parameter (vec< parameter > &params, unsigned int id, const parameter &value)
 
static bool add_parameter (vec< parameter > &params1, vec< parameter > &params2, const parameter &param1, const parameter &param2, unsigned int start, unsigned int *res)
 
static bool merge_relative_positions (position **roota, position *a, position *rootb, position *b)
 
static bool merge_patterns (merge_state_info *sinfo1, merge_state_info *sinfo2)
 
static void populate_pattern_routine (create_pattern_info *, merge_state_info *, state *, const vec< parameter > &)
 
static decisioninit_pattern_use (create_pattern_info *cpi, merge_state_info *sinfo, const vec< parameter > &params)
 
static void add_pattern_acceptance (create_pattern_info *cpi, state *s)
 
static void populate_pattern_use (create_pattern_info *cpi, decision *use, merge_state_info *sinfo)
 
static void use_pattern (merge_state_info *sinfo)
 
static void split_out_patterns (vec< merge_state_info > &states)
 
static int subroutine_candidate_cmp (const void *a, const void *b)
 
static statecreate_subroutine (routine_type type, state *s, vec< state * > &procs)
 
static state_size find_subroutines (routine_type type, state *s, vec< state * > &procs)
 
static bool safe_predicate_mode (const struct pred_data *pred, machine_mode mode)
 
static void get_predicate_codes (const struct pred_data *pred, int_set *codes)
 
static bool has_same_test_p (decision *d1, decision *d2)
 
static bool mutually_exclusive_p (decision *d1, decision *d2)
 
static bool merge_into_decision (decision *d1, state *s2, const int_set *exclude, state **next_s1, state **next_s2, const int_set **next_exclude)
 
static bool merge_into_state_1 (state *s1, state *s2, const int_set *exclude, state **next_s1, state **next_s2, const int_set **next_exclude)
 
static void merge_into_state (state *s1, state *s2)
 
bool operator< (const pattern_pos &e1, const pattern_pos &e2)
 
static statematch_pattern_2 (state *s, md_rtx_info *info, position *pos, rtx pattern)
 
static void match_pattern_1 (state *s, md_rtx_info *info, rtx pattern, acceptance_type acceptance)
 
static void match_pattern (state *s, md_rtx_info *info, rtx pattern, acceptance_type acceptance)
 
static void write_header (void)
 
static const charparameter_type_string (parameter::type_enum type)
 
static bool single_statement_p (const acceptance_type &acceptance)
 
static const charget_failure_return (routine_type type)
 
static bool terminal_pattern_p (decision *d, unsigned int *base_out, unsigned int *count_out)
 
static bool test_position_available_p (output_state *os, const rtx_test &test)
 
static void ATTRIBUTE_PRINTF_2 printf_indent (unsigned int indent, const char *format,...)
 
static void change_state (output_state *os, position *pos, unsigned int indent)
 
static void print_code (enum rtx_code code)
 
static void print_host_wide_int (uint64_t val)
 
static void print_parameter_value (const parameter &param)
 
static void print_test_rtx (output_state *os, const rtx_test &test)
 
static void print_nonbool_test (output_state *os, const rtx_test &test)
 
static void print_label_value (const rtx_test &test, bool is_param, uint64_t value)
 
static void print_test (output_state *os, const rtx_test &test, bool is_param, uint64_t value, bool invert_p)
 
static exit_state print_decision (output_state *, decision *, unsigned int, bool)
 
static exit_state print_state (output_state *os, state *s, unsigned int indent, bool is_final)
 
static const charprint_subroutine_call (const acceptance_type &acceptance)
 
static exit_state print_acceptance (const acceptance_type &acceptance, unsigned int indent, bool is_final)
 
static void assign_position_var (output_state *os, position *pos, bool root_p)
 
static void assign_position_vars (output_state *os, state *s)
 
static void print_subroutine_start (output_state *os, state *s, position *root)
 
static void print_pattern (output_state *os, pattern_routine *routine)
 
static void print_subroutine (output_state *os, state *s, int proc_id)
 
static void print_subroutine_group (output_state *os, routine_type type, state *root)
 
static rtx get_peephole2_pattern (md_rtx_info *info)
 
static bool remove_clobbers (acceptance_type *acceptance_ptr, rtx *pattern_ptr)
 
int main (int argc, const char **argv)
 

Variables

static const bool merge_states_p = true
 
static const bool collapse_optional_decisions_p = true
 
static const bool cse_tests_p = true
 
static const bool simplify_tests_p = true
 
static const bool use_operand_variables_p = true
 
static const bool use_subroutines_p = true
 
static const bool use_pattern_routines_p = true
 
static const bool mark_optional_transitions_p = false
 
static const bool relative_patterns_p = false
 
static const bool pattern_have_num_clobbers_p = true
 
static const bool pattern_c_test_p = false
 
static const bool force_unique_params_p = true
 
static const unsigned int MAX_DEPTH = 6
 
static const unsigned int MIN_NUM_STATEMENTS = 5
 
static const unsigned int MAX_NUM_STATEMENTS = 200
 
static const unsigned int MIN_COMBINE_COST = 4
 
static const unsigned int MAX_PATTERN_PARAMS = 5
 
int num_operands
 
static struct position root_pos
 
static unsigned int num_positions = 1
 
static struct positionpeep2_insn_pos_list = &root_pos
 
static vec< pattern_routine * > patterns
 
const unsigned char TESTED_CODE = 1
 
const unsigned char TESTED_VECLEN = 2
 
static unsigned int pattern_use_states
 
static unsigned int pattern_def_states
 

Macro Definition Documentation

◆ DEF_RTL_EXPR

#define DEF_RTL_EXPR ( ENUM,
NAME,
FORMAT,
CLASS )   TRUE_##ENUM,

◆ GENERATOR_FILE

#define GENERATOR_FILE   1

◆ INCLUDE_ALGORITHM

#define INCLUDE_ALGORITHM
Generate code from machine description to recognize rtl as insns.
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/>.   
This program is used to produce insn-recog.cc, which contains a
function called `recog' plus its subroutines.  These functions
contain a decision tree that recognizes whether an rtx, the
argument given to recog, is a valid instruction.

recog returns -1 if the rtx is not valid.  If the rtx is valid,
recog returns a nonnegative number which is the insn code number
for the pattern that matched.  This is the same as the order in the
machine description of the entry that matched.  This number can be
used as an index into various insn_* tables, such as insn_template,
insn_outfun, and insn_n_operands (found in insn-output.cc).

The third argument to recog is an optional pointer to an int.  If
present, recog will accept a pattern if it matches except for
missing CLOBBER expressions at the end.  In that case, the value
pointed to by the optional pointer will be set to the number of
CLOBBERs that need to be added (it should be initialized to zero by
the caller).  If it is set nonzero, the caller should allocate a
PARALLEL of the appropriate size, copy the initial entries, and
call add_clobbers (found in insn-emit.cc) to fill in the CLOBBERs.

This program also generates the function `split_insns', which
returns 0 if the rtl could not be split, or it returns the split
rtl as an INSN list.

This program also generates the function `peephole2_insns', which
returns 0 if the rtl could not be matched.  If there was a match,
the new rtl is returned in an INSN list, and LAST_INSN will point
to the last recognized insn in the old sequence.


At a high level, the algorithm used in this file is as follows:

1. Build up a decision tree for each routine, using the following
   approach to matching an rtx:

   - First determine the "shape" of the rtx, based on GET_CODE,
     XVECLEN and XINT.  This phase examines SET_SRCs before SET_DESTs
     since SET_SRCs tend to be more distinctive.  It examines other
     operands in numerical order, since the canonicalization rules
     prefer putting complex operands of commutative operators first.

   - Next check modes and predicates.  This phase examines all
     operands in numerical order, even for SETs, since the mode of a
     SET_DEST is exact while the mode of a SET_SRC can be VOIDmode
     for constant integers.

   - Next check match_dups.

   - Finally check the C condition and (where appropriate) pnum_clobbers.

2. Try to optimize the tree by removing redundant tests, CSEing tests,
   folding tests together, etc.

3. Look for common subtrees and split them out into "pattern" routines.
   These common subtrees can be identical or they can differ in mode,
   code, or integer (usually an UNSPEC or UNSPEC_VOLATILE code).
   In the latter case the users of the pattern routine pass the
   appropriate mode, etc., as argument.  For example, if two patterns
   contain:

      (plus:SI (match_operand:SI 1 "register_operand")
               (match_operand:SI 2 "register_operand"))

   we can split the associated matching code out into a subroutine.
   If a pattern contains:

      (minus:DI (match_operand:DI 1 "register_operand")
                (match_operand:DI 2 "register_operand"))

   then we can consider using the same matching routine for both
   the plus and minus expressions, passing PLUS and SImode in the
   former case and MINUS and DImode in the latter case.

   The main aim of this phase is to reduce the compile time of the
   insn-recog.cc code and to reduce the amount of object code in
   insn-recog.o.

4. Split the matching trees into functions, trying to limit the
   size of each function to a sensible amount.

   Again, the main aim of this phase is to reduce the compile time
   of insn-recog.cc.  (It doesn't help with the size of insn-recog.o.)

5. Write out C++ code for each function.   

◆ NUM_TRUE_RTX_CODE

#define NUM_TRUE_RTX_CODE   ((int) FIRST_GENERATOR_RTX_CODE)

Referenced by get_predicate_codes().

Typedef Documentation

◆ subroutine_candidate

Pairs a transition with information about its target state.   

Enumeration Type Documentation

◆ exit_state

Indicates whether a block of code always returns or whether it can fall
through.   
Enumerator
ES_RETURNED 
ES_FALLTHROUGH 

◆ position_type

Ways of obtaining an rtx to be tested.   
Enumerator
POS_PEEP2_INSN 
POS_XEXP 
POS_XVECEXP0 

◆ routine_type

Enumerator
SUBPATTERN 
RECOG 
SPLIT 
PEEPHOLE2 

◆ true_rtx_doe

Enumerator
FIRST_GENERATOR_RTX_CODE 

Function Documentation

◆ add_decision() [1/2]

static state * add_decision ( state * from,
const rtx_test & test,
int_set labels,
bool optional )
static
Add a transition from FROM to a new, empty state that is taken
when TEST == LABELS.  OPTIONAL says whether the new transition
should be optional.  Return the new state.   

References add_decision().

◆ add_decision() [2/2]

static void add_decision ( state * from,
const rtx_test & test,
transition * trans )
static
Add to FROM a decision that performs TEST and has a single transition
TRANS.   

References ggc_alloc(), and list_head< T >::push_back().

Referenced by add_decision(), add_pattern_acceptance(), create_subroutine(), match_pattern_1(), and match_pattern_2().

◆ add_parameter()

static bool add_parameter ( vec< parameter > & params1,
vec< parameter > & params2,
const parameter & param1,
const parameter & param2,
unsigned int start,
unsigned int * res )
static
PARAMS2 is the "params" array for a pattern and PARAMS1 is the
set of parameters that a particular state is going to pass to
that pattern.

Try to extend PARAMS1 and PARAMS2 so that there is a parameter
that is equal to PARAM1 for the state and has a default value of
PARAM2.  Parameters beginning at START were added as part of the
same match and so may be reused.   

References force_unique_params_p, gcc_assert, ggc_alloc(), i, and MAX_PATTERN_PARAMS.

Referenced by merge_patterns().

◆ add_pattern_acceptance()

static void add_pattern_acceptance ( create_pattern_info * cpi,
state * s )
static

◆ assign_position_var()

static void assign_position_var ( output_state * os,
position * pos,
bool root_p )
static
Make sure that OS has a position variable for POS.  ROOT_P is true if
POS is the root position for the routine.   

References assign_position_var(), position::base, ggc_alloc(), position::id, POS_PEEP2_INSN, and position::type.

Referenced by assign_position_var(), assign_position_vars(), and print_subroutine_start().

◆ assign_position_vars()

static void assign_position_vars ( output_state * os,
state * s )
static
Make sure that OS has the position variables required by S.   

References assign_position_var(), assign_position_vars(), list_head< T >::first, and ggc_alloc().

Referenced by assign_position_vars(), and print_subroutine_start().

◆ change_state()

static void change_state ( output_state * os,
position * pos,
unsigned int indent )
static
Emit code to initialize the variable associated with POS, if it isn't
already valid in state OS.  Indent each line by INDENT spaces.  Update
OS with the new state.   

References position::arg, position::base, change_state(), gcc_assert, ggc_alloc(), position::id, POS_PEEP2_INSN, POS_XEXP, POS_XVECEXP0, printf_indent(), and position::type.

Referenced by change_state(), and print_decision().

◆ collapse_optional_decisions()

static void collapse_optional_decisions ( state * s)
static
Remove any optional transitions from S that turned out not to be useful.   

References collapse_optional_decisions(), list_head< T >::first, ggc_alloc(), decision::next, list_head< T >::replace(), and list_head< T >::singleton().

Referenced by collapse_optional_decisions(), and optimize_subroutine_group().

◆ common_position()

static struct position * common_position ( struct position * pos1,
struct position * pos2 )
static
Return the most deeply-nested position that is common to both
POS1 and POS2.  If the positions are from different instructions,
return the one with the lowest insn_id.   

References ggc_alloc().

Referenced by populate_pattern_routine(), and split_out_patterns().

◆ common_test_p()

static bool common_test_p ( decision * d,
transition * common,
vec< transition * > * where )
static
Return true if all successful returns passing through D require the
condition tested by COMMON to be true.

When returning true, add all transitions like COMMON in D to WHERE.
WHERE may contain a partial result on failure.   

References rtx_test::ACCEPT, common_test_p(), list_head< T >::first, transition::from, ggc_alloc(), rtx_test::kind, transition::labels, transition::optional, list_head< T >::singleton(), and decision::test.

Referenced by common_test_p(), and find_common_test().

◆ compare_positions()

static int compare_positions ( struct position * pos1,
struct position * pos2 )
static
Compare positions POS1 and POS2 lexicographically.   

References ggc_alloc().

Referenced by operator<().

◆ compatible_tests_p()

static bool compatible_tests_p ( const rtx_test & a,
const rtx_test & b,
parameter * parama,
parameter * paramb )
static
Return true if A and B can be tested by a single test.  If the test
can be parameterised, store the parameter value for A in *PARAMA and
the parameter value for B in *PARAMB, otherwise leave PARAMA and
PARAMB alone.   

References a, b, ggc_alloc(), parameter::INT, parameter::MODE, rtx_test::PREDICATE, and rtx_test::SAVED_CONST_INT.

Referenced by test_pattern_hasher::equal(), and merge_patterns().

◆ complete_result_p()

static bool complete_result_p ( merge_pattern_info * pat,
merge_state_info * sinfo )
static
Return true if PAT represents the biggest posssible match for SINFO;
that is, if the next action of SINFO's state on return from PAT will
be something that cannot be merged with any other state.   

References ggc_alloc(), and merge_pattern_info::transitions.

Referenced by split_out_patterns().

◆ constraints_supported_in_insn_p()

static bool constraints_supported_in_insn_p ( rtx insn)
static
In DEFINE_EXPAND, DEFINE_SPLIT, and DEFINE_PEEPHOLE2, we
don't use the MATCH_OPERAND constraint, only the predicate.
This is confusing to folks doing new ports, so help them
not make the mistake.   

References GET_CODE, and ggc_alloc().

Referenced by validate_pattern().

◆ create_subroutine()

static state * create_subroutine ( routine_type type,
state * s,
vec< state * > & procs )
static
Turn S into a subroutine of type TYPE and add it to PROCS.  Return a new
state that performs a subroutine call to S.   

References rtx_test::accept(), add_decision(), ggc_alloc(), acceptance_type::partial_p, acceptance_type::subroutine_id, type(), acceptance_type::type, and acceptance_type::u.

Referenced by find_subroutines().

◆ cse_tests()

static void cse_tests ( position * pos,
state * s,
known_conditions * kc )
static
Try to promote common subtests in S to a single, shared decision.
Also try to bunch tests for the same position together.  POS is the
position of the rtx tested before reaching S.  KC are the conditions
that are known to hold on entry to S.   

References rtx_test::ACCEPT, rtx_test::C_TEST, rtx_test::CODE, cse_tests(), find_common_test(), list_head< T >::first, transition::from, gcc_assert, ggc_alloc(), insert_decision_before(), transition::labels, MAX, transition::optional, rtx_test::PEEP2_COUNT, safe_to_hoist_p(), rtx_test::SET_OP, decision::test, TESTED_CODE, TESTED_VECLEN, rtx_test::VECLEN, and rtx_test::VECLEN_GE.

Referenced by cse_tests(), and optimize_subroutine_group().

◆ find_common_test()

static decision * find_common_test ( decision * outer,
bool with_position_p,
position * pos,
bool worthwhile_single_p,
known_conditions * kc,
vec< transition * > * where )
static
Look for a transition that is taken by all successful returns from a range
of decisions starting at OUTER and that would be better performed by
OUTER's state instead.  On success, store all instances of that transition
in WHERE and return the last decision in the range.  The range could
just be OUTER, or it could include later decisions as well.

WITH_POSITION_P is true if only tests with position POS should be tried,
false if any test should be tried.  WORTHWHILE_SINGLE_P is true if the
result is useful even when the range contains just a single decision
with a single transition.  KC are the conditions that are known to
hold at OUTER.   

References common_test_p(), list_head< T >::first, ggc_alloc(), decision::next, safe_to_hoist_p(), list_head< T >::singleton(), decision::test, and transition::to.

Referenced by cse_tests().

◆ find_matching_operand()

static rtx find_matching_operand ( rtx pattern,
int n )
static
Search for and return operand M, such that it has a matching
constraint for operand N.   

References find_matching_operand(), gcc_unreachable, GET_CODE, GET_RTX_FORMAT, GET_RTX_LENGTH, ggc_alloc(), i, NULL, r, RTX_CODE, XEXP, XSTR, XVEC, XVECEXP, and XVECLEN.

Referenced by find_matching_operand(), and validate_pattern().

◆ find_operand()

static rtx find_operand ( rtx pattern,
int n,
rtx stop )
static
Search for and return operand N, stop when reaching node STOP.   

References find_operand(), gcc_unreachable, GET_CODE, GET_RTX_FORMAT, GET_RTX_LENGTH, ggc_alloc(), i, NULL, NULL_RTX, r, RTX_CODE, XEXP, XINT, XVEC, XVECEXP, and XVECLEN.

Referenced by find_operand(), match_pattern_2(), and validate_pattern().

◆ find_operand_positions()

static void find_operand_positions ( state * s,
vec< int > & operand_pos )
static
Initialize the pos_operand fields of each state reachable from S.
If OPERAND_POS[ID] >= 0, the position with id ID is stored in
operands[OPERAND_POS[ID]] on entry to S.   

References find_operand_positions(), list_head< T >::first, ggc_alloc(), and rtx_test::SET_OP.

Referenced by find_operand_positions(), and optimize_subroutine_group().

◆ find_subroutines()

static state_size find_subroutines ( routine_type type,
state * s,
vec< state * > & procs )
static
Walk state tree S, of type TYPE, and look for subtrees that would be
better split into subroutines.  Accumulate all such subroutines in PROCS.
Return the size of the new state tree (excluding subroutines).   

References rtx_test::ACCEPT, candidates, create_subroutine(), state_size::depth, find_subroutines(), list_head< T >::first, ggc_alloc(), i, MAX, MAX_DEPTH, MAX_NUM_STATEMENTS, MIN_NUM_STATEMENTS, state_size::num_statements, rtx_test::SET_OP, and subroutine_candidate_cmp().

Referenced by find_subroutines(), and print_subroutine_group().

◆ get_failure_return()

static const char * get_failure_return ( routine_type type)
static
Return the C failure value for a routine of type TYPE.   

References gcc_unreachable, PEEPHOLE2, RECOG, SPLIT, and SUBPATTERN.

Referenced by print_decision(), and print_state().

◆ get_peephole2_pattern()

static rtx get_peephole2_pattern ( md_rtx_info * info)
static
Return the rtx pattern for the list of rtxes in a define_peephole2.   

References md_rtx_info::def, error_at(), GET_CODE, GET_NUM_ELEM, ggc_alloc(), i, md_rtx_info::loc, rtvec_alloc(), RTVEC_ELT, rtx_alloc(), XVEC, XVECEXP, and XVECLEN.

Referenced by main().

◆ get_predicate_codes()

static void get_predicate_codes ( const struct pred_data * pred,
int_set * codes )
static
Fill CODES with the set of codes that could be matched by PRED.   

References pred_data::codes, i, and NUM_TRUE_RTX_CODE.

Referenced by match_pattern_2().

◆ get_stats()

static stats get_stats ( state * s)
static
Return statistics about S.   

References rtx_test::ACCEPT, list_head< T >::first, get_stats(), and ggc_alloc().

Referenced by get_stats(), and optimize_subroutine_group().

◆ has_same_test_p()

static bool has_same_test_p ( decision * d1,
decision * d2 )
static
Return true if the first path through D1 tests the same thing as D2.   

References d1, and d2.

Referenced by mutually_exclusive_p().

◆ init_pattern_use()

static decision * init_pattern_use ( create_pattern_info * cpi,
merge_state_info * sinfo,
const vec< parameter > & params )
static
SINFO matches a pattern for which we've decided to create a C routine.
Return a decision that performs a call to the pattern routine,
but leave the caller to add the transitions to it.  Initialize CPI
for this purpose.  Also create a definition for the pattern routine,
if it doesn't already have one.

PARAMS are the parameters that SINFO passes to its pattern.   

References list_head< T >::first, gcc_assert, ggc_alloc(), i, pattern_routine::insn_p, create_pattern_info::next_result, merge_pattern_info::num_results, pattern_routine::param_types, merge_pattern_info::params, rtx_test::pattern, merge_state_result::pattern, pattern_routine::pattern_id, patterns, pattern_routine::pnum_clobbers_p, populate_pattern_routine(), pattern_routine::pos, rtx_test::pos, rtx_test::pos_operand, merge_state_result::root, merge_pattern_info::routine, create_pattern_info::routine, sinfo::s, pattern_routine::s, and decision::test.

Referenced by populate_pattern_routine(), and use_pattern().

◆ insert_decision_before()

static decision * insert_decision_before ( state::range r,
const rtx_test & test,
const int_set & labels,
bool optional )
static
Insert a decision before decisions R to make them dependent on
TEST == LABELS.  OPTIONAL says whether the new transition should be
optional.   

References ggc_alloc(), and r.

Referenced by cse_tests().

◆ main()

◆ match_pattern()

static void match_pattern ( state * s,
md_rtx_info * info,
rtx pattern,
acceptance_type acceptance )
static
Like match_pattern_1, but (if merge_states_p) try to merge the
decisions with what's already in S, to reduce the amount of
backtracking.   

References match_pattern_1(), merge_into_state(), and merge_states_p.

Referenced by main().

◆ match_pattern_1()

static void match_pattern_1 ( state * s,
md_rtx_info * info,
rtx pattern,
acceptance_type acceptance )
static
Add new decisions to S that make it return ACCEPTANCE if:

(1) the rtx doesn't match anything already matched by S
(2) the rtx matches TOP_PATTERN and
(3) the C test required by INFO->def is true

For peephole2, TOP_PATTERN is a SEQUENCE of the instruction patterns
to match, otherwise it is a single instruction pattern.   

References rtx_test::accept(), add_decision(), rtx_test::c_test(), count, md_rtx_info::def, acceptance_type::full, get_c_test(), ggc_alloc(), rtx_test::have_num_clobbers(), i, acceptance_type::match_len, match_pattern_2(), maybe_eval_c_test(), next_position(), acceptance_type::num_clobbers, rtx_test::peep2_count(), peep2_insn_pos_list, PEEPHOLE2, POS_PEEP2_INSN, RECOG, root_pos, acceptance_type::type, acceptance_type::u, XVECEXP, and XVECLEN.

Referenced by match_pattern().

◆ match_pattern_2()

◆ merge_into_decision()

static bool merge_into_decision ( decision * d1,
state * s2,
const int_set * exclude,
state ** next_s1,
state ** next_s2,
const int_set ** next_exclude )
static
Try to merge S2's decision into D1, given that they have the same test.
Fail only if EXCLUDE is nonnull and the new transition would have the
same labels as *EXCLUDE.  When returning true, set *NEXT_S1, *NEXT_S2
and *NEXT_EXCLUDE as for merge_into_state_1, or set *NEXT_S2 to null
if the merge is complete.   

References int_set::begin(), d1, d2, int_set::end(), end(), gcc_assert, ggc_alloc(), i, i1, i2, and r.

Referenced by merge_into_state_1().

◆ merge_into_state()

static void merge_into_state ( state * s1,
state * s2 )
static
Merge S2 into S1.  If they both match a particular rtx, give
priority to S1.  Each state in S2 has a single decision.   

References ggc_alloc(), and merge_into_state_1().

Referenced by match_pattern().

◆ merge_into_state_1()

static bool merge_into_state_1 ( state * s1,
state * s2,
const int_set * exclude,
state ** next_s1,
state ** next_s2,
const int_set ** next_exclude )
static
Make progress in merging S2 into S1, given that each state in S2
has a single decision.  If EXCLUDE is nonnull, avoid creating a new
transition with the same test as S2's decision and with the labels
in *EXCLUDE.

Return true if there is still work to do.  When returning true,
set *NEXT_S1, *NEXT_S2 and *NEXT_EXCLUDE to the values that
S1, S2 and EXCLUDE should have next time round.

If S1 and S2 both match a particular rtx, give priority to S1.   

References d1, d2, ggc_alloc(), merge_into_decision(), and mutually_exclusive_p().

Referenced by merge_into_state().

◆ merge_patterns()

◆ merge_relative_positions()

static bool merge_relative_positions ( position ** roota,
position * a,
position * rootb,
position * b )
static
If *ROOTA is nonnull, return true if the same sequence of steps are
required to reach A from *ROOTA as to reach B from ROOTB.  If *ROOTA
is null, update it if necessary in order to make the condition hold.   

References a, b, ggc_alloc(), and relative_patterns_p.

Referenced by merge_patterns().

◆ mutually_exclusive_p()

static bool mutually_exclusive_p ( decision * d1,
decision * d2 )
static
Return true if D1 and D2 cannot match the same rtx.  All states reachable
from D2 have single decisions and all those decisions have single
transitions.   

References d1, d2, ggc_alloc(), has_same_test_p(), i1, i2, and mutually_exclusive_p().

Referenced by merge_into_state_1(), and mutually_exclusive_p().

◆ next_position()

static struct position * next_position ( struct position ** next_ptr,
struct position * base,
enum position_type type,
int arg )
static
Return a position with the given BASE, TYPE and ARG.  NEXT_PTR
points to where the unique object that represents the position
should be stored.  Create the object if it doesn't already exist,
otherwise reuse the object that is already there.   

References position::arg, position::base, position::depth, ggc_alloc(), position::id, position::insn_id, num_positions, POS_PEEP2_INSN, type(), and position::type.

Referenced by match_pattern_1(), and match_pattern_2().

◆ operator!=() [1/4]

◆ operator!=() [2/4]

References a, b, and operator==().

◆ operator!=() [3/4]

bool operator!= ( const parameter & param1,
const parameter & param2 )

References ggc_alloc(), and operator==().

◆ operator!=() [4/4]

References a, b, and operator==().

◆ operator<()

Compare entries according to their depth-first order.  There shouldn't
be two entries at the same position.   

References compare_positions(), gcc_assert, pattern_pos::pattern, and pattern_pos::pos.

◆ operator==() [1/4]

References a, and b.

Referenced by operator!=(), operator!=(), operator!=(), and operator!=().

◆ operator==() [2/4]

References a, b, and i.

◆ operator==() [3/4]

bool operator== ( const parameter & param1,
const parameter & param2 )

References ggc_alloc().

◆ operator==() [4/4]

◆ optimize_subroutine_group()

static void optimize_subroutine_group ( const char * type,
state * root )
static

◆ parameter_type_string()

static const char * parameter_type_string ( parameter::type_enum type)
static
Return the C type of a parameter with type TYPE.   

References parameter::CODE, gcc_unreachable, parameter::INT, parameter::MODE, parameter::UINT, parameter::UNSET, and parameter::WIDE_INT.

Referenced by print_pattern().

◆ populate_pattern_routine()

static void populate_pattern_routine ( create_pattern_info * cpi,
merge_state_info * sinfo,
state * news,
const vec< parameter > & params )
static
Initialize new empty state NEWS so that it implements SINFO's pattern
(here referred to as "P").  P may be the top level of a pattern routine
or a subpattern that should be inlined into its parent pattern's routine
(as per same_pattern_p).  The choice of SINFO for a top-level pattern is
arbitrary; it could be any of the states that use P.  The choice for
subpatterns follows the choice for the parent pattern.

PARAMS gives the value of each parameter to P in terms of the parameters
to the top-level pattern.  If P itself is the top level pattern, PARAMS[I]
is always "parameter (TYPE, true, I)".   

References add_pattern_acceptance(), rtx_test::C_TEST, common_position(), list_head< T >::first, gcc_assert, gcc_unreachable, ggc_alloc(), rtx_test::HAVE_NUM_CLOBBERS, i, init_pattern_use(), pattern_routine::insn_p, parameter::is_param, rtx_test::kind, merge_pattern_info::param_test, merge_pattern_info::param_test_p, merge_pattern_info::param_transition, merge_pattern_info::param_transition_p, merge_state_result::pattern, pattern_def_states, pattern_routine::pnum_clobbers_p, populate_pattern_routine(), pattern_routine::pos, rtx_test::PREDICATE, merge_state_info::res, create_pattern_info::routine, sinfo::s, same_pattern_p(), rtx_test::SAVED_CONST_INT, decision::test, merge_pattern_info::transitions, and parameter::value.

Referenced by init_pattern_use(), and populate_pattern_routine().

◆ populate_pattern_use()

static void populate_pattern_use ( create_pattern_info * cpi,
decision * use,
merge_state_info * sinfo )
static
USE is a decision that calls a pattern routine and SINFO is part of the
original state tree that the call is supposed to replace.  Add the
transitions for SINFO and its substates to USE.   

References list_head< T >::first, gcc_assert, ggc_alloc(), i, create_pattern_info::next_result, merge_state_result::pattern, pattern_use_states, populate_pattern_use(), sinfo::s, and merge_pattern_info::transitions.

Referenced by populate_pattern_use(), and use_pattern().

◆ predicate_name()

static const char * predicate_name ( rtx match_rtx)
static
Return the name of the predicate matched by MATCH_RTX.   

References GET_CODE, ggc_alloc(), match_rtx(), and XSTR.

Referenced by match_pattern_2(), and special_predicate_operand_p().

◆ print_acceptance()

static exit_state print_acceptance ( const acceptance_type & acceptance,
unsigned int indent,
bool is_final )
static

◆ print_code()

static void print_code ( enum rtx_code code)
static
Print the enumerator constant for CODE -- the upcase version of
the name.   

References GET_RTX_NAME, and ggc_alloc().

Referenced by print_parameter_value().

◆ print_decision()

◆ print_host_wide_int()

static void print_host_wide_int ( uint64_t val)
static
Emit a uint64_t as an integer constant expression.  We need to take
special care to avoid "decimal constant is so large that it is unsigned"
warnings in the resulting code.   

References ggc_alloc(), HOST_BITS_PER_WIDE_INT, and HOST_WIDE_INT_PRINT_DEC_C.

Referenced by print_parameter_value().

◆ print_label_value()

static void print_label_value ( const rtx_test & test,
bool is_param,
uint64_t value )
static
IS_PARAM and LABEL are taken from a transition whose source
decision performs TEST.  Print the C code for the label.   

References rtx_test::kind, print_parameter_value(), and transition_parameter_type().

Referenced by print_decision(), and print_test().

◆ print_nonbool_test()

◆ print_parameter_value()

◆ print_pattern()

◆ print_state()

static exit_state print_state ( output_state * os,
state * s,
unsigned int indent,
bool is_final )
static
Print code to perform S, indent each line by INDENT spaces.
IS_FINAL is true if there are no fallback decisions to test on failure;
if the state fails then the entire routine fails.   

References ES_FALLTHROUGH, ES_RETURNED, list_head< T >::first, get_failure_return(), ggc_alloc(), print_decision(), and printf_indent().

Referenced by print_decision(), print_filtered_help(), print_pattern(), and print_subroutine().

◆ print_subroutine()

static void print_subroutine ( output_state * os,
state * s,
int proc_id )
static
Output a routine of type TYPE that implements S.  PROC_ID is the
number of the subroutine associated with S, or 0 if S is the main
routine.   

References gcc_unreachable, ggc_alloc(), PEEPHOLE2, print_state(), print_subroutine_start(), RECOG, root_pos, SPLIT, and SUBPATTERN.

Referenced by print_subroutine_group().

◆ print_subroutine_call()

static const char * print_subroutine_call ( const acceptance_type & acceptance)
static
Print the code for subroutine call ACCEPTANCE (for which partial_p
is known to be true).  Return the C condition that indicates a successful
match.   

References gcc_unreachable, ggc_alloc(), PEEPHOLE2, RECOG, SPLIT, SUBPATTERN, acceptance_type::subroutine_id, acceptance_type::type, and acceptance_type::u.

Referenced by print_acceptance().

◆ print_subroutine_group()

static void print_subroutine_group ( output_state * os,
routine_type type,
state * root )
static
Print out a routine of type TYPE that performs ROOT.   

References find_subroutines(), FOR_EACH_VEC_ELT, ggc_alloc(), i, print_subroutine(), type(), and use_subroutines_p.

Referenced by main().

◆ print_subroutine_start()

static void print_subroutine_start ( output_state * os,
state * s,
position * root )
static
Print the open brace and variable definitions for a routine that
implements S.  ROOT is the deepest rtx from which S can access all
relevant parts of the first instruction it matches.  Initialize OS
so that every relevant position has an rtx variable xN and so that
only ROOT's variable has a valid value.   

References assign_position_var(), assign_position_vars(), ggc_alloc(), i, num_positions, RECOG, and SUBPATTERN.

Referenced by print_pattern(), and print_subroutine().

◆ print_test()

◆ print_test_rtx()

static void print_test_rtx ( output_state * os,
const rtx_test & test )
static
Print the C expression for the rtx tested by TEST.   

References ggc_alloc(), position::id, rtx_test::pos, and rtx_test::pos_operand.

Referenced by print_decision(), print_nonbool_test(), and print_test().

◆ printf_indent()

static void ATTRIBUTE_PRINTF_2 printf_indent ( unsigned int indent,
const char * format,
... )
static
Like printf, but print INDENT spaces at the beginning.   

References ap, and ggc_alloc().

Referenced by change_state(), print_acceptance(), print_decision(), and print_state().

◆ prune_invalid_results()

static void prune_invalid_results ( merge_state_info * sinfo)
static
Remove any matches that are no longer valid from the head of SINFO's
list of matches.   

References gcc_assert, and valid_result_p().

Referenced by split_out_patterns().

◆ remove_clobbers()

static bool remove_clobbers ( acceptance_type * acceptance_ptr,
rtx * pattern_ptr )
static
Return true if *PATTERN_PTR is a PARALLEL in which at least one trailing
rtx can be added automatically by add_clobbers.  If so, update
*ACCEPTANCE_PTR so that its num_clobbers field contains the number
of such trailing rtxes and update *PATTERN_PTR so that it contains
the pattern without those rtxes.   

References GET_CODE, ggc_alloc(), i, REG_P, rtvec_alloc(), rtx_alloc(), XEXP, XVEC, XVECEXP, and XVECLEN.

Referenced by main().

◆ safe_predicate_mode()

static bool safe_predicate_mode ( const struct pred_data * pred,
machine_mode mode )
static
Return true if, for all X, PRED (X, MODE) implies that X has mode MODE.   

References pred_data::codes, GET_MODE_CLASS, ggc_alloc(), and pred_data::special.

Referenced by match_pattern_2().

◆ safe_to_hoist_p()

static bool safe_to_hoist_p ( decision * d,
const rtx_test & test,
known_conditions * kc )
static
Return true if TEST can safely be performed at D, where
the conditions in KC hold.  TEST is known to occur along the
first path from D (i.e. always following the first transition
of the first decision).  Any intervening tests can be used as
negative proof that hoisting isn't safe, but only KC can be used
as positive proof.   

References rtx_test::ACCEPT, position::arg, position::base, rtx_test::C_TEST, rtx_test::CODE, rtx_test::DUPLICATE, gcc_unreachable, ggc_alloc(), rtx_test::HAVE_NUM_CLOBBERS, position::id, rtx_test::INT_FIELD, rtx_test::kind, rtx_test::MODE, rtx_test::opno, rtx_test::PATTERN, rtx_test::PEEP2_COUNT, rtx_test::pos, POS_PEEP2_INSN, POS_XEXP, POS_XVECEXP0, rtx_test::PREDICATE, rtx_test::REGNO_FIELD, rtx_test::SAVED_CONST_INT, rtx_test::SET_OP, rtx_test::SUBREG_FIELD, TESTED_CODE, TESTED_VECLEN, position::type, rtx_test::u, rtx_test::VECLEN, rtx_test::VECLEN_GE, and rtx_test::WIDE_INT_FIELD.

Referenced by cse_tests(), and find_common_test().

◆ same_pattern_p()

static bool same_pattern_p ( merge_pattern_info * pat1,
merge_pattern_info * pat2 )
static
PAT2 is a subpattern of PAT1.  Return true if PAT2 should be inlined
into PAT1's C routine.   

References ggc_alloc(), and useful_pattern_p().

Referenced by populate_pattern_routine(), and split_out_patterns().

◆ set_parameter()

static bool set_parameter ( vec< parameter > & params,
unsigned int id,
const parameter & value )
static
PARAMS is an array of the parameters that a state is going to pass
to a pattern routine.  It is still incomplete; index I has a kind of
parameter::UNSET if we don't yet know what the state will pass
as parameter I.  Try to make parameter ID equal VALUE, returning
true on success.   

References force_unique_params_p, i, and parameter::UNSET.

Referenced by merge_patterns().

◆ simplify_tests()

◆ single_statement_p()

static bool single_statement_p ( const acceptance_type & acceptance)
static
Return true if ACCEPTANCE requires only a single C statement even in
a backtracking context.   

References acceptance_type::full, gcc_unreachable, acceptance_type::num_clobbers, acceptance_type::partial_p, PEEPHOLE2, RECOG, SPLIT, SUBPATTERN, acceptance_type::type, and acceptance_type::u.

Referenced by print_decision().

◆ special_predicate_operand_p()

static bool special_predicate_operand_p ( rtx operand)
static
Return true if OPERAND is a MATCH_OPERAND using a special predicate
function.   

References GET_CODE, ggc_alloc(), lookup_predicate(), NULL, predicate_name(), and pred_data::special.

Referenced by validate_pattern().

◆ split_out_patterns()

◆ subroutine_candidate_cmp()

static int subroutine_candidate_cmp ( const void * a,
const void * b )
static
Sort two subroutine_candidates so that the one with the largest
number of statements comes last.   

References a, and b.

Referenced by find_subroutines().

◆ terminal_pattern_p()

static bool terminal_pattern_p ( decision * d,
unsigned int * base_out,
unsigned int * count_out )
static
Return true if D is a call to a pattern routine and if there is some X
such that the transition for pattern result N goes to a successful return
with code X+N.  When returning true, set *BASE_OUT to this X and *COUNT_OUT
to the number of return values.  (We know that every PATTERN decision has
a transition for every successful return.)   

References rtx_test::ACCEPT, count, list_head< T >::first, ggc_alloc(), rtx_test::kind, rtx_test::PATTERN, and decision::test.

Referenced by print_decision().

◆ test_position_available_p()

static bool test_position_available_p ( output_state * os,
const rtx_test & test )
static
Return true if TEST doesn't test an rtx or if the rtx it tests is
already available in state OS.   

References position::id, rtx_test::pos, and rtx_test::pos_operand.

Referenced by print_decision().

◆ transition_parameter_type()

◆ update_parameters()

static void update_parameters ( vec< parameter > & to,
const vec< parameter > & from )
static
Update TO for any parameters that have been added to FROM since TO
was last set.  The extra parameters in FROM will be constants or
instructions to duplicate earlier parameters.   

References i.

Referenced by merge_patterns(), split_out_patterns(), and use_pattern().

◆ use_pattern()

static void use_pattern ( merge_state_info * sinfo)
static
We have decided to replace SINFO's state with a call to a pattern
routine.  Make the change, creating a definition of the pattern routine
if it doesn't have one already.   

References init_pattern_use(), merge_pattern_info::params, merge_state_result::params, merge_state_result::pattern, populate_pattern_use(), list_head< T >::push_back(), list_head< T >::release(), sinfo::s, and update_parameters().

Referenced by split_out_patterns().

◆ useful_pattern_p()

static bool useful_pattern_p ( merge_pattern_info * pat)
static
True if PAT would be useful as a subroutine.   

References MIN_COMBINE_COST, and merge_pattern_info::num_statements.

Referenced by same_pattern_p(), and split_out_patterns().

◆ valid_result_p()

static bool valid_result_p ( merge_pattern_info * pat,
merge_state_info * sinfo )
static
PAT was previously matched against SINFO based on tentative matches
for the target states of SINFO's state.  Return true if the match
still holds; that is, if the target states of SINFO's state still
match the corresponding transitions of PAT.   

References ggc_alloc(), and merge_pattern_info::transitions.

Referenced by prune_invalid_results(), and split_out_patterns().

◆ validate_pattern()

static void validate_pattern ( rtx pattern,
md_rtx_info * info,
rtx set,
int set_code )
static

◆ write_header()

static void write_header ( void )
static
Begin the output file.   

References ggc_alloc().

Referenced by main().

Variable Documentation

◆ collapse_optional_decisions_p

const bool collapse_optional_decisions_p = true
static

◆ cse_tests_p

const bool cse_tests_p = true
static

◆ force_unique_params_p

const bool force_unique_params_p = true
static
Whether to require each parameter passed to a pattern routine to be
unique.  Disabling this check for example allows unary operators with
matching modes (like NEG) and unary operators with mismatched modes
(like ZERO_EXTEND) to be matched by a single pattern.  However, we then
often have cases where the same value is passed too many times.   

Referenced by add_parameter(), and set_parameter().

◆ mark_optional_transitions_p

const bool mark_optional_transitions_p = false
static
Whether to add comments for optional tests that we decided to keep.
Can be useful when debugging the generator itself but is noise when
debugging the generated code.   

Referenced by print_decision().

◆ MAX_DEPTH

const unsigned int MAX_DEPTH = 6
static
The maximum (approximate) depth of block nesting that an individual
routine or subroutine should have.  This limit is about keeping the
output readable rather than reducing compile time.   

Referenced by find_subroutines().

◆ MAX_NUM_STATEMENTS

const unsigned int MAX_NUM_STATEMENTS = 200
static
The number of pseudo-statements a state can have before we consider
splitting out substates into subroutines.  This limit is about avoiding
compile-time problems with very big functions (and also about keeping
functions within --param optimization limits, etc.).   

Referenced by find_subroutines().

◆ MAX_PATTERN_PARAMS

const unsigned int MAX_PATTERN_PARAMS = 5
static
The maximum number of arguments that a pattern routine can have.
The idea is to prevent one pattern getting a ridiculous number of
arguments when it would be more beneficial to have a separate pattern
routine instead.   

Referenced by add_parameter().

◆ merge_states_p

const bool merge_states_p = true
static
Debugging variables to control which optimizations are performed.
Note that disabling merge_states_p leads to very large output.   

Referenced by match_pattern().

◆ MIN_COMBINE_COST

const unsigned int MIN_COMBINE_COST = 4
static
The minimum number of pseudo-statements that can be used in a pattern
routine.   

Referenced by useful_pattern_p().

◆ MIN_NUM_STATEMENTS

const unsigned int MIN_NUM_STATEMENTS = 5
static
The minimum number of pseudo-statements that a state must have before
we split it out into a subroutine.   

Referenced by find_subroutines().

◆ num_operands

static int num_operands
The maximum operand number plus one.   

Referenced by gen_proto(), match_pattern_2(), and optimize_subroutine_group().

◆ num_positions

unsigned int num_positions = 1
static
The number of positions created.  Also one higher than the maximum
position id.   

Referenced by main(), next_position(), optimize_subroutine_group(), and print_subroutine_start().

◆ pattern_c_test_p

const bool pattern_c_test_p = false
static
Whether pattern routines should be allowed to test .md file C conditions.
This requires passing insn around as a parameter, in case the C
condition refers to it.  In practice this tends to lead to bigger
object files.   

Referenced by split_out_patterns().

◆ pattern_def_states

unsigned int pattern_def_states
static
The number of states used while defining pattern routines.   

Referenced by populate_pattern_routine(), and split_out_patterns().

◆ pattern_have_num_clobbers_p

const bool pattern_have_num_clobbers_p = true
static
Whether pattern routines should be allowed to test whether pnum_clobbers
is null.  This requires passing pnum_clobbers around as a parameter.   

Referenced by split_out_patterns().

◆ pattern_use_states

unsigned int pattern_use_states
static
The number of states that were removed by calling pattern routines.   

Referenced by populate_pattern_use(), and split_out_patterns().

◆ patterns

vec<pattern_routine *> patterns
static
All defined patterns.   

Referenced by init_pattern_use(), and main().

◆ peep2_insn_pos_list

struct position* peep2_insn_pos_list = &root_pos
static
A list of all POS_PEEP2_INSNs.  The entry for insn 0 is the root position,
since we are given that instruction's pattern as x0.   

Referenced by match_pattern_1().

◆ relative_patterns_p

const bool relative_patterns_p = false
static
Whether pattern routines should calculate positions relative to their
rtx parameter rather than use absolute positions.  This e.g. allows
a pattern routine to be shared between a plain SET and a PARALLEL
that includes a SET.

In principle it sounds like this should be useful, especially for
recog_for_combine, where the plain SET form is generated automatically
from a PARALLEL of a single SET and some CLOBBERs.  In practice it doesn't
seem to help much and leads to slightly bigger object files.   

Referenced by test_pattern_hasher::equal(), test_pattern_hasher::hash(), and merge_relative_positions().

◆ root_pos

struct position root_pos
static
The root position (x0).   

Referenced by match_pattern_1(), optimize_subroutine_group(), and print_subroutine().

◆ simplify_tests_p

const bool simplify_tests_p = true
static

◆ TESTED_CODE

const unsigned char TESTED_CODE = 1
Indicates that we have tested GET_CODE (X) for a particular rtx X.   

Referenced by cse_tests(), and safe_to_hoist_p().

◆ TESTED_VECLEN

const unsigned char TESTED_VECLEN = 2
Indicates that we have tested XVECLEN (X, 0) for a particular rtx X.   

Referenced by cse_tests(), and safe_to_hoist_p().

◆ use_operand_variables_p

const bool use_operand_variables_p = true
static

◆ use_pattern_routines_p

const bool use_pattern_routines_p = true
static

Referenced by main().

◆ use_subroutines_p

const bool use_subroutines_p = true
static

Referenced by print_subroutine_group().