GCC Middle and Back End API Reference
genautomata.cc File Reference
#include "bconfig.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "rtl.h"
#include "obstack.h"
#include "errors.h"
#include "gensupport.h"
#include <math.h>
#include "fnmatch.h"
Include dependency graph for genautomata.cc:

Data Structures

struct  ticker
 
struct  unit_decl
 
struct  bypass_decl
 
struct  automaton_decl
 
struct  excl_rel_decl
 
struct  unit_pattern_rel_decl
 
struct  reserv_decl
 
struct  insn_reserv_decl
 
struct  decl
 
struct  unit_regexp
 
struct  reserv_regexp
 
struct  nothing_regexp
 
struct  sequence_regexp
 
struct  repeat_regexp
 
struct  allof_regexp
 
struct  oneof_regexp
 
struct  regexp
 
struct  description
 
struct  unit_set_el
 
struct  pattern_set_el
 
struct  pattern_reserv
 
class  state
 
struct  arc
 
struct  alt_state
 
struct  ainsn
 
struct  automaton
 
struct  automata_list_el
 
struct  state_ainsn_table
 
struct  unit_usage
 

Macros

#define CHAR_BIT   8
 
#define NO_MINIMIZATION_OPTION   "-no-minimization"
 
#define TIME_OPTION   "-time"
 
#define STATS_OPTION   "-stats"
 
#define V_OPTION   "-v"
 
#define W_OPTION   "-w"
 
#define NDFA_OPTION   "-ndfa"
 
#define COLLAPSE_OPTION   "-collapse-ndfa"
 
#define NO_COMB_OPTION   "-no-comb-vect"
 
#define PROGRESS_OPTION   "-progress"
 
#define DECL_UNIT(d)   (&(d)->decl.unit)
 
#define DECL_BYPASS(d)   (&(d)->decl.bypass)
 
#define DECL_AUTOMATON(d)   (&(d)->decl.automaton)
 
#define DECL_EXCL(d)   (&(d)->decl.excl)
 
#define DECL_PRESENCE(d)   (&(d)->decl.presence)
 
#define DECL_ABSENCE(d)   (&(d)->decl.absence)
 
#define DECL_RESERV(d)   (&(d)->decl.reserv)
 
#define DECL_INSN_RESERV(d)   (&(d)->decl.insn_reserv)
 
#define REGEXP_UNIT(r)   (&(r)->regexp.unit)
 
#define REGEXP_RESERV(r)   (&(r)->regexp.reserv)
 
#define REGEXP_SEQUENCE(r)   (&(r)->regexp.sequence)
 
#define REGEXP_REPEAT(r)   (&(r)->regexp.repeat)
 
#define REGEXP_ALLOF(r)   (&(r)->regexp.allof)
 
#define REGEXP_ONEOF(r)   (&(r)->regexp.oneof)
 
#define XCREATENODE(T)   ((T *) create_node (sizeof (T)))
 
#define XCREATENODEVEC(T, N)   ((T *) create_node (sizeof (T) * (N)))
 
#define XCREATENODEVAR(T, S)   ((T *) create_node ((S)))
 
#define XCOPYNODE(T, P)   ((T *) copy_node ((P), sizeof (T)))
 
#define XCOPYNODEVEC(T, P, N)   ((T *) copy_node ((P), sizeof (T) * (N)))
 
#define XCOPYNODEVAR(T, P, S)   ((T *) copy_node ((P), (S)))
 
#define NOTHING_NAME   "nothing"
 
#define bitmap_set_bit(bitstring, bitno)
 
#define CLEAR_BIT(bitstring, bitno)
 
#define bitmap_bit_p(bitstring, bitno)
 
#define MAX_FLOATING_POINT_VALUE_FOR_AUTOMATON_BOUND   1.0E37
 
#define CHIP_NAME   "DFA_chip"
 
#define ADVANCE_CYCLE_VALUE_NAME   "DFA__ADVANCE_CYCLE"
 
#define COLLAPSE_NDFA_VALUE_NAME   "NDFA__COLLAPSE"
 
#define CPU_UNITS_QUERY_MACRO_NAME   "CPU_UNITS_QUERY"
 
#define INTERNAL_MIN_ISSUE_DELAY_FUNC_NAME   "internal_min_issue_delay"
 
#define STATE_TYPE_NAME   "state_t"
 
#define INTERNAL_TRANSITION_FUNC_NAME   "internal_state_transition"
 
#define INTERNAL_RESET_FUNC_NAME   "internal_reset"
 
#define INTERNAL_DEAD_LOCK_FUNC_NAME   "internal_state_dead_lock_p"
 
#define INTERNAL_INSN_LATENCY_FUNC_NAME   "internal_insn_latency"
 
#define DFA_INSN_CODES_VARIABLE_NAME   "dfa_insn_codes"
 
#define DFA_INSN_CODES_LENGTH_VARIABLE_NAME   "dfa_insn_codes_length"
 
#define SIZE_FUNC_NAME   "state_size"
 
#define TRANSITION_FUNC_NAME   "state_transition"
 
#define MIN_ISSUE_DELAY_FUNC_NAME   "min_issue_delay"
 
#define MIN_INSN_CONFLICT_DELAY_FUNC_NAME   "min_insn_conflict_delay"
 
#define DEAD_LOCK_FUNC_NAME   "state_dead_lock_p"
 
#define RESET_FUNC_NAME   "state_reset"
 
#define INSN_LATENCY_FUNC_NAME   "insn_latency"
 
#define PRINT_RESERVATION_FUNC_NAME   "print_reservation"
 
#define GET_CPU_UNIT_CODE_FUNC_NAME   "get_cpu_unit_code"
 
#define CPU_UNIT_RESERVATION_P_FUNC_NAME   "cpu_unit_reservation_p"
 
#define INSN_HAS_DFA_RESERVATION_P_FUNC_NAME   "insn_has_dfa_reservation_p"
 
#define DFA_CLEAN_INSN_CACHE_FUNC_NAME   "dfa_clean_insn_cache"
 
#define DFA_CLEAR_SINGLE_INSN_CACHE_FUNC_NAME   "dfa_clear_single_insn_cache"
 
#define DFA_START_FUNC_NAME   "dfa_start"
 
#define DFA_FINISH_FUNC_NAME   "dfa_finish"
 
#define STATE_NAME   "state"
 
#define INSN_PARAMETER_NAME   "insn"
 
#define INSN2_PARAMETER_NAME   "insn2"
 
#define CHIP_PARAMETER_NAME   "chip"
 
#define FILE_PARAMETER_NAME   "f"
 
#define CPU_UNIT_NAME_PARAMETER_NAME   "cpu_unit_name"
 
#define CPU_CODE_PARAMETER_NAME   "cpu_unit_code"
 
#define INTERNAL_INSN_CODE_NAME   "insn_code"
 
#define INTERNAL_INSN2_CODE_NAME   "insn2_code"
 
#define TEMPORARY_VARIABLE_NAME   "temp"
 
#define I_VARIABLE_NAME   "i"
 
#define RESULT_VARIABLE_NAME   "res"
 
#define INTERNAL_DFA_INSN_CODE_FUNC_NAME   "internal_dfa_insn_code"
 
#define DFA_INSN_CODE_FUNC_NAME   "dfa_insn_code"
 
#define NAME_CODE_STRUCT_NAME   "name_code"
 
#define NAME_CODE_TABLE_NAME   "name_code_table"
 
#define NAME_MEMBER_NAME   "name"
 
#define CODE_MEMBER_NAME   "code"
 
#define CMP_VARIABLE_NAME   "cmp"
 
#define LOW_VARIABLE_NAME   "l"
 
#define MIDDLE_VARIABLE_NAME   "m"
 
#define HIGH_VARIABLE_NAME   "h"
 
#define MAX_LINE_LENGTH   70
 
#define STANDARD_OUTPUT_DESCRIPTION_FILE_SUFFIX   ".dfa"
 

Typedefs

typedef int pos_t
 
typedef unsigned HOST_WIDE_INT set_el_t
 
typedef set_el_treserv_sets_t
 
typedef const set_el_tconst_reserv_sets_t
 
typedef struct ticker ticker_t
 
typedef HOST_WIDE_INT vect_el_t
 
typedef struct unit_declunit_decl_t
 
typedef const struct unit_declconst_unit_decl_t
 
typedef struct decldecl_t
 
typedef const struct declconst_decl_t
 
typedef struct regexpregexp_t
 
typedef struct unit_set_elunit_set_el_t
 
typedef struct pattern_set_elpattern_set_el_t
 
typedef struct pattern_reservpattern_reserv_t
 
typedef struct alt_statealt_state_t
 
typedef struct statestate_t
 
typedef const struct stateconst_state_t
 
typedef struct arcarc_t
 
typedef struct ainsnainsn_t
 
typedef struct automatonautomaton_t
 
typedef struct automata_list_elautomata_list_el_t
 
typedef const struct automata_list_elconst_automata_list_el_t
 
typedef struct state_ainsn_tablestate_ainsn_table_t
 
typedef vec< vect_el_tvla_hwint_t
 
typedef struct unit_usageunit_usage_t
 

Enumerations

enum  decl_mode {
  dm_unit , dm_bypass , dm_automaton , dm_excl ,
  dm_presence , dm_absence , dm_reserv , dm_insn_reserv
}
 
enum  regexp_mode {
  rm_unit , rm_reserv , rm_nothing , rm_sequence ,
  rm_repeat , rm_allof , rm_oneof
}
 

Functions

static regexp_t gen_regexp_sequence (const char *)
 
static void reserv_sets_or (reserv_sets_t, reserv_sets_t, reserv_sets_t)
 
static reserv_sets_t get_excl_set (reserv_sets_t)
 
static int check_presence_pattern_sets (reserv_sets_t, reserv_sets_t, int)
 
static int check_absence_pattern_sets (reserv_sets_t, reserv_sets_t, int)
 
static arc_t first_out_arc (const_state_t)
 
static arc_t next_out_arc (arc_t)
 
static voidcreate_node (size_t size)
 
static voidcopy_node (const void *from, size_t size)
 
static const charcheck_name (const char *name, pos_t pos)
 
static charnext_sep_el (const char **pstr, int sep, int par_flag)
 
static int n_sep_els (const char *s, int sep, int par_flag)
 
static char ** get_str_vect (const char *str, int *els_num, int sep, int paren_p)
 
static void gen_cpu_unit (md_rtx_info *info)
 
static void gen_query_cpu_unit (md_rtx_info *info)
 
static void gen_bypass (md_rtx_info *info)
 
static void gen_excl_set (md_rtx_info *info)
 
static void gen_presence_absence_set (md_rtx_info *info, int presence_p, int final_p)
 
static void gen_presence_set (md_rtx_info *info)
 
static void gen_final_presence_set (md_rtx_info *info)
 
static void gen_absence_set (md_rtx_info *info)
 
static void gen_final_absence_set (md_rtx_info *info)
 
static void gen_automaton (md_rtx_info *info)
 
static void gen_automata_option (md_rtx_info *info)
 
static regexp_t gen_regexp_el (const char *str)
 
static regexp_t gen_regexp_repeat (const char *str)
 
static regexp_t gen_regexp_allof (const char *str)
 
static regexp_t gen_regexp_oneof (const char *str)
 
static regexp_t gen_regexp (const char *str)
 
static void gen_reserv (md_rtx_info *info)
 
static void gen_insn_reserv (md_rtx_info *info)
 
static unsigned string_hash (const char *string)
 
static hashval_t automaton_decl_hash (const void *automaton_decl)
 
static int automaton_decl_eq_p (const void *automaton_decl_1, const void *automaton_decl_2)
 
static decl_t insert_automaton_decl (decl_t automaton_decl)
 
static decl_t find_automaton_decl (const char *name)
 
static void initiate_automaton_decl_table (void)
 
static void finish_automaton_decl_table (void)
 
static hashval_t insn_decl_hash (const void *insn_decl)
 
static int insn_decl_eq_p (const void *insn_decl_1, const void *insn_decl_2)
 
static decl_t insert_insn_decl (decl_t insn_decl)
 
static decl_t find_insn_decl (const char *name)
 
static void initiate_insn_decl_table (void)
 
static void finish_insn_decl_table (void)
 
static hashval_t decl_hash (const void *decl)
 
static int decl_eq_p (const void *decl_1, const void *decl_2)
 
static decl_t insert_decl (decl_t decl)
 
static decl_t find_decl (const char *name)
 
static void initiate_decl_table (void)
 
static void finish_decl_table (void)
 
static unit_set_el_t process_excls (char **names, int num, pos_t excl_pos)
 
static void add_excls (unit_set_el_t dest_list, unit_set_el_t source_list, pos_t excl_pos)
 
static unit_set_el_t process_presence_absence_names (char **names, int num, pos_t req_pos, int presence_p, int final_p)
 
static pattern_set_el_t process_presence_absence_patterns (char ***patterns, int num, pos_t req_pos, int presence_p, int final_p)
 
static void add_presence_absence (unit_set_el_t dest_list, pattern_set_el_t pattern_list, pos_t req_pos, int presence_p, int final_p)
 
static void insert_bypass (struct bypass_decl *bypass)
 
static void for_each_matching_insn (decl_t bypass, const char *pattern, void(*fn)(decl_t, decl_t, void *), void *data)
 
static void process_bypass_2 (decl_t model, decl_t out_insn_reserv, void *data)
 
static void process_bypass_1 (decl_t bypass, decl_t in_insn_reserv, void *data)
 
static void process_bypass (decl_t bypass)
 
static void process_decls (void)
 
static void check_automaton_usage (void)
 
static regexp_t process_regexp (regexp_t regexp)
 
static void process_regexp_decls (void)
 
static void check_usage (void)
 
static int loop_in_regexp (regexp_t regexp, decl_t start_decl)
 
static void check_loops_in_regexps (void)
 
static void process_regexp_cycles (regexp_t regexp, int max_start_cycle, int min_start_cycle, int *max_finish_cycle, int *min_finish_cycle)
 
static void evaluate_max_reserv_cycles (void)
 
static void check_all_description (void)
 
static ticker_t create_ticker (void)
 
static void ticker_off (ticker_t *ticker)
 
static void ticker_on (ticker_t *ticker)
 
static int active_time (ticker_t ticker)
 
static void print_active_time (FILE *f, ticker_t ticker)
 
static void add_advance_cycle_insn_decl (void)
 
static void add_collapse_ndfa_insn_decl (void)
 
static bool special_decl_p (struct insn_reserv_decl *decl)
 
static alt_state_t get_free_alt_state (void)
 
static void free_alt_state (alt_state_t alt_state)
 
static void free_alt_states (alt_state_t alt_states_list)
 
static int alt_state_cmp (const void *alt_state_ptr_1, const void *alt_state_ptr_2)
 
static alt_state_t uniq_sort_alt_states (alt_state_t alt_states_list)
 
static int alt_states_eq (alt_state_t alt_states_1, alt_state_t alt_states_2)
 
static void initiate_alt_states (void)
 
static void finish_alt_states (void)
 
static reserv_sets_t alloc_empty_reserv_sets (void)
 
static unsigned reserv_sets_hash_value (reserv_sets_t reservs)
 
static int reserv_sets_cmp (const_reserv_sets_t reservs_1, const_reserv_sets_t reservs_2)
 
static int reserv_sets_eq (const_reserv_sets_t reservs_1, const_reserv_sets_t reservs_2)
 
static void set_unit_reserv (reserv_sets_t reservs, int cycle_num, int unit_num)
 
static int test_unit_reserv (reserv_sets_t reservs, int cycle_num, int unit_num)
 
static int reserv_sets_are_intersected (reserv_sets_t operand_1, reserv_sets_t operand_2)
 
static void reserv_sets_shift (reserv_sets_t result, reserv_sets_t operand)
 
static void reserv_sets_and (reserv_sets_t result, reserv_sets_t operand_1, reserv_sets_t operand_2)
 
static void output_cycle_reservs (FILE *f, reserv_sets_t reservs, int start_cycle, int repetition_num)
 
static void output_reserv_sets (FILE *f, reserv_sets_t reservs)
 
static state_t get_free_state (int with_reservs, automaton_t automaton)
 
static void free_state (state_t state)
 
static hashval_t state_hash (const void *state)
 
static int state_eq_p (const void *state_1, const void *state_2)
 
static state_t insert_state (state_t state)
 
static void set_state_reserv (state_t state, int cycle_num, int unit_num)
 
static int intersected_state_reservs_p (state_t state1, state_t state2)
 
static state_t states_union (state_t state1, state_t state2, reserv_sets_t reservs)
 
static state_t state_shift (state_t state, reserv_sets_t reservs)
 
static void initiate_states (void)
 
static void finish_states (void)
 
static void free_arc (arc_t arc)
 
static void remove_arc (state_t from_state, arc_t arc)
 
static arc_t find_arc (state_t from_state, state_t to_state, ainsn_t insn)
 
static void add_arc (state_t from_state, state_t to_state, ainsn_t ainsn)
 
static void initiate_arcs (void)
 
static void finish_arcs (void)
 
static automata_list_el_t get_free_automata_list_el (void)
 
static void free_automata_list_el (automata_list_el_t automata_list_el)
 
static void free_automata_list (automata_list_el_t automata_list)
 
static hashval_t automata_list_hash (const void *automata_list)
 
static int automata_list_eq_p (const void *automata_list_1, const void *automata_list_2)
 
static void initiate_automata_lists (void)
 
static void automata_list_start (void)
 
static void automata_list_add (automaton_t automaton)
 
static automata_list_el_t automata_list_finish (void)
 
static void finish_automata_lists (void)
 
static void initiate_excl_sets (void)
 
static pattern_reserv_t form_reserv_sets_list (pattern_set_el_t pattern_list)
 
static void initiate_presence_absence_pattern_sets (void)
 
static regexp_t copy_insn_regexp (regexp_t regexp)
 
static regexp_t transform_1 (regexp_t regexp)
 
static regexp_t transform_2 (regexp_t regexp)
 
static regexp_t transform_3 (regexp_t regexp)
 
static regexp_t regexp_transform_func (regexp_t regexp, regexp_t(*func)(regexp_t regexp))
 
static regexp_t transform_regexp (regexp_t regexp)
 
static void transform_insn_regexps (void)
 
static void store_alt_unit_usage (regexp_t regexp, regexp_t unit, int cycle, int alt_num)
 
static bool unit_present_on_list_p (unit_usage_t list, unit_decl_t unit_decl)
 
static bool equal_alternatives_p (int alt1, int alt2, int n_alts, struct automaton_decl *excluded_automaton_decl)
 
