GCC Middle and Back End API Reference
ira-int.h File Reference
#include "recog.h"
#include "function-abi.h"
Include dependency graph for ira-int.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ira_loop_tree_node
 
struct  live_range
 
struct  ira_object
 
struct  ira_allocno
 
struct  ira_emit_data
 
struct  ira_allocno_pref
 
struct  ira_allocno_copy
 
class  ira_spilled_reg_stack_slot
 
struct  minmax_set_iterator
 
class  target_ira_int
 
struct  ira_allocno_iterator
 
struct  ira_object_iterator
 
struct  ira_allocno_object_iterator
 
struct  ira_pref_iterator
 
struct  ira_copy_iterator
 
struct  ira_object_conflict_iterator
 
class  ira_loop_border_costs
 

Macros

#define ira_assert(c)   ((void)(0 && (c)))
 
#define REG_FREQ_FROM_EDGE_FREQ(freq)
 
#define IRA_BB_NODE_BY_INDEX(index)   (&ira_bb_nodes[index])
 
#define IRA_BB_NODE(bb)   IRA_BB_NODE_BY_INDEX ((bb)->index)
 
#define IRA_LOOP_NODE_BY_INDEX(index)   (&ira_loop_nodes[index])
 
#define IRA_LOOP_NODE(loop)   IRA_LOOP_NODE_BY_INDEX ((loop)->num)
 
#define ALLOCNO_NUM(A)   ((A)->num)
 
#define ALLOCNO_REGNO(A)   ((A)->regno)
 
#define ALLOCNO_REG(A)   ((A)->reg)
 
#define ALLOCNO_NEXT_REGNO_ALLOCNO(A)   ((A)->next_regno_allocno)
 
#define ALLOCNO_LOOP_TREE_NODE(A)   ((A)->loop_tree_node)
 
#define ALLOCNO_CAP(A)   ((A)->cap)
 
#define ALLOCNO_CAP_MEMBER(A)   ((A)->cap_member)
 
#define ALLOCNO_NREFS(A)   ((A)->nrefs)
 
#define ALLOCNO_FREQ(A)   ((A)->freq)
 
#define ALLOCNO_MIGHT_CONFLICT_WITH_PARENT_P(A)    ((A)->might_conflict_with_parent_p)
 
#define ALLOCNO_REGISTER_FILTERS(A)   0
 
#define ALLOCNO_SET_REGISTER_FILTERS(A, X)   ((void) (A), gcc_assert ((X) == 0))
 
#define ALLOCNO_HARD_REGNO(A)   ((A)->hard_regno)
 
#define ALLOCNO_CALL_FREQ(A)   ((A)->call_freq)
 
#define ALLOCNO_CALLS_CROSSED_NUM(A)   ((A)->calls_crossed_num)
 
#define ALLOCNO_CHEAP_CALLS_CROSSED_NUM(A)   ((A)->cheap_calls_crossed_num)
 
#define ALLOCNO_CROSSED_CALLS_ABIS(A)   ((A)->crossed_calls_abis)
 
#define ALLOCNO_CROSSED_CALLS_CLOBBERED_REGS(A)    ((A)->crossed_calls_clobbered_regs)
 
#define ALLOCNO_MEM_OPTIMIZED_DEST(A)   ((A)->mem_optimized_dest)
 
#define ALLOCNO_MEM_OPTIMIZED_DEST_P(A)   ((A)->mem_optimized_dest_p)
 
#define ALLOCNO_SOMEWHERE_RENAMED_P(A)   ((A)->somewhere_renamed_p)
 
#define ALLOCNO_CHILD_RENAMED_P(A)   ((A)->child_renamed_p)
 
#define ALLOCNO_DONT_REASSIGN_P(A)   ((A)->dont_reassign_p)
 
#define ALLOCNO_BAD_SPILL_P(A)   ((A)->bad_spill_p)
 
#define ALLOCNO_ASSIGNED_P(A)   ((A)->assigned_p)
 
#define ALLOCNO_MODE(A)   ((A)->mode)
 
#define ALLOCNO_WMODE(A)   ((A)->wmode)
 
#define ALLOCNO_PREFS(A)   ((A)->allocno_prefs)
 
#define ALLOCNO_COPIES(A)   ((A)->allocno_copies)
 
#define ALLOCNO_HARD_REG_COSTS(A)   ((A)->hard_reg_costs)
 
#define ALLOCNO_UPDATED_HARD_REG_COSTS(A)   ((A)->updated_hard_reg_costs)
 
#define ALLOCNO_CONFLICT_HARD_REG_COSTS(A)    ((A)->conflict_hard_reg_costs)
 
#define ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS(A)    ((A)->updated_conflict_hard_reg_costs)
 
#define ALLOCNO_CLASS(A)   ((A)->aclass)
 
#define ALLOCNO_CLASS_COST(A)   ((A)->class_cost)
 
#define ALLOCNO_UPDATED_CLASS_COST(A)   ((A)->updated_class_cost)
 
#define ALLOCNO_MEMORY_COST(A)   ((A)->memory_cost)
 
#define ALLOCNO_UPDATED_MEMORY_COST(A)   ((A)->updated_memory_cost)
 
#define ALLOCNO_EXCESS_PRESSURE_POINTS_NUM(A)    ((A)->excess_pressure_points_num)
 
#define ALLOCNO_OBJECT(A, N)   ((A)->objects[N])
 
#define ALLOCNO_NUM_OBJECTS(A)   ((A)->num_objects)
 
#define ALLOCNO_ADD_DATA(A)   ((A)->add_data)
 
#define ALLOCNO_EMIT_DATA(a)   ((ira_emit_data_t) ALLOCNO_ADD_DATA (a))
 
#define OBJECT_ALLOCNO(O)   ((O)->allocno)
 
#define OBJECT_SUBWORD(O)   ((O)->subword)
 
#define OBJECT_CONFLICT_ARRAY(O)   ((O)->conflicts_array)
 
#define OBJECT_CONFLICT_VEC(O)   ((ira_object_t *)(O)->conflicts_array)
 
#define OBJECT_CONFLICT_BITVEC(O)   ((IRA_INT_TYPE *)(O)->conflicts_array)
 
#define OBJECT_CONFLICT_ARRAY_SIZE(O)   ((O)->conflicts_array_size)
 
#define OBJECT_CONFLICT_VEC_P(O)   ((O)->conflict_vec_p)
 
#define OBJECT_NUM_CONFLICTS(O)   ((O)->num_accumulated_conflicts)
 
#define OBJECT_CONFLICT_HARD_REGS(O)   ((O)->conflict_hard_regs)
 
#define OBJECT_TOTAL_CONFLICT_HARD_REGS(O)   ((O)->total_conflict_hard_regs)
 
#define OBJECT_MIN(O)   ((O)->min)
 
#define OBJECT_MAX(O)   ((O)->max)
 
#define OBJECT_CONFLICT_ID(O)   ((O)->id)
 
#define OBJECT_LIVE_RANGES(O)   ((O)->live_ranges)
 
#define IRA_INT_BITS   HOST_BITS_PER_WIDE_INT
 
#define IRA_INT_TYPE   HOST_WIDE_INT
 
#define SET_MINMAX_SET_BIT(R, I, MIN, MAX)
 
#define CLEAR_MINMAX_SET_BIT(R, I, MIN, MAX)
 
#define TEST_MINMAX_SET_BIT(R, I, MIN, MAX)
 
#define FOR_EACH_BIT_IN_MINMAX_SET(VEC, MIN, MAX, N, ITER)
 
#define this_target_ira_int   (&default_target_ira_int)
 
#define ira_reg_mode_hard_regset    (this_target_ira_int->x_ira_reg_mode_hard_regset)
 
#define ira_register_move_cost    (this_target_ira_int->x_ira_register_move_cost)
 
#define ira_max_memory_move_cost    (this_target_ira_int->x_ira_max_memory_move_cost)
 
#define ira_may_move_in_cost    (this_target_ira_int->x_ira_may_move_in_cost)
 
#define ira_may_move_out_cost    (this_target_ira_int->x_ira_may_move_out_cost)
 
#define ira_reg_allocno_class_p    (this_target_ira_int->x_ira_reg_allocno_class_p)
 
#define ira_reg_pressure_class_p    (this_target_ira_int->x_ira_reg_pressure_class_p)
 
#define ira_non_ordered_class_hard_regs    (this_target_ira_int->x_ira_non_ordered_class_hard_regs)
 
#define ira_class_hard_reg_index    (this_target_ira_int->x_ira_class_hard_reg_index)
 
#define ira_useful_class_mode_regs    (this_target_ira_int->x_ira_useful_class_mode_regs)
 
#define ira_important_classes_num    (this_target_ira_int->x_ira_important_classes_num)
 
#define ira_important_classes    (this_target_ira_int->x_ira_important_classes)
 
#define ira_important_class_nums    (this_target_ira_int->x_ira_important_class_nums)
 
#define ira_uniform_class_p    (this_target_ira_int->x_ira_uniform_class_p)
 
#define ira_reg_class_intersect    (this_target_ira_int->x_ira_reg_class_intersect)
 
#define ira_reg_class_super_classes    (this_target_ira_int->x_ira_reg_class_super_classes)
 
#define ira_reg_class_subunion    (this_target_ira_int->x_ira_reg_class_subunion)
 
#define ira_reg_class_superunion    (this_target_ira_int->x_ira_reg_class_superunion)
 
#define ira_prohibited_mode_move_regs    (this_target_ira_int->x_ira_prohibited_mode_move_regs)
 
#define FOR_EACH_ALLOCNO(A, ITER)
 
#define FOR_EACH_OBJECT(OBJ, ITER)
 
#define FOR_EACH_ALLOCNO_OBJECT(A, O, ITER)
 
#define FOR_EACH_PREF(P, ITER)
 
#define FOR_EACH_COPY(C, ITER)
 
#define FOR_EACH_OBJECT_CONFLICT(OBJ, CONF, ITER)
 

Typedefs

typedef struct live_rangelive_range_t
 
typedef struct ira_allocnoira_allocno_t
 
typedef struct ira_allocno_prefira_pref_t
 
typedef struct ira_allocno_copyira_copy_t
 
typedef struct ira_objectira_object_t
 
typedef struct ira_loop_tree_nodeira_loop_tree_node_t
 
typedef unsigned short move_table[N_REG_CLASSES]
 
typedef struct ira_emit_dataira_emit_data_t
 

Functions

rtx allocno_emit_reg (ira_allocno_t a)
 
void minmax_set_iter_init (minmax_set_iterator *i, IRA_INT_TYPE *vec, int min, int max)
 
bool minmax_set_iter_cond (minmax_set_iterator *i, int *n)
 
void minmax_set_iter_next (minmax_set_iterator *i)
 
void * ira_allocate (size_t)
 
void ira_free (void *addr)
 
bitmap ira_allocate_bitmap (void)
 
void ira_free_bitmap (bitmap)
 
void ira_print_disposition (FILE *)
 
void ira_debug_disposition (void)
 
void ira_debug_allocno_classes (void)
 
void ira_init_register_move_cost (machine_mode)
 
alternative_mask ira_setup_alts (rtx_insn *)
 
int ira_get_dup_out_num (int, alternative_mask, bool &)
 
void ira_debug_pref (ira_pref_t)
 
void ira_debug_prefs (void)
 
void ira_debug_allocno_prefs (ira_allocno_t)
 
void ira_debug_copy (ira_copy_t)
 
void debug (ira_allocno_copy &ref)
 
void debug (ira_allocno_copy *ptr)
 
void ira_debug_copies (void)
 
void ira_debug_allocno_copies (ira_allocno_t)
 
void debug (ira_allocno &ref)
 
void debug (ira_allocno *ptr)
 
void ira_traverse_loop_tree (bool, ira_loop_tree_node_t, void(*)(ira_loop_tree_node_t), void(*)(ira_loop_tree_node_t))
 
ira_allocno_t ira_parent_allocno (ira_allocno_t)
 
ira_allocno_t ira_parent_or_cap_allocno (ira_allocno_t)
 
ira_allocno_t ira_create_allocno (int, bool, ira_loop_tree_node_t)
 
void ira_create_allocno_objects (ira_allocno_t)
 
void ira_set_allocno_class (ira_allocno_t, enum reg_class)
 
bool ira_conflict_vector_profitable_p (ira_object_t, int)
 
void ira_allocate_conflict_vec (ira_object_t, int)
 
void ira_allocate_object_conflicts (ira_object_t, int)
 
void ior_hard_reg_conflicts (ira_allocno_t, const_hard_reg_set)
 
void ira_print_expanded_allocno (ira_allocno_t)
 
void ira_add_live_range_to_object (ira_object_t, int, int)
 
live_range_t ira_create_live_range (ira_object_t, int, int, live_range_t)
 
live_range_t ira_copy_live_range_list (live_range_t)
 
live_range_t ira_merge_live_ranges (live_range_t, live_range_t)
 
bool ira_live_ranges_intersect_p (live_range_t, live_range_t)
 
void ira_finish_live_range (live_range_t)
 
void ira_finish_live_range_list (live_range_t)
 
void ira_free_allocno_updated_costs (ira_allocno_t)
 
ira_pref_t ira_create_pref (ira_allocno_t, int, int)
 
void ira_add_allocno_pref (ira_allocno_t, int, int)
 
void ira_remove_pref (ira_pref_t)
 
void ira_remove_allocno_prefs (ira_allocno_t)
 
ira_copy_t ira_create_copy (ira_allocno_t, ira_allocno_t, int, bool, rtx_insn *, ira_loop_tree_node_t)
 
ira_copy_t ira_add_allocno_copy (ira_allocno_t, ira_allocno_t, int, bool, rtx_insn *, ira_loop_tree_node_t)
 
int * ira_allocate_cost_vector (reg_class_t)
 
void ira_free_cost_vector (int *, reg_class_t)
 
void ira_flattening (int, int)
 
bool ira_build (void)
 
void ira_destroy (void)
 
void ira_init_costs_once (void)
 
void ira_init_costs (void)
 
void ira_costs (void)
 
void ira_tune_allocno_costs (void)
 
void ira_rebuild_start_finish_chains (void)
 
void ira_print_live_range_list (FILE *, live_range_t)
 
void debug (live_range &ref)
 
void debug (live_range *ptr)
 
void ira_debug_live_range_list (live_range_t)
 
void ira_debug_allocno_live_ranges (ira_allocno_t)
 
void ira_debug_live_ranges (void)
 
void ira_create_allocno_live_ranges (void)
 
void ira_compress_allocno_live_ranges (void)
 
void ira_finish_allocno_live_ranges (void)
 
void ira_implicitly_set_insn_hard_regs (HARD_REG_SET *, alternative_mask)
 
void ira_debug_conflicts (bool)
 
void ira_build_conflicts (void)
 
ira_allocno_t ira_soft_conflict (ira_allocno_t, ira_allocno_t)
 
void ira_debug_hard_regs_forest (void)
 
int ira_loop_edge_freq (ira_loop_tree_node_t, int, bool)
 
void ira_reassign_conflict_allocnos (int)
 
void ira_initiate_assign (void)
 
void ira_finish_assign (void)
 
void ira_color (void)
 
void ira_initiate_emit_data (void)
 
void ira_finish_emit_data (void)
 
void ira_emit (bool)
 
bool ira_equiv_no_lvalue_p (int regno)
 
void ira_init_register_move_cost_if_necessary (machine_mode mode)
 
void ira_allocno_iter_init (ira_allocno_iterator *i)
 
bool ira_allocno_iter_cond (ira_allocno_iterator *i, ira_allocno_t *a)
 
void ira_object_iter_init (ira_object_iterator *i)
 
bool ira_object_iter_cond (ira_object_iterator *i, ira_object_t *obj)
 
void ira_allocno_object_iter_init (ira_allocno_object_iterator *i)
 
bool ira_allocno_object_iter_cond (ira_allocno_object_iterator *i, ira_allocno_t a, ira_object_t *o)
 
void ira_pref_iter_init (ira_pref_iterator *i)
 
bool ira_pref_iter_cond (ira_pref_iterator *i, ira_pref_t *pref)
 
void ira_copy_iter_init (ira_copy_iterator *i)
 
bool ira_copy_iter_cond (ira_copy_iterator *i, ira_copy_t *cp)
 
void ira_object_conflict_iter_init (ira_object_conflict_iterator *i, ira_object_t obj)
 
bool ira_object_conflict_iter_cond (ira_object_conflict_iterator *i, ira_object_t *pobj)
 
bool ira_hard_reg_set_intersection_p (int hard_regno, machine_mode mode, HARD_REG_SET hard_regset)
 
int hard_reg_set_size (HARD_REG_SET set)
 
bool ira_hard_reg_in_set_p (int hard_regno, machine_mode mode, HARD_REG_SET hard_regset)
 
void ira_allocate_and_set_costs (int **vec, reg_class_t aclass, int val)
 
void ira_allocate_and_copy_costs (int **vec, enum reg_class aclass, int *src)
 
void ira_allocate_and_accumulate_costs (int **vec, enum reg_class aclass, int *src)
 
void ira_allocate_and_set_or_copy_costs (int **vec, enum reg_class aclass, int val, int *src)
 
rtx ira_create_new_reg (rtx)
 
HARD_REG_SET ira_need_caller_save_regs (ira_allocno_t a)
 
bool ira_need_caller_save_p (ira_allocno_t a, unsigned int regno)
 
bool ira_subloop_allocnos_can_differ_p (ira_allocno_t a, bool allocated_p=true, bool exclude_old_reload=true)
 
bool ira_single_region_allocno_p (ira_allocno_t a, ira_allocno_t subloop_a)
 
HARD_REG_SET ira_total_conflict_hard_regs (ira_allocno_t a)
 
int ira_caller_save_cost (ira_allocno_t a)
 
bool ira_caller_save_loop_spill_p (ira_allocno_t a, ira_allocno_t subloop_a, int spill_cost)
 

Variables

int internal_flag_ira_verbose
 
FILE * ira_dump_file
 
ira_loop_tree_node_t ira_loop_tree_root
 
int ira_loop_tree_height
 
ira_loop_tree_node_t ira_bb_nodes
 
ira_loop_tree_node_t ira_loop_nodes
 
int ira_max_point
 
live_range_tira_start_point_ranges
 
live_range_tira_finish_point_ranges
 
ira_emit_data_t ira_allocno_emit_data
 
ira_allocno_tira_regno_allocno_map
 
ira_allocno_tira_allocnos
 
int ira_allocnos_num
 
ira_object_tira_object_id_map
 
int ira_objects_num
 
ira_pref_tira_prefs
 
int ira_prefs_num
 
ira_copy_tira_copies
 
int ira_copies_num
 
int ira_spilled_reg_stack_slots_num
 
class ira_spilled_reg_stack_slotira_spilled_reg_stack_slots
 
int64_t ira_overall_cost
 
int64_t ira_reg_cost
 
int64_t ira_mem_cost
 
int64_t ira_load_cost
 
int64_t ira_store_cost
 
int64_t ira_shuffle_cost
 
int ira_move_loops_num
 
int ira_additional_jumps_num
 
class target_ira_int default_target_ira_int
 
ira_loop_tree_node_t ira_curr_loop_tree_node
 
ira_allocno_tira_curr_regno_allocno_map
 
int first_moveable_pseudo
 
int last_moveable_pseudo
 

Macro Definition Documentation

◆ ALLOCNO_ADD_DATA

◆ ALLOCNO_ASSIGNED_P

◆ ALLOCNO_BAD_SPILL_P

◆ ALLOCNO_CALL_FREQ

◆ ALLOCNO_CALLS_CROSSED_NUM

◆ ALLOCNO_CAP

◆ ALLOCNO_CAP_MEMBER

◆ ALLOCNO_CHEAP_CALLS_CROSSED_NUM

◆ ALLOCNO_CHILD_RENAMED_P

#define ALLOCNO_CHILD_RENAMED_P ( A)    ((A)->child_renamed_p)

◆ ALLOCNO_CLASS

#define ALLOCNO_CLASS ( A)    ((A)->aclass)

Referenced by add_allocno_to_bucket(), allocno_copy_cost_saving(), allocno_reload_assign(), allocno_spill_priority(), assign_hard_reg(), bucket_allocno_compare_func(), build_conflict_bit_table(), build_object_conflicts(), calculate_allocation_cost(), calculate_spill_cost(), change_loop(), check_and_make_def_conflict(), check_hard_reg_p(), color_allocnos(), color_pass(), create_cap_allocno(), delete_allocno_from_bucket(), emit_move_list(), fast_allocation(), get_conflict_and_start_profitable_regs(), improve_allocation(), ira_build_conflicts(), ira_caller_save_cost(), ira_create_allocno(), ira_create_allocno_objects(), ira_create_object(), ira_flattening(), ira_free_allocno_costs(), ira_free_allocno_updated_costs(), ira_mark_allocation_change(), ira_propagate_hard_reg_costs(), ira_reassign_conflict_allocnos(), ira_set_allocno_class(), ira_single_region_allocno_p(), ira_subloop_allocnos_can_differ_p(), ira_tune_allocno_costs(), make_pseudo_conflict(), mark_pseudo_regno_dead(), mark_pseudo_regno_live(), mark_pseudo_regno_subword_dead(), mark_pseudo_regno_subword_live(), modify_move_list(), move_spill_restore(), pop_allocnos_from_stack(), print_allocno_conflicts(), process_bb_node_for_hard_reg_moves(), process_register_constraint_filters(), process_regs_for_copy(), process_single_reg_class_operands(), propagate_allocno_info(), propagate_some_info_from_allocno(), push_allocno_to_stack(), push_allocnos_to_stack(), queue_update_cost(), setup_allocno_assignment_flags(), setup_allocno_available_regs_num(), setup_allocno_class_and_costs(), setup_allocno_priorities(), setup_left_conflict_sizes_p(), setup_min_max_conflict_allocno_ids(), setup_profitable_hard_regs(), update_allocno_cost(), update_allocno_pressure_excess_length(), update_bad_spill_attribute(), update_conflict_hard_reg_costs(), update_conflict_hard_regno_costs(), update_costs(), update_costs_from_allocno(), update_costs_from_copies(), update_curr_costs(), and update_left_conflict_sizes_p().

◆ ALLOCNO_CLASS_COST

◆ ALLOCNO_CONFLICT_HARD_REG_COSTS

◆ ALLOCNO_COPIES

◆ ALLOCNO_CROSSED_CALLS_ABIS

◆ ALLOCNO_CROSSED_CALLS_CLOBBERED_REGS

◆ ALLOCNO_DONT_REASSIGN_P

#define ALLOCNO_DONT_REASSIGN_P ( A)    ((A)->dont_reassign_p)

◆ ALLOCNO_EMIT_DATA

◆ ALLOCNO_EXCESS_PRESSURE_POINTS_NUM

◆ ALLOCNO_FREQ

◆ ALLOCNO_HARD_REG_COSTS

◆ ALLOCNO_HARD_REGNO

◆ ALLOCNO_LOOP_TREE_NODE

◆ ALLOCNO_MEM_OPTIMIZED_DEST

#define ALLOCNO_MEM_OPTIMIZED_DEST ( A)    ((A)->mem_optimized_dest)

◆ ALLOCNO_MEM_OPTIMIZED_DEST_P

#define ALLOCNO_MEM_OPTIMIZED_DEST_P ( A)    ((A)->mem_optimized_dest_p)

◆ ALLOCNO_MEMORY_COST

◆ ALLOCNO_MIGHT_CONFLICT_WITH_PARENT_P

#define ALLOCNO_MIGHT_CONFLICT_WITH_PARENT_P ( A)     ((A)->might_conflict_with_parent_p)

◆ ALLOCNO_MODE

◆ ALLOCNO_NEXT_REGNO_ALLOCNO

◆ ALLOCNO_NREFS

◆ ALLOCNO_NUM

#define ALLOCNO_NUM ( A)    ((A)->num)
All members of the allocno structures should be accessed only
through the following macros.   