static void check_regexp_units_distribution (const char *insn_reserv_name, regexp_t regexp)
 
static void check_unit_distributions_to_automata (void)
 
static int process_seq_for_forming_states (regexp_t regexp, automaton_t automaton, int curr_cycle)
 
static void finish_forming_alt_state (alt_state_t alt_state, automaton_t automaton)
 
static void process_alts_for_forming_states (regexp_t regexp, automaton_t automaton, int inside_oneof_p)
 
static void create_alt_states (automaton_t automaton)
 
static void form_ainsn_with_same_reservs (automaton_t automaton)
 
static reserv_sets_t form_reservs_matter (automaton_t automaton)
 
static void make_automaton (automaton_t automaton)
 
static void form_arcs_marked_by_insn (state_t state)
 
static int create_composed_state (state_t original_state, arc_t arcs_marked_by_insn, vec< state_t > *state_stack)
 
static void NDFA_to_DFA (automaton_t automaton)
 
static void pass_state_graph (state_t start_state, void(*applied_func)(state_t state))
 
static void pass_states (automaton_t automaton, void(*applied_func)(state_t state))
 
static void initiate_pass_states (void)
 
static void add_achieved_state (state_t state)
 
static void set_out_arc_insns_equiv_num (state_t state, int odd_iteration_flag)
 
static void clear_arc_insns_equiv_num (state_t state)
 
static int first_cycle_unit_presence (state_t state, int unit_num)
 
static void cache_presence (state_t state)
 
static int state_is_differed (state_t state, state_t another_state, int odd_iteration_flag)
 
static int compare_states_for_equiv (const void *state_ptr_1, const void *state_ptr_2)
 
static int init_equiv_class (vec< state_t > states, vec< state_t > *classes)
 
static void copy_equiv_class (vec< state_t > *to, vec< state_t > from)
 
static int partition_equiv_class (state_t first_state, int odd_iteration_flag, vec< state_t > *next_iteration_classes, int *new_equiv_class_num_ptr)
 
static void evaluate_equiv_classes (automaton_t automaton, vec< state_t > *equiv_classes)
 
static void merge_states (automaton_t automaton, const vec< state_t > &equiv_classes)
 
static void set_new_cycle_flags (state_t state)
 
static void minimize_DFA (automaton_t automaton)
 
static void incr_states_and_arcs_nums (state_t state)
 
static void count_states_and_arcs (automaton_t automaton, int *states_num, int *arcs_num)
 
static void build_automaton (automaton_t automaton)
 
static void set_order_state_num (state_t state)
 
static void enumerate_states (automaton_t automaton)
 
static ainsn_t insert_ainsn_into_equiv_class (ainsn_t ainsn, ainsn_t cyclic_equiv_class_insn_list)
 
static void delete_ainsn_from_equiv_class (ainsn_t equiv_class_insn)
 
static void process_insn_equiv_class (ainsn_t ainsn, arc_t *insn_arcs_array)
 
static void process_state_for_insn_equiv_partition (state_t state)
 
static void set_insn_equiv_classes (automaton_t automaton)
 
static double estimate_one_automaton_bound (void)
 
static int compare_max_occ_cycle_nums (const void *unit_decl_1, const void *unit_decl_2)
 
static void units_to_automata_heuristic_distr (void)
 
static void create_ainsns (automaton_t automaton)
 
static void units_to_automata_distr (void)
 
static void create_automata (void)
 
static void form_regexp (regexp_t regexp)
 
static const charregexp_representation (regexp_t regexp)
 
static void finish_regexp_representation (void)
 
static void output_range_type (FILE *f, long int min_range_value, long int max_range_value)
 
static void output_vect (vla_hwint_t vect)
 
static void output_chip_member_name (FILE *f, automaton_t automaton)
 
static void output_temp_chip_member_name (FILE *f, automaton_t automaton)
 
static void output_translate_vect_name (FILE *f, automaton_t automaton)
 
static void output_trans_full_vect_name (FILE *f, automaton_t automaton)
 
static void output_trans_comb_vect_name (FILE *f, automaton_t automaton)
 
static void output_trans_check_vect_name (FILE *f, automaton_t automaton)
 
static void output_trans_base_vect_name (FILE *f, automaton_t automaton)
 
static void output_min_issue_delay_vect_name (FILE *f, automaton_t automaton)
 
static void output_dead_lock_vect_name (FILE *f, automaton_t automaton)
 
static void output_reserved_units_table_name (FILE *f, automaton_t automaton)
 
static void output_state_member_type (FILE *f, automaton_t automaton)
 
static void output_chip_definitions (void)
 
static void output_translate_vect (automaton_t automaton)
 
static int comb_vect_p (state_ainsn_table_t tab)
 
static state_ainsn_table_t create_state_ainsn_table (automaton_t automaton)
 
static void output_state_ainsn_table (state_ainsn_table_t tab, const char *table_name, void(*output_full_vect_name_func)(FILE *, automaton_t), void(*output_comb_vect_name_func)(FILE *, automaton_t), void(*output_check_vect_name_func)(FILE *, automaton_t), void(*output_base_vect_name_func)(FILE *, automaton_t))
 
static void add_vect (state_ainsn_table_t tab, int vect_num, vla_hwint_t vect)
 
static int out_state_arcs_num (const_state_t state)
 
static int compare_transition_els_num (const void *state_ptr_1, const void *state_ptr_2)
 
static void add_vect_el (vla_hwint_t &vect, ainsn_t ainsn, int el_value)
 
static void add_states_vect_el (state_t state)
 
static void output_trans_table (automaton_t automaton)
 
static void output_min_issue_delay_table (automaton_t automaton)
 
static void output_dead_lock_vect (automaton_t automaton)
 
static void output_reserved_units_table (automaton_t automaton)
 
static void output_tables (void)
 
static void output_max_insn_queue_index_def (void)
 
static void output_insn_code_cases (void(*output_automata_list_code)(automata_list_el_t))
 
static void output_automata_list_min_issue_delay_code (automata_list_el_t automata_list)
 
static void output_internal_min_issue_delay_func (void)
 
static void output_automata_list_transition_code (automata_list_el_t automata_list)
 
static void output_internal_trans_func (void)
 
static void output_internal_insn_code_evaluation (const char *insn_name, const char *insn_code_name, int code)
 
static void output_dfa_insn_code_func (void)
 
static void output_trans_func (void)
 
static void output_min_issue_delay_func (void)
 
static void output_internal_dead_lock_func (void)
 
static void output_dead_lock_func (void)
 
static void output_internal_reset_func (void)
 
static void output_size_func (void)
 
static void output_reset_func (void)
 
static void output_min_insn_conflict_delay_func (void)
 
static void output_default_latencies (void)
 
static void output_internal_insn_latency_func (void)
 
static void output_internal_maximal_insn_latency_func (void)
 
static void output_insn_latency_func (void)
 
static void output_maximal_insn_latency_func (void)
 
static void output_print_reservation_func (void)
 
static int units_cmp (const void *unit1, const void *unit2)
 
static void output_get_cpu_unit_code_func (void)
 
static void output_cpu_unit_reservation_p (void)
 
static void output_insn_has_dfa_reservation_p (void)
 
static void output_dfa_clean_insn_cache_func (void)
 
static void output_dfa_start_func (void)
 
static void output_dfa_finish_func (void)
 
static void output_regexp (regexp_t regexp)
 
static void output_unit_set_el_list (unit_set_el_t list)
 
static void output_pattern_set_el_list (pattern_set_el_t list)
 
static void output_description (void)
 
static void output_automaton_name (FILE *f, automaton_t automaton)
 
static void output_automaton_units (automaton_t automaton)
 
static void add_state_reservs (state_t state)
 
static void output_state_arcs (state_t state)
 
static int state_reservs_cmp (const void *reservs_ptr_1, const void *reservs_ptr_2)
 
static void remove_state_duplicate_reservs (void)
 
static void output_state (state_t state)
 
static void output_automaton_descriptions (void)
 
static void output_statistics (FILE *f)
 
static void output_time_statistics (FILE *f)
 
static void generate (void)
 
static const charfile_name_suffix (const char *file_name)
 
static const charbase_file_name (const char *file_name)
 
static bool parse_automata_opt (const char *str)
 
static void initiate_automaton_gen (const char **argv)
 
static void check_automata_insn_issues (void)
 
static void add_automaton_state (state_t state)
 
static void form_important_insn_automata_lists (void)
 
static void expand_automata (void)
 
static void write_automata (void)
 
int main (int argc, const char **argv)
 

Variables

static pos_t no_pos = 0
 
static struct obstack irp
 
static int ndfa_flag
 
static int collapse_flag
 
static int no_minimization_flag
 
static int no_comb_flag
 
static int split_argument
 
static int time_flag
 
static int stats_flag
 
static int v_flag
 
static int progress_flag
 
static int w_flag
 
static FILEoutput_file
 
static FILEoutput_description_file
 
static charoutput_description_file_name
 
static struct description * description
 
static vec< decl_tdecls
 
static const charreserv_str
 
static htab_t automaton_decl_table
 
static struct decl work_automaton_decl
 
static htab_t insn_decl_table
 
static struct decl work_insn_decl
 
static htab_t decl_table
 
static struct decl work_decl
 
static int curr_loop_pass_num
 
static int automata_num
 
static ticker_t transform_time
 
static ticker_t NDFA_time
 
static ticker_t NDFA_to_DFA_time
 
static ticker_t minimize_time
 
static ticker_t equiv_time
 
static ticker_t automaton_generation_time
 
static ticker_t output_time
 
static ticker_t check_time
 
static ticker_t generation_time
 
static ticker_t all_time
 
static decl_t advance_cycle_insn_decl
 
static decl_t collapse_ndfa_insn_decl
 
static alt_state_t first_free_alt_state
 
static int allocated_alt_states_num = 0
 
static int max_cycles_num
 
static int els_in_cycle_reserv
 
static int els_in_reservs
 
static unit_decl_tunits_array
 
static reserv_sets_t temp_reserv
 
static htab_t state_table
 
static state_t first_free_state
 
static int curr_unique_state_num
 
static int allocated_states_num = 0
 
static arc_t first_free_arc
 
static int allocated_arcs_num = 0
 
static automata_list_el_t first_free_automata_list_el
 
static automata_list_el_t current_automata_list
 
static htab_t automata_list_table
 
static reserv_sets_t excl_set
 
static reserv_sets_tunit_excl_set_table
 
static pattern_reserv_tunit_presence_set_table
 
static pattern_reserv_tunit_final_presence_set_table
 
static pattern_reserv_tunit_absence_set_table
 
static pattern_reserv_tunit_final_absence_set_table
 
static int regexp_transformed_p
 
static int annotation_message_reported_p
 
static vec< decl_tautomaton_decls
 
static struct obstack unit_usages
 
static vec< unit_usage_tcycle_alt_unit_usages
 
static state_t state_being_formed
 
static alt_state_t alt_state_being_formed
 
static ainsn_t curr_ainsn
 
static int curr_state_graph_pass_num
 
static vec< state_tall_achieved_states
 
static int curr_counted_states_num
 
static int curr_counted_arcs_num
 
static int curr_state_order_num
 
static int undefined_vect_el_value
 
static vec< state_toutput_states_vect
 
static vec< reserv_sets_tstate_reservs
 
static vec< state_tautomaton_states
 

Macro Definition Documentation

◆ ADVANCE_CYCLE_VALUE_NAME

#define ADVANCE_CYCLE_VALUE_NAME   "DFA__ADVANCE_CYCLE"
This is name of macro value which is code of pseudo_insns
representing advancing cpu cycle and collapsing the NDFA.
Its value is used as internal code unknown insn.   

Referenced by output_insn_has_dfa_reservation_p(), output_internal_insn_code_evaluation(), output_min_issue_delay_func(), output_print_reservation_func(), output_tables(), and output_trans_func().

◆ bitmap_bit_p

#define bitmap_bit_p ( bitstring,
bitno )
Value:
((bitstring)[(bitno) / (sizeof (*(bitstring)) * CHAR_BIT)] >> \
(bitno) % (sizeof (*(bitstring)) * CHAR_BIT) & 1)
#define CHAR_BIT
Definition genautomata.cc:120
T * ggc_alloc(ALONE_CXX_MEM_STAT_INFO)
Definition ggc.h:184
Test if bit number bitno in the bitstring is set.  The macro is not
side effect proof.   

Referenced by update_list::add(), add_clobbers_to_eh_landing_pad(), add_conflict_from_region_landing_pads(), add_exit_phis_var(), add_graph_edge(), add_new_name_mapping(), add_partitioned_vars_to_ptset(), add_removable_extension(), add_store_equivs(), addr_object_size(), adjust_cleared_regs(), all_positions_needed_p(), analyze_access_subtree(), analyze_all_variable_accesses(), assign_by_spills(), assign_hard_reg(), assign_spill_hard_regs(), back_propagate_equivalences(), bb_in_loop_p(), sbr_lazy_vector::bb_range_p(), bb_seen_p(), bbs_ok_for_cmove_arith(), find_comparison_dom_walker::before_dom_children(), rewrite_dom_walker::before_dom_children(), rewrite_update_dom_walker::before_dom_children(), eliminate_dom_walker::before_dom_children(), bitmap_find_leader(), bitmap_set_contains_value(), bitmap_set_subtract_values(), loop_distribution::break_alias_scc_partitions(), build_access_from_expr_1(), build_bitint_stmt_ssa_conflicts(), build_insn_chain(), build_store_vectors(), build_succ_graph(), cached_can_duplicate_bb_p(), cached_make_edge(), calculate_equiv_gains(), calculate_livein_cands(), calculate_loop_reg_pressure(), call_may_clobber_ref_p_1(), can_decompose_p(), can_sm_ref_p(), cand_trans_fun(), range_def_chain::chain_import_p(), rt_bb_visited::check(), check_all_va_list_escapes(), check_argument_load(), check_for_plus_in_loops_1(), symtab_node::check_ifunc_callee_symtab_nodes(), check_va_list_escapes(), loop_distribution::classify_partition(), cleanup_control_flow_pre(), cleanup_empty_eh_merge_phis(), coalesce_bitint(), coalesce_spill_slots(), collect_object_sizes_for(), color_pass(), combine_reload_insn(), combine_reloads(), compute_always_reached(), compute_antic(), compute_antic_aux(), compute_builtin_object_size(), compute_dependence_clique(), compute_path_counts(), compute_topo_order(), condense_visit(), consider_split(), control_parents_preserved_p(), convert_local_reference_op(), convert_nonlocal_reference_op(), copy_cfg_body(), copy_loops(), create_access(), create_caps(), create_coalesce_list_for_region(), create_loop_allocnos(), create_variable_info_for_1(), cgraph_node::create_version_clone(), cse_find_path(), cse_main(), dce_process_block(), dead_debug_global_replace_temp(), dead_debug_insert_temp(), dead_debug_reset_uses(), dead_or_predicable(), df_analyze(), df_compact_blocks(), df_create_unused_note(), df_exit_block_uses_collect(), df_get_bb_dirty(), df_get_call_refs(), df_install_ref_incremental(), df_install_refs(), df_live_verify_transfer_functions(), df_lr_verify_transfer_functions(), df_md_bb_local_compute_process_def(), df_md_local_compute(), df_note_bb_compute(), df_notes_rescan(), df_print_word_regset(), df_prune_to_subcfg(), df_rd_bb_local_compute_process_def(), df_reg_chain_unlink(), df_remove_dead_eq_notes(), df_set_dead_notes_for_mw(), df_set_unused_notes_for_mw(), df_whole_mw_reg_dead_p(), df_whole_mw_reg_unused_p(), df_worklist_propagate_backward(), df_worklist_propagate_forward(), discover_loop(), do_ds_constraint(), do_remat(), do_rpo_vn_1(), do_sd_constraint(), draw_cfg_edges(), draw_cfg_nodes_no_loops(), dse_classify_store(), dse_step2(), dse_step3(), dse_step5(), phi_analyzer::dump(), range_def_chain::dump(), dump_bitmap_file(), dump_components(), dump_replaceable_exprs(), duplicate_loop_body_to_header_edge(), eh_region_may_contain_throw(), eh_region_outermost(), elim_backward(), elim_create(), elim_forward(), elim_unvisited_predecessor(), eliminate_phi(), eliminate_dom_walker::eliminate_stmt(), eliminate_tail_call(), eliminate_temp_copies(), eliminate_unnecessary_stmts(), execute_sm(), execute_update_addresses_taken(), path_range_query::exit_dependency_p(), expand_gimple_basic_block(), expand_gimple_cond(), expand_loc(), expand_one_ssa_partition(), expand_one_var(), expand_used_vars(), fast_dce(), fill_always_executed_in_1(), equiv_chain::find(), find_all_spills_for(), find_avail_set(), find_bypass_set(), find_costs_and_classes(), find_dummy_reload(), equiv_oracle::find_equiv_dom(), find_equivalent_node(), find_indirect_cycles(), find_invariants_body(), find_many_sub_basic_blocks(), find_moveable_pseudos(), infer_range_manager::exit_range_head::find_ptr(), relation_chain_head::find_relation(), dom_oracle::find_relation_block(), dom_oracle::find_relation_dom(), find_reload_regno_insns(), find_replaceable_in_bb(), find_ssa_names_to_propagate(), find_tail_calls(), find_va_list_reference(), find_what_var_points_to(), finish_taskreg_scan(), fix_bb_placements(), ipa_icf::sem_item_optimizer::fixup_pt_set(), fold_marked_statements(), foll_in_subgraph(), generate_edge_moves(), generate_loops_for_partition(), get_access_for_expr(), get_bb_avail_insn(), sbr_lazy_vector::get_bb_range(), get_gimple_for_ssa_name(), get_loop_body_in_if_conv_order(), get_loop_hot_path(), ssa_lazy_cache::get_range(), get_reg_known_equiv_p(), get_tm_region_blocks(), gimple_call_copy_skip_args(), gimple_equal_p(), gimple_flow_call_edges_add(), gimple_infer_range::gimple_infer_range(), gimple_lower_bitint(), gimplify_omp_for(), equiv_oracle::has_equiv_p(), ssa_lazy_cache::has_range(), infer_range_manager::has_range_p(), hoist_code(), hoist_memory_references(), improve_inheritance(), range_def_chain::in_chain_p(), independent_of_stmt_p(), inherit_in_ebb(), init_live_subregs(), initialize_parameter_reductions(), initialize_uninitialized_regs(), insert_store(), instrument_decisions(), interesting_dest_for_shprep_1(), invariant_p(), inverted_rev_post_order_compute(), ipa_pta_execute(), ipa_tm_diagnose_transaction(), ipa_tm_note_irrevocable(), ipa_tm_propagate_irr(), ipa_tm_scan_irr_blocks(), ipa_tm_scan_irr_function(), ipa_tm_transform_calls(), ipa_tm_transform_calls_1(), ipa_tm_transform_transaction(), ira_former_scratch_operand_p(), ira_former_scratch_p(), ira_loop_edge_freq(), ira_reassign_conflict_allocnos(), ira_reuse_stack_slot(), gori_map::is_export_p(), gori_map::is_import_p(), phi_group::is_modifier_p(), is_new_name(), is_old_name(), is_proper_for_analysis(), is_used_p(), path_oracle::killing_def(), label_visit(), latch_dominating_def(), live_track_live_p(), live_track_process_def(), loe_visit_block(), lower_omp_regimplify_p(), lra_coalesce(), lra_constraints(), lra_push_insn_1(), lra_split_hard_reg_for(), make_regs_eqv(), mark_all_reaching_defs_necessary_1(), ipa_param_body_adjustments::mark_dead_statements(), mark_def_interesting(), mark_def_sites(), mark_dfs_back_edges(), mark_elimination(), mark_nonssa_use(), mark_operand_necessary(), mark_reachable_blocks(), mark_use_interesting(), marked_for_renaming(), marked_insn_p(), vect_optimize_slp_pass::materialize(), maybe_optimize_var(), maybe_rewrite_mem_ref_base(), maybe_skip_until(), mem_might_overlap_already_clobbered_arg_p(), merge_object_sizes(), move_spill_restore(), multiplier_allowed_in_address_p(), must_not_spill_p(), need_for_split_p(), neuter_worker_single(), oacc_entry_exit_ok_1(), oacc_entry_exit_single_gang(), object_sizes_set(), omp_copy_decl_2(), one_store_motion_pass(), operand_to_remat(), phi_analyzer::operator[](), outermost_indep_loop(), output_cycle_reservs(), param_change_prob(), partition_is_global(), partition_view_bitmap(), perform_var_substitution(), pg_collect_alias_ddrs(), pg_unmark_merged_alias_ddrs(), place_prologue_for_one_component(), plus_stmt_object_size(), post_order_compute(), pre_delete(), pre_edge_insert(), pre_expr_DFS(), pre_expr_DFS(), pre_expr_reaches_here_p_work(), pred_blocks_visited_p(), ipa_param_body_adjustments::prepare_debug_expressions(), prepare_def_site_for(), prepare_names_to_update(), prescan_insns_for_dce(), process_bb(), process_bb_lives(), phi_analyzer::process_phi(), propagate_all_subaccesses(), propagate_allocno_info(), propagate_freq(), propagate_necessity(), propagate_rank(), propagate_unknowns(), uninit_analysis::prune_phi_opnds(), prune_unused_phi_nodes(), pseudo_prefix_title(), pt_solution_includes_1(), pt_solution_set_var(), push_allocno_to_stack(), push_reload(), query_loop_dependence(), dom_oracle::query_relation(), path_oracle::query_relation(), loop_distribution::rdg_build_partitions(), reachable_at_most_once(), ana::reachability< GraphTraits >::reachable_from_p(), record_set(), ref_indep_loop_p(), ref_maybe_used_by_call_p_1(), region_contains_p(), infer_range_manager::register_all_uses(), dom_oracle::register_relation(), equiv_oracle::register_relation(), dom_oracle::register_transitives(), regrename_analyze(), release_defs_bitset(), remap_gimple_stmt(), remove_inheritance_pseudos(), remove_path(), remove_reachable_equiv_notes(), remove_some_program_points_and_update_live_ranges(), remove_some_program_points_and_update_live_ranges(), remove_unreachable_eh_regions_worker(), remove_unreachable_handlers(), remove_unreachable_handlers_no_lp(), remove_unused_locals(), reorder_loops(), rev_post_order_and_mark_dfs_back_seme(), rewrite_debug_stmt_uses(), rewrite_expr_tree_parallel(), rewrite_update_phi_arguments(), rtl_flow_call_edges_add(), scan_rtx_reg(), scc_visit(), rtx_reuse_manager::seen_def_p(), set_allocno_somewhere_renamed_p(), set_parm_rtl(), set_uids_in_ptset(), set_union_with_increment(), should_hoist_expr_to_dom(), simplify_gimple_switch_label_vec(), pcom_worker::single_nonlooparound_use(), sm_seq_valid_bb(), solve_graph(), sort_and_splice_var_accesses(), spill_for(), spill_hard_reg_in_range(), spill_pseudos(), spill_pseudos(), split_function(), split_live_ranges_for_shrink_wrap(), split_part_set_ssa_name_p(), ssa_conflicts_test_p(), stack_var_conflict_p(), vect_optimize_slp_pass::start_choosing_layouts(), store_can_be_removed_p(), test_nonssa_use(), test_unit_reserv(), jump_threader::thread_around_empty_blocks(), jump_threader::thread_through_normal_block(), tm_memopt_compute_antic(), tm_memopt_compute_available(), tm_memopt_transform_blocks(), tm_region_init(), topo_visit(), ipa_icf::sem_item_optimizer::traverse_congruence_split(), tree_optimize_tail_calls_1(), tree_unroll_loops_completely_1(), tree_unswitch_single_loop(), try_apply_stack_adjustment(), try_peel_loop(), try_shrink_wrapping(), undistribute_bitref_for_vector(), undo_optional_reloads(), update_bad_spill_attribute(), update_bb_reg_pressure(), update_callee_keys(), fwd_jt_path_registry::update_cfg(), update_dominators_in_loop(), update_ebb_live_info(), update_equiv_regs(), use_pointer_for_field(), va_list_counter_struct_op(), va_list_ptr_read(), va_list_ptr_write(), validate_arglist(), value_dies_in_block_x(), vect_slp_check_for_roots(), vect_transform_slp_perm_load_1(), verify_live_on_entry(), verify_loop_structure(), verify_non_ssa_vars(), verify_sese(), verify_ssaname_freelists(), verify_use(), version_to_be_replaced_p(), visit_loadstore(), vt_find_locations(), and word_dce_process_block().