Referenced by add_range_and_copies_from_move_list(), allocno_cost_compare_func(), allocno_priority_compare_func(), allocno_spill_priority_compare(), assign_hard_reg(), bucket_allocno_compare_func(), build_object_conflicts(), coalesce_allocnos(), coalesce_spill_slots(), coalesced_allocno_conflict_p(), color_pass(), copy_allocno_live_ranges(), create_caps(), create_loop_allocnos(), find_costs_and_classes(), form_threads_from_colorable_allocno(), form_threads_from_copies(), generate_edge_moves(), get_next_update_cost(), improve_allocation(), ira_create_allocno(), ira_flattening(), ira_free_allocno_costs(), ira_initiate_emit_data(), ira_print_disposition(), ira_print_expanded_allocno(), ira_reassign_conflict_allocnos(), ira_reassign_pseudos(), ira_sort_regnos_for_alter_reg(), mark_pseudo_regno_dead(), mark_pseudo_regno_live(), mark_pseudo_regno_subword_dead(), mark_pseudo_regno_subword_live(), merge_allocnos(), modify_move_list(), move_allocno_live_ranges(), move_spill_restore(), object_range_compare_func(), print_allocno_conflicts(), print_allocno_copies(), print_allocno_costs(), print_allocno_live_ranges(), print_allocno_prefs(), print_copy(), print_move_list(), print_pref(), process_bb_node_lives(), propagate_allocno_info(), push_allocno_to_stack(), queue_update_cost(), regno_allocno_order_compare_func(), remove_unnecessary_allocnos(), restore_costs_from_copies(), setup_allocno_available_regs_num(), setup_allocno_class_and_costs(), setup_allocno_priorities(), swap_allocno_copy_ends_if_necessary(), update_costs_from_allocno(), update_costs_from_copies(), and update_costs_from_prefs().

◆ ALLOCNO_NUM_OBJECTS

◆ ALLOCNO_OBJECT

◆ ALLOCNO_PREFS

◆ ALLOCNO_REG

#define ALLOCNO_REG ( A)    ((A)->reg)

◆ ALLOCNO_REGISTER_FILTERS

◆ ALLOCNO_REGNO

#define ALLOCNO_REGNO ( A)    ((A)->regno)

Referenced by add_conflict_from_region_landing_pads(), add_range_and_copies_from_move_list(), allocno_priority_compare_func(), allocno_reload_assign(), allocno_spill_priority_compare(), allocnos_conflict_by_live_ranges_p(), assign_hard_reg(), calculate_allocno_spill_cost(), change_loop(), coalesce_allocnos(), coalesce_spill_slots(), color_pass(), copy_allocno_live_ranges(), create_cap_allocno(), find_costs_and_classes(), form_threads_from_colorable_allocno(), form_threads_from_copies(), improve_allocation(), ira(), ira_build_conflicts(), ira_create_allocno(), ira_emit(), ira_flattening(), ira_parent_allocno(), ira_print_disposition(), ira_print_expanded_allocno(), ira_reassign_conflict_allocnos(), ira_reassign_pseudos(), ira_reuse_stack_slot(), ira_soft_conflict(), ira_sort_regnos_for_alter_reg(), ira_subloop_allocnos_can_differ_p(), make_hard_regno_dead(), modify_move_list(), move_allocno_live_ranges(), move_spill_restore(), print_allocno_conflicts(), print_allocno_copies(), print_allocno_costs(), print_allocno_live_ranges(), print_allocno_prefs(), print_copy(), print_loop_title(), print_move_list(), print_pref(), process_bb_node_for_hard_reg_moves(), process_bb_node_lives(), rebuild_regno_allocno_maps(), remove_low_level_allocnos(), restore_costs_from_copies(), set_allocno_reg(), set_allocno_somewhere_renamed_p(), setup_allocno_available_regs_num(), setup_allocno_class_and_costs(), setup_coalesced_allocno_costs_and_nums(), setup_profitable_hard_regs(), setup_reg_renumber(), store_can_be_removed_p(), update_conflict_hard_reg_costs(), update_costs(), update_costs_from_allocno(), update_costs_from_copies(), and update_costs_from_prefs().

◆ ALLOCNO_SET_REGISTER_FILTERS

#define ALLOCNO_SET_REGISTER_FILTERS ( A,
X )   ((void) (A), gcc_assert ((X) == 0))

◆ ALLOCNO_SOMEWHERE_RENAMED_P

#define ALLOCNO_SOMEWHERE_RENAMED_P ( A)    ((A)->somewhere_renamed_p)

◆ ALLOCNO_UPDATED_CLASS_COST

◆ ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS

◆ ALLOCNO_UPDATED_HARD_REG_COSTS

◆ ALLOCNO_UPDATED_MEMORY_COST

◆ ALLOCNO_WMODE

#define ALLOCNO_WMODE ( A)    ((A)->wmode)

◆ CLEAR_MINMAX_SET_BIT

#define CLEAR_MINMAX_SET_BIT ( R,
I,
MIN,
MAX )
Value:
((R)[(unsigned) ((I) - (MIN)) / IRA_INT_BITS] \
&= ~((IRA_INT_TYPE) 1 << ((unsigned) ((I) - (MIN)) % IRA_INT_BITS)))
#define I
Definition gensupport.cc:204
#define IRA_INT_TYPE
Definition ira-int.h:667
#define IRA_INT_BITS
Definition ira-int.h:666
#define MIN(X, Y)
Definition system.h:392

◆ FOR_EACH_ALLOCNO

◆ FOR_EACH_ALLOCNO_OBJECT

#define FOR_EACH_ALLOCNO_OBJECT ( A,
O,
ITER )
Value:
for (ira_allocno_object_iter_init (&(ITER)); \
ira_allocno_object_iter_cond (&(ITER), (A), &(O));)
void ira_allocno_object_iter_init(ira_allocno_object_iterator *i)
Definition ira-int.h:1206
Loop over all objects associated with allocno A.  In each
iteration, O is set to the next object.  ITER is an instance of
ira_allocno_object_iterator used to iterate the conflicts.   

Referenced by build_conflict_bit_table(), ior_hard_reg_conflicts(), ira_flattening(), ira_free_allocno_costs(), ira_set_allocno_class(), ira_tune_allocno_costs(), remove_low_level_allocnos(), sort_conflict_id_map(), and update_bad_spill_attribute().

◆ FOR_EACH_BIT_IN_MINMAX_SET

#define FOR_EACH_BIT_IN_MINMAX_SET ( VEC,
MIN,
MAX,
N,
ITER )
Value:
for (minmax_set_iter_init (&(ITER), (VEC), (MIN), (MAX)); \
minmax_set_iter_cond (&(ITER), &(N)); \
minmax_set_iter_next (&(ITER)))
#define N
Definition gensupport.cc:202
void minmax_set_iter_init(minmax_set_iterator *i, IRA_INT_TYPE *vec, int min, int max)
Definition ira-int.h:752
#define MAX(X, Y)
Definition system.h:393
Loop over all elements of a min/max set given by bit vector VEC and
their minimal and maximal values MIN and MAX.  In each iteration, N
is set to the number of next allocno.  ITER is an instance of
minmax_set_iterator used to iterate over the set.   

Referenced by build_object_conflicts().

◆ FOR_EACH_COPY

#define FOR_EACH_COPY ( C,
ITER )
Value:
for (ira_copy_iter_init (&(ITER)); \
ira_copy_iter_cond (&(ITER), &(C));)
void ira_copy_iter_init(ira_copy_iterator *i)
Definition ira-int.h:1281
Loop over all copies.  In each iteration, C is set to the next
copy.  ITER is an instance of ira_copy_iterator used to iterate
the copies.   

Referenced by finish_copies(), ira_flattening(), print_copies(), and propagate_copies().

◆ FOR_EACH_OBJECT

#define FOR_EACH_OBJECT ( OBJ,
ITER )
Value:
for (ira_object_iter_init (&(ITER)); \
ira_object_iter_cond (&(ITER), &(OBJ));)
void ira_object_iter_init(ira_object_iterator *i)
Definition ira-int.h:1169
Loop over all objects.  In each iteration, OBJ is set to the next
object.  ITER is an instance of ira_object_iterator used to iterate
the objects.   

Referenced by compress_conflict_vecs(), create_start_finish_chains(), ira_build_conflicts(), remove_some_program_points_and_update_live_ranges(), and setup_min_max_allocno_live_range_point().

◆ FOR_EACH_OBJECT_CONFLICT

#define FOR_EACH_OBJECT_CONFLICT ( OBJ,
CONF,
ITER )
Value:
for (ira_object_conflict_iter_init (&(ITER), (OBJ)); \
ira_object_conflict_iter_cond (&(ITER), &(CONF));)
void ira_object_conflict_iter_init(ira_object_conflict_iterator *i, ira_object_t obj)
Definition ira-int.h:1342
Loop over all objects conflicting with OBJ.  In each iteration,
CONF is set to the next conflicting object.  ITER is an instance
of ira_object_conflict_iterator used to iterate the conflicts.   

Referenced by assign_hard_reg(), improve_allocation(), ira_reassign_conflict_allocnos(), ira_reassign_pseudos(), object_conflicts_with_allocno_p(), print_allocno_conflicts(), push_allocno_to_stack(), setup_left_conflict_sizes_p(), setup_profitable_hard_regs(), and update_conflict_allocno_hard_prefs().

◆ FOR_EACH_PREF

#define FOR_EACH_PREF ( P,
ITER )
Value:
for (ira_pref_iter_init (&(ITER)); \
ira_pref_iter_cond (&(ITER), &(P));)
void ira_pref_iter_init(ira_pref_iterator *i)
Definition ira-int.h:1243
Loop over all prefs.  In each iteration, P is set to the next
pref.  ITER is an instance of ira_pref_iterator used to iterate
the prefs.   

Referenced by finish_prefs(), and print_prefs().

◆ ira_assert

#define ira_assert ( c)    ((void)(0 && (c)))
Integrated Register Allocator (IRA) intercommunication header file.
   Copyright (C) 2006-2024 Free Software Foundation, Inc.
   Contributed 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/>.   
To provide consistency in naming, all IRA external variables,
functions, common typedefs start with prefix ira_.   
Always define and include C, so that warnings for empty body in an
'if' statement and unused variable do not occur.   

Referenced by add_allocno_to_bucket(), allocate_conflict_bit_vec(), allocno_reload_assign(), assign_hard_reg(), build_object_conflicts(), calculate_allocation_cost(), calculate_equiv_gains(), calculate_saved_nregs(), calculate_spill_cost(), change_loop(), coalesce_spill_slots(), collect_allocno_hard_regs_cover(), color_allocnos(), color_pass(), compress_conflict_vec(), copy_info_to_removed_store_destinations(), create_bb_allocnos(), create_loop_tree_node_allocnos(), dec_register_pressure(), delete_allocno_from_bucket(), emit_move_list(), emit_moves(), find_costs_and_classes(), finish_loop_tree_node(), fix_reg_equiv_init(), form_allocno_hard_regs_nodes_forest(), form_loop_tree(), go_through_subreg(), improve_allocation(), ira(), ira_add_allocno_copy(), ira_add_allocno_pref(), ira_adjust_equiv_reg_cost(), ira_allocate_conflict_vec(), ira_flattening(), ira_free_cost_vector(), ira_hard_reg_in_set_p(), ira_init_register_move_cost(), ira_loop_edge_freq(), ira_mark_allocation_change(), ira_mark_memory_move_deletion(), ira_mark_new_stack_slot(), ira_merge_live_ranges(), ira_nullify_asm_goto(), ira_reassign_conflict_allocnos(), ira_reassign_pseudos(), ira_rebuild_regno_allocno_list(), ira_register_new_scratch_op(), ira_remove_pref(), ira_restore_scratches(), ira_reuse_stack_slot(), ira_setup_alts(), ira_soft_conflict(), ira_sort_regnos_for_alter_reg(), ira_subloop_allocnos_can_differ_p(), ira_traverse_loop_tree(), ira_tune_allocno_costs(), ira_update_equiv_info_by_shuffle_insn(), loop_compare_func(), make_object_dead(), mark_all_loops_for_removal(), mark_loops_for_removal(), move_spill_restore(), pop_allocnos_from_stack(), print_allocno_costs(), print_loop_title(), print_pseudo_costs(), process_bb_node_lives(), propagate_allocno_info(), propagate_copies(), propagate_modified_regnos(), propagate_some_info_from_allocno(), push_allocno_to_stack(), push_allocnos_to_stack(), rebuild_regno_allocno_maps(), record_reg_classes(), remove_low_level_allocnos(), remove_some_program_points_and_update_live_ranges(), setup_allocno_assignment_flags(), setup_allocno_class_and_costs(), setup_allocno_priorities(), setup_class_hard_regs(), setup_entered_from_non_parent_p(), setup_left_conflict_sizes_p(), setup_loop_tree_level(), setup_min_max_allocno_live_range_point(), setup_preferred_alternate_classes_for_new_pseudos(), setup_pressure_classes(), setup_reg_renumber(), spill_soft_conflicts(), store_can_be_removed_p(), update_allocno_pressure_excess_length(), update_conflict_hard_regno_costs(), update_costs_from_copies(), update_curr_costs(), and update_left_conflict_sizes_p().

◆ IRA_BB_NODE

#define IRA_BB_NODE ( bb)    IRA_BB_NODE_BY_INDEX ((bb)->index)

◆ IRA_BB_NODE_BY_INDEX

#define IRA_BB_NODE_BY_INDEX ( index)    (&ira_bb_nodes[index])
Two access macros to the nodes representing basic blocks.   

Referenced by ira_loop_tree_body_rev_postorder().

◆ ira_class_hard_reg_index

◆ ira_important_class_nums

#define ira_important_class_nums    (this_target_ira_int->x_ira_important_class_nums)

◆ ira_important_classes

◆ ira_important_classes_num

◆ IRA_INT_BITS

#define IRA_INT_BITS   HOST_BITS_PER_WIDE_INT
This page contains a bitset implementation called 'min/max sets' used to
record conflicts in IRA.
They are named min/maxs set since we keep track of a minimum and a maximum
bit number for each set representing the bounds of valid elements.  Otherwise,
the implementation resembles sbitmaps in that we store an array of integers
whose bits directly represent the members of the set.   
The type used as elements in the array, and the number of bits in
this type.   

Referenced by add_to_conflicts(), allocate_conflict_bit_vec(), build_conflict_bit_table(), build_object_conflicts(), clear_conflicts(), ira_object_conflict_iter_cond(), ira_object_conflict_iter_init(), and minmax_set_iter_cond().

◆ IRA_INT_TYPE

◆ IRA_LOOP_NODE

#define IRA_LOOP_NODE ( loop)    IRA_LOOP_NODE_BY_INDEX ((loop)->num)

◆ IRA_LOOP_NODE_BY_INDEX

#define IRA_LOOP_NODE_BY_INDEX ( index)    (&ira_loop_nodes[index])
Two access macros to the nodes representing loops.   

Referenced by form_loop_tree().

◆ ira_max_memory_move_cost

#define ira_max_memory_move_cost    (this_target_ira_int->x_ira_max_memory_move_cost)

◆ ira_may_move_in_cost

#define ira_may_move_in_cost    (this_target_ira_int->x_ira_may_move_in_cost)

◆ ira_may_move_out_cost

#define ira_may_move_out_cost    (this_target_ira_int->x_ira_may_move_out_cost)

◆ ira_non_ordered_class_hard_regs

#define ira_non_ordered_class_hard_regs    (this_target_ira_int->x_ira_non_ordered_class_hard_regs)

◆ ira_prohibited_mode_move_regs

#define ira_prohibited_mode_move_regs    (this_target_ira_int->x_ira_prohibited_mode_move_regs)

◆ ira_reg_allocno_class_p

#define ira_reg_allocno_class_p    (this_target_ira_int->x_ira_reg_allocno_class_p)

◆ ira_reg_class_intersect

#define ira_reg_class_intersect    (this_target_ira_int->x_ira_reg_class_intersect)

◆ ira_reg_class_subunion

#define ira_reg_class_subunion    (this_target_ira_int->x_ira_reg_class_subunion)

◆ ira_reg_class_super_classes

#define ira_reg_class_super_classes    (this_target_ira_int->x_ira_reg_class_super_classes)

◆ ira_reg_class_superunion

#define ira_reg_class_superunion    (this_target_ira_int->x_ira_reg_class_superunion)

◆ ira_reg_mode_hard_regset

#define ira_reg_mode_hard_regset    (this_target_ira_int->x_ira_reg_mode_hard_regset)

◆ ira_reg_pressure_class_p

◆ ira_register_move_cost

◆ ira_uniform_class_p

#define ira_uniform_class_p    (this_target_ira_int->x_ira_uniform_class_p)

◆ ira_useful_class_mode_regs

#define ira_useful_class_mode_regs    (this_target_ira_int->x_ira_useful_class_mode_regs)

◆ OBJECT_ALLOCNO

◆ OBJECT_CONFLICT_ARRAY

◆ OBJECT_CONFLICT_ARRAY_SIZE

#define OBJECT_CONFLICT_ARRAY_SIZE ( O)    ((O)->conflicts_array_size)

◆ OBJECT_CONFLICT_BITVEC

#define OBJECT_CONFLICT_BITVEC ( O)    ((IRA_INT_TYPE *)(O)->conflicts_array)

◆ OBJECT_CONFLICT_HARD_REGS

◆ OBJECT_CONFLICT_ID

◆ OBJECT_CONFLICT_VEC

#define OBJECT_CONFLICT_VEC ( O)    ((ira_object_t *)(O)->conflicts_array)

◆ OBJECT_CONFLICT_VEC_P

◆ OBJECT_LIVE_RANGES

◆ OBJECT_MAX

◆ OBJECT_MIN

◆ OBJECT_NUM_CONFLICTS

#define OBJECT_NUM_CONFLICTS ( O)    ((O)->num_accumulated_conflicts)

◆ OBJECT_SUBWORD

◆ OBJECT_TOTAL_CONFLICT_HARD_REGS

◆ REG_FREQ_FROM_EDGE_FREQ

#define REG_FREQ_FROM_EDGE_FREQ ( freq)
Value:
? (freq * REG_FREQ_MAX / BB_FREQ_MAX) : 1)
#define BB_FREQ_MAX
Definition basic-block.h:158
#define cfun
Definition function.h:475
optimize_size_level optimize_function_for_size_p(struct function *fun)
Definition predict.cc:265
#define REG_FREQ_MAX
Definition regs.h:125
Compute register frequency from edge frequency FREQ.  It is
analogous to REG_FREQ_FROM_BB.  When optimizing for size, or
profile driven feedback is available and the function is never
executed, frequency is always equivalent.  Otherwise rescale the
edge frequency.   

Referenced by add_ranges_and_copies(), emit_moves(), and ira_loop_edge_freq().

◆ SET_MINMAX_SET_BIT

#define SET_MINMAX_SET_BIT ( R,
I,
MIN,
MAX )
Value:
((R)[(unsigned) ((I) - (MIN)) / IRA_INT_BITS] \
|= ((IRA_INT_TYPE) 1 << ((unsigned) ((I) - (MIN)) % IRA_INT_BITS)))
Set, clear or test bit number I in R, a bit vector of elements with
minimal index and maximal index equal correspondingly to MIN and
MAX.   

Referenced by add_to_conflicts(), build_object_conflicts(), and record_object_conflict().

◆ TEST_MINMAX_SET_BIT

#define TEST_MINMAX_SET_BIT ( R,
I,
MIN,
MAX )
Value:
((R)[(unsigned) ((I) - (MIN)) / IRA_INT_BITS] \
& ((IRA_INT_TYPE) 1 << ((unsigned) ((I) - (MIN)) % IRA_INT_BITS)))

Referenced by object_conflicts_with_allocno_p().

◆ this_target_ira_int

#define this_target_ira_int   (&default_target_ira_int)

Typedef Documentation

◆ ira_allocno_t

typedef struct ira_allocno* ira_allocno_t

◆ ira_copy_t

typedef struct ira_allocno_copy* ira_copy_t

◆ ira_emit_data_t

typedef struct ira_emit_data* ira_emit_data_t
Typedef for pointer to the subsequent structure.   

◆ ira_loop_tree_node_t

Definition of vector of allocnos and copies.   
Typedef for pointer to the subsequent structure.   

◆ ira_object_t

typedef struct ira_object* ira_object_t

◆ ira_pref_t

typedef struct ira_allocno_pref* ira_pref_t

◆ live_range_t

typedef struct live_range* live_range_t
Typedefs for pointers to allocno live range, allocno, and copy of
allocnos.   

◆ move_table

typedef unsigned short move_table[N_REG_CLASSES]

Function Documentation

◆ allocno_emit_reg()

◆ debug() [1/6]

void debug ( ira_allocno & ref)
extern

◆ debug() [2/6]

void debug ( ira_allocno * ptr)
extern

References debug.

◆ debug() [3/6]

void debug ( ira_allocno_copy & ref)
extern

References print_copy().

◆ debug() [4/6]

void debug ( ira_allocno_copy * ptr)
extern

References debug.

◆ debug() [5/6]

void debug ( live_range & ref)
extern

◆ debug() [6/6]

void debug ( live_range * ptr)
extern

References debug.

◆ hard_reg_set_size()

int hard_reg_set_size ( HARD_REG_SET set)
inline
Return number of hard registers in hard register SET.   

References i, and TEST_HARD_REG_BIT.

Referenced by create_new_allocno_hard_regs_node(), and setup_stack_reg_pressure_class().

◆ ior_hard_reg_conflicts()

void ior_hard_reg_conflicts ( ira_allocno_t a,
const_hard_reg_set set )
extern
Update hard register conflict information for all objects associated with
A to include the regs in SET.   

References a, FOR_EACH_ALLOCNO_OBJECT, i, OBJECT_CONFLICT_HARD_REGS, and OBJECT_TOTAL_CONFLICT_HARD_REGS.

Referenced by add_range_and_copies_from_move_list(), and ira_build().

◆ ira_add_allocno_copy()

ira_copy_t ira_add_allocno_copy ( ira_allocno_t first,
ira_allocno_t second,
int freq,
bool constraint_p,
rtx_insn * insn,
ira_loop_tree_node_t loop_tree_node )
extern
Create (or update frequency if the copy already exists) and return
the copy of allocnos FIRST and SECOND with frequency FREQ
corresponding to move insn INSN (if any) and originated from
LOOP_TREE_NODE.   

References add_allocno_copy_to_list(), find_allocno_copy(), ira_allocno_copy::freq, ira_assert, ira_create_copy(), NULL, and swap_allocno_copy_ends_if_necessary().

Referenced by add_range_and_copies_from_move_list(), process_regs_for_copy(), and propagate_copies().

◆ ira_add_allocno_pref()

void ira_add_allocno_pref ( ira_allocno_t a,
int hard_regno,
int freq )
extern
Create (or update frequency if the pref already exists) the pref of
allocnos A preferring HARD_REGNO with frequency FREQ.   

References a, add_allocno_pref_to_list(), find_allocno_pref(), ira_allocno_pref::freq, ira_assert, ira_create_pref(), NULL, and pref.

Referenced by find_costs_and_classes(), process_bb_node_for_hard_reg_moves(), and process_regs_for_copy().

◆ ira_add_live_range_to_object()

void ira_add_live_range_to_object ( ira_object_t object,
int start,
int finish )
extern
Create a new live range for OBJECT and queue it at the head of its
live range list.   

References ira_create_live_range(), and OBJECT_LIVE_RANGES.

Referenced by add_range_and_copies_from_move_list(), and make_object_live().

◆ ira_allocate()

◆ ira_allocate_and_accumulate_costs()

void ira_allocate_and_accumulate_costs ( int ** vec,
enum reg_class aclass,
int * src )
inline
Allocate cost vector *VEC for hard registers of ACLASS and add
values of vector SRC into the vector if it is necessary  

References i, ira_allocate_cost_vector(), ira_class_hard_regs_num, and NULL.

Referenced by propagate_allocno_info(), and propagate_some_info_from_allocno().

◆ ira_allocate_and_copy_costs()

void ira_allocate_and_copy_costs ( int ** vec,
enum reg_class aclass,
int * src )
inline
Allocate cost vector *VEC for hard registers of ACLASS and copy
values of vector SRC into the vector if it is necessary  

References ira_allocate_cost_vector(), ira_class_hard_regs_num, and NULL.

Referenced by assign_hard_reg(), create_cap_allocno(), and update_conflict_hard_regno_costs().

◆ ira_allocate_and_set_costs()

void ira_allocate_and_set_costs ( int ** vec,
reg_class_t aclass,
int val )
inline
To save memory we use a lazy approach for allocation and
initialization of the cost vectors.  We do this only when it is
really necessary.   
Allocate cost vector *VEC for hard registers of ACLASS and
initialize the elements by VAL if it is necessary  