◆ bitmap_set_bit

#define bitmap_set_bit ( bitstring,
bitno )
Value:
((bitstring)[(bitno) / (sizeof (*(bitstring)) * CHAR_BIT)] |= \
HOST_WIDE_INT_1 << (bitno) % (sizeof (*(bitstring)) * CHAR_BIT))
#define HOST_WIDE_INT_1
Definition hwint.h:69
The page contains macros for work with bits strings.  We could use
standard gcc bitmap or sbitmap but it would result in difficulties
of building canadian cross.   
Set bit number bitno in the bit string.  The macro is not side
effect proof.   

Referenced by add_bb_to_cluster(), add_candidate_1(), add_control_edge(), add_exit_phis(), add_forwarder_blocks(), add_graph_edge(), add_implicit_graph_edge(), add_iv_candidate_derived_from_uses(), pcom_worker::add_looparound_copies(), add_new_name_mapping(), equiv_oracle::add_partial_equiv(), add_pred_graph_edge(), infer_range_manager::add_range(), ipa_icf::sem_item::add_reference(), add_regs_to_insn_regno_info(), add_ssa_edge(), add_stack_var_conflict(), add_store_equivs(), path_range_query::add_to_exit_dependencies(), add_to_partition_kill_list(), add_to_repl_tbl(), add_to_value(), analyze_function(), apply_clusters(), assign_by_spills(), assign_hard_reg(), assign_spill_hard_regs(), assign_temporarily(), avoid_type_punning_on_regs(), loop_distribution::bb_top_order_init(), bb_valid_for_noce_process_p(), bbs_ok_for_cmove_arith(), ipcp_modif_dom_walker::before_dom_children(), dom_opt_dom_walker::before_dom_children(), substitute_and_fold_dom_walker::before_dom_children(), bitmap_insert_into_set(), bitmap_set_range(), bitmap_set_subtract_expressions(), bitmap_value_insert_into_set(), bitmap_value_replace_in_set(), break_superblocks(), build_access_from_call_arg(), build_access_from_expr(), build_accesses_from_assign(), build_insn_chain(), build_pred_graph(), loop_distribution::build_rdg_partition_for_vertex(), build_store_vectors(), build_succ_graph(), cache_can_duplicate_bb_p(), cached_make_edge(), calculate_bb_reg_pressure(), calculate_equiv_gains(), calculate_gen_cands(), calculate_live_on_exit(), calculate_livein_cands(), cand_trans_fun(), change_loop(), check_dependency(), check_for_plus_in_loops_1(), check_forbidden_calls(), symtab_node::check_ifunc_callee_symtab_nodes(), check_reduction_path(), check_sibcall_argument_overlap(), check_va_list_escapes(), cleanup_control_expr_graph(), cleanup_control_flow_bb(), cleanup_control_flow_pre(), cleanup_empty_eh_merge_phis(), cleanup_tree_cfg_bb(), coalesce_bitint(), coalesce_with_default(), coalesced_allocno_conflict_p(), collect_object_sizes_for(), combine_and_move_insns(), compute_always_reached(), compute_antic(), compute_builtin_object_size(), compute_cprop_data(), compute_dependence_clique(), compute_dominance_frontiers(), hybrid_jt_simplifier::compute_exit_dependencies(), path_range_query::compute_exit_dependencies(), compute_idf(), compute_live_loop_exits(), compute_live_vars_visit(), compute_local_properties(), compute_local_properties(), compute_path_counts(), condense_visit(), control_parents_preserved_p(), convert_local_omp_clauses(), convert_nonlocal_omp_clauses(), create_block_for_threading(), create_coalesce_list_for_region(), create_expression_by_pieces(), create_insn_allocnos(), create_loop_allocnos(), create_new_chain(), create_variable_info_for_1(), cse_find_path(), cselib_expand_value_rtx_1(), curr_insn_transform(), dead_debug_add(), dead_debug_global_replace_temp(), dead_debug_insert_temp(), dead_debug_promote_uses(), dead_debug_reset_uses(), dead_or_predicable(), decompose_multiword_subregs(), delete_dead_or_redundant_assignment(), delete_dead_or_redundant_call(), deps_ok_for_redirect_from_bb_to_bb(), determine_dominators_for_sons(), determine_group_iv_cost_address(), determine_group_iv_cost_cond(), determine_group_iv_cost_generic(), determine_group_iv_costs(), df_analyze(), df_analyze_loop(), df_chain_create_bb(), df_compact_blocks(), 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_insn_rescan(), df_live_bb_local_compute(), df_live_set_all_dirty(), df_live_verify_transfer_functions(), df_lr_bb_local_compute(), df_lr_local_compute(), df_lr_verify_transfer_functions(), df_md_bb_local_compute_process_def(), df_md_simulate_artificial_defs_at_top(), df_md_simulate_one_insn(), df_mir_simulate_one_insn(), df_note_bb_compute(), df_notes_rescan(), df_rd_bb_local_compute_process_def(), df_rd_local_compute(), df_rd_simulate_artificial_defs_at_top(), df_rd_simulate_one_insn(), df_set_bb_dirty(), df_set_blocks(), df_set_unused_notes_for_mw(), df_simulate_finalize_backwards(), df_simulate_find_defs(), df_simulate_find_noclobber_defs(), df_simulate_find_uses(), df_simulate_initialize_backwards(), df_simulate_initialize_forwards(), df_simulate_uses(), df_word_lr_alloc(), df_word_lr_mark_ref(), df_worklist_dataflow(), df_worklist_propagate_backward(), df_worklist_propagate_forward(), dfs_broadcast_reachable_1(), dfs_find_deadend(), discover_loop(), discover_nonconstant_array_refs(), discover_nonconstant_array_refs_r(), disqualify_candidate(), do_complex_constraint(), ipa_icf::sem_item_optimizer::do_congruence_step_for_index(), do_ds_constraint(), do_invalidate(), do_pre_regular_insertion(), do_remat(), do_rpo_vn_1(), do_sd_constraint(), draw_cfg_edges(), draw_cfg_nodes_no_loops(), dse_classify_store(), dse_step1(), dse_step2(), dump_final_callee_vcg(), duplicate_loop_body_to_header_edge(), eh_region_outermost(), elim_backward(), elim_create(), elim_forward(), eliminate_dom_walker::eliminate_cleanup(), eliminate_dom_walker::eliminate_stmt(), eliminate_unnecessary_stmts(), equiv_oracle::equiv_set(), path_oracle::equiv_set(), estimate_loops(), estimate_loops_at_level(), execute_update_addresses_taken(), expand_call_inline(), expand_complex_comparison(), expand_vector_condition(), expr_expected_value_1(), fast_dce(), fill_always_executed_in(), find_always_executed_bbs(), find_call_stack_args(), find_conditions(), find_decomposable_shift_zext(), find_decomposable_subregs(), find_exits(), find_inv_vars_cb(), find_local_vars_to_propagate(), find_moveable_pseudos(), back_threader::find_paths_to_names(), find_pseudo_copy(), find_refs_for_sm(), find_same_succ_bb(), find_split_points(), find_tail_calls(), find_uses_to_rename_use(), find_vdef_in_loop(), fix_bb_live_info(), fix_bb_placements(), fix_loop_structure(), ipa_icf::sem_item_optimizer::fixup_pt_set(), fold_marked_statements(), form_reserv_sets_list(), gather_mem_refs_stmt(), gather_ssa_name_hash_map_from(), generate_summary(), get_live_on_other_edges(), get_loop_body_in_bfs_order(), get_loop_body_in_if_conv_order(), get_loop_hot_path(), get_nonnull_args(), get_range_strlen(), get_range_strlen_phi(), get_rank(), get_tm_region_blocks(), get_undefined_value_partitions(), gimple_ior_addresses_taken_1(), gimple_lower_bitint(), gimple_merge_blocks(), gimple_redirect_edge_and_branch(), gimplify_omp_for(), gimplify_size_expressions(), remove_unreachable::handle_early(), hardcfr_sibcall_search_block(), hardcfr_sibcall_search_preds(), hoist_code(), hoist_memory_references(), improve_allocation(), improve_inheritance(), inherit_in_ebb(), inherit_reload_reg(), init_alias_analysis(), init_live_reload_and_inheritance_pseudos(), init_live_subregs(), init_rename_info(), init_var_map(), initialize_uninitialized_regs(), initiate_excl_sets(), initiate_live_solver(), insert_into_preds_of_block(), insert_phi_nodes(), insert_updated_phi_nodes_for(), tree_loop_interchange::interchange_loops(), inverted_rev_post_order_compute(), ipa_reference_read_optimization_summary(), ipa_reference_write_optimization_summary(), ipa_tm_propagate_irr(), ipa_tm_scan_irr_blocks(), ipa_tm_transform_calls(), ira_create_allocno(), ira_reassign_conflict_allocnos(), ira_reassign_pseudos(), ira_register_new_scratch_op(), ira_sort_regnos_for_alter_reg(), tree_switch_conversion::bit_test_cluster::is_beneficial(), is_caller_ifunc_resolver(), is_maybe_undefined(), iterate_fix_dominators(), iv_ca_set_cp(), path_oracle::killing_def(), label_visit(), live_track_add_partition(), loe_visit_block(), loop_inverted_rev_post_order_compute(), loop_rev_post_order_compute(), lra_push_insn_1(), lra_remat(), lra_split_hard_reg_for(), lra_undo_inheritance(), lto_output(), make_dependent_on_partition(), make_edges(), make_hard_regno_dead(), make_hard_regno_live(), make_live_on_entry(), malloc_candidate_p_1(), tree_loop_interchange::map_inductions_to_loop(), mark_basic_block_deleted(), mark_bb_seen(), mark_block_for_update(), mark_conflict(), mark_control_dependent_edges_necessary(), mark_def_sites(), mark_dfs_back_edges(), mark_elimination(), mark_for_renaming(), mark_insn(), mark_last_stmt_necessary(), mark_nonssa_use(), mark_operand_necessary(), mark_phi_for_rewrite(), mark_reachable_handlers(), mark_ref_regs(), mark_regno_dead(), mark_regno_live(), mark_regno_live(), mark_replaceable(), mark_stmt_necessary(), fwd_jt_path_registry::mark_threaded_blocks(), match_simplify_replacement(), vect_optimize_slp_pass::materialize(), gori_map::maybe_add_gori(), maybe_add_sra_candidate(), maybe_lower_iteration_bound(), maybe_optimize_var(), maybe_remove_writeonly_store(), maybe_skip_until(), back_threader::maybe_thread_block(), merge_pseudos(), ssa_lazy_cache::merge_range(), move_stmt(), multiplier_allowed_in_address_p(), nearest_common_dominator_of_uses(), note_eh_region_may_contain_throw(), oacc_do_neutering(), oacc_entry_exit_ok(), oacc_entry_exit_ok_1(), object_sizes_set(), dom_opt_dom_walker::optimize_stmt(), optimize_va_list_gpr_fpr_size(), partition_view_bitmap(), partition_view_init(), perform_var_substitution(), place_prologue_for_one_component(), populate_coalesce_list_for_outofssa(), populate_single_mode_bitmaps(), post_order_compute(), pre_edge_insert(), pre_expr_DFS(), predcom_tmp_var(), predict_paths_for_bb(), process_bb_lives(), process_invariant_for_inheritance(), phi_analyzer::process_phi(), process_regs_for_copy(), process_replaceable(), update_list::propagation_failed(), prune_clobbered_mems(), prune_expressions(), prune_insertions_deletions(), uninit_analysis::prune_phi_opnds(), prune_unused_phi_nodes(), pt_solution_set_var(), ana::reachability< GraphTraits >::reachability(), reachable_at_most_once(), record_important_candidates(), record_invariant(), record_last_mem_set_info_common(), record_loop_dependence(), record_modified(), record_reg_sets(), record_set(), infer_range_manager::register_all_uses(), range_def_chain::register_dependency(), equiv_oracle::register_equiv(), equiv_oracle::register_initial_def(), equiv_oracle::register_relation(), path_oracle::register_relation(), regstat_bb_compute_calls_crossed(), regstat_bb_compute_ri(), release_ssa_name_after_update_ssa(), remove_edge_and_dominated_blocks(), remove_forwarder_block(), remove_path(), remove_prop_source_from_use(), remove_reachable_equiv_notes(), remove_some_program_points_and_update_live_ranges(), remove_some_program_points_and_update_live_ranges(), remove_unnecessary_allocnos(), remove_unreachable_handlers_no_lp(), remove_unused_ivs(), remove_unused_locals(), replace_scc_by_value(), replace_uses_by(), rewrite_blocks(), scan_reads(), scan_sharing_clauses(), scan_stores(), scc_visit(), sese_build_liveouts_use(), sbr_lazy_vector::set_bb_range(), set_bb_regs(), control_dependences::set_control_dependence_map_bit(), set_def_block(), range_def_chain::set_import(), set_is_used(), set_iv(), set_livein_block(), dom_oracle::set_one_relation(), set_parm_default_def_partition(), set_position_unneeded(), ssa_lazy_cache::set_range(), gori_map::set_range_invariant(), set_ref_loaded_in_loop(), set_ref_stored_in_loop(), set_reg_known_equiv_p(), rtx_reuse_manager::set_seen_def(), set_uids_in_ptset(), set_union_with_increment(), set_unit_reserv(), set_usage_bits(), set_var_live_on_entry(), setup_live_pseudos_and_spill_after_risky_transforms(), setup_try_hard_regno_pseudos(), should_hoist_expr_to_dom(), simple_dce_from_worklist(), simplify_gimple_switch_label_vec(), simplify_loop_version(), simplify_operand_subreg(), sm_seq_valid_bb(), solve_add_graph_edge(), solve_graph(), sorted_array_from_bitmap_set(), spill_for(), spill_pseudos(), split_all_insns(), pcom_worker::split_data_refs_to_components(), split_function(), split_live_ranges_for_shrink_wrap(), split_reg(), spread_components(), ssa_conflicts_add_one(), ssa_conflicts_merge(), vect_optimize_slp_pass::start_choosing_layouts(), jump_threader::thread_across_edge(), jump_threader::thread_around_empty_blocks(), thread_prologue_and_epilogue_insns(), jump_threader::thread_through_normal_block(), tidy_after_forward_propagate_addr(), tm_memopt_accumulate_memops(), tm_memopt_transform_blocks(), tm_region_init(), tm_region_init_1(), topo_visit(), tree_if_conversion(), tree_loop_unroll_and_jam(), tree_unroll_loops_completely(), tree_unroll_loops_completely_1(), tree_unswitch_single_loop(), try_peel_loop(), try_shrink_wrapping(), undistribute_ops_list(), loop_cand::undo_simple_reduction(), unify_nodes(), unroll_loop_constant_iterations(), unroll_loop_runtime_iterations(), update_alias_info_with_stack_vars(), update_bad_spill_attribute(), update_caller_keys(), update_complex_assignment(), update_dominators_in_loop(), update_ebb_live_info(), update_live_info(), update_lives(), use_pointer_for_field(), va_list_ptr_read(), relation_oracle::valid_equivs(), value_dies_in_block_x(), vect_slp_check_for_roots(), vect_slp_function(), vect_transform_slp_perm_load_1(), verify_loop_structure(), verify_non_ssa_vars(), verify_sese(), verify_ssa(), verify_ssaname_freelists(), verify_vssa(), visit_bb(), visit_conflict(), visit_op(), ssa_name_limit_t::visit_phi(), vt_find_locations(), and walk_aliased_vdefs_1().