References i, ira_allocate_cost_vector(), ira_class_hard_regs_num, and NULL.

Referenced by ira_propagate_hard_reg_costs(), ira_tune_allocno_costs(), process_bb_node_for_hard_reg_moves(), process_regs_for_copy(), process_single_reg_class_operands(), and update_conflict_hard_reg_costs().

◆ ira_allocate_and_set_or_copy_costs()

void ira_allocate_and_set_or_copy_costs ( int ** vec,
enum reg_class aclass,
int val,
int * src )
inline
Allocate cost vector *VEC for hard registers of ACLASS and copy
values of vector SRC into the vector or initialize it by VAL (if
SRC is null).   

References i, ira_allocate_cost_vector(), ira_class_hard_regs_num, and NULL.

Referenced by color_pass(), update_allocno_cost(), and update_curr_costs().

◆ ira_allocate_bitmap()

bitmap ira_allocate_bitmap ( void )
extern

◆ ira_allocate_conflict_vec()

void ira_allocate_conflict_vec ( ira_object_t obj,
int num )
extern
Allocates and initialize the conflict vector of OBJ for NUM
conflicting objects.   

References ira_allocate(), ira_assert, NULL, loop::num, OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_VEC_P, and OBJECT_NUM_CONFLICTS.

Referenced by build_object_conflicts(), and ira_allocate_object_conflicts().

◆ ira_allocate_cost_vector()

int * ira_allocate_cost_vector ( reg_class_t aclass)
extern

◆ ira_allocate_object_conflicts()

void ira_allocate_object_conflicts ( ira_object_t obj,
int num )
extern
Allocate and initialize the conflict vector or conflict bit vector
of OBJ for NUM conflicting allocnos whatever is more profitable.   

References allocate_conflict_bit_vec(), ira_allocate_conflict_vec(), ira_conflict_vector_profitable_p(), and loop::num.

Referenced by add_range_and_copies_from_move_list().

◆ ira_allocno_iter_cond()

bool ira_allocno_iter_cond ( ira_allocno_iterator * i,
ira_allocno_t * a )
inline
Return TRUE if we have more allocnos to visit, in which case *A is
set to the allocno to be visited.  Otherwise, return FALSE.   

References a, i, ira_allocnos, ira_allocnos_num, and NULL.

◆ ira_allocno_iter_init()

void ira_allocno_iter_init ( ira_allocno_iterator * i)
inline
Initialize the iterator I.   

References i.

◆ ira_allocno_object_iter_cond()

bool ira_allocno_object_iter_cond ( ira_allocno_object_iterator * i,
ira_allocno_t a,
ira_object_t * o )
inline
Return TRUE if we have more objects to visit in allocno A, in which
case *O is set to the object to be visited.  Otherwise, return
FALSE.   

References a, ALLOCNO_NUM_OBJECTS, ALLOCNO_OBJECT, and i.

◆ ira_allocno_object_iter_init()

void ira_allocno_object_iter_init ( ira_allocno_object_iterator * i)
inline
Initialize the iterator I.   

References i.

◆ ira_build()

◆ ira_build_conflicts()

◆ ira_caller_save_cost()

int ira_caller_save_cost ( ira_allocno_t a)
inline
Return the cost of saving a caller-saved register before each call
in A's live range and restoring the same register after each call.   

References a, ALLOCNO_CALL_FREQ, ALLOCNO_CLASS, ALLOCNO_MODE, and ira_memory_move_cost.

Referenced by ira_caller_save_loop_spill_p(), and ira_tune_allocno_costs().

◆ ira_caller_save_loop_spill_p()

bool ira_caller_save_loop_spill_p ( ira_allocno_t a,
ira_allocno_t subloop_a,
int spill_cost )
inline
A and SUBLOOP_A are allocnos for the same pseudo register, with A's
loop immediately enclosing SUBLOOP_A's loop.  If we allocate to A a
hard register R that is clobbered by a call in SUBLOOP_A, decide
which of the following approaches should be used for handling the
conflict:

(1) Spill R on entry to SUBLOOP_A's loop, assign memory to SUBLOOP_A,
    and restore R on exit from SUBLOOP_A's loop.

(2) Spill R before each necessary call in SUBLOOP_A's live range and
    restore R after each such call.

Return true if (1) is better than (2).  SPILL_COST is the cost of
doing (1).   

References a, ira_caller_save_cost(), ira_subloop_allocnos_can_differ_p(), and spill_cost.

Referenced by ira_propagate_hard_reg_costs(), move_spill_restore(), and propagate_allocno_info().

◆ ira_color()

void ira_color ( void )
extern

◆ ira_compress_allocno_live_ranges()

void ira_compress_allocno_live_ranges ( void )
extern

◆ ira_conflict_vector_profitable_p()

bool ira_conflict_vector_profitable_p ( ira_object_t obj,
int num )
extern
Return TRUE if a conflict vector with NUM elements is more
profitable than a conflict bit vector for OBJ.   

References loop::num, OBJECT_MAX, OBJECT_MIN, and STATIC_ASSERT.

Referenced by build_object_conflicts(), and ira_allocate_object_conflicts().

◆ ira_copy_iter_cond()

bool ira_copy_iter_cond ( ira_copy_iterator * i,
ira_copy_t * cp )
inline
Return TRUE if we have more copies to visit, in which case *CP is
set to the copy to be visited.  Otherwise, return FALSE.   

References i, ira_copies, ira_copies_num, and NULL.

◆ ira_copy_iter_init()

void ira_copy_iter_init ( ira_copy_iterator * i)
inline
Initialize the iterator I.   

References i.

◆ ira_copy_live_range_list()

live_range_t ira_copy_live_range_list ( live_range_t r)
extern
Copy allocno live range list given by its head R and return the
result.   

References copy_live_range(), last, filedep::next, NULL, and r.

Referenced by copy_allocno_live_ranges(), and setup_slot_coalesced_allocno_live_ranges().

◆ ira_costs()

◆ ira_create_allocno()

◆ ira_create_allocno_live_ranges()

void ira_create_allocno_live_ranges ( void )
extern

◆ ira_create_allocno_objects()

void ira_create_allocno_objects ( ira_allocno_t a)
extern
Determine the number of objects we should associate with allocno A
and allocate them.   

References a, ALLOCNO_CLASS, ALLOCNO_MODE, ALLOCNO_NUM_OBJECTS, ALLOCNO_OBJECT, GET_MODE_SIZE(), i, ira_create_object(), and ira_reg_class_max_nregs.

Referenced by create_allocno_objects(), create_cap_allocno(), and modify_move_list().

◆ ira_create_copy()

ira_copy_t ira_create_copy ( ira_allocno_t first,
ira_allocno_t second,
int freq,
bool constraint_p,
rtx_insn * insn,
ira_loop_tree_node_t loop_tree_node )
extern
Create and return copy with given attributes LOOP_TREE_NODE, FIRST,
SECOND, FREQ, CONSTRAINT_P, and INSN.   

References ira_allocno_copy::constraint_p, copy_pool, copy_vec, ira_allocno_copy::first, ira_allocno_copy::freq, ira_allocno_copy::insn, ira_copies, ira_copies_num, ira_allocno_copy::loop_tree_node, ira_allocno_copy::num, and ira_allocno_copy::second.

Referenced by ira_add_allocno_copy().

◆ ira_create_live_range()

live_range_t ira_create_live_range ( ira_object_t obj,
int start,
int finish,
live_range_t next )
extern
Create and return a live range for OBJECT with given attributes.   

References live_range::finish, live_range_pool, live_range::next, loop::next, live_range::object, and live_range::start.

Referenced by ira_add_live_range_to_object().

◆ ira_create_new_reg()

rtx ira_create_new_reg ( rtx original_reg)
extern

◆ ira_create_pref()

ira_pref_t ira_create_pref ( ira_allocno_t a,
int hard_regno,
int freq )
extern
Create and return pref with given attributes A, HARD_REGNO, and FREQ.   

References a, ira_prefs, ira_prefs_num, ira_allocno_pref::num, pref, pref_pool, and pref_vec.

Referenced by ira_add_allocno_pref().

◆ ira_debug_allocno_classes()

void ira_debug_allocno_classes ( void )
extern
Output all possible allocno and translation classes and the
translation maps into stderr.   

References print_translated_classes(), and print_uniform_and_important_classes().

◆ ira_debug_allocno_copies()

void ira_debug_allocno_copies ( ira_allocno_t a)
extern
Print info about copies involving allocno A into stderr.   

References a, and print_allocno_copies().

◆ ira_debug_allocno_live_ranges()

void ira_debug_allocno_live_ranges ( ira_allocno_t a)
extern
Print live ranges of allocno A to stderr.   

References a, and print_allocno_live_ranges().

◆ ira_debug_allocno_prefs()

void ira_debug_allocno_prefs ( ira_allocno_t a)
extern
Print info about prefs involving allocno A into stderr.   

References a, and print_allocno_prefs().

◆ ira_debug_conflicts()

void ira_debug_conflicts ( bool reg_p)
extern
ira-conflicts.cc  
Print information about allocno or only regno (if REG_P) conflicts
to stderr.   

References print_conflicts().

◆ ira_debug_copies()

void ira_debug_copies ( void )
extern
Print info about all copies into stderr.   

References print_copies().

◆ ira_debug_copy()

void ira_debug_copy ( ira_copy_t cp)
extern
Print info about copy CP into stderr.   

References print_copy().

◆ ira_debug_disposition()

void ira_debug_disposition ( void )
extern
Outputs information about allocation of all allocnos into
stderr.   

References ira_print_disposition().

◆ ira_debug_hard_regs_forest()

void ira_debug_hard_regs_forest ( void )
extern
Print the allocno hard register forest to stderr.   

References print_hard_regs_forest().

◆ ira_debug_live_range_list()

void ira_debug_live_range_list ( live_range_t r)
extern
Print live ranges R to stderr.   

References ira_print_live_range_list(), and r.

◆ ira_debug_live_ranges()

void ira_debug_live_ranges ( void )
extern
Print live ranges of all allocnos to stderr.   

References print_live_ranges().

◆ ira_debug_pref()

void ira_debug_pref ( ira_pref_t pref)
extern
Print info about PREF into stderr.   

References pref, and print_pref().

◆ ira_debug_prefs()

void ira_debug_prefs ( void )
extern
Print info about all prefs into stderr.   

References print_prefs().

◆ ira_destroy()

void ira_destroy ( void )
extern
Release the data created by function ira_build.   

References finish_allocnos(), finish_copies(), finish_cost_vectors(), finish_loop_tree_nodes(), finish_prefs(), and ira_finish_allocno_live_ranges().

Referenced by do_reload().

◆ ira_emit()

◆ ira_equiv_no_lvalue_p()

bool ira_equiv_no_lvalue_p ( int regno)
inline

◆ ira_finish_allocno_live_ranges()

void ira_finish_allocno_live_ranges ( void )
extern
Free arrays IRA_START_POINT_RANGES and IRA_FINISH_POINT_RANGES.   

References ira_finish_point_ranges, ira_free(), and ira_start_point_ranges.

Referenced by ira_destroy().

◆ ira_finish_assign()

void ira_finish_assign ( void )
extern
Deallocate data used by assign_hard_reg.   

References allocno_priorities, consideration_allocno_bitmap, finish_cost_update(), ira_free(), ira_free_bitmap(), sorted_allocnos, and sorted_copies.

Referenced by color(), and do_reload().

◆ ira_finish_emit_data()

void ira_finish_emit_data ( void )
extern
Free the emit data.   

References a, ALLOCNO_ADD_DATA, FOR_EACH_ALLOCNO, ira_allocno_emit_data, ira_free(), new_allocno_emit_data_vec, and NULL.

Referenced by ira().

◆ ira_finish_live_range()

void ira_finish_live_range ( live_range_t r)
extern

◆ ira_finish_live_range_list()

void ira_finish_live_range_list ( live_range_t r)
extern
Free list of allocno live ranges starting with R.   

References ira_finish_live_range(), live_range::next, NULL, and r.

Referenced by coalesce_spill_slots(), and ira_free_allocno_costs().

◆ ira_flattening()

void ira_flattening ( int max_regno_before_emit,
int ira_max_point_before_emit )
extern
Flatten the IR.  In other words, this function transforms IR as if
it were built with one region (without loops).  We could make it
much simpler by rebuilding IR with one region, but unfortunately it
takes a lot of time.  MAX_REGNO_BEFORE_EMIT and
IRA_MAX_POINT_BEFORE_EMIT are correspondingly MAX_REG_NUM () and
IRA_MAX_POINT before emitting insns on the loop borders.   

References a, add_allocno_copy_to_list(), ALLOCNO_ASSIGNED_P, ALLOCNO_CALL_FREQ, ALLOCNO_CALLS_CROSSED_NUM, ALLOCNO_CAP, ALLOCNO_CAP_MEMBER, ALLOCNO_CHEAP_CALLS_CROSSED_NUM, ALLOCNO_CLASS, ALLOCNO_CLASS_COST, ALLOCNO_CONFLICT_HARD_REG_COSTS, ALLOCNO_COPIES, ALLOCNO_EMIT_DATA, allocno_emit_reg(), ALLOCNO_EXCESS_PRESSURE_POINTS_NUM, ALLOCNO_FREQ, ALLOCNO_HARD_REG_COSTS, ALLOCNO_LOOP_TREE_NODE, ALLOCNO_MEMORY_COST, ALLOCNO_NEXT_REGNO_ALLOCNO, ALLOCNO_NREFS, ALLOCNO_NUM, ALLOCNO_REGNO, ALLOCNO_UPDATED_CLASS_COST, ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS, ALLOCNO_UPDATED_HARD_REG_COSTS, ALLOCNO_UPDATED_MEMORY_COST, clear_conflicts(), compress_conflict_vecs(), copy_info_to_removed_store_destinations(), EXECUTE_IF_SET_IN_SPARSESET, finish_allocno(), finish_copy(), live_range::finish_next, ira_allocno_copy::first, FOR_EACH_ALLOCNO, FOR_EACH_ALLOCNO_OBJECT, FOR_EACH_COPY, i, internal_flag_ira_verbose, ira_add_conflict(), ira_allocate(), ira_assert, ira_class_hard_regs_num, ira_compress_allocno_live_ranges(), ira_copies, ira_dump_file, ira_finish_point_ranges, ira_free(), ira_free_allocno_updated_costs(), ira_loop_tree_root, ira_max_point, ira_object_id_map, ira_objects_num, ira_parent_allocno(), ira_rebuild_start_finish_chains(), ira_reg_classes_intersect_p, ira_regno_allocno_map, ira_remove_allocno_prefs(), ira_start_point_ranges, ira_allocno_copy::loop_tree_node, max_reg_num(), ira_emit_data::mem_optimized_dest_p, merge_hard_reg_conflicts(), move_allocno_live_ranges(), NULL, ira_allocno_copy::num, OBJECT_ALLOCNO, OBJECT_CONFLICT_HARD_REGS, OBJECT_CONFLICT_ID, OBJECT_LIVE_RANGES, OBJECT_TOTAL_CONFLICT_HARD_REGS, objects_live, r, rebuild_regno_allocno_maps(), ira_emit_data::reg, REGNO, ira_loop_tree_node::regno_allocno_map, regno_top_level_allocno_map, ira_allocno_copy::second, sparseset_alloc(), sparseset_clear_bit(), sparseset_free, sparseset_set_bit(), live_range::start_next, and swap_allocno_copy_ends_if_necessary().

Referenced by ira().

◆ ira_free()

◆ ira_free_allocno_updated_costs()

◆ ira_free_bitmap()

◆ ira_free_cost_vector()

void ira_free_cost_vector ( int * vec,
reg_class_t aclass )
extern
Free a cost vector VEC for ACLASS.   

References cost_vector_pool, ira_assert, and NULL.

Referenced by ira_free_allocno_costs(), and ira_free_allocno_updated_costs().

◆ ira_get_dup_out_num()

int ira_get_dup_out_num ( int op_num,
alternative_mask alts,
bool & single_input_op_has_cstr_p )
extern
Return the number of the output non-early clobber operand which
should be the same in any case as operand with number OP_NUM (or
negative value if there is no such operand).  ALTS is the mask
of alternatives that we should consider.  SINGLE_INPUT_OP_HAS_CSTR_P
should be set in this function, it indicates whether there is only
a single input operand which has the matching constraint on the
output operand at the position specified in return value.  If the
pattern allows any one of several input operands holds the matching
constraint, it's set as false, one typical case is destructive FMA
instruction on target rs6000.  Note that for a non-NO_REG preferred
register class with no free register move copy, if the parameter
PARAM_IRA_CONSIDER_DUP_IN_ALL_ALTS is set to one, this function
will check all available alternatives for matching constraints,
even if it has found or will find one alternative with non-NO_REG
regclass, it can respect more cases with matching constraints.  If
PARAM_IRA_CONSIDER_DUP_IN_ALL_ALTS is set to zero,
SINGLE_INPUT_OP_HAS_CSTR_P is always true, it will stop to find
matching constraint relationship once it hits some alternative with
some non-NO_REG regclass.   

References ALTERNATIVE_BIT, recog_data_d::constraints, end(), gcc_assert, GET_MODE, ira_init_register_move_cost_if_necessary(), ira_may_move_in_cost, ira_reg_class_intersect, ira_register_move_cost, recog_data_d::n_alternatives, recog_data_d::n_operands, OP_IN, OP_OUT, recog_data_d::operand, recog_data_d::operand_type, recog_data, recog_op_alt, reg_or_subregno(), reg_preferred_class(), targetm, and TEST_BIT.

Referenced by add_insn_allocno_copies().

◆ ira_hard_reg_in_set_p()

bool ira_hard_reg_in_set_p ( int hard_regno,
machine_mode mode,
HARD_REG_SET hard_regset )
inline
The function returns TRUE if hard registers starting with
HARD_REGNO and containing value of MODE are fully in set
HARD_REGSET.   

References hard_regno_nregs(), i, ira_assert, and TEST_HARD_REG_BIT.

Referenced by calculate_allocation_cost(), color_allocnos(), record_operand_costs(), and setup_allocno_assignment_flags().

◆ ira_hard_reg_set_intersection_p()

bool ira_hard_reg_set_intersection_p ( int hard_regno,
machine_mode mode,
HARD_REG_SET hard_regset )
inline
The function returns TRUE if at least one hard register from ones
starting with HARD_REGNO and containing value of MODE are in set
HARD_REGSET.   

References gcc_assert, hard_regno_nregs(), i, and TEST_HARD_REG_BIT.

Referenced by assign_hard_reg(), fast_allocation(), ira_tune_allocno_costs(), and spill_soft_conflicts().

◆ ira_implicitly_set_insn_hard_regs()

void ira_implicitly_set_insn_hard_regs ( HARD_REG_SET * set,
alternative_mask preferred )
extern
The function sets up hard register set *SET to hard registers which
might be used by insn reloads because the constraints are too
strict.   

References add_to_hard_reg_set(), CLEAR_HARD_REG_SET, recog_data_d::constraints, GET_CODE, GET_MODE, i, ira_class_singleton, recog_data_d::n_operands, recog_data_d::operand, PSEUDO_REGNO_MODE, recog_data, REG_P, REGNO, and SUBREG_REG.

◆ ira_init_costs()

void ira_init_costs ( void )
extern
This is called each time register related information is
changed.   

References i, init_cost, ira_important_classes_num, max_struct_costs_size, costs::mem_cost, op_costs, temp_costs, this_op_costs, and this_target_ira_int.

Referenced by ira_init().

◆ ira_init_costs_once()

void ira_init_costs_once ( void )
extern
ira-costs.cc  
Function called once during compiler work.   

References i, init_cost, NULL, op_costs, temp_costs, and this_op_costs.

Referenced by ira_init_once().

◆ ira_init_register_move_cost()

◆ ira_init_register_move_cost_if_necessary()

◆ ira_initiate_assign()

void ira_initiate_assign ( void )
extern
Allocate and initialize data necessary for assign_hard_reg.   

References allocno_priorities, consideration_allocno_bitmap, initiate_cost_update(), ira_allocate(), ira_allocate_bitmap(), ira_allocnos_num, ira_copies_num, sorted_allocnos, and sorted_copies.

Referenced by color(), and ira().

◆ ira_initiate_emit_data()

void ira_initiate_emit_data ( void )
extern
ira-emit.cc  
Allocate and initiate the emit data.   

References a, ALLOCNO_ADD_DATA, ALLOCNO_NUM, FOR_EACH_ALLOCNO, ira_allocate(), ira_allocno_emit_data, ira_allocnos_num, and new_allocno_emit_data_vec.

Referenced by ira().

◆ ira_live_ranges_intersect_p()

bool ira_live_ranges_intersect_p ( live_range_t r1,
live_range_t r2 )
extern
Return TRUE if live ranges R1 and R2 intersect.   

References live_range::finish, live_range::next, NULL, and live_range::start.

Referenced by allocnos_conflict_by_live_ranges_p(), and slot_coalesced_allocno_live_ranges_intersect_p().

◆ ira_loop_edge_freq()

int ira_loop_edge_freq ( ira_loop_tree_node_t loop_node,
int regno,
bool exit_p )
extern

◆ ira_merge_live_ranges()

live_range_t ira_merge_live_ranges ( live_range_t r1,
live_range_t r2 )
extern
Merge ranges R1 and R2 and returns the result.  The function
maintains the order of ranges and tries to minimize number of the
result ranges.   

References live_range::finish, ira_assert, ira_finish_live_range(), last, filedep::next, live_range::next, NULL, and live_range::start.

Referenced by copy_allocno_live_ranges(), move_allocno_live_ranges(), and setup_slot_coalesced_allocno_live_ranges().

◆ ira_need_caller_save_p()

bool ira_need_caller_save_p ( ira_allocno_t a,
unsigned int regno )
inline
Return true if we would need to save allocno A around a call if we
assigned hard register REGNO.   

References a, ALLOCNO_CALLS_CROSSED_NUM, ALLOCNO_CROSSED_CALLS_ABIS, ALLOCNO_CROSSED_CALLS_CLOBBERED_REGS, ALLOCNO_MODE, and call_clobbered_in_region_p().

Referenced by allocno_reload_assign(), ira_tune_allocno_costs(), move_spill_restore(), and setup_reg_renumber().

◆ ira_need_caller_save_regs()

HARD_REG_SET ira_need_caller_save_regs ( ira_allocno_t a)
inline
Return the set of registers that would need a caller save if allocno A
overlapped them.   

References a, ALLOCNO_CROSSED_CALLS_ABIS, ALLOCNO_CROSSED_CALLS_CLOBBERED_REGS, ALLOCNO_MODE, and call_clobbers_in_region().

Referenced by allocno_reload_assign(), ira_build(), ira_build_conflicts(), and ira_propagate_hard_reg_costs().

◆ ira_object_conflict_iter_cond()

bool ira_object_conflict_iter_cond ( ira_object_conflict_iterator * i,
ira_object_t * pobj )
inline
Return TRUE if we have more conflicting allocnos to visit, in which
case *A is set to the allocno to be visited.  Otherwise, return
FALSE.   

References ctz_hwi(), i, IRA_INT_BITS, IRA_INT_TYPE, ira_object_id_map, and NULL.

◆ ira_object_conflict_iter_init()

void ira_object_conflict_iter_init ( ira_object_conflict_iterator * i,
ira_object_t obj )
inline
Initialize the iterator I with ALLOCNO conflicts.   

References i, IRA_INT_BITS, IRA_INT_TYPE, OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_MAX, and OBJECT_MIN.

◆ ira_object_iter_cond()

bool ira_object_iter_cond ( ira_object_iterator * i,
ira_object_t * obj )
inline
Return TRUE if we have more objects to visit, in which case *OBJ is
set to the object to be visited.  Otherwise, return FALSE.   

References i, ira_object_id_map, ira_objects_num, and NULL.

◆ ira_object_iter_init()

void ira_object_iter_init ( ira_object_iterator * i)
inline
Initialize the iterator I.   

References i.

◆ ira_parent_allocno()

ira_allocno_t ira_parent_allocno ( ira_allocno_t a)
extern
Find the allocno that corresponds to A at a level one higher up in the
loop tree.  Returns NULL if A is a cap, or if it has no parent.   