◆ CHAR_BIT

#define CHAR_BIT   8
Pipeline hazard description translator.
   Copyright (C) 2000-2024 Free Software Foundation, Inc.

   Written by Vladimir Makarov <vmakarov@redhat.com>

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/>.   
References:

1. The finite state automaton based pipeline hazard recognizer and
   instruction scheduler in GCC.  V. Makarov.  Proceedings of GCC
   summit, 2003.

2. Detecting pipeline structural hazards quickly. T. Proebsting,
   C. Fraser. Proceedings of ACM SIGPLAN-SIGACT Symposium on
   Principles of Programming Languages, pages 280--286, 1994.

   This article is a good start point to understand usage of finite
   state automata for pipeline hazard recognizers.  But I'd
   recommend the 1st and 3rd article for more deep understanding.

3. Efficient Instruction Scheduling Using Finite State Automata:
   V. Bala and N. Rubin, Proceedings of MICRO-28.  This is the best
   article about usage of finite state automata for pipeline hazard
   recognizers.

The current implementation is described in the 1st article and it
is different from the 3rd article in the following:

1. New operator `|' (alternative) is permitted in functional unit
   reservation which can be treated deterministically and
   non-deterministically.

2. Possibility of usage of nondeterministic automata too.

3. Possibility to query functional unit reservations for given
   automaton state.

4. Several constructions to describe impossible reservations
   (`exclusion_set', `presence_set', `final_presence_set',
   `absence_set', and `final_absence_set').

5. No reverse automata are generated.  Trace instruction scheduling
   requires this.  It can be easily added in the future if we
   really need this.

6. Union of automaton states are not generated yet.  It is planned
   to be implemented.  Such feature is needed to make more accurate
   interlock insn scheduling to get state describing functional
   unit reservation in a joint CFG point.   
This file code processes constructions of machine description file
which describes automaton used for recognition of processor pipeline
hazards by insn scheduler and can be used for other tasks (such as
VLIW insn packing.

The translator functions `gen_cpu_unit', `gen_query_cpu_unit',
`gen_bypass', `gen_excl_set', `gen_presence_set',
`gen_final_presence_set', `gen_absence_set',
`gen_final_absence_set', `gen_automaton', `gen_automata_option',
`gen_reserv', `gen_insn_reserv' are called from file
`genattrtab.cc'.  They transform RTL constructions describing
automata in .md file into internal representation convenient for
further processing.

The translator major function `expand_automata' processes the
description internal representation into finite state automaton.
It can be divided on:

  o checking correctness of the automaton pipeline description
    (major function is `check_all_description').

  o generating automaton (automata) from the description (major
    function is `make_automaton').

  o optional transformation of nondeterministic finite state
    automata into deterministic ones if the alternative operator
    `|' is treated nondeterministically in the description (major
    function is NDFA_to_DFA).

  o optional minimization of the finite state automata by merging
    equivalent automaton states (major function is `minimize_DFA').

  o forming tables (some as comb vectors) and attributes
    representing the automata (functions output_..._table).

Function `write_automata' outputs the created finite state
automaton as different tables and functions which works with the
automata to inquire automaton state and to change its state.  These
function are used by gcc instruction scheduler and may be some
other gcc code.   

Referenced by add_vect(), automata_list_hash(), bitmap_get_aligned_chunk(), bitmap_set_aligned_chunk(), cache_presence(), check_absence_pattern_sets(), check_presence_pattern_sets(), compare_states_for_equiv(), const_rtx_hash_1(), const_with_all_bytes_same(), constant_byte_string(), strlen_pass::count_nonzero_bytes(), do_mpfr_remquo(), fold_view_convert_expr(), fprint_whex(), wi::from_mpz(), get_excl_set(), wi::primitive_int_traits< T, signed_p >::get_precision(), gimple_fold_builtin_clear_padding(), gimple_fold_builtin_memset(), hash_table_mod1(), hash_table_mod2(), hwasan_increment_frame_tag(), initiate_states(), input_struct_function_base(), ira_setup_alts(), md_decimal_string(), wi::mul_internal(), native_encode_string(), output_cycle_reservs(), output_struct_function_base(), popcount_hwi(), vn_walk_cb_data::push_partial_def(), reserv_sets_hash_value(), set_unit_reserv(), simplify_builtin_call(), state_hash(), state_is_differed(), string_hash(), test_unit_reserv(), tree_add_const_value_attribute(), visit_nary_op(), and vn_reference_lookup_3().

◆ CHIP_NAME

◆ CHIP_PARAMETER_NAME

◆ CLEAR_BIT

#define CLEAR_BIT ( bitstring,
bitno )
Value:
((bitstring)[(bitno) / (sizeof (*(bitstring)) * CHAR_BIT)] &= \
~(HOST_WIDE_INT_1 << (bitno) % (sizeof (*(bitstring)) * CHAR_BIT)))

◆ CMP_VARIABLE_NAME

#define CMP_VARIABLE_NAME   "cmp"
The following macro values are local variable names for function
`get_cpu_unit_code'.   

Referenced by output_get_cpu_unit_code_func().

◆ CODE_MEMBER_NAME

#define CODE_MEMBER_NAME   "code"

◆ COLLAPSE_NDFA_VALUE_NAME

#define COLLAPSE_NDFA_VALUE_NAME   "NDFA__COLLAPSE"

Referenced by output_tables(), and output_trans_func().

◆ COLLAPSE_OPTION

#define COLLAPSE_OPTION   "-collapse-ndfa"

◆ CPU_CODE_PARAMETER_NAME

#define CPU_CODE_PARAMETER_NAME   "cpu_unit_code"

◆ CPU_UNIT_NAME_PARAMETER_NAME

#define CPU_UNIT_NAME_PARAMETER_NAME   "cpu_unit_name"

◆ CPU_UNIT_RESERVATION_P_FUNC_NAME

#define CPU_UNIT_RESERVATION_P_FUNC_NAME   "cpu_unit_reservation_p"

◆ CPU_UNITS_QUERY_MACRO_NAME

#define CPU_UNITS_QUERY_MACRO_NAME   "CPU_UNITS_QUERY"
Name of the PHR interface macro.   

Referenced by output_reserved_units_table(), and write_automata().

◆ DEAD_LOCK_FUNC_NAME

#define DEAD_LOCK_FUNC_NAME   "state_dead_lock_p"

Referenced by output_dead_lock_func().

◆ DECL_ABSENCE

#define DECL_ABSENCE ( d)    (&(d)->decl.absence)

◆ DECL_AUTOMATON

◆ DECL_BYPASS

◆ DECL_EXCL

#define DECL_EXCL ( d)    (&(d)->decl.excl)

Referenced by gen_excl_set(), and process_decls().

◆ DECL_INSN_RESERV

◆ DECL_PRESENCE

#define DECL_PRESENCE ( d)    (&(d)->decl.presence)

◆ DECL_RESERV

◆ DECL_UNIT

◆ DFA_CLEAN_INSN_CACHE_FUNC_NAME

#define DFA_CLEAN_INSN_CACHE_FUNC_NAME   "dfa_clean_insn_cache"

◆ DFA_CLEAR_SINGLE_INSN_CACHE_FUNC_NAME

#define DFA_CLEAR_SINGLE_INSN_CACHE_FUNC_NAME   "dfa_clear_single_insn_cache"

◆ DFA_FINISH_FUNC_NAME

#define DFA_FINISH_FUNC_NAME   "dfa_finish"

Referenced by output_dfa_finish_func().

◆ DFA_INSN_CODE_FUNC_NAME

#define DFA_INSN_CODE_FUNC_NAME   "dfa_insn_code"

◆ DFA_INSN_CODES_LENGTH_VARIABLE_NAME

#define DFA_INSN_CODES_LENGTH_VARIABLE_NAME   "dfa_insn_codes_length"
Name of length of cache of insn dfa codes.   

Referenced by output_dfa_clean_insn_cache_func(), output_dfa_insn_code_func(), output_dfa_start_func(), and write_automata().

◆ DFA_INSN_CODES_VARIABLE_NAME

#define DFA_INSN_CODES_VARIABLE_NAME   "dfa_insn_codes"

◆ DFA_START_FUNC_NAME

#define DFA_START_FUNC_NAME   "dfa_start"

Referenced by output_dfa_start_func().

◆ FILE_PARAMETER_NAME

#define FILE_PARAMETER_NAME   "f"

◆ GET_CPU_UNIT_CODE_FUNC_NAME

#define GET_CPU_UNIT_CODE_FUNC_NAME   "get_cpu_unit_code"

◆ HIGH_VARIABLE_NAME

#define HIGH_VARIABLE_NAME   "h"

◆ I_VARIABLE_NAME

#define I_VARIABLE_NAME   "i"

◆ INSN2_PARAMETER_NAME

#define INSN2_PARAMETER_NAME   "insn2"

◆ INSN_HAS_DFA_RESERVATION_P_FUNC_NAME

#define INSN_HAS_DFA_RESERVATION_P_FUNC_NAME   "insn_has_dfa_reservation_p"

◆ INSN_LATENCY_FUNC_NAME

#define INSN_LATENCY_FUNC_NAME   "insn_latency"

◆ INSN_PARAMETER_NAME

◆ INTERNAL_DEAD_LOCK_FUNC_NAME

#define INTERNAL_DEAD_LOCK_FUNC_NAME   "internal_state_dead_lock_p"

◆ INTERNAL_DFA_INSN_CODE_FUNC_NAME

#define INTERNAL_DFA_INSN_CODE_FUNC_NAME   "internal_dfa_insn_code"
Name of function (attribute) to translate insn into internal insn
code.   

Referenced by output_dfa_insn_code_func().

◆ INTERNAL_INSN2_CODE_NAME

#define INTERNAL_INSN2_CODE_NAME   "insn2_code"

◆ INTERNAL_INSN_CODE_NAME

◆ INTERNAL_INSN_LATENCY_FUNC_NAME

#define INTERNAL_INSN_LATENCY_FUNC_NAME   "internal_insn_latency"

◆ INTERNAL_MIN_ISSUE_DELAY_FUNC_NAME

#define INTERNAL_MIN_ISSUE_DELAY_FUNC_NAME   "internal_min_issue_delay"

◆ INTERNAL_RESET_FUNC_NAME

#define INTERNAL_RESET_FUNC_NAME   "internal_reset"

◆ INTERNAL_TRANSITION_FUNC_NAME

#define INTERNAL_TRANSITION_FUNC_NAME   "internal_state_transition"

◆ LOW_VARIABLE_NAME

#define LOW_VARIABLE_NAME   "l"

◆ MAX_FLOATING_POINT_VALUE_FOR_AUTOMATON_BOUND

#define MAX_FLOATING_POINT_VALUE_FOR_AUTOMATON_BOUND   1.0E37
This page contains code for creating DFA(s) and calls functions
building them.   
The following value is used to prevent floating point overflow for
estimating an automaton bound.  The value should be less DBL_MAX on
the host machine.  We use here approximate minimum of maximal
double floating point value required by ANSI C standard.  It
will work for non ANSI sun compiler too.   

Referenced by estimate_one_automaton_bound().

◆ MAX_LINE_LENGTH

#define MAX_LINE_LENGTH   70
Maximal length of line for pretty printing into description
file.   

Referenced by output_automaton_units(), and output_state_arcs().

◆ MIDDLE_VARIABLE_NAME

#define MIDDLE_VARIABLE_NAME   "m"

◆ MIN_INSN_CONFLICT_DELAY_FUNC_NAME

#define MIN_INSN_CONFLICT_DELAY_FUNC_NAME   "min_insn_conflict_delay"

◆ MIN_ISSUE_DELAY_FUNC_NAME

#define MIN_ISSUE_DELAY_FUNC_NAME   "min_issue_delay"

◆ NAME_CODE_STRUCT_NAME

#define NAME_CODE_STRUCT_NAME   "name_code"
The following macro value is name of struct containing unit name
and unit code.   

Referenced by output_get_cpu_unit_code_func().

◆ NAME_CODE_TABLE_NAME

#define NAME_CODE_TABLE_NAME   "name_code_table"
The following macro value is name of table of struct name_code.   

Referenced by output_get_cpu_unit_code_func().

◆ NAME_MEMBER_NAME

#define NAME_MEMBER_NAME   "name"
The following macro values are member names for struct name_code.   

Referenced by output_get_cpu_unit_code_func().

◆ NDFA_OPTION

#define NDFA_OPTION   "-ndfa"

◆ NO_COMB_OPTION

#define NO_COMB_OPTION   "-no-comb-vect"

Referenced by gen_automata_option().

◆ NO_MINIMIZATION_OPTION

#define NO_MINIMIZATION_OPTION   "-no-minimization"
Options with the following names can be set up in automata_option
construction.  Because the strings occur more one time we use the
macros.   

Referenced by gen_automata_option(), and parse_automata_opt().

◆ NOTHING_NAME

#define NOTHING_NAME   "nothing"
Name in reservation to denote absence reservation.   

Referenced by form_regexp(), gen_regexp_el(), output_cycle_reservs(), output_print_reservation_func(), and process_decls().

◆ PRINT_RESERVATION_FUNC_NAME

#define PRINT_RESERVATION_FUNC_NAME   "print_reservation"

◆ PROGRESS_OPTION

#define PROGRESS_OPTION   "-progress"

◆ REGEXP_ALLOF

◆ REGEXP_ONEOF

◆ REGEXP_REPEAT

◆ REGEXP_RESERV

#define REGEXP_RESERV ( r)    (&(r)->regexp.reserv)

◆ REGEXP_SEQUENCE

◆ REGEXP_UNIT

◆ RESET_FUNC_NAME

#define RESET_FUNC_NAME   "state_reset"

Referenced by output_reset_func().

◆ RESULT_VARIABLE_NAME

#define RESULT_VARIABLE_NAME   "res"
Name of result variable in some functions.   

Referenced by output_automata_list_min_issue_delay_code(), and output_internal_min_issue_delay_func().

◆ SIZE_FUNC_NAME

#define SIZE_FUNC_NAME   "state_size"
Names of the PHR interface functions:  

Referenced by output_size_func().

◆ STANDARD_OUTPUT_DESCRIPTION_FILE_SUFFIX

#define STANDARD_OUTPUT_DESCRIPTION_FILE_SUFFIX   ".dfa"
This page mainly contains top level functions of pipeline hazards
description translator.   
The following macro value is suffix of name of description file of
pipeline hazards description translator.   

Referenced by initiate_automaton_gen().

◆ STATE_NAME

#define STATE_NAME   "state"

◆ STATE_TYPE_NAME

#define STATE_TYPE_NAME   "state_t"

◆ STATS_OPTION

#define STATS_OPTION   "-stats"

◆ TEMPORARY_VARIABLE_NAME

#define TEMPORARY_VARIABLE_NAME   "temp"

◆ TIME_OPTION

#define TIME_OPTION   "-time"

◆ TRANSITION_FUNC_NAME

#define TRANSITION_FUNC_NAME   "state_transition"

Referenced by output_trans_func().

◆ V_OPTION

#define V_OPTION   "-v"

◆ W_OPTION

#define W_OPTION   "-w"

◆ XCOPYNODE

#define XCOPYNODE ( T,
P )   ((T *) copy_node ((P), sizeof (T)))

◆ XCOPYNODEVAR

#define XCOPYNODEVAR ( T,
P,
S )   ((T *) copy_node ((P), (S)))

Referenced by copy_insn_regexp().

◆ XCOPYNODEVEC

#define XCOPYNODEVEC ( T,
P,
N )   ((T *) copy_node ((P), sizeof (T) * (N)))

◆ XCREATENODE

◆ XCREATENODEVAR

◆ XCREATENODEVEC

#define XCREATENODEVEC ( T,
N )   ((T *) create_node (sizeof (T) * (N)))

Referenced by cache_presence().

Typedef Documentation

◆ ainsn_t

◆ alt_state_t

◆ arc_t

◆ automata_list_el_t

◆ automaton_t

◆ const_automata_list_el_t

◆ const_decl_t

◆ const_reserv_sets_t

◆ const_state_t

◆ const_unit_decl_t

◆ decl_t

◆ pattern_reserv_t

◆ pattern_set_el_t

◆ pos_t

Positions in machine description file.  Now they are not used.  But
they could be used in the future for better diagnostic messages.   

◆ regexp_t

◆ reserv_sets_t

Reservations of function units are represented by value of the following
type.   

◆ set_el_t

The following is element of vector of current (and planned in the
future) functional unit reservations.   

◆ state_ainsn_table_t

◆ state_t

◆ ticker_t

The ticker is represented by the following type.   

◆ unit_decl_t

The following typedefs are for brevity.   

◆ unit_set_el_t

◆ unit_usage_t

◆ vect_el_t

The following type describes elements of output vectors.   

◆ vla_hwint_t

Declare vector types for various data structures:  

Enumeration Type Documentation

◆ decl_mode

This page contains description of IR structure (nodes).   
Enumerator
dm_unit 
dm_bypass 
dm_automaton 
dm_excl 
dm_presence 
dm_absence 
dm_reserv 
dm_insn_reserv 

◆ regexp_mode

The following structures represent parsed reservation strings.   
Enumerator
rm_unit 
rm_reserv 
rm_nothing 
rm_sequence 
rm_repeat 
rm_allof 
rm_oneof 

Function Documentation

◆ active_time()

static int active_time ( ticker_t ticker)
static
The following function returns current time in milliseconds since
the moment when given ticker was created.   

References ggc_alloc(), ticker::incremented_off_time, and ticker::modified_creation_time.

Referenced by print_active_time().

◆ add_achieved_state()

static void add_achieved_state ( state_t state)
static
This function is called by function pass_states to add an achieved
STATE.   

References all_achieved_states.

Referenced by evaluate_equiv_classes().

◆ add_advance_cycle_insn_decl()

static void add_advance_cycle_insn_decl ( void )
static
Create and record a decl for the special advance-cycle transition.   

References advance_cycle_insn_decl, DECL_INSN_RESERV, description::decls, description::decls_num, dm_insn_reserv, description::insns_num, decl::mode, no_pos, NULL, decl::pos, and XCREATENODE.

Referenced by transform_insn_regexps().

◆ add_arc()

static void add_arc ( state_t from_state,
state_t to_state,
ainsn_t ainsn )
static
The function adds arc from FROM_STATE to TO_STATE marked by AINSN,
unless such an arc already exists.   

References allocated_arcs_num, ainsn::arc_exists_p, find_arc(), first_free_arc, state::first_out_arc, ggc_alloc(), arc::next_out_arc, NULL, state::num_out_arcs, and XCREATENODE.

Referenced by create_composed_state(), make_automaton(), merge_states(), and NDFA_to_DFA().

◆ add_automaton_state()

static void add_automaton_state ( state_t state)
static
This function is called by function pass_states to add an achieved
STATE.   

References automaton_states.

Referenced by form_important_insn_automata_lists().

◆ add_collapse_ndfa_insn_decl()

static void add_collapse_ndfa_insn_decl ( void )
static
Create and record a decl for the special collapse-NDFA transition.   

References collapse_ndfa_insn_decl, DECL_INSN_RESERV, description::decls, description::decls_num, dm_insn_reserv, description::insns_num, decl::mode, no_pos, NULL, decl::pos, and XCREATENODE.

Referenced by transform_insn_regexps().

◆ add_excls()

static void add_excls ( unit_set_el_t dest_list,
unit_set_el_t source_list,
pos_t excl_pos )
static
The function adds each element from SOURCE_LIST to the exclusion
list of the each element from DEST_LIST.  Checking situation "unit
excludes itself".   

References unit_decl::automaton_name, error(), unit_decl::excl_list, ggc_alloc(), unit_decl::name, unit_set_el::next_unit_set_el, NULL, unit_set_el::unit_decl, and XCOPYNODE.

Referenced by process_decls().

◆ add_presence_absence()

static void add_presence_absence ( unit_set_el_t dest_list,
pattern_set_el_t pattern_list,
pos_t req_pos,
int presence_p,
int final_p )
static
The function adds each element from PATTERN_LIST to presence (if
PRESENCE_P) or absence list of the each element from DEST_LIST.
Checking situations "unit requires own absence", and "unit excludes
and requires presence of ...", "unit requires absence and presence
of ...", "units in (final) presence set belong to different
automata", and "units in (final) absence set belong to different
automata".  Remember that we process absence sets only after all
presence sets.   

References unit_decl::absence_list, unit_decl::automaton_name, error(), unit_decl::excl_list, unit_decl::final_absence_list, unit_decl::final_presence_list, ggc_alloc(), i, unit_decl::name, pattern_set_el::next_pattern_set_el, unit_set_el::next_unit_set_el, NULL, unit_decl::presence_list, unit_set_el::unit_decl, pattern_set_el::unit_decls, pattern_set_el::units_num, w_flag, warning(), and XCOPYNODE.

Referenced by process_decls().

◆ add_state_reservs()

static void add_state_reservs ( state_t state)
static
The function forms `state_reservs' for STATE.   

References add_state_reservs(), state::component_states, ggc_alloc(), NULL, state::reservs, and state_reservs.

Referenced by add_state_reservs(), and output_state().

◆ add_states_vect_el()

static void add_states_vect_el ( state_t state)
static
The function is called by function pass_states.  The function adds
STATE to `output_states_vect'.   

References output_states_vect.

Referenced by output_dead_lock_vect(), output_min_issue_delay_table(), output_reserved_units_table(), and output_trans_table().

◆ add_vect()

static void add_vect ( state_ainsn_table_t tab,
int vect_num,
vla_hwint_t vect )
static
The following function adds vector VECT to table TAB as its line
with number VECT_NUM.   

References CHAR_BIT, gcc_assert, ggc_alloc(), i, no_comb_flag, and undefined_vect_el_value.

Referenced by output_trans_table().

◆ add_vect_el()

static void add_vect_el ( vla_hwint_t & vect,
ainsn_t ainsn,
int el_value )
static
The function adds element EL_VALUE to vector VECT for a table state
x AINSN.   

References insn_reserv_decl::equiv_class_num, gcc_assert, ggc_alloc(), ainsn::insn_equiv_class_num, and undefined_vect_el_value.

Referenced by output_trans_table().

◆ alloc_empty_reserv_sets()

static reserv_sets_t alloc_empty_reserv_sets ( void )
static
Allocate new reservation set.   

References els_in_reservs, ggc_alloc(), and irp.

Referenced by form_reserv_sets_list(), form_reservs_matter(), get_free_state(), and initiate_states().

◆ alt_state_cmp()

static int alt_state_cmp ( const void * alt_state_ptr_1,
const void * alt_state_ptr_2 )
static
The function compares unique numbers of alt states.   

References ggc_alloc(), and state::unique_num.

Referenced by alt_states_eq(), and uniq_sort_alt_states().

◆ alt_states_eq()

static int alt_states_eq ( alt_state_t alt_states_1,
alt_state_t alt_states_2 )
static
The function checks equality of alt state lists.  Remember that the
lists must be already sorted by the previous function.   

References alt_state_cmp(), ggc_alloc(), and NULL.

Referenced by form_ainsn_with_same_reservs().

◆ automata_list_add()

static void automata_list_add ( automaton_t automaton)
static
The following function adds AUTOMATON to the current list.   

References current_automata_list, and get_free_automata_list_el().

Referenced by form_important_insn_automata_lists().

◆ automata_list_eq_p()

static int automata_list_eq_p ( const void * automata_list_1,
const void * automata_list_2 )
static
Return nonzero value if the automata_lists are the same.   

References ggc_alloc(), and NULL.

Referenced by initiate_automata_lists().

◆ automata_list_finish()

static automata_list_el_t automata_list_finish ( void )
static
The following function finishes forming the current list, inserts
it into the table and returns it.   

References automata_list_table, current_automata_list, free_automata_list(), ggc_alloc(), and NULL.

Referenced by form_important_insn_automata_lists().

◆ automata_list_hash()

static hashval_t automata_list_hash ( const void * automata_list)
static
Hash value of AUTOMATA_LIST.   

References CHAR_BIT, ggc_alloc(), and NULL.

Referenced by initiate_automata_lists().

◆ automata_list_start()

static void automata_list_start ( void )
static
The following function starts new automata list and makes it the
current one.   

References current_automata_list, and NULL.

Referenced by form_important_insn_automata_lists().

◆ automaton_decl_eq_p()

static int automaton_decl_eq_p ( const void * automaton_decl_1,
const void * automaton_decl_2 )
static
The function tests automaton declarations on equality of their
keys.  The function is used by abstract data `hashtab'.  The
function returns 1 if the declarations have the same key, 0
otherwise.   

References DECL_AUTOMATON, dm_automaton, gcc_assert, and ggc_alloc().

Referenced by initiate_automaton_decl_table().

◆ automaton_decl_hash()

static hashval_t automaton_decl_hash ( const void * automaton_decl)
static
This page contains abstract data `table of automaton declarations'.
Elements of the table is nodes representing automaton declarations.
Key of the table elements is name of given automaton.  Remember
that automaton names have own space.   
The function evaluates hash value of an automaton declaration.  The
function is used by abstract data `hashtab'.  The function returns
hash value (0..UINT_MAX) of given automaton declaration.   

References DECL_AUTOMATON, dm_automaton, gcc_assert, decl::mode, and string_hash().

Referenced by initiate_automaton_decl_table().

◆ base_file_name()

static const char * base_file_name ( const char * file_name)
static
The function returns base name of given file name, i.e. pointer to
first char after last `/' (or `\' for WIN32) in given file name,
given file name itself if the directory name is absent.  The
returned string cannot be changed.   

References ggc_alloc().

Referenced by diagnostic_output_format_init(), diagnostic_output_format_init_json_file(), diagnostic_output_format_init_sarif_file(), and initiate_automaton_gen().

◆ build_automaton()

◆ cache_presence()

static void cache_presence ( state_t state)
static

◆ check_absence_pattern_sets()

static int check_absence_pattern_sets ( reserv_sets_t checked_set,
reserv_sets_t original_set,
int final_p )
static
The function checks that CHECKED_SET satisfies all absence pattern
sets for units in ORIGINAL_SET.  The function returns TRUE if it
is ok.   

References CHAR_BIT, els_in_cycle_reserv, ggc_alloc(), i, NULL, unit_absence_set_table, unit_final_absence_set_table, and description::units_num.

Referenced by reserv_sets_are_intersected().

◆ check_all_description()

static void check_all_description ( void )
static
The following function calls functions for checking all
description.   

References check_automaton_usage(), check_loops_in_regexps(), check_usage(), evaluate_max_reserv_cycles(), have_error, process_decls(), and process_regexp_decls().

Referenced by expand_automata().

◆ check_automata_insn_issues()

◆ check_automaton_usage()

static void check_automaton_usage ( void )
static
The following function checks that declared automaton is used.  If
the automaton is not used, the function fixes error/warning.  The
following function must be called only after `process_decls'.   

References DECL_AUTOMATON, description::decls, description::decls_num, dm_automaton, error(), i, decl::mode, w_flag, and warning().

Referenced by check_all_description().

◆ check_loops_in_regexps()

static void check_loops_in_regexps ( void )
static
The following function fixes errors "cycle in definition ...".  The
function uses function `loop_in_regexp' for that.   

References curr_loop_pass_num, DECL_RESERV, description::decls, description::decls_num, dm_reserv, error(), gcc_assert, i, loop_in_regexp(), and decl::mode.

Referenced by check_all_description().

◆ check_name()