References a, ALLOCNO_CAP, ALLOCNO_LOOP_TREE_NODE, ALLOCNO_REGNO, NULL, ira_loop_tree_node::parent, and ira_loop_tree_node::regno_allocno_map.

Referenced by ira_flattening(), ira_parent_or_cap_allocno(), and ira_soft_conflict().

◆ ira_parent_or_cap_allocno()

ira_allocno_t ira_parent_or_cap_allocno ( ira_allocno_t a)
extern
Find the allocno that corresponds to A at a level one higher up in the
loop tree.  If ALLOCNO_CAP is set for A, return that.   

References a, ALLOCNO_CAP, ira_parent_allocno(), and NULL.

Referenced by build_object_conflicts(), process_regs_for_copy(), propagate_copies(), and spill_soft_conflicts().

◆ ira_pref_iter_cond()

bool ira_pref_iter_cond ( ira_pref_iterator * i,
ira_pref_t * pref )
inline
Return TRUE if we have more prefs to visit, in which case *PREF is
set to the pref to be visited.  Otherwise, return FALSE.   

References i, ira_prefs, ira_prefs_num, NULL, and pref.

◆ ira_pref_iter_init()

void ira_pref_iter_init ( ira_pref_iterator * i)
inline
Initialize the iterator I.   

References i.

◆ ira_print_disposition()

void ira_print_disposition ( FILE * f)
extern
Output information about allocation of all allocnos (except for
caps) into file F.   

References a, ALLOCNO_HARD_REGNO, ALLOCNO_LOOP_TREE_NODE, ALLOCNO_NEXT_REGNO_ALLOCNO, ALLOCNO_NUM, ALLOCNO_REGNO, i, basic_block_def::index, ira_regno_allocno_map, max_reg_num(), max_regno, and NULL.

Referenced by do_coloring(), fast_allocation(), and ira_debug_disposition().

◆ ira_print_expanded_allocno()

◆ ira_print_live_range_list()

void ira_print_live_range_list ( FILE * f,
live_range_t r )
extern
Print live ranges R to file F.   

References NULL, and r.

Referenced by copy_allocno_live_ranges(), debug(), ira_debug_live_range_list(), move_allocno_live_ranges(), and print_object_live_ranges().

◆ ira_reassign_conflict_allocnos()

void ira_reassign_conflict_allocnos ( int start_regno)
extern
Try to assign hard registers to the unassigned allocnos and
allocnos conflicting with them or conflicting with allocnos whose
regno >= START_REGNO.  The function is called after ira_flattening,
so more allocnos (including ones created in ira-emit.cc) will have a
chance to get a hard register.  We use simple assignment algorithm
based on priorities.   

References a, ALLOCNO_ASSIGNED_P, ALLOCNO_CLASS, ALLOCNO_HARD_REGNO, ALLOCNO_NUM, ALLOCNO_NUM_OBJECTS, ALLOCNO_OBJECT, allocno_priority_compare_func(), ALLOCNO_REGNO, ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS, ALLOCNO_UPDATED_HARD_REG_COSTS, assign_hard_reg(), bitmap_bit_p, bitmap_set_bit, FOR_EACH_ALLOCNO, FOR_EACH_OBJECT_CONFLICT, i, internal_flag_ira_verbose, ira_allocate_bitmap(), ira_assert, ira_dump_file, ira_free_bitmap(), ira_reg_classes_intersect_p, NULL, OBJECT_ALLOCNO, qsort, setup_allocno_priorities(), sorted_allocnos, and update_curr_costs().

Referenced by ira().

◆ ira_rebuild_start_finish_chains()

void ira_rebuild_start_finish_chains ( void )
extern
ira-lives.cc  
Rebuild IRA_START_POINT_RANGES and IRA_FINISH_POINT_RANGES after
new live ranges and program points were added as a result if new
insn generation.   

References create_start_finish_chains(), ira_finish_point_ranges, ira_free(), and ira_start_point_ranges.

Referenced by ira_compress_allocno_live_ranges(), ira_flattening(), remove_low_level_allocnos(), and remove_unnecessary_allocnos().

◆ ira_remove_allocno_prefs()

void ira_remove_allocno_prefs ( ira_allocno_t a)
extern

◆ ira_remove_pref()

void ira_remove_pref ( ira_pref_t pref)
extern
Remove PREF from the list of allocno prefs and free memory for
it.   

References ALLOCNO_PREFS, finish_pref(), internal_flag_ira_verbose, ira_assert, ira_dump_file, ira_allocno_pref::next_pref, NULL, and pref.

Referenced by color_allocnos().

◆ ira_set_allocno_class()

void ira_set_allocno_class ( ira_allocno_t a,
enum reg_class aclass )
extern
Set up register class for A and update its conflict hard
registers.   

References a, ALLOCNO_CLASS, FOR_EACH_ALLOCNO_OBJECT, OBJECT_CONFLICT_HARD_REGS, and OBJECT_TOTAL_CONFLICT_HARD_REGS.

Referenced by create_cap_allocno(), modify_move_list(), and setup_allocno_class_and_costs().

◆ ira_setup_alts()

alternative_mask ira_setup_alts ( rtx_insn * insn)
extern
Extract INSN and return the set of alternatives that we should consider.
This excludes any alternatives whose constraints are obviously impossible
to meet (e.g. because the constraint requires a constant and the operand
is nonconstant).  It also excludes alternatives that are bound to need
a spill or reload, as long as we have other alternatives that match
exactly.   

References ALTERNATIVE_BIT, CHAR_BIT, CONST_INT_P, operand_alternative::constraint, recog_data_d::constraints, curr_swapped, end(), extract_insn(), extract_mem_from_operand(), get_preferred_alternatives(), INTVAL, ira_assert, MAX, MEM_P, recog_data_d::n_alternatives, recog_data_d::n_operands, NULL, recog_data_d::operand, preprocess_constraints(), recog_data, recog_op_alt, REG_P, operand_alternative::reject, rtx_equal_p(), SUBREG_P, and TEST_BIT.

Referenced by add_insn_allocno_copies(), and process_bb_node_lives().

◆ ira_single_region_allocno_p()

bool ira_single_region_allocno_p ( ira_allocno_t a,
ira_allocno_t subloop_a )
inline
Return true if we should treat A and SUBLOOP_A as belonging to a
single region.   

References a, ALLOCNO_CLASS, ALLOCNO_LOOP_TREE_NODE, ALLOCNO_MIGHT_CONFLICT_WITH_PARENT_P, ira_class_hard_regs_num, ira_pressure_class_translate, and IRA_REGION_MIXED.

Referenced by color_pass().

◆ ira_soft_conflict()

ira_allocno_t ira_soft_conflict ( ira_allocno_t a1,
ira_allocno_t a2 )
extern
ira-color.cc  
Allocnos A1 and A2 are known to conflict.  Check whether, in some loop L
that is either the current loop or a nested subloop, the conflict is of
the following form:

- One allocno (X) is a cap allocno for some non-cap allocno X2.

- X2 belongs to some loop L2.

- The other allocno (Y) is a non-cap allocno.

- Y is an ancestor of some allocno Y2 in L2.  (Note that such a Y2
  must exist, given that X and Y conflict.)

- Y2 is not referenced in L2 (that is, ALLOCNO_NREFS (Y2) == 0).

- Y can use a different allocation from Y2.

In this case, Y's register is live across L2 but is not used within it,
whereas X's register is used only within L2.  The conflict is therefore
only "soft", in that it can easily be avoided by spilling Y2 inside L2
without affecting any insn references.

If the conflict does have this form, return the Y2 that would need to be
spilled in order to allow X and Y (and thus A1 and A2) to use the same
register.  Return null otherwise.  Returning null is conservatively correct;
any nonnnull return value is an optimization.   

References ALLOCNO_CAP_MEMBER, ALLOCNO_LOOP_TREE_NODE, ALLOCNO_NREFS, ALLOCNO_REGNO, ira_assert, ira_parent_allocno(), ira_subloop_allocnos_can_differ_p(), and max_soft_conflict_loop_depth.

Referenced by assign_hard_reg(), improve_allocation(), and spill_soft_conflicts().

◆ ira_subloop_allocnos_can_differ_p()

bool ira_subloop_allocnos_can_differ_p ( ira_allocno_t a,
bool allocated_p = true,
bool exclude_old_reload = true )
inline
Return true if subloops that contain allocnos for A's register can
use a different assignment from A.  ALLOCATED_P is true for the case
in which allocation succeeded for A.  EXCLUDE_OLD_RELOAD is true if
we should always return false for non-LRA targets.  (This is a hack
and should be removed along with old reload.)   

References a, ALLOCNO_CLASS, ALLOCNO_MODE, ALLOCNO_REGNO, ira_assert, ira_equiv_no_lvalue_p(), ira_pressure_class_translate, ira_reg_class_max_nregs, ira_reg_equiv_len, ira_use_lra_p, NULL, pic_offset_table_rtx, and REGNO.

Referenced by color_pass(), ira_caller_save_loop_spill_p(), ira_soft_conflict(), move_spill_restore(), and propagate_allocno_info().

◆ ira_total_conflict_hard_regs()

HARD_REG_SET ira_total_conflict_hard_regs ( ira_allocno_t a)
inline
Return the set of all hard registers that conflict with A.   

References a, ALLOCNO_NUM_OBJECTS, ALLOCNO_OBJECT, conflicts, i, and OBJECT_TOTAL_CONFLICT_HARD_REGS.

Referenced by ira_propagate_hard_reg_costs(), and move_spill_restore().

◆ ira_traverse_loop_tree()

void ira_traverse_loop_tree ( bool bb_p,
ira_loop_tree_node_t loop_node,
void(* preorder_func )(ira_loop_tree_node_t),
void(* postorder_func )(ira_loop_tree_node_t) )
extern
This recursive function traverses loop tree with root LOOP_NODE
calling non-null functions PREORDER_FUNC and POSTORDER_FUNC
correspondingly in preorder and postorder.  The function sets up
IRA_CURR_LOOP_TREE_NODE and IRA_CURR_REGNO_ALLOCNO_MAP.  If BB_P,
basic block nodes of LOOP_NODE is also processed (before its
subloop nodes).

If BB_P is set and POSTORDER_FUNC is given, the basic blocks in
the loop are passed in the *reverse* post-order of the *reverse*
CFG.  This is only used by ira_create_allocno_live_ranges, which
wants to visit basic blocks in this order to minimize the number
of elements per live range chain.
Note that the loop tree nodes are still visited in the normal,
forward post-order of  the loop tree.   

References ira_loop_tree_node::bb, ira_loop_tree_node::children, FOR_EACH_VEC_ELT, FOR_EACH_VEC_ELT_REVERSE, i, ira_assert, ira_curr_loop_tree_node, ira_curr_regno_allocno_map, ira_loop_tree_body_rev_postorder(), ira_traverse_loop_tree(), ira_loop_tree_node::next, NULL, ira_loop_tree_node::regno_allocno_map, ira_loop_tree_node::subloop_next, and ira_loop_tree_node::subloops.

Referenced by create_allocnos(), do_coloring(), find_costs_and_classes(), ira_build_conflicts(), ira_create_allocno_live_ranges(), ira_emit(), ira_traverse_loop_tree(), and setup_allocno_class_and_costs().

◆ ira_tune_allocno_costs()

◆ minmax_set_iter_cond()

bool minmax_set_iter_cond ( minmax_set_iterator * i,
int * n )
inline
Return TRUE if we have more allocnos to visit, in which case *N is
set to the number of the element to be visited.  Otherwise, return
FALSE.   

References ctz_hwi(), i, and IRA_INT_BITS.

◆ minmax_set_iter_init()

void minmax_set_iter_init ( minmax_set_iterator * i,
IRA_INT_TYPE * vec,
int min,
int max )
inline
Initialize the iterator I for bit vector VEC containing minimal and
maximal values MIN and MAX.   

References i.

◆ minmax_set_iter_next()

void minmax_set_iter_next ( minmax_set_iterator * i)
inline
Advance to the next element in the set.   

References i.

Variable Documentation

◆ default_target_ira_int

class target_ira_int default_target_ira_int
extern

◆ first_moveable_pseudo

int first_moveable_pseudo
extern
Record the range of register numbers added by find_moveable_pseudos.   

Referenced by find_costs_and_classes(), find_moveable_pseudos(), and move_unallocated_pseudos().