static const char * check_name ( const char * name,
pos_t pos )
static
The function checks that NAME does not contain quotes (`"').   

References error().

Referenced by gen_automaton(), gen_cpu_unit(), gen_insn_reserv(), gen_query_cpu_unit(), and gen_reserv().

◆ check_presence_pattern_sets()

static int check_presence_pattern_sets ( reserv_sets_t checked_set,
reserv_sets_t original_set,
int final_p )
static
The function checks that CHECKED_SET satisfies all presence pattern
sets for units in ORIGINAL_SET.  The function returns TRUE if it
is ok.   

References CHAR_BIT, els_in_cycle_reserv, ggc_alloc(), i, NULL, unit_final_presence_set_table, unit_presence_set_table, and description::units_num.

Referenced by reserv_sets_are_intersected().

◆ check_regexp_units_distribution()

◆ check_unit_distributions_to_automata()

static void check_unit_distributions_to_automata ( void )
static
The function finds units which violates units to automata
distribution rule.  If the units exist, report about them.   

References annotation_message_reported_p, automaton_decls, check_regexp_units_distribution(), DECL_INSN_RESERV, description::decls, description::decls_num, dm_automaton, dm_insn_reserv, ggc_alloc(), i, decl::mode, and progress_flag.

Referenced by expand_automata().

◆ check_usage()

static void check_usage ( void )
static
The following function checks that declared unit is used.  If the
unit is not used, the function fixes errors/warnings.  The
following function must be called only after `process_decls',
`process_regexp_decls'.   

References DECL_RESERV, DECL_UNIT, description::decls, description::decls_num, dm_reserv, dm_unit, error(), i, decl::mode, w_flag, and warning().

Referenced by check_all_description().

◆ clear_arc_insns_equiv_num()

static void clear_arc_insns_equiv_num ( state_t state)
static
The function clears equivalence numbers and alt_states in all insns
which mark all out arcs of STATE.   

References insn_reserv_decl::equiv_class_num, first_out_arc(), arc::insn, ainsn::insn_reserv_decl, next_out_arc(), and NULL.

Referenced by partition_equiv_class().

◆ comb_vect_p()

static int comb_vect_p ( state_ainsn_table_t tab)
static
The following function returns nonzero value if the best
representation of the table is comb vector.   

References ggc_alloc(), and no_comb_flag.

Referenced by output_automata_list_transition_code(), output_state_ainsn_table(), and output_statistics().

◆ compare_max_occ_cycle_nums()

static int compare_max_occ_cycle_nums ( const void * unit_decl_1,
const void * unit_decl_2 )
static
The function compares unit declarations according to their maximal
cycle in reservations.   

References DECL_UNIT, and ggc_alloc().

Referenced by units_to_automata_heuristic_distr().

◆ compare_states_for_equiv()

static int compare_states_for_equiv ( const void * state_ptr_1,
const void * state_ptr_2 )
static
Compares two states pointed to by STATE_PTR_1 and STATE_PTR_2
and return -1, 0 or 1.  This function can be used as predicate for
qsort().  It requires the member presence_signature[] of both
states be filled.   

References CHAR_BIT, ggc_alloc(), description::query_units_num, and si.

Referenced by evaluate_equiv_classes(), and init_equiv_class().

◆ compare_transition_els_num()

static int compare_transition_els_num ( const void * state_ptr_1,
const void * state_ptr_2 )
static
Compare number of possible transitions from the states.   

References ggc_alloc(), and out_state_arcs_num().

Referenced by output_trans_table().

◆ copy_equiv_class()

static void copy_equiv_class ( vec< state_t > * to,
vec< state_t > from )
static
The function copies pointers to equivalent states from vla FROM
into vla TO.   

Referenced by evaluate_equiv_classes().

◆ copy_insn_regexp()

static regexp_t copy_insn_regexp ( regexp_t regexp)
static
This page contains code for transformation of original reservations
described in .md file.  The main goal of transformations is
simplifying reservation and lifting up all `|' on the top of IR
reservation representation.   
The following function makes copy of IR representation of
reservation.  The function also substitutes all reservations
defined by define_reservation by corresponding value during making
the copy.   

References copy_insn_regexp(), gcc_unreachable, i, regexp::mode, reserv_decl::regexp, REGEXP_ALLOF, REGEXP_ONEOF, REGEXP_REPEAT, REGEXP_RESERV, REGEXP_SEQUENCE, rm_allof, rm_nothing, rm_oneof, rm_repeat, rm_reserv, rm_sequence, rm_unit, XCOPYNODE, and XCOPYNODEVAR.

Referenced by copy_insn_regexp(), transform_1(), transform_2(), transform_3(), and transform_insn_regexps().

◆ copy_node()

◆ count_states_and_arcs()

static void count_states_and_arcs ( automaton_t automaton,
int * states_num,
int * arcs_num )
static
The function counts states and arcs of AUTOMATON.   

References curr_counted_arcs_num, curr_counted_states_num, ggc_alloc(), incr_states_and_arcs_nums(), and pass_states().

Referenced by build_automaton().

◆ create_ainsns()

static void create_ainsns ( automaton_t automaton)
static
The functions creates automaton insns for each automata.  Automaton
insn is simply insn for given automaton which makes reservation
only of units of the automaton.   

References automaton::advance_ainsn, advance_cycle_insn_decl, automaton::ainsn_list, automaton::collapse_ainsn, collapse_ndfa_insn_decl, curr_ainsn, DECL_INSN_RESERV, description::decls, description::decls_num, dm_insn_reserv, ggc_alloc(), i, ainsn::important_p, ainsn::insn_reserv_decl, decl::mode, ainsn::next_ainsn, NULL, and XCREATENODE.

Referenced by create_automata().

◆ create_alt_states()

◆ create_automata()

◆ create_composed_state()

static int create_composed_state ( state_t original_state,
arc_t arcs_marked_by_insn,
vec< state_t > * state_stack )
static
The function creates composed state (see comments for IR) from
ORIGINAL_STATE and list of arcs ARCS_MARKED_BY_INSN marked by the
same insn.  If the composed state is not in STATE_STACK yet, it is
pushed into STATE_STACK.   

References add_arc(), advance_cycle_insn_decl, insn_reserv_decl::arcs_marked_by_insn, state::automaton, collapse_flag, state::component_states, DECL_INSN_RESERV, first_out_arc(), free_state(), gcc_assert, get_free_alt_state(), get_free_state(), ggc_alloc(), insert_state(), state::it_was_placed_in_stack_for_DFA_forming, ndfa_flag, arc::next_arc_marked_by_insn, next_out_arc(), alt_state::next_sorted_alt_state, NULL, remove_arc(), alt_state::state, arc::to_state, and uniq_sort_alt_states().

Referenced by NDFA_to_DFA().

◆ create_node()

static void * create_node ( size_t size)
static
Create IR structure (node).   

References ggc_alloc(), and irp.

Referenced by copy_node().

◆ create_state_ainsn_table()

static state_ainsn_table_t create_state_ainsn_table ( automaton_t automaton)
static
The following function creates new table for AUTOMATON.   

References automaton::achieved_states_num, ggc_alloc(), i, automaton::insn_equiv_classes_num, undefined_vect_el_value, and XCREATENODE.

Referenced by output_trans_table().

◆ create_ticker()

static ticker_t create_ticker ( void )
static
The page contains abstract data `ticker'.  This data is used to
report time of different phases of building automata.  It is
possibly to write a description for which automata will be built
during several minutes even on fast machine.   
The following function creates ticker and makes it active.   

References ggc_alloc(), ticker::incremented_off_time, and ticker::modified_creation_time.

Referenced by create_automata(), expand_automata(), generate(), transform_insn_regexps(), and write_automata().

◆ decl_eq_p()

static int decl_eq_p ( const void * decl_1,
const void * decl_2 )
static
The function tests declarations on equality of their keys.  The
function is used by abstract data 'hashtab'.  The function
returns 1 if the declarations have the same key, 0 otherwise.   

References d1, d2, DECL_RESERV, DECL_UNIT, dm_reserv, dm_unit, gcc_assert, and ggc_alloc().

Referenced by initiate_decl_table().

◆ decl_hash()

static hashval_t decl_hash ( const void * decl)
static
This page contains abstract data `table of declarations'.  Elements
of the table is nodes representing declarations (of units and
reservations).  Key of the table elements is names of given
declarations.   
The function evaluates hash value of a declaration.  The function
is used by abstract data `hashtab'.  The function returns hash
value (0..UINT_MAX) of given declaration.   

References DECL_RESERV, DECL_UNIT, dm_reserv, dm_unit, gcc_assert, decl::mode, and string_hash().

Referenced by initiate_decl_table().

◆ delete_ainsn_from_equiv_class()

static void delete_ainsn_from_equiv_class ( ainsn_t equiv_class_insn)
static
The function deletes equiv_class_insn into cyclic list of
equivalent ainsns.   

References ggc_alloc().

Referenced by process_insn_equiv_class().

◆ enumerate_states()

static void enumerate_states ( automaton_t automaton)
static
The function enumerates all states of AUTOMATON.   

References automaton::achieved_states_num, curr_state_order_num, pass_states(), and set_order_state_num().

Referenced by create_automata().

◆ equal_alternatives_p()

static bool equal_alternatives_p ( int alt1,
int alt2,
int n_alts,
struct automaton_decl * excluded_automaton_decl )
static
The function returns true if reservations of alternatives ALT1 and
ALT2 are equal after excluding reservations of units of
EXCLUDED_AUTOMATON_DECL.   

References cycle_alt_unit_usages, ggc_alloc(), i, and NULL.

Referenced by check_regexp_units_distribution().

◆ estimate_one_automaton_bound()

static double estimate_one_automaton_bound ( void )
static
The function estimate size of the single DFA used by PHR (pipeline
hazards recognizer).   

References automata_num, DECL_UNIT, description::decls, description::decls_num, dm_unit, exp(), ggc_alloc(), i, log(), MAX_FLOATING_POINT_VALUE_FOR_AUTOMATON_BOUND, and decl::mode.

Referenced by units_to_automata_heuristic_distr().

◆ evaluate_equiv_classes()

static void evaluate_equiv_classes ( automaton_t automaton,
vec< state_t > * equiv_classes )
static

◆ evaluate_max_reserv_cycles()

static void evaluate_max_reserv_cycles ( void )
static
The following function is called only for correct program.  The
function defines max reservation of insns in cycles.   

References DECL_INSN_RESERV, description::decls, description::decls_num, dm_insn_reserv, ggc_alloc(), i, description::max_insn_reserv_cycles, decl::mode, and process_regexp_cycles().

Referenced by check_all_description().

◆ expand_automata()

◆ file_name_suffix()

static const char * file_name_suffix ( const char * file_name)
static
The function returns suffix of given file name.  The returned
string cannot be changed.   

References ggc_alloc(), and NULL.

Referenced by initiate_automaton_gen().

◆ find_arc()

static arc_t find_arc ( state_t from_state,
state_t to_state,
ainsn_t insn )
static
The functions returns arc with given characteristics (or NULL if
the arc does not exist).   

References collapse_flag, collapse_ndfa_insn_decl, DECL_INSN_RESERV, first_out_arc(), arc::insn, ainsn::insn_reserv_decl, next_out_arc(), NULL, and arc::to_state.

Referenced by add_arc().

◆ find_automaton_decl()

static decl_t find_automaton_decl ( const char * name)
static
The function searches for automaton declaration in the table with
the same key as node representing name of the automaton
declaration.  The function returns node found in the table, NULL if
such node does not exist in the table.   

References automaton_decl_table, DECL_AUTOMATON, dm_automaton, ggc_alloc(), decl::mode, and work_automaton_decl.

Referenced by process_decls().

◆ find_decl()

static decl_t find_decl ( const char * name)
static
The function searches for declaration in the table with the same
key as node representing name of the declaration.  The function
returns node found in the table, NULL if such node does not exist
in the table.   

References decl_table, DECL_UNIT, dm_unit, ggc_alloc(), decl::mode, and work_decl.

Referenced by process_decls(), process_excls(), process_presence_absence_names(), process_presence_absence_patterns(), and process_regexp().

◆ find_insn_decl()

static decl_t find_insn_decl ( const char * name)
static
The function searches for insn reservation declaration in the table
with the same key as node representing name of the insn reservation
declaration.  The function returns node found in the table, NULL if
such node does not exist in the table.   

References DECL_INSN_RESERV, dm_insn_reserv, ggc_alloc(), insn_decl_table, decl::mode, and work_insn_decl.

Referenced by for_each_matching_insn().

◆ finish_alt_states()

static void finish_alt_states ( void )
static
Finishing work with the abstract data.   

Referenced by finish_states().

◆ finish_arcs()

static void finish_arcs ( void )
static
Finishing work with the abstract data.   

Referenced by write_automata().

◆ finish_automata_lists()

static void finish_automata_lists ( void )
static
Finishing work with the abstract data.   

References automata_list_table, and ggc_alloc().

Referenced by write_automata().

◆ finish_automaton_decl_table()

static void finish_automaton_decl_table ( void )
static
The function deletes the automaton declaration table.  Only call of
function `initiate_automaton_decl_table' is possible immediately
after this function call.   

References automaton_decl_table, and ggc_alloc().

Referenced by write_automata().

◆ finish_decl_table()

static void finish_decl_table ( void )
static
The function deletes the declaration table.  Only call of function
`initiate_declaration_table' is possible immediately after this
function call.   

References decl_table, and ggc_alloc().

Referenced by write_automata().

◆ finish_forming_alt_state()

static void finish_forming_alt_state ( alt_state_t alt_state,
automaton_t automaton )
static
This recursive function finishes forming ALT_STATE of AUTOMATON and
inserts alt_state into the table.   

References free_state(), ggc_alloc(), insert_state(), and alt_state::state.

Referenced by process_alts_for_forming_states().

◆ finish_insn_decl_table()

static void finish_insn_decl_table ( void )
static
The function deletes the insn declaration table.  Only call of
function `initiate_insn_decl_table' is possible immediately after
this function call.   

References ggc_alloc(), and insn_decl_table.

Referenced by write_automata().

◆ finish_regexp_representation()

static void finish_regexp_representation ( void )
static
The function frees memory allocated for last formed string
representation of regexp.   

References ggc_alloc(), and irp.

Referenced by output_print_reservation_func(), and output_regexp().

◆ finish_states()

static void finish_states ( void )
static
Finishing work with the abstract data.   

References finish_alt_states(), first_free_state, free(), ggc_alloc(), NULL, state_table, and units_array.

Referenced by write_automata().

◆ first_cycle_unit_presence()

static int first_cycle_unit_presence ( state_t state,
int unit_num )
static
The following function returns TRUE if STATE reserves the unit with
UNIT_NUM on the first cycle.   

References state::component_states, alt_state::next_sorted_alt_state, NULL, state::reservs, alt_state::state, and test_unit_reserv().

Referenced by cache_presence(), and output_reserved_units_table().

◆ first_out_arc()

◆ for_each_matching_insn()

static void for_each_matching_insn ( decl_t bypass,
const char * pattern,
void(*)(decl_t, decl_t, void *) fn,
void * data )
static
BYPASS is a define_bypass decl that includes glob pattern PATTERN.
Call FN (BYPASS, INSN, DATA) for each matching instruction INSN.   

References DECL_INSN_RESERV, description::decls, description::decls_num, dm_insn_reserv, error(), find_insn_decl(), ggc_alloc(), i, and insn_reserv_decl::name.

Referenced by process_bypass(), and process_bypass_1().

◆ form_ainsn_with_same_reservs()

static void form_ainsn_with_same_reservs ( automaton_t automaton)
static
The page contains major code for building DFA(s) for fast pipeline
hazards recognition.   
The function forms list of ainsns of AUTOMATON with the same
reservation.   

References automaton::ainsn_list, alt_states_eq(), curr_ainsn, ainsn::first_insn_with_same_reservs, ggc_alloc(), i, ainsn::insn_reserv_decl, ainsn::next_ainsn, ainsn::next_same_reservs_insn, NULL, ainsn::sorted_alt_states, and special_decl_p().

Referenced by create_automata().

◆ form_arcs_marked_by_insn()

◆ form_important_insn_automata_lists()

◆ form_regexp()

static void form_regexp ( regexp_t regexp)
static
This page contains code for forming string representation of
regexp.  The representation is formed on IR obstack.  So you should
not work with IR obstack between regexp_representation and
finish_regexp_representation calls.   
This recursive function forms string representation of regexp
(without trailing '\0').   

References form_regexp(), gcc_unreachable, ggc_alloc(), i, irp, regexp::mode, insn_reserv_decl::name, NOTHING_NAME, REGEXP_ALLOF, REGEXP_ONEOF, REGEXP_REPEAT, REGEXP_RESERV, REGEXP_SEQUENCE, REGEXP_UNIT, rm_allof, rm_nothing, rm_oneof, rm_repeat, rm_reserv, rm_sequence, and rm_unit.

Referenced by form_regexp(), and regexp_representation().

◆ form_reserv_sets_list()

static pattern_reserv_t form_reserv_sets_list ( pattern_set_el_t pattern_list)
static
The following function forms list of reservation sets for given
PATTERN_LIST.   

References alloc_empty_reserv_sets(), bitmap_set_bit, ggc_alloc(), i, pattern_reserv::next_pattern_reserv, NULL, and XCREATENODE.

Referenced by initiate_presence_absence_pattern_sets().

◆ form_reservs_matter()

static reserv_sets_t form_reservs_matter ( automaton_t automaton)
static
Forming unit reservations which can affect creating the automaton
states achieved from a given state.  It permits to build smaller
automata in many cases.  We would have the same automata after
the minimization without such optimization, but the automaton
right after the building could be huge.  So in other words, usage
of reservs_matter means some minimization during building the
automaton.   

References alloc_empty_reserv_sets(), automaton::corresponding_automaton_decl, ggc_alloc(), unit_decl::in_set_p, max_cycles_num, unit_decl::min_occ_cycle_num, unit_decl::query_p, set_unit_reserv(), units_array, and description::units_num.

Referenced by make_automaton().

◆ free_alt_state()

static void free_alt_state ( alt_state_t alt_state)
static
The function frees node ALT_STATE.   

References first_free_alt_state, alt_state::next_alt_state, and NULL.

Referenced by free_alt_states().

◆ free_alt_states()

static void free_alt_states ( alt_state_t alt_states_list)
static
The function frees list started with node ALT_STATE_LIST.   

References free_alt_state(), ggc_alloc(), and NULL.

Referenced by free_state().

◆ free_arc()

static void free_arc ( arc_t arc)
static
The function frees node ARC.   

References first_free_arc, and arc::next_out_arc.

Referenced by merge_states(), and remove_arc().

◆ free_automata_list()

static void free_automata_list ( automata_list_el_t automata_list)
static
The function frees list AUTOMATA_LIST.   

References free_automata_list_el(), ggc_alloc(), and NULL.

Referenced by automata_list_finish().

◆ free_automata_list_el()

static void free_automata_list_el ( automata_list_el_t automata_list_el)
static
The function frees node AUTOMATA_LIST_EL.   

References first_free_automata_list_el, automata_list_el::next_automata_list_el, and NULL.

Referenced by free_automata_list().

◆ free_state()

◆ gen_absence_set()

static void gen_absence_set ( md_rtx_info * info)
static
Process an ABSENCE_SET.

This gives information about a cpu unit reservation requirements.
We fill a struct unit_pattern_rel_decl (absence) with information
used later by `expand_automata'.   

References gen_presence_absence_set().

Referenced by main().

◆ gen_automata_option()

static void gen_automata_option ( md_rtx_info * info)
static
Process an AUTOMATA_OPTION.

This gives information how to generate finite state automaton used
for recognizing pipeline hazards.   

References collapse_flag, COLLAPSE_OPTION, md_rtx_info::def, fatal_at(), GET_CODE, GET_RTX_NAME, ggc_alloc(), md_rtx_info::loc, ndfa_flag, NDFA_OPTION, no_comb_flag, NO_COMB_OPTION, no_minimization_flag, NO_MINIMIZATION_OPTION, option(), progress_flag, PROGRESS_OPTION, stats_flag, STATS_OPTION, time_flag, TIME_OPTION, v_flag, V_OPTION, w_flag, W_OPTION, and XSTR.

Referenced by main().

◆ gen_automaton()

static void gen_automaton ( md_rtx_info * info)
static
Process a DEFINE_AUTOMATON.

This gives information about a finite state automaton used for
recognizing pipeline hazards.  We fill a struct automaton_decl
with information used later by `expand_automata'.   

References check_name(), DECL_AUTOMATON, decls, md_rtx_info::def, dm_automaton, fatal_at(), GET_CODE, GET_RTX_NAME, get_str_vect(), ggc_alloc(), i, md_rtx_info::loc, decl::mode, NULL, decl::pos, XCREATENODE, and XSTR.

Referenced by main().

◆ gen_bypass()

static void gen_bypass ( md_rtx_info * info)
static
Process a DEFINE_BYPASS.

This gives information about a unit contained in the CPU.  We fill
in a struct bypass_decl with information used later by
`expand_automata'.   

References DECL_BYPASS, decls, md_rtx_info::def, dm_bypass, fatal_at(), GET_CODE, GET_RTX_NAME, get_str_vect(), ggc_alloc(), i, md_rtx_info::loc, decl::mode, NULL, decl::pos, XCREATENODE, XINT, and XSTR.

Referenced by main().

◆ gen_cpu_unit()

static void gen_cpu_unit ( md_rtx_info * info)
static
Process a DEFINE_CPU_UNIT.

This gives information about a unit contained in CPU.  We fill a
struct unit_decl with information used later by `expand_automata'.   

References check_name(), DECL_UNIT, decls, md_rtx_info::def, dm_unit, fatal_at(), GET_CODE, GET_RTX_NAME, get_str_vect(), ggc_alloc(), i, md_rtx_info::loc, decl::mode, NULL, decl::pos, XCREATENODE, and XSTR.

Referenced by main().

◆ gen_excl_set()

static void gen_excl_set ( md_rtx_info * info)
static
Process an EXCLUSION_SET.

This gives information about a cpu unit conflicts.  We fill a
struct excl_rel_decl (excl) with information used later by
`expand_automata'.   

References DECL_EXCL, decls, md_rtx_info::def, dm_excl, fatal_at(), GET_CODE, GET_RTX_NAME, get_str_vect(), ggc_alloc(), i, md_rtx_info::loc, decl::mode, NULL, decl::pos, XCREATENODEVAR, and XSTR.

Referenced by main().

◆ gen_final_absence_set()

static void gen_final_absence_set ( md_rtx_info * info)
static
Process a FINAL_ABSENCE_SET.

This gives information about a cpu unit reservation requirements.
We fill a struct unit_pattern_rel_decl (absence) with information
used later by `expand_automata'.   

References gen_presence_absence_set().

Referenced by main().

◆ gen_final_presence_set()

static void gen_final_presence_set ( md_rtx_info * info)
static
Process a FINAL_PRESENCE_SET.

This gives information about a cpu unit reservation requirements.
We fill a struct unit_pattern_rel_decl (presence) with information
used later by `expand_automata'.   

References gen_presence_absence_set().

Referenced by main().

◆ gen_insn_reserv()

static void gen_insn_reserv ( md_rtx_info * info)
static
Process a DEFINE_INSN_RESERVATION.

This gives information about the reservation of cpu units by an
insn.  We fill a struct insn_reserv_decl with information used
later by `expand_automata'.   

References check_name(), DECL_INSN_RESERV, decls, md_rtx_info::def, dm_insn_reserv, gen_regexp(), decl::mode, decl::pos, XCREATENODE, XEXP, XINT, and XSTR.

Referenced by main().

◆ gen_presence_absence_set()

static void gen_presence_absence_set ( md_rtx_info * info,
int presence_p,
int final_p )
static
Process a PRESENCE_SET, a FINAL_PRESENCE_SET, an ABSENCE_SET,
FINAL_ABSENCE_SET (it is depended on PRESENCE_P and FINAL_P).

This gives information about a cpu unit reservation requirements.
We fill a struct unit_pattern_rel_decl with information used later
by `expand_automata'.   

References DECL_ABSENCE, DECL_PRESENCE, decls, md_rtx_info::def, dm_absence, dm_presence, fatal_at(), gcc_assert, GET_CODE, GET_RTX_NAME, get_str_vect(), ggc_alloc(), i, irp, md_rtx_info::loc, decl::mode, NULL, decl::pos, XCREATENODE, and XSTR.

Referenced by gen_absence_set(), gen_final_absence_set(), gen_final_presence_set(), and gen_presence_set().

◆ gen_presence_set()

static void gen_presence_set ( md_rtx_info * info)
static
Process a PRESENCE_SET.

This gives information about a cpu unit reservation requirements.
We fill a struct unit_pattern_rel_decl (presence) with information
used later by `expand_automata'.   

References gen_presence_absence_set().

Referenced by main().

◆ gen_query_cpu_unit()

static void gen_query_cpu_unit ( md_rtx_info * info)
static
Process a DEFINE_QUERY_CPU_UNIT.

This gives information about a unit contained in CPU.  We fill a
struct unit_decl with information used later by `expand_automata'.   

References check_name(), DECL_UNIT, decls, md_rtx_info::def, dm_unit, fatal_at(), GET_CODE, GET_RTX_NAME, get_str_vect(), ggc_alloc(), i, md_rtx_info::loc, decl::mode, NULL, decl::pos, XCREATENODE, and XSTR.

Referenced by main().

◆ gen_regexp()

static regexp_t gen_regexp ( const char * str)
static
Parse construction reservation STR.   

References gen_regexp_sequence(), and reserv_str.

Referenced by gen_insn_reserv(), and gen_reserv().

◆ gen_regexp_allof()

static regexp_t gen_regexp_allof ( const char * str)
static
Parse reservation STR which possibly contains separator '+'.   

References fatal(), gen_regexp_repeat(), get_str_vect(), ggc_alloc(), i, regexp::mode, NULL, REGEXP_ALLOF, reserv_str, rm_allof, and XCREATENODEVAR.

Referenced by gen_regexp_oneof().

◆ gen_regexp_el()

static regexp_t gen_regexp_el ( const char * str)
static

◆ gen_regexp_oneof()

static regexp_t gen_regexp_oneof ( const char * str)
static
Parse reservation STR which possibly contains separator '|'.   

References fatal(), gen_regexp_allof(), get_str_vect(), ggc_alloc(), i, regexp::mode, NULL, REGEXP_ONEOF, reserv_str, rm_oneof, and XCREATENODEVAR.

Referenced by gen_regexp_sequence().

◆ gen_regexp_repeat()

static regexp_t gen_regexp_repeat ( const char * str)
static
Parse construction `repeat' in STR.   

References fatal(), gen_regexp_el(), get_str_vect(), ggc_alloc(), i, regexp::mode, NULL, REGEXP_REPEAT, reserv_str, rm_repeat, and XCREATENODE.

Referenced by gen_regexp_allof().

◆ gen_regexp_sequence()

static regexp_t gen_regexp_sequence ( const char * str)
static
Forward declarations of functions used before their definitions, only.   
Parse reservation STR which possibly contains separator ','.   

References fatal(), gen_regexp_oneof(), get_str_vect(), ggc_alloc(), i, regexp::mode, NULL, REGEXP_SEQUENCE, rm_sequence, and XCREATENODEVAR.

Referenced by gen_regexp(), and gen_regexp_el().

◆ gen_reserv()

static void gen_reserv ( md_rtx_info * info)
static
Process a DEFINE_RESERVATION.

This gives information about a reservation of cpu units.  We fill
in a struct reserv_decl with information used later by
`expand_automata'.   

References check_name(), DECL_RESERV, decls, md_rtx_info::def, dm_reserv, gen_regexp(), decl::mode, decl::pos, XCREATENODE, and XSTR.

Referenced by main().

◆ generate()

static void generate ( void )
static
The function generates DFA (deterministic finite state automaton)
for fast recognition of pipeline hazards.  No errors during
checking must be fixed before this function call.   

References automata_num, automaton_generation_time, create_automata(), create_ticker(), initiate_arcs(), initiate_automata_lists(), initiate_excl_sets(), initiate_pass_states(), initiate_presence_absence_pattern_sets(), initiate_states(), split_argument, ticker_off(), and description::units_num.

Referenced by expand_automata(), and op_by_pieces_d::run().

◆ get_excl_set()

static reserv_sets_t get_excl_set ( reserv_sets_t in_set)
static
The function sets up and return EXCL_SET which is union of
exclusion sets for each unit in IN_SET.   

References CHAR_BIT, els_in_cycle_reserv, excl_set, ggc_alloc(), i, unit_excl_set_table, and description::units_num.

Referenced by reserv_sets_are_intersected().

◆ get_free_alt_state()

static alt_state_t get_free_alt_state ( void )
static
The following function returns free node alt_state.  It may be new
allocated node or node freed earlier.   

References allocated_alt_states_num, first_free_alt_state, alt_state::next_alt_state, alt_state::next_sorted_alt_state, NULL, alt_state::state, and XCREATENODE.

Referenced by create_composed_state(), merge_states(), and process_alts_for_forming_states().

◆ get_free_automata_list_el()

static automata_list_el_t get_free_automata_list_el ( void )
static
The following function returns free automata list el.  It may be
new allocated node or node freed earlier.   

References automata_list_el::automaton, first_free_automata_list_el, automata_list_el::next_automata_list_el, NULL, and XCREATENODE.

Referenced by automata_list_add().

◆ get_free_state()

static state_t get_free_state ( int with_reservs,
automaton_t automaton )
static

◆ get_str_vect()

static char ** get_str_vect ( const char * str,
int * els_num,
int sep,
int paren_p )
static
Given a string and a separator, return vector of strings which are
elements in the string and number of elements through els_num.
Take parentheses into account if PAREN_P has nonzero value.  The
function also inserts the end marker NULL at the end of vector.
Return 0 for the null string, -1 if parentheses are not balanced.   

References gcc_assert, ggc_alloc(), i, irp, n_sep_els(), next_sep_el(), and NULL.

Referenced by gen_automaton(), gen_bypass(), gen_cpu_unit(), gen_excl_set(), gen_presence_absence_set(), gen_query_cpu_unit(), gen_regexp_allof(), gen_regexp_oneof(), gen_regexp_repeat(), and gen_regexp_sequence().

◆ incr_states_and_arcs_nums()

static void incr_states_and_arcs_nums ( state_t state)
static
The function is called by function `pass_states' to count states
and arcs of an automaton.   

References curr_counted_arcs_num, curr_counted_states_num, first_out_arc(), next_out_arc(), and NULL.

Referenced by count_states_and_arcs().

◆ init_equiv_class()

static int init_equiv_class ( vec< state_t > states,
vec< state_t > * classes )
static
The function makes initial partition of STATES on equivalent
classes and saves it into CLASSES.  This function requires the input
to be sorted via compare_states_for_equiv().   

References compare_states_for_equiv(), state::equiv_class_num_1, ggc_alloc(), i, state::next_equiv_class_state, and NULL.

Referenced by evaluate_equiv_classes().

◆ initiate_alt_states()

static void initiate_alt_states ( void )
static
Initialization of the abstract data.   

References first_free_alt_state, and NULL.

Referenced by initiate_states().

◆ initiate_arcs()

static void initiate_arcs ( void )
static
Initialization of the abstract data.   

References first_free_arc, and NULL.

Referenced by generate().

◆ initiate_automata_lists()

static void initiate_automata_lists ( void )
static
Initialization of the abstract data.   

References automata_list_eq_p(), automata_list_hash(), automata_list_table, first_free_automata_list_el, ggc_alloc(), and NULL.

Referenced by generate().

◆ initiate_automaton_decl_table()

static void initiate_automaton_decl_table ( void )
static
The function creates empty automaton declaration table and node
representing automaton declaration and used for searching automaton
declaration with given name.  The function must be called only once
before any work with the automaton declaration table.   

References automaton_decl_eq_p(), automaton_decl_hash(), automaton_decl_table, dm_automaton, ggc_alloc(), decl::mode, and work_automaton_decl.

Referenced by initiate_automaton_gen().

◆ initiate_automaton_gen()

static void initiate_automaton_gen ( const char ** argv)
static
The following is top level function to initialize the work of
pipeline hazards description translator.   

References base_file_name(), file_name_suffix(), ggc_alloc(), initiate_automaton_decl_table(), initiate_decl_table(), initiate_insn_decl_table(), irp, NULL, output_description_file, output_description_file_name, output_file, and STANDARD_OUTPUT_DESCRIPTION_FILE_SUFFIX.

Referenced by main().

◆ initiate_decl_table()

static void initiate_decl_table ( void )
static
The function creates empty declaration table and node representing
declaration and used for searching declaration with given name.
The function must be called only once before any work with the
declaration table.   

References decl_eq_p(), decl_hash(), decl_table, dm_unit, ggc_alloc(), decl::mode, and work_decl.

Referenced by initiate_automaton_gen().

◆ initiate_excl_sets()

static void initiate_excl_sets ( void )
static
The following function forms the array containing exclusion sets
for each unit.   

References bitmap_set_bit, DECL_UNIT, description::decls, description::decls_num, dm_unit, els_in_cycle_reserv, excl_set, ggc_alloc(), i, irp, decl::mode, NULL, unit_excl_set_table, and description::units_num.

Referenced by generate().

◆ initiate_insn_decl_table()

static void initiate_insn_decl_table ( void )
static
The function creates empty insn declaration table and node
representing insn declaration and used for searching insn
declaration with given name.  The function must be called only once
before any work with the insn declaration table.   

References dm_insn_reserv, ggc_alloc(), insn_decl_eq_p(), insn_decl_hash(), insn_decl_table, decl::mode, and work_insn_decl.

Referenced by initiate_automaton_gen().

◆ initiate_pass_states()

static void initiate_pass_states ( void )
static
The function initializes code for passing of all states.   

References curr_state_graph_pass_num.

Referenced by generate().

◆ initiate_presence_absence_pattern_sets()

◆ initiate_states()

◆ insert_ainsn_into_equiv_class()

static ainsn_t insert_ainsn_into_equiv_class ( ainsn_t ainsn,
ainsn_t cyclic_equiv_class_insn_list )
static
The page contains code for finding equivalent automaton insns
(ainsns).   
The function inserts AINSN into cyclic list
CYCLIC_EQUIV_CLASS_INSN_LIST of ainsns.   

References ggc_alloc(), ainsn::next_equiv_class_insn, and NULL.

Referenced by process_insn_equiv_class(), and set_insn_equiv_classes().

◆ insert_automaton_decl()

static decl_t insert_automaton_decl ( decl_t automaton_decl)
static
The function inserts automaton declaration into the table.  The
function does nothing if an automaton declaration with the same key
exists already in the table.  The function returns automaton
declaration node in the table with the same key as given automaton
declaration node.   

References automaton_decl_table, ggc_alloc(), and NULL.

Referenced by process_decls().

◆ insert_bypass()

static void insert_bypass ( struct bypass_decl * bypass)
static
The function inserts BYPASS in the list of bypasses of the
corresponding output insn.  The order of bypasses in the list is
described in a comment for member `bypass_list' (see above).  If
there is already the same bypass in the list the function reports
this and does nothing.   

References bypass_decl::bypass_guard_name, insn_reserv_decl::bypass_list, error(), ggc_alloc(), bypass_decl::in_insn_reserv, bypass_decl::in_pattern, last, bypass_decl::next, filedep::next, NULL, bypass_decl::out_insn_reserv, bypass_decl::out_pattern, w_flag, and warning().

Referenced by process_bypass_2().

◆ insert_decl()

static decl_t insert_decl ( decl_t decl)
static
The function inserts declaration into the table.  The function does
nothing if a declaration with the same key exists already in the
table.  The function returns declaration node in the table with the
same key as given declaration node.   

References decl_table, ggc_alloc(), and NULL.

Referenced by process_decls().

◆ insert_insn_decl()

static decl_t insert_insn_decl ( decl_t insn_decl)
static
The function inserts insn declaration into the table.  The function
does nothing if an insn declaration with the same key exists
already in the table.  The function returns insn declaration node
in the table with the same key as given insn declaration node.   

References ggc_alloc(), insn_decl_table, and NULL.

Referenced by process_decls().

◆ insert_state()

static state_t insert_state ( state_t state)
static
Insert STATE into the state table.   

References ggc_alloc(), NULL, and state_table.

Referenced by create_composed_state(), finish_forming_alt_state(), make_automaton(), state_shift(), and states_union().

◆ insn_decl_eq_p()

static int insn_decl_eq_p ( const void * insn_decl_1,
const void * insn_decl_2 )
static
The function tests insn declarations on equality of their keys.
The function is used by abstract data `hashtab'.  The function
returns 1 if declarations have the same key, 0 otherwise.   

References DECL_INSN_RESERV, dm_insn_reserv, gcc_assert, and ggc_alloc().

Referenced by initiate_insn_decl_table().

◆ insn_decl_hash()

static hashval_t insn_decl_hash ( const void * insn_decl)
static
This page contains abstract data `table of insn declarations'.
Elements of the table is nodes representing insn declarations.  Key
of the table elements is name of given insn (in corresponding
define_insn_reservation).  Remember that insn names have own
space.   
The function evaluates hash value of an insn declaration.  The
function is used by abstract data `hashtab'.  The function returns
hash value (0..UINT_MAX) of given insn declaration.   

References DECL_INSN_RESERV, dm_insn_reserv, gcc_assert, ggc_alloc(), decl::mode, and string_hash().

Referenced by initiate_insn_decl_table().

◆ intersected_state_reservs_p()

static int intersected_state_reservs_p ( state_t state1,
state_t state2 )
static
Return nonzero value if the deterministic states contains a
reservation of the same cpu unit on the same cpu cycle.   

References gcc_assert, ggc_alloc(), and reserv_sets_are_intersected().

Referenced by make_automaton().

◆ loop_in_regexp()

static int loop_in_regexp ( regexp_t regexp,
decl_t start_decl )
static
The following recursive function returns nonzero value if REGEXP
contains given decl or reservations in given regexp refers for
given decl.   

References curr_loop_pass_num, DECL_RESERV, dm_reserv, gcc_unreachable, ggc_alloc(), i, loop_in_regexp(), reserv_decl::loop_pass_num, regexp::mode, NULL, reserv_decl::regexp, REGEXP_ALLOF, REGEXP_ONEOF, REGEXP_REPEAT, REGEXP_RESERV, REGEXP_SEQUENCE, rm_allof, rm_nothing, rm_oneof, rm_repeat, rm_reserv, rm_sequence, and rm_unit.

Referenced by check_loops_in_regexps(), and loop_in_regexp().

◆ main()

◆ make_automaton()

◆ merge_states()

static void merge_states ( automaton_t automaton,
const vec< state_t > & equiv_classes )
static

◆ minimize_DFA()

static void minimize_DFA ( automaton_t automaton)
static
The top level function for minimization of deterministic
AUTOMATON.   

References evaluate_equiv_classes(), ggc_alloc(), merge_states(), pass_states(), and set_new_cycle_flags().

Referenced by build_automaton().

◆ n_sep_els()

static int n_sep_els ( const char * s,
int sep,
int par_flag )
static
Given a string and a separator, return the number of separated
elements in it, taking parentheses into account if PAR_FLAG has
nonzero value.  Return 0 for the null string, -1 if parentheses is
not balanced.   

References ggc_alloc().

Referenced by get_str_vect().

◆ NDFA_to_DFA()

◆ next_out_arc()

◆ next_sep_el()

static char * next_sep_el ( const char ** pstr,
int sep,
int par_flag )
static
Given a pointer to a (char *) and a separator, return an alloc'ed
string containing the next separated element, taking parentheses
into account if PAR_FLAG has nonzero value.  Advance the pointer to
after the string scanned, or the end-of-string.  Return NULL if at
end of string.   

References ggc_alloc(), irp, and NULL.

Referenced by get_str_vect().

◆ out_state_arcs_num()

static int out_state_arcs_num ( const_state_t state)
static

◆ output_automata_list_min_issue_delay_code()

static void output_automata_list_min_issue_delay_code ( automata_list_el_t automata_list)
static

◆ output_automata_list_transition_code()

◆ output_automaton_descriptions()

static void output_automaton_descriptions ( void )
static
The following function output readable representation of
DFAs used for fast recognition of pipeline hazards.   

References description::first_automaton, ggc_alloc(), automaton::next_automaton, NULL, output_automaton_name(), output_automaton_units(), output_description_file, and pass_states().

Referenced by write_automata().

◆ output_automaton_name()

static void output_automaton_name ( FILE * f,
automaton_t automaton )
static

◆ output_automaton_units()

static void output_automaton_units ( automaton_t automaton)
static

◆ output_chip_definitions()

static void output_chip_definitions ( void )
static
Output definition of the structure representing current DFA(s)
state(s).   

References CHIP_NAME, description::first_automaton, ggc_alloc(), automaton::next_automaton, NULL, output_chip_member_name(), output_file, and output_state_member_type().

Referenced by write_automata().

◆ output_chip_member_name()

◆ output_cpu_unit_reservation_p()

static void output_cpu_unit_reservation_p ( void )
static
The following function outputs function to check reservation of cpu
unit (its internal code will be passed as the function argument) in
given cpu state.   

References CHIP_NAME, CPU_CODE_PARAMETER_NAME, CPU_UNIT_RESERVATION_P_FUNC_NAME, description::first_automaton, ggc_alloc(), automaton::next_automaton, NULL, output_chip_member_name(), output_file, output_reserved_units_table_name(), description::query_units_num, STATE_NAME, and STATE_TYPE_NAME.

Referenced by write_automata().

◆ output_cycle_reservs()

static void output_cycle_reservs ( FILE * f,
reserv_sets_t reservs,
int start_cycle,
int repetition_num )
static
The function outputs string representation of units reservation on
cycle START_CYCLE in the reservation set.  The function uses repeat
construction if REPETITION_NUM > 1.   

References bitmap_bit_p, CHAR_BIT, els_in_cycle_reserv, gcc_assert, ggc_alloc(), NOTHING_NAME, units_array, and description::units_num.

Referenced by output_reserv_sets().

◆ output_dead_lock_func()

static void output_dead_lock_func ( void )
static
The function outputs PHR interface function `state_dead_lock_p'.   

References CHIP_NAME, DEAD_LOCK_FUNC_NAME, ggc_alloc(), INTERNAL_DEAD_LOCK_FUNC_NAME, output_file, STATE_NAME, and STATE_TYPE_NAME.

Referenced by write_automata().

◆ output_dead_lock_vect()

◆ output_dead_lock_vect_name()

static void output_dead_lock_vect_name ( FILE * f,
automaton_t automaton )
static

◆ output_default_latencies()

static void output_default_latencies ( void )
static
Output the array holding default latency values.  These are used in
insn_latency and maximal_insn_latency function implementations.   

References collapse_flag, DECL_INSN_RESERV, description::decls, description::decls_num, insn_reserv_decl::default_latency, dm_insn_reserv, gcc_assert, ggc_alloc(), i, insn_reserv_decl::insn_num, description::insns_num, decl::mode, description::normal_decls_num, output_file, UCHAR_MAX, and USHRT_MAX.

Referenced by write_automata().

◆ output_description()

◆ output_dfa_clean_insn_cache_func()

static void output_dfa_clean_insn_cache_func ( void )
static
The function outputs PHR interface functions `dfa_clean_insn_cache'
and 'dfa_clear_single_insn_cache'.   

References DFA_CLEAN_INSN_CACHE_FUNC_NAME, DFA_CLEAR_SINGLE_INSN_CACHE_FUNC_NAME, DFA_INSN_CODES_LENGTH_VARIABLE_NAME, DFA_INSN_CODES_VARIABLE_NAME, ggc_alloc(), I_VARIABLE_NAME, INSN_PARAMETER_NAME, and output_file.

Referenced by write_automata().

◆ output_dfa_finish_func()

static void output_dfa_finish_func ( void )
static
The function outputs PHR interface function `dfa_finish'.   

References DFA_FINISH_FUNC_NAME, DFA_INSN_CODES_VARIABLE_NAME, ggc_alloc(), and output_file.

Referenced by write_automata().

◆ output_dfa_insn_code_func()

static void output_dfa_insn_code_func ( void )
static
This function outputs `dfa_insn_code' and its helper function
`dfa_insn_code_enlarge'.   

References DFA_INSN_CODE_FUNC_NAME, DFA_INSN_CODES_LENGTH_VARIABLE_NAME, DFA_INSN_CODES_VARIABLE_NAME, ggc_alloc(), INSN_PARAMETER_NAME, INTERNAL_DFA_INSN_CODE_FUNC_NAME, INTERNAL_INSN_CODE_NAME, and output_file.

Referenced by write_automata().

◆ output_dfa_start_func()

static void output_dfa_start_func ( void )
static
The function outputs PHR interface function `dfa_start'.   

References DFA_CLEAN_INSN_CACHE_FUNC_NAME, DFA_INSN_CODES_LENGTH_VARIABLE_NAME, DFA_INSN_CODES_VARIABLE_NAME, DFA_START_FUNC_NAME, ggc_alloc(), and output_file.

Referenced by write_automata().

◆ output_get_cpu_unit_code_func()

static void output_get_cpu_unit_code_func ( void )
static

◆ output_insn_code_cases()

static void output_insn_code_cases ( void(*)(automata_list_el_t) output_automata_list_code)
static

◆ output_insn_has_dfa_reservation_p()

static void output_insn_has_dfa_reservation_p ( void )
static

◆ output_insn_latency_func()

◆ output_internal_dead_lock_func()

◆ output_internal_insn_code_evaluation()

static void output_internal_insn_code_evaluation ( const char * insn_name,
const char * insn_code_name,
int code )
static
Output code

gcc_checking_assert (insn != 0);
insn_code = dfa_insn_code (insn);
if (insn_code >= DFA__ADVANCE_CYCLE)
  return code;

where insn denotes INSN_NAME, insn_code denotes INSN_CODE_NAME, and
code denotes CODE.   

References ADVANCE_CYCLE_VALUE_NAME, DFA_INSN_CODE_FUNC_NAME, ggc_alloc(), and output_file.

Referenced by output_insn_latency_func(), output_maximal_insn_latency_func(), and output_min_insn_conflict_delay_func().

◆ output_internal_insn_latency_func()

◆ output_internal_maximal_insn_latency_func()

static void output_internal_maximal_insn_latency_func ( void )
static

◆ output_internal_min_issue_delay_func()

◆ output_internal_reset_func()

static void output_internal_reset_func ( void )
static
Output function `internal_reset'.   

References CHIP_NAME, CHIP_PARAMETER_NAME, ggc_alloc(), INTERNAL_RESET_FUNC_NAME, and output_file.

Referenced by write_automata().

◆ output_internal_trans_func()

◆ output_max_insn_queue_index_def()

static void output_max_insn_queue_index_def ( void )
static
The function outputs definition and value of PHR interface variable
`max_insn_queue_index'.  Its value is not less than maximal queue
length needed for the insn scheduler.   

References advance_cycle_insn_decl, DECL_BYPASS, DECL_INSN_RESERV, description::decls, description::decls_num, dm_bypass, dm_insn_reserv, gcc_assert, ggc_alloc(), i, description::max_insn_reserv_cycles, decl::mode, and output_file.

Referenced by write_automata().

◆ output_maximal_insn_latency_func()

static void output_maximal_insn_latency_func ( void )
static
The function outputs PHR interface function `maximal_insn_latency'.   

References ggc_alloc(), INSN_PARAMETER_NAME, INTERNAL_INSN_CODE_NAME, output_file, and output_internal_insn_code_evaluation().

Referenced by write_automata().

◆ output_min_insn_conflict_delay_func()

◆ output_min_issue_delay_func()

◆ output_min_issue_delay_table()

◆ output_min_issue_delay_vect_name()

static void output_min_issue_delay_vect_name ( FILE * f,
automaton_t automaton )
static

◆ output_pattern_set_el_list()

static void output_pattern_set_el_list ( pattern_set_el_t list)
static
Output patterns in LIST separated by comma.   

References ggc_alloc(), i, NULL, and output_description_file.

Referenced by output_description().

◆ output_print_reservation_func()

◆ output_range_type()

static void output_range_type ( FILE * f,
long int min_range_value,
long int max_range_value )
static
This page contains code for output PHR (pipeline hazards recognizer).   
The function outputs minimal C type which is sufficient for
representation numbers in range min_range_value and
max_range_value.  Because host machine and build machine may be
different, we use here minimal values required by ANSI C standard
instead of UCHAR_MAX, SHRT_MAX, SHRT_MIN, etc.  This is a good
approximation.   

References ggc_alloc().

Referenced by output_dead_lock_vect(), output_min_issue_delay_table(), output_reserved_units_table(), output_state_ainsn_table(), output_state_member_type(), and output_translate_vect().

◆ output_regexp()

static void output_regexp ( regexp_t regexp)
static
The page contains code for output description file (readable
representation of original description and generated DFA(s).   
The function outputs string representation of IR reservation.   

References finish_regexp_representation(), ggc_alloc(), output_description_file, and regexp_representation().

Referenced by output_description().

◆ output_reserv_sets()

static void output_reserv_sets ( FILE * f,
reserv_sets_t reservs )
static
The function outputs string representation of units reservation in
the reservation set.   

References els_in_cycle_reserv, ggc_alloc(), max_cycles_num, and output_cycle_reservs().

Referenced by output_state().

◆ output_reserved_units_table()

◆ output_reserved_units_table_name()

static void output_reserved_units_table_name ( FILE * f,
automaton_t automaton )
static
Output name of reserved units table for AUTOMATON into file F.   

References automaton::automaton_order_num, automaton::corresponding_automaton_decl, ggc_alloc(), automaton_decl::name, and NULL.

Referenced by output_cpu_unit_reservation_p(), and output_reserved_units_table().

◆ output_reset_func()

static void output_reset_func ( void )
static
The function outputs PHR interface function `state_reset'.   

References CHIP_NAME, ggc_alloc(), INTERNAL_RESET_FUNC_NAME, output_file, RESET_FUNC_NAME, STATE_NAME, and STATE_TYPE_NAME.

Referenced by write_automata().

◆ output_size_func()

static void output_size_func ( void )
static
The function outputs PHR interface function `state_size'.   

References CHIP_NAME, ggc_alloc(), output_file, and SIZE_FUNC_NAME.

Referenced by write_automata().

◆ output_state()

static void output_state ( state_t state)
static
The following function output readable representation of DFA(s)
state used for fast recognition of pipeline hazards.  State is
described by possible (current and scheduled) cpu unit
reservations.   

References add_state_reservs(), ggc_alloc(), i, state::new_cycle_p, state::order_state_num, output_description_file, output_reserv_sets(), output_state_arcs(), remove_state_duplicate_reservs(), state_reservs, and state_reservs_cmp().

◆ output_state_ainsn_table()

static void output_state_ainsn_table ( state_ainsn_table_t tab,
const char * table_name,
void(*)(FILE *, automaton_t) output_full_vect_name_func,
void(*)(FILE *, automaton_t) output_comb_vect_name_func,
void(*)(FILE *, automaton_t) output_check_vect_name_func,
void(*)(FILE *, automaton_t) output_base_vect_name_func )
static
The following function outputs the best C representation of the
table TAB of given TABLE_NAME.   

References comb_vect_p(), ggc_alloc(), output_file, output_range_type(), and output_vect().

Referenced by output_trans_table().

◆ output_state_arcs()

◆ output_state_member_type()

static void output_state_member_type ( FILE * f,
automaton_t automaton )
static
Output C type which is used for representation of codes of states
of AUTOMATON.   

References automaton::achieved_states_num, and output_range_type().

Referenced by output_automata_list_transition_code(), and output_chip_definitions().

◆ output_statistics()

◆ output_tables()

◆ output_temp_chip_member_name()

static void output_temp_chip_member_name ( FILE * f,
automaton_t automaton )
static
The following is name of temporary variable which stores state of a
DFA for PHR.   

References ggc_alloc(), and output_chip_member_name().

Referenced by output_automata_list_transition_code().

◆ output_time_statistics()

static void output_time_statistics ( FILE * f)
static
The function output times of work of different phases of DFA
generator.   

References automaton_generation_time, equiv_time, ggc_alloc(), minimize_time, ndfa_flag, NDFA_time, NDFA_to_DFA_time, output_time, print_active_time(), and transform_time.

Referenced by write_automata().

◆ output_trans_base_vect_name()

static void output_trans_base_vect_name ( FILE * f,
automaton_t automaton )
static
Output name of base vector of the transition table for given
automaton.   

References automaton::automaton_order_num, automaton::corresponding_automaton_decl, ggc_alloc(), automaton_decl::name, and NULL.

Referenced by output_automata_list_transition_code(), and output_trans_table().

◆ output_trans_check_vect_name()

static void output_trans_check_vect_name ( FILE * f,
automaton_t automaton )
static
Output name of check vector of the transition table for given
automaton.   

References automaton::automaton_order_num, automaton::corresponding_automaton_decl, ggc_alloc(), automaton_decl::name, and NULL.

Referenced by output_automata_list_transition_code(), and output_trans_table().

◆ output_trans_comb_vect_name()

static void output_trans_comb_vect_name ( FILE * f,
automaton_t automaton )
static
Output name of comb vector of the transition table for given
automaton.   

References automaton::automaton_order_num, automaton::corresponding_automaton_decl, ggc_alloc(), automaton_decl::name, and NULL.

Referenced by output_automata_list_transition_code(), and output_trans_table().

◆ output_trans_full_vect_name()

static void output_trans_full_vect_name ( FILE * f,
automaton_t automaton )
static

◆ output_trans_func()

◆ output_trans_table()

◆ output_translate_vect()

static void output_translate_vect ( automaton_t automaton)
static
The function outputs translate vector of internal insn code into
insn equivalence class number.  The equivalence class number is
used to access to table and vectors representing DFA(s).   

References automaton::ainsn_list, ggc_alloc(), ainsn::insn_equiv_class_num, automaton::insn_equiv_classes_num, insn_reserv_decl::insn_num, ainsn::insn_reserv_decl, description::insns_num, ainsn::next_ainsn, NULL, output_file, output_range_type(), output_translate_vect_name(), and output_vect().

Referenced by output_tables().

◆ output_translate_vect_name()

static void output_translate_vect_name ( FILE * f,
automaton_t automaton )
static

◆ output_unit_set_el_list()

static void output_unit_set_el_list ( unit_set_el_t list)
static
Output names of units in LIST separated by comma.   

References ggc_alloc(), NULL, and output_description_file.

Referenced by output_description().

◆ output_vect()

static void output_vect ( vla_hwint_t vect)
static
The function outputs all initialization values of VECT.   

References ggc_alloc(), i, and output_file.

Referenced by output_dead_lock_vect(), output_min_issue_delay_table(), output_reserved_units_table(), output_state_ainsn_table(), and output_translate_vect().

◆ parse_automata_opt()

static bool parse_automata_opt ( const char * str)
static
A function passed as argument to init_rtx_reader_args_cb.  It parses the
options available for genautomata.  Returns true if the option was
recognized.   

References collapse_flag, COLLAPSE_OPTION, fatal(), ggc_alloc(), ndfa_flag, NDFA_OPTION, no_minimization_flag, NO_MINIMIZATION_OPTION, progress_flag, PROGRESS_OPTION, stats_flag, STATS_OPTION, time_flag, TIME_OPTION, v_flag, V_OPTION, w_flag, and W_OPTION.

Referenced by main().

◆ partition_equiv_class()

static int partition_equiv_class ( state_t first_state,
int odd_iteration_flag,
vec< state_t > * next_iteration_classes,
int * new_equiv_class_num_ptr )
static
The function processes equivalence class given by its first state,
FIRST_STATE, on odd iteration if ODD_ITERATION_FLAG.  If there
are not equivalent states, the function partitions the class
removing nonequivalent states and placing them in
*NEXT_ITERATION_CLASSES, increments *NEW_EQUIV_CLASS_NUM_PTR ans
assigns it to the state equivalence number.  If the class has been
partitioned, the function returns nonzero value.   

References clear_arc_insns_equiv_num(), ggc_alloc(), NULL, set_out_arc_insns_equiv_num(), and state_is_differed().

Referenced by evaluate_equiv_classes().

◆ pass_state_graph()

static void pass_state_graph ( state_t start_state,
void(*)(state_t state) applied_func )
static
This recursive function passes all states achieved from START_STATE
and applies APPLIED_FUNC to them.   

References curr_state_graph_pass_num, first_out_arc(), ggc_alloc(), next_out_arc(), NULL, state::pass_num, pass_state_graph(), and arc::to_state.

Referenced by pass_state_graph(), and pass_states().

◆ pass_states()

◆ print_active_time()

static void print_active_time ( FILE * f,
ticker_t ticker )
static
The following function returns string representation of active time
  of given ticker.  The result is string representation of seconds
  with accuracy of 1/100 second.  Only result of the last call of the
  function exists.  Therefore the following code is not correct

     printf ("parser time: %s\ngeneration time: %s\n",
             active_time_string (parser_ticker),
             active_time_string (generation_ticker));

  Correct code has to be the following

     printf ("parser time: %s\n", active_time_string (parser_ticker));
     printf ("generation time: %s\n",
             active_time_string (generation_ticker));

References active_time(), and ggc_alloc().

Referenced by output_time_statistics(), and write_automata().

◆ process_alts_for_forming_states()

static void process_alts_for_forming_states ( regexp_t regexp,
automaton_t automaton,
int inside_oneof_p )
static
This recursive function processes `|' in reservation REGEXP for
forming alt_states of AUTOMATON.  List of the alt states should
have the same order as in the description.   

References alt_state_being_formed, ainsn::alt_states, curr_ainsn, finish_forming_alt_state(), gcc_assert, get_free_alt_state(), get_free_state(), ggc_alloc(), i, regexp::mode, alt_state::next_alt_state, process_alts_for_forming_states(), process_seq_for_forming_states(), REGEXP_ONEOF, rm_oneof, alt_state::state, and state_being_formed.

Referenced by create_alt_states(), and process_alts_for_forming_states().

◆ process_bypass()

static void process_bypass ( decl_t bypass)
static
Process define_bypass decl BYPASS, inserting a bypass for each specific
pair of insn reservations.   

References DECL_BYPASS, for_each_matching_insn(), bypass_decl::in_pattern, NULL, and process_bypass_1().

Referenced by process_decls().

◆ process_bypass_1()

static void process_bypass_1 ( decl_t bypass,
decl_t in_insn_reserv,
void * data )
static
A subroutine of process_bypass that is called for each input
instruction IN_INSN_RESERV.   

References DECL_BYPASS, for_each_matching_insn(), bypass_decl::in_insn_reserv, bypass_decl::out_pattern, and process_bypass_2().

Referenced by process_bypass().

◆ process_bypass_2()

static void process_bypass_2 ( decl_t model,
decl_t out_insn_reserv,
void * data )
static
A subroutine of process_bypass that is called for each pair
of matching instructions.  OUT_INSN_RESERV is the output
instruction and DATA is the input instruction.   

References bypass_decl::bypass_guard_name, DECL_BYPASS, DECL_INSN_RESERV, ggc_alloc(), bypass_decl::in_insn_reserv, bypass_decl::in_pattern, insert_bypass(), bypass_decl::latency, bypass_decl::out_insn_reserv, and bypass_decl::out_pattern.

Referenced by process_bypass_1().

◆ process_decls()

◆ process_excls()

static unit_set_el_t process_excls ( char ** names,
int num,
pos_t excl_pos )
static
This page contains checker of pipeline hazard description.   
Checking NAMES in an exclusion clause vector and returning formed
unit_set_el_list.   

References DECL_UNIT, dm_unit, error(), find_decl(), ggc_alloc(), i, names, NULL, and XCREATENODE.

Referenced by process_decls().

◆ process_insn_equiv_class()

static void process_insn_equiv_class ( ainsn_t ainsn,
arc_t * insn_arcs_array )
static
The function processes AINSN of a state in order to find equivalent
ainsns.  INSN_ARCS_ARRAY is table: code of insn -> out arc of the
state.   

References curr_insn, delete_ainsn_from_equiv_class(), gcc_assert, ggc_alloc(), insert_ainsn_into_equiv_class(), insn_reserv_decl::insn_num, ainsn::insn_reserv_decl, next_insn(), NULL, and arc::to_state.

Referenced by process_state_for_insn_equiv_partition().

◆ process_presence_absence_names()

static unit_set_el_t process_presence_absence_names ( char ** names,
int num,
pos_t req_pos,
int presence_p,
int final_p )
static
Checking NAMES in presence/absence clause and returning the
formed unit_set_el_list.  The function is called only after
processing all exclusion sets.   

References DECL_UNIT, dm_unit, error(), find_decl(), ggc_alloc(), i, names, NULL, and XCREATENODE.

Referenced by process_decls().

◆ process_presence_absence_patterns()

static pattern_set_el_t process_presence_absence_patterns ( char *** patterns,
int num,
pos_t req_pos,
int presence_p,
int final_p )
static
Checking NAMES in patterns of a presence/absence clause and
returning the formed pattern_set_el_list.  The function is called
only after processing all exclusion sets.   

References DECL_UNIT, dm_unit, error(), find_decl(), ggc_alloc(), i, NULL, patterns, and XCREATENODEVAR.

Referenced by process_decls().

◆ process_regexp()

static regexp_t process_regexp ( regexp_t regexp)
static
The following recursive function processes all regexp in order to
fix usage of units or reservations and to fix errors of undeclared
name.  The function may change unit_regexp onto reserv_regexp.
Remember that reserv_regexp does not exist before the function
call.   

References DECL_RESERV, DECL_UNIT, dm_reserv, dm_unit, error(), find_decl(), gcc_unreachable, ggc_alloc(), i, regexp::mode, NULL, regexp::pos, process_regexp(), REGEXP_ALLOF, REGEXP_ONEOF, REGEXP_REPEAT, REGEXP_RESERV, REGEXP_SEQUENCE, REGEXP_UNIT, rm_allof, rm_nothing, rm_oneof, rm_repeat, rm_reserv, rm_sequen