◆ internal_flag_ira_verbose

int internal_flag_ira_verbose
extern
A modified value of flag `-fira-verbose' used internally.   

Referenced by add_range_and_copies_from_move_list(), allocno_reload_assign(), assign_hard_reg(), build_conflict_bit_table(), calculate_allocation_cost(), change_loop(), coalesce_allocnos(), coalesce_spill_slots(), color_allocnos(), color_pass(), copy_allocno_live_ranges(), create_cap_allocno(), do_coloring(), do_reload(), fast_allocation(), find_costs_and_classes(), form_threads_from_colorable_allocno(), form_threads_from_copies(), generate_edge_moves(), improve_allocation(), ira(), ira_build(), ira_build_conflicts(), ira_compress_allocno_live_ranges(), ira_create_allocno_live_ranges(), ira_create_new_reg(), ira_flattening(), ira_mark_new_stack_slot(), ira_reassign_conflict_allocnos(), ira_reassign_pseudos(), ira_rebuild_regno_allocno_list(), ira_remove_pref(), ira_reuse_stack_slot(), ira_set_pseudo_classes(), ira_sort_regnos_for_alter_reg(), ira_update_equiv_info_by_shuffle_insn(), mark_all_loops_for_removal(), mark_loops_for_removal(), modify_move_list(), move_allocno_live_ranges(), move_spill_restore(), pop_allocnos_from_stack(), process_bb_node_lives(), push_allocno_to_stack(), push_only_colorable(), record_reg_classes(), remove_allocno_from_bucket_and_push(), remove_some_program_points_and_update_live_ranges(), restore_costs_from_copies(), scan_one_insn(), setup_allocno_available_regs_num(), setup_preferred_alternate_classes_for_new_pseudos(), update_costs_from_allocno(), update_costs_from_copies(), and update_costs_from_prefs().

◆ ira_additional_jumps_num

int ira_additional_jumps_num

Referenced by emit_moves().

◆ ira_allocno_emit_data

ira_emit_data_t ira_allocno_emit_data
extern
Data used to emit live range split insns and to flattening IR.   
Integrated Register Allocator.  Changing code and generating moves.
   Copyright (C) 2006-2024 Free Software Foundation, Inc.
   Contributed 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/>.   
When we have more one region, we need to change the original RTL
code after coloring.  Let us consider two allocnos representing the
same pseudo-register outside and inside a region respectively.
They can get different hard-registers.  The reload pass works on
pseudo registers basis and there is no way to say the reload that
pseudo could be in different registers and it is even more
difficult to say in what places of the code the pseudo should have
particular hard-registers.  So in this case IRA has to create and
use a new pseudo-register inside the region and adds code to move
allocno values on the region's borders.  This is done by the code
in this file.

The code makes top-down traversal of the regions and generate new
pseudos and the move code on the region borders.  In some
complicated cases IRA can create a new pseudo used temporarily to
move allocno values when a swap of values stored in two
hard-registers is needed (e.g. two allocnos representing different
pseudos outside region got respectively hard registers 1 and 2 and
the corresponding allocnos inside the region got respectively hard
registers 2 and 1).  At this stage, the new pseudo is marked as
spilled.

IRA still creates the pseudo-register and the moves on the region
borders even when the both corresponding allocnos were assigned to
the same hard-register.  It is done because, if the reload pass for
some reason spills a pseudo-register representing the original
pseudo outside or inside the region, the effect will be smaller
because another pseudo will still be in the hard-register.  In most
cases, this is better then spilling the original pseudo in its
whole live-range.  If reload does not change the allocation for the
two pseudo-registers, the trivial move will be removed by
post-reload optimizations.

IRA does not generate a new pseudo and moves for the allocno values
if the both allocnos representing an original pseudo inside and
outside region assigned to the same hard register when the register
pressure in the region for the corresponding pressure class is less
than number of available hard registers for given pressure class.

IRA also does some optimizations to remove redundant moves which is
transformed into stores by the reload pass on CFG edges
representing exits from the region.

IRA tries to reduce duplication of code generated on CFG edges
which are enters and exits to/from regions by moving some code to
the edge sources or destinations when it is possible.   
Data used to emit live range split insns and to flattening IR.   

Referenced by ira_finish_emit_data(), and ira_initiate_emit_data().

◆ ira_allocnos

ira_allocno_t* ira_allocnos
extern
Array of references to all allocnos.  The order number of the
allocno corresponds to the index in the array.  Removed allocnos
have NULL element value.   

Referenced by change_loop(), coalesce_allocnos(), color_allocnos(), color_pass(), form_allocno_hard_regs_nodes_forest(), improve_allocation(), init_allocno_threads(), initiate_allocnos(), ira_allocno_iter_cond(), ira_create_allocno(), ira_free_allocno_costs(), print_loop_title(), setup_profitable_hard_regs(), and spill_soft_conflicts().

◆ ira_allocnos_num

◆ ira_bb_nodes

ira_loop_tree_node_t ira_bb_nodes
extern
All nodes representing basic blocks are referred through the
following array.  We cannot use basic block member `aux' for this
because it is used for insertion of insns on edges.   

Referenced by calculate_equiv_gains(), create_loop_tree_nodes(), finish_loop_tree_nodes(), and form_loop_tree().

◆ ira_copies

ira_copy_t* ira_copies
extern
Array of references to all copies.  The order number of the copy
corresponds to the index in the array.  Removed copies have NULL
element value.   

Referenced by initiate_copies(), ira_copy_iter_cond(), ira_create_copy(), and ira_flattening().

◆ ira_copies_num

int ira_copies_num
extern

◆ ira_curr_loop_tree_node

ira_loop_tree_node_t ira_curr_loop_tree_node
extern
ira-build.cc  
The current loop tree node and its regno allocno map.   
The current loop tree node and its regno allocno map.   

Referenced by change_loop(), create_bb_allocnos(), create_insn_allocnos(), create_loop_allocnos(), ira_traverse_loop_tree(), and process_regs_for_copy().

◆ ira_curr_regno_allocno_map

◆ ira_dump_file

FILE* ira_dump_file
extern
Dump file of the allocator if it is not NULL.   

Referenced by add_range_and_copies_from_move_list(), allocno_reload_assign(), assign_hard_reg(), build_conflict_bit_table(), calculate_allocation_cost(), change_loop(), coalesce_allocnos(), coalesce_spill_slots(), color_allocnos(), color_pass(), copy_allocno_live_ranges(), create_cap_allocno(), decrease_live_ranges_number(), do_coloring(), do_reload(), fast_allocation(), find_costs_and_classes(), form_threads_from_colorable_allocno(), form_threads_from_copies(), generate_edge_moves(), improve_allocation(), ira(), ira_build(), ira_build_conflicts(), ira_compress_allocno_live_ranges(), ira_create_allocno_live_ranges(), ira_create_new_reg(), ira_flattening(), ira_mark_new_stack_slot(), ira_print_expanded_allocno(), ira_reassign_conflict_allocnos(), ira_reassign_pseudos(), ira_rebuild_regno_allocno_list(), ira_remove_insn_scratches(), ira_remove_pref(), ira_reuse_stack_slot(), ira_set_pseudo_classes(), ira_sort_regnos_for_alter_reg(), ira_update_equiv_info_by_shuffle_insn(), mark_all_loops_for_removal(), mark_loops_for_removal(), modify_move_list(), move_allocno_live_ranges(), move_spill_restore(), pop_allocnos_from_stack(), print_allocno_costs(), print_loop_title(), print_pseudo_costs(), process_bb_node_lives(), push_allocno_to_stack(), push_only_colorable(), record_reg_classes(), remove_allocno_from_bucket_and_push(), remove_scratches(), remove_some_program_points_and_update_live_ranges(), restore_costs_from_copies(), scan_one_insn(), setup_allocno_available_regs_num(), setup_preferred_alternate_classes_for_new_pseudos(), update_costs_from_allocno(), update_costs_from_copies(), and update_costs_from_prefs().

◆ ira_finish_point_ranges

live_range_t * ira_finish_point_ranges

◆ ira_load_cost

int64_t ira_load_cost
extern

◆ ira_loop_nodes

◆ ira_loop_tree_height

int ira_loop_tree_height
extern
Height of the loop tree.   

Referenced by form_loop_tree().

◆ ira_loop_tree_root

◆ ira_max_point

int ira_max_point
extern
Program points are enumerated by numbers from range
0..IRA_MAX_POINT-1.  There are approximately two times more program
points than insns.  Program points are places in the program where
liveness info can be changed.  In most general case (there are more
complicated cases too) some program points correspond to places
where input operand dies and other ones correspond to places where
output operands are born.   
IRA processing allocno lives to build allocno live ranges.
   Copyright (C) 2006-2024 Free Software Foundation, Inc.
   Contributed 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/>.   
The code in this file is similar to one in global but the code
works on the allocno basis and creates live ranges instead of
pseudo-register conflicts.   
Program points are enumerated by numbers from range
0..IRA_MAX_POINT-1.  There are approximately two times more program
points than insns.  Program points are places in the program where
liveness info can be changed.  In most general case (there are more
complicated cases too) some program points correspond to places
where input operand dies and other ones correspond to places where
output operands are born.   

Referenced by add_range_and_copies_from_move_list(), build_conflict_bit_table(), create_start_finish_chains(), fast_allocation(), ira(), ira_build(), ira_create_allocno_live_ranges(), ira_flattening(), remove_some_program_points_and_update_live_ranges(), setup_min_max_allocno_live_range_point(), and setup_min_max_conflict_allocno_ids().

◆ ira_mem_cost

int64_t ira_mem_cost

◆ ira_move_loops_num

int ira_move_loops_num
extern

◆ ira_object_id_map

◆ ira_objects_num

int ira_objects_num
extern

◆ ira_overall_cost

int64_t ira_overall_cost
extern
Correspondingly overall cost of the allocation, cost of the
allocnos assigned to hard-registers, cost of the allocnos assigned
to memory, cost of loads, stores and register move insns generated
for pseudo-register live range splitting (see ira-emit.cc).   
Correspondingly overall cost of the allocation, overall cost before
reload, cost of the allocnos assigned to hard-registers, cost of
the allocnos assigned to memory, cost of loads, stores and register
move insns generated for pseudo-register live range splitting (see
ira-emit.cc).   

Referenced by allocno_reload_assign(), calculate_allocation_cost(), do_reload(), emit_move_list(), ira(), and ira_mark_allocation_change().

◆ ira_prefs

ira_pref_t* ira_prefs
extern
Array of references to all allocno preferences.  The order number
of the preference corresponds to the index in the array.   

Referenced by finish_pref(), initiate_prefs(), ira_create_pref(), and ira_pref_iter_cond().

◆ ira_prefs_num

int ira_prefs_num
extern
Size of the previous array.   

Referenced by initiate_prefs(), ira_create_pref(), and ira_pref_iter_cond().

◆ ira_reg_cost

int64_t ira_reg_cost
extern

Referenced by calculate_allocation_cost(), and ira().

◆ ira_regno_allocno_map

◆ ira_shuffle_cost

int64_t ira_shuffle_cost

Referenced by emit_move_list().

◆ ira_spilled_reg_stack_slots

class ira_spilled_reg_stack_slot* ira_spilled_reg_stack_slots
extern
The following array contains info about spilled pseudo-registers
stack slots used in current function so far.   

Referenced by do_reload(), ira(), ira_mark_new_stack_slot(), and ira_reuse_stack_slot().

◆ ira_spilled_reg_stack_slots_num

int ira_spilled_reg_stack_slots_num
extern
The number of elements in the following array.   

Referenced by ira(), ira_mark_new_stack_slot(), ira_reuse_stack_slot(), and ira_sort_regnos_for_alter_reg().

◆ ira_start_point_ranges

live_range_t* ira_start_point_ranges
extern
Arrays of size IRA_MAX_POINT mapping a program point to the allocno
live ranges with given start/finish point.   

Referenced by build_conflict_bit_table(), create_start_finish_chains(), ira_finish_allocno_live_ranges(), ira_flattening(), and ira_rebuild_start_finish_chains().

◆ ira_store_cost

int64_t ira_store_cost

Referenced by emit_move_list().

◆ last_moveable_pseudo

int last_moveable_pseudo

Referenced by find_costs_and_classes().