GCC Middle and Back End API Reference
ira-int.h File Reference
#include "cfgloop.h"
#include "ira.h"
#include "alloc-pool.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
struct  ira_spilled_reg_stack_slot
struct  minmax_set_iterator
struct  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

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_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_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_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_prohibited_class_mode_regs   (this_target_ira_int->x_ira_prohibited_class_mode_regs)
#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

static rtx allocno_emit_reg ()
static void minmax_set_iter_init (minmax_set_iterator *i, IRA_INT_TYPE *vec, int min, int max)
static bool minmax_set_iter_cond ()
static void minmax_set_iter_next ()
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 (enum machine_mode)
void ira_setup_alts (rtx insn, HARD_REG_SET &alts)
int ira_get_dup_out_num (int op_num, HARD_REG_SET &alts)
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, 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, ira_loop_tree_node_t)
ira_copy_t ira_add_allocno_copy (ira_allocno_t, ira_allocno_t, int, bool, rtx, 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_finish_costs_once (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_debug_conflicts (bool)
void ira_build_conflicts (void)
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)
static bool ira_equiv_no_lvalue_p ()
static void ira_init_register_move_cost_if_necessary ()
static void ira_allocno_iter_init ()
static bool ira_allocno_iter_cond ()
static void ira_object_iter_init ()
static bool ira_object_iter_cond ()
static void ira_allocno_object_iter_init ()
static bool ira_allocno_object_iter_cond (ira_allocno_object_iterator *i, ira_allocno_t a, ira_object_t *o)
static void ira_pref_iter_init ()
static bool ira_pref_iter_cond ()
static void ira_copy_iter_init ()
static bool ira_copy_iter_cond ()
static void ira_object_conflict_iter_init (ira_object_conflict_iterator *i, ira_object_t obj)
static bool ira_object_conflict_iter_cond (ira_object_conflict_iterator *i, ira_object_t *pobj)
static bool ira_hard_reg_set_intersection_p (int hard_regno, enum machine_mode mode, HARD_REG_SET hard_regset)
static int hard_reg_set_size ()
static bool ira_hard_reg_in_set_p (int hard_regno, enum machine_mode mode, HARD_REG_SET hard_regset)
static void ira_allocate_and_set_costs ()
static void ira_allocate_and_copy_costs ()
static void ira_allocate_and_accumulate_costs ()
static void ira_allocate_and_set_or_copy_costs (int **vec, enum reg_class aclass, int val, int *src)
rtx ira_create_new_reg (rtx)

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
struct ira_spilled_reg_stack_slotira_spilled_reg_stack_slots
int ira_overall_cost
int ira_reg_cost
int ira_mem_cost
int ira_load_cost
int ira_store_cost
int ira_shuffle_cost
int ira_move_loops_num
int ira_additional_jumps_num
struct 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

#define ALLOCNO_ADD_DATA (   A)    ((A)->add_data)
#define ALLOCNO_ASSIGNED_P (   A)    ((A)->assigned_p)
#define ALLOCNO_BAD_SPILL_P (   A)    ((A)->bad_spill_p)

Referenced by ira_create_object().

#define ALLOCNO_CALL_FREQ (   A)    ((A)->call_freq)
#define ALLOCNO_CALLS_CROSSED_NUM (   A)    ((A)->calls_crossed_num)
#define ALLOCNO_CAP (   A)    ((A)->cap)
#define ALLOCNO_CAP_MEMBER (   A)    ((A)->cap_member)

Referenced by ira_create_object().

#define ALLOCNO_CHEAP_CALLS_CROSSED_NUM (   A)    ((A)->cheap_calls_crossed_num)
#define ALLOCNO_CHILD_RENAMED_P (   A)    ((A)->child_renamed_p)
#define ALLOCNO_CONFLICT_HARD_REG_COSTS (   A)    ((A)->conflict_hard_reg_costs)
#define ALLOCNO_COPIES (   A)    ((A)->allocno_copies)
#define ALLOCNO_DONT_REASSIGN_P (   A)    ((A)->dont_reassign_p)

Referenced by ira_create_object().

#define ALLOCNO_EMIT_DATA (   a)    ((ira_emit_data_t) ALLOCNO_ADD_DATA (a))
#define ALLOCNO_EXCESS_PRESSURE_POINTS_NUM (   A)    ((A)->excess_pressure_points_num)

Referenced by ira_reassign_pseudos().

#define ALLOCNO_FREQ (   A)    ((A)->freq)
#define ALLOCNO_HARD_REG_COSTS (   A)    ((A)->hard_reg_costs)
#define ALLOCNO_LOOP_TREE_NODE (   A)    ((A)->loop_tree_node)
#define ALLOCNO_MEM_OPTIMIZED_DEST (   A)    ((A)->mem_optimized_dest)
#define ALLOCNO_MEM_OPTIMIZED_DEST_P (   A)    ((A)->mem_optimized_dest_p)
#define ALLOCNO_NEXT_REGNO_ALLOCNO (   A)    ((A)->next_regno_allocno)
#define ALLOCNO_NREFS (   A)    ((A)->nrefs)
#define ALLOCNO_PREFS (   A)    ((A)->allocno_prefs)
#define ALLOCNO_REG (   A)    ((A)->reg)
#define ALLOCNO_SOMEWHERE_RENAMED_P (   A)    ((A)->somewhere_renamed_p)
#define ALLOCNO_UPDATED_CLASS_COST (   A)    ((A)->updated_class_cost)

Referenced by pop_allocnos_from_stack().

#define ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS (   A)    ((A)->updated_conflict_hard_reg_costs)
#define ALLOCNO_UPDATED_HARD_REG_COSTS (   A)    ((A)->updated_hard_reg_costs)
#define ALLOCNO_UPDATED_MEMORY_COST (   A)    ((A)->updated_memory_cost)
#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 FOR_EACH_ALLOCNO (   A,
  ITER 
)
Value:
for (ira_allocno_iter_init (&(ITER)); \
ira_allocno_iter_cond (&(ITER), &(A));)

Loop over all allocnos. In each iteration, A is set to the next allocno. ITER is an instance of ira_allocno_iterator used to iterate the allocnos.

Referenced by coalesced_pseudo_reg_slot_compare(), do_coloring(), free_ira_costs(), ira_finish_live_range_list(), ira_set_allocno_class(), move_unallocated_pseudos(), scan_one_insn(), and update_bad_spill_attribute().

#define FOR_EACH_ALLOCNO_OBJECT (   A,
  O,
  ITER 
)
Value:
ira_allocno_object_iter_cond (&(ITER), (A), &(O));)

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 create_allocno_objects(), ira_init_costs(), and update_bad_spill_attribute().

#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)))

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

#define FOR_EACH_COPY (   C,
  ITER 
)
Value:
for (ira_copy_iter_init (&(ITER)); \
ira_copy_iter_cond (&(ITER), &(C));)

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

#define FOR_EACH_OBJECT (   OBJ,
  ITER 
)
Value:
for (ira_object_iter_init (&(ITER)); \
ira_object_iter_cond (&(ITER), &(OBJ));)

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.

#define FOR_EACH_OBJECT_CONFLICT (   OBJ,
  CONF,
  ITER 
)
Value:
for (ira_object_conflict_iter_init (&(ITER), (OBJ)); \
ira_object_conflict_iter_cond (&(ITER), &(CONF));)

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

#define FOR_EACH_PREF (   P,
  ITER 
)
Value:
for (ira_pref_iter_init (&(ITER)); \
ira_pref_iter_cond (&(ITER), &(P));)

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.

#define ira_assert (   c)    ((void)(0 && (c)))

Integrated Register Allocator (IRA) intercommunication header file. Copyright (C) 2006-2013 Free Software Foundation, Inc. Contributed by Vladimir Makarov vmaka.nosp@m.rov@.nosp@m.redha.nosp@m.t.co.nosp@m.m.

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_copies(), bucket_allocno_compare_func(), collect_spilled_coalesced_allocnos(), copy_info_to_removed_store_destinations(), find_call_crossed_cheap_reg(), finish_allocnos(), finish_cost_vectors(), inc_register_pressure(), ira_reassign_pseudos(), move_allocno_live_ranges(), propagate_copies(), push_allocnos_to_stack(), scan_one_insn(), setup_allocno_hard_regs_subnode_index(), slot_coalesced_allocno_live_ranges_intersect_p(), split_live_ranges_for_shrink_wrap(), and update_costs_from_allocno().

#define IRA_BB_NODE (   bb)    IRA_BB_NODE_BY_INDEX ((bb)->index)
#define IRA_BB_NODE_BY_INDEX (   index)    (&ira_bb_nodes[index])

Two access macros to the nodes representing basic blocks.

#define ira_class_hard_reg_index   (this_target_ira_int->x_ira_class_hard_reg_index)
#define ira_important_class_nums   (this_target_ira_int->x_ira_important_class_nums)
#define ira_important_classes   (this_target_ira_int->x_ira_important_classes)
#define ira_important_classes_num   (this_target_ira_int->x_ira_important_classes_num)
#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 build_conflict_bit_table(), ira_object_iter_init(), and merge_hard_reg_conflicts().

#define IRA_LOOP_NODE (   loop)    IRA_LOOP_NODE_BY_INDEX ((loop)->num)
#define IRA_LOOP_NODE_BY_INDEX (   index)    (&ira_loop_nodes[index])

Two access macros to the nodes representing loops.

#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_non_ordered_class_hard_regs   (this_target_ira_int->x_ira_non_ordered_class_hard_regs)
#define ira_prohibited_class_mode_regs   (this_target_ira_int->x_ira_prohibited_class_mode_regs)
#define ira_prohibited_mode_move_regs   (this_target_ira_int->x_ira_prohibited_mode_move_regs)
#define ira_reg_allocno_class_p   (this_target_ira_int->x_ira_reg_allocno_class_p)
#define ira_reg_class_intersect   (this_target_ira_int->x_ira_reg_class_intersect)
#define ira_reg_class_subunion   (this_target_ira_int->x_ira_reg_class_subunion)
#define ira_reg_class_super_classes   (this_target_ira_int->x_ira_reg_class_super_classes)
#define ira_reg_class_superunion   (this_target_ira_int->x_ira_reg_class_superunion)
#define ira_reg_mode_hard_regset   (this_target_ira_int->x_ira_reg_mode_hard_regset)
#define ira_reg_pressure_class_p   (this_target_ira_int->x_ira_reg_pressure_class_p)
#define ira_register_move_cost   (this_target_ira_int->x_ira_register_move_cost)
#define ira_uniform_class_p   (this_target_ira_int->x_ira_uniform_class_p)

Referenced by setup_cost_classes().

#define ira_useful_class_mode_regs   (this_target_ira_int->x_ira_useful_class_mode_regs)
#define OBJECT_CONFLICT_ARRAY (   O)    ((O)->conflicts_array)
#define OBJECT_CONFLICT_ARRAY_SIZE (   O)    ((O)->conflicts_array_size)
#define OBJECT_CONFLICT_BITVEC (   O)    ((IRA_INT_TYPE *)(O)->conflicts_array)
#define OBJECT_CONFLICT_HARD_REGS (   O)    ((O)->conflict_hard_regs)
#define OBJECT_CONFLICT_ID (   O)    ((O)->id)
#define OBJECT_CONFLICT_VEC (   O)    ((ira_object_t *)(O)->conflicts_array)
#define OBJECT_CONFLICT_VEC_P (   O)    ((O)->conflict_vec_p)
#define OBJECT_LIVE_RANGES (   O)    ((O)->live_ranges)
#define OBJECT_NUM_CONFLICTS (   O)    ((O)->num_accumulated_conflicts)
#define OBJECT_SUBWORD (   O)    ((O)->subword)
#define OBJECT_TOTAL_CONFLICT_HARD_REGS (   O)    ((O)->total_conflict_hard_regs)
#define REG_FREQ_FROM_EDGE_FREQ (   freq)
Value:
(optimize_size || (flag_branch_probabilities && !ENTRY_BLOCK_PTR->count) \
? (freq * REG_FREQ_MAX / BB_FREQ_MAX) : 1)

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.

#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.

#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)))
#define this_target_ira_int   (&default_target_ira_int)

Typedef Documentation

typedef struct ira_allocno* ira_allocno_t
typedef struct ira_allocno_copy* ira_copy_t
typedef struct ira_emit_data* ira_emit_data_t

Typedef for pointer to the subsequent structure.

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

typedef struct ira_object* ira_object_t
typedef struct ira_allocno_pref* ira_pref_t
typedef struct live_range* live_range_t

Typedefs for pointers to allocno live range, allocno, and copy of allocnos.

typedef unsigned short move_table[N_REG_CLASSES]

Function Documentation

static rtx allocno_emit_reg ( )
inlinestatic

Abbreviation for frequent emit data access.

Referenced by modify_move_list().

void debug ( ira_allocno_copy ref)
void debug ( ira_allocno_copy ptr)
void debug ( ira_allocno ref)
void debug ( ira_allocno ptr)
void debug ( live_range ref)
void debug ( live_range ptr)
static int hard_reg_set_size ( )
inlinestatic

Return number of hard registers in hard register SET.

Referenced by finish_allocno_hard_regs(), and ira_debug_disposition().

void ior_hard_reg_conflicts ( ira_allocno_t  ,
HARD_REG_SET  
)
ira_copy_t ira_add_allocno_copy ( ira_allocno_t  first,
ira_allocno_t  second,
int  freq,
bool  constraint_p,
rtx  insn,
ira_loop_tree_node_t  loop_tree_node 
)

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

Referenced by add_copies().

void ira_add_allocno_pref ( ira_allocno_t  ,
int  ,
int   
)
void ira_add_live_range_to_object ( ira_object_t  ,
int  ,
int   
)
static void ira_allocate_and_accumulate_costs ( )
inlinestatic

Allocate cost vector *VEC for hard registers of ACLASS and add values of vector SRC into the vector if it is necessary

static void ira_allocate_and_copy_costs ( )
inlinestatic

Allocate cost vector *VEC for hard registers of ACLASS and copy values of vector SRC into the vector if it is necessary

Referenced by update_costs_from_allocno().

static void ira_allocate_and_set_costs ( )
inlinestatic

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

Referenced by finish_costs(), ira_init_costs(), and process_single_reg_class_operands().

static void ira_allocate_and_set_or_copy_costs ( int **  vec,
enum reg_class  aclass,
int  val,
int *  src 
)
inlinestatic

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

bitmap ira_allocate_bitmap ( void  )

Allocate and returns bitmap for IRA.

Referenced by coalesced_pseudo_reg_slot_compare(), do_coloring(), and ira_reuse_stack_slot().

void ira_allocate_conflict_vec ( ira_object_t  ,
int   
)
int* ira_allocate_cost_vector ( reg_class_t  )
void ira_allocate_object_conflicts ( ira_object_t  ,
int   
)
static bool ira_allocno_iter_cond ( )
inlinestatic

Return TRUE if we have more allocnos to visit, in which case *A is set to the allocno to be visited. Otherwise, return FALSE.

static void ira_allocno_iter_init ( )
inlinestatic

Initialize the iterator I.

static bool ira_allocno_object_iter_cond ( ira_allocno_object_iterator i,
ira_allocno_t  a,
ira_object_t o 
)
inlinestatic

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.

static void ira_allocno_object_iter_init ( )
inlinestatic

Initialize the iterator I.

bool ira_build ( void  )

Create a internal representation (IR) for IRA (allocnos, copies, loop tree nodes). The function returns TRUE if we generate loop structure (besides nodes representing all function and the basic blocks) for regional allocation. A true return means that we really need to flatten IR before the reload.

Remove all regions but root one.

     We don't save hard registers around calls for fast allocation
     &ndash; add caller clobbered registers as conflicting ones to
     allocno crossing calls.   

Referenced by split_live_ranges_for_shrink_wrap().

void ira_build_conflicts ( void  )

Entry function which builds allocno conflicts and allocno copies and accumulate some allocno info on upper level regions.

         We need finished conflict table for the subsequent call.   
         Now we can free memory for the conflict table (see function
         build_object_conflicts for details).   
             For debugging purposes don't put user defined variables in
             callee-clobbered registers.  However, do allow parameters
             in callee-clobbered registers to improve debugging.  This
             is a bit of a fragile hack.   
             Allocnos bigger than the saved part of call saved
             regs must conflict with them.   
void ira_color ( void  )

Entry function doing coloring.

Setup updated costs.

Referenced by split_live_ranges_for_shrink_wrap().

void ira_compress_allocno_live_ranges ( void  )

Compress allocno live ranges.

bool ira_conflict_vector_profitable_p ( ira_object_t  ,
int   
)
static bool ira_copy_iter_cond ( )
inlinestatic

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 ira_allocate_cost_vector(), ira_class_hard_regs_num, and NULL.

static void ira_copy_iter_init ( )
inlinestatic

Initialize the iterator I.

live_range_t ira_copy_live_range_list ( live_range_t  )
void ira_costs ( void  )

Entry function which defines register class, memory and hard register costs for each allocno.

ira_allocno_t ira_create_allocno ( int  regno,
bool  cap_p,
ira_loop_tree_node_t  loop_tree_node 
)

Create and return the allocno corresponding to REGNO in LOOP_TREE_NODE. Add the allocno to the list of allocnos with the same regno if CAP_P is FALSE.

Remember that we can create temporary allocnos to break cycles in register shuffle on region borders (see ira-emit.c).

void ira_create_allocno_live_ranges ( void  )

The main entry function creates live ranges, set up CONFLICT_HARD_REGS and TOTAL_CONFLICT_HARD_REGS for objects, and calculate register pressure info.

Clean up.

void ira_create_allocno_objects ( ira_allocno_t  )
ira_copy_t ira_create_copy ( ira_allocno_t  first,
ira_allocno_t  second,
int  freq,
bool  constraint_p,
rtx  insn,
ira_loop_tree_node_t  loop_tree_node 
)

Create and return copy with given attributes LOOP_TREE_NODE, FIRST, SECOND, FREQ, CONSTRAINT_P, and INSN.

References ALLOCNO_NUM, ALLOCNO_REGNO, ira_allocno_copy::constraint_p, ira_allocno_copy::first, ira_allocno_copy::freq, ira_allocno_copy::insn, ira_allocno_copy::num, and ira_allocno_copy::second.

live_range_t ira_create_live_range ( ira_object_t  obj,
int  start,
int  finish,
live_range_t  next 
)

Create and return a live range for OBJECT with given attributes.

References first, last, NULL, and live_range::start.

Referenced by create_cap_allocno().

rtx ira_create_new_reg ( rtx  )
ira_pref_t ira_create_pref ( ira_allocno_t  ,
int  ,
int   
)
void ira_debug_allocno_classes ( void  )

Output all possible allocno and translation classes and the translation maps into stderr.

References targetm.

void ira_debug_allocno_copies ( ira_allocno_t  )
void ira_debug_allocno_live_ranges ( ira_allocno_t  )
void ira_debug_allocno_prefs ( ira_allocno_t  )
void ira_debug_conflicts ( bool  )
void ira_debug_copies ( void  )

Print info about all copies into stderr.

void ira_debug_copy ( ira_copy_t  )
void ira_debug_disposition ( void  )

Outputs information about allocation of all allocnos into stderr.

References AND_HARD_REG_SET, COPY_HARD_REG_SET, hard_reg_set_size(), ira_pressure_classes, ira_stack_reg_pressure_class, reg_class_contents, and temp_hard_regset.

void ira_debug_hard_regs_forest ( void  )

ira-color.c

Print the allocno hard register forest to stderr.

void ira_debug_live_range_list ( live_range_t  )
void ira_debug_live_ranges ( void  )

Print live ranges of all allocnos to stderr.

void ira_debug_pref ( ira_pref_t  )
void ira_debug_prefs ( void  )

Print info about all prefs into stderr.

void ira_destroy ( void  )

Release the data created by function ira_build.

void ira_emit ( bool  )
static bool ira_equiv_no_lvalue_p ( )
inlinestatic

Return true if equivalence of pseudo REGNO is not a lvalue.

void ira_finish_allocno_live_ranges ( void  )

Free arrays IRA_START_POINT_RANGES and IRA_FINISH_POINT_RANGES.

void ira_finish_assign ( void  )

Deallocate data used by assign_hard_reg.

void ira_finish_costs_once ( void  )

Function called once at the end of compiler work.

void ira_finish_emit_data ( void  )

Free the emit data.

References ira_free().

void ira_finish_live_range ( live_range_t  )
void ira_finish_live_range_list ( live_range_t  )
void ira_flattening ( int  ,
int   
)
void ira_free_allocno_updated_costs ( ira_allocno_t  )
void ira_free_bitmap ( bitmap  )
void ira_free_cost_vector ( int *  ,
reg_class_t   
)
int ira_get_dup_out_num ( int  op_num,
HARD_REG_SET alts 
)
static bool ira_hard_reg_in_set_p ( int  hard_regno,
enum machine_mode  mode,
HARD_REG_SET  hard_regset 
)
inlinestatic

The function returns TRUE if hard registers starting with HARD_REGNO and containing value of MODE are fully in set HARD_REGSET.

static bool ira_hard_reg_set_intersection_p ( int  hard_regno,
enum machine_mode  mode,
HARD_REG_SET  hard_regset 
)
inlinestatic

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.

Referenced by ira_init_costs().

void ira_init_costs ( void  )

This is called each time register related information is changed.

Don't use ira_allocate because vectors live through several IRA calls.

References ALLOCNO_CLASS_COST, ALLOCNO_HARD_REG_COSTS, FOR_EACH_ALLOCNO_OBJECT, ira_allocate_and_set_costs(), ira_class_hard_regs, ira_hard_reg_set_intersection_p(), and OBJECT_CONFLICT_HARD_REGS.

void ira_init_costs_once ( void  )

ira-costs.c

Function called once during compiler work.

void ira_init_register_move_cost ( enum  machine_mode)
static void ira_init_register_move_cost_if_necessary ( )
inlinestatic

Initialize register costs for MODE if necessary.

References ira_copy_iterator::n, and NULL.

Referenced by process_single_reg_class_operands().

void ira_initiate_assign ( void  )

Allocate and initialize data necessary for assign_hard_reg.

Referenced by move_unallocated_pseudos(), and split_live_ranges_for_shrink_wrap().

void ira_initiate_emit_data ( void  )

ira-emit.c

Allocate and initiate the emit data.

Referenced by split_live_ranges_for_shrink_wrap().

bool ira_live_ranges_intersect_p ( live_range_t  ,
live_range_t   
)
int ira_loop_edge_freq ( ira_loop_tree_node_t  ,
int  ,
bool   
)
live_range_t ira_merge_live_ranges ( live_range_t  ,
live_range_t   
)
static bool ira_object_conflict_iter_cond ( ira_object_conflict_iterator i,
ira_object_t pobj 
)
inlinestatic

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.

     Skip words that are zeros.   
         If we have reached the end, break.   
     Skip bits that are zero.   
static void ira_object_conflict_iter_init ( ira_object_conflict_iterator i,
ira_object_t  obj 
)
inlinestatic

Initialize the iterator I with ALLOCNO conflicts.

static bool ira_object_iter_cond ( )
inlinestatic

Return TRUE if we have more objects to visit, in which case *OBJ is set to the object to be visited. Otherwise, return FALSE.

ira_allocno_t ira_parent_allocno ( ira_allocno_t  )
ira_allocno_t ira_parent_or_cap_allocno ( ira_allocno_t  )
static bool ira_pref_iter_cond ( )
inlinestatic

Return TRUE if we have more prefs to visit, in which case *PREF is set to the pref to be visited. Otherwise, return FALSE.

static void ira_pref_iter_init ( )
inlinestatic

Initialize the iterator I.

References TEST_HARD_REG_BIT.

void ira_print_disposition ( FILE *  )
void ira_print_expanded_allocno ( ira_allocno_t  )
void ira_print_live_range_list ( FILE *  ,
live_range_t   
)
void ira_reassign_conflict_allocnos ( int  )
void ira_rebuild_start_finish_chains ( void  )

ira-lives.c

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.

Referenced by ira_debug_live_range_list().

void ira_remove_allocno_prefs ( ira_allocno_t  )
void ira_remove_pref ( ira_pref_t  )
void ira_set_allocno_class ( ira_allocno_t  ,
enum  reg_class 
)
void ira_setup_alts ( rtx  insn,
HARD_REG_SET alts 
)
void ira_traverse_loop_tree ( bool  bb_p,
ira_loop_tree_node_t  loop_node,
void(*)(ira_loop_tree_node_t preorder_func,
void(*)(ira_loop_tree_node_t postorder_func 
)

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.

Add all nodes to the set of nodes to visit. The IRA loop tree is set up such that nodes in the loop body appear in a pre-order of their place in the CFG.

Referenced by create_loop_allocnos(), print_conflicts(), and process_bb_for_costs().

void ira_tune_allocno_costs ( void  )

Change hard register costs for allocnos which lives through function calls. This is called only when we found all intersected calls during building allocno live ranges.

Some targets allow pseudos to be allocated to unaligned sequences of hard registers. However, selecting an unaligned sequence can unnecessarily restrict later allocations. So increase the cost of unaligned hard regs to encourage the use of aligned hard regs.

static bool minmax_set_iter_cond ( )
inlinestatic

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.

 Skip words that are zeros.   
     If we have reached the end, break.   
 Skip bits that are zero.   
static void minmax_set_iter_init ( minmax_set_iterator i,
IRA_INT_TYPE vec,
int  min,
int  max 
)
inlinestatic

Initialize the iterator I for bit vector VEC containing minimal and maximal values MIN and MAX.

static void minmax_set_iter_next ( )
inlinestatic

Advance to the next element in the set.


Variable Documentation

struct target_ira_int default_target_ira_int
int first_moveable_pseudo

Record the range of register numbers added by find_moveable_pseudos.

int ira_additional_jumps_num
ira_emit_data_t ira_allocno_emit_data

Data used to emit live range split insns and to flattening IR.

Integrated Register Allocator. Changing code and generating moves. Copyright (C) 2006-2013 Free Software Foundation, Inc. Contributed by Vladimir Makarov vmaka.nosp@m.rov@.nosp@m.redha.nosp@m.t.co.nosp@m.m.

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.

ira_allocno_t* ira_allocnos

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

int ira_allocnos_num

The size of the previous array.

Sizes of the previous array.

Referenced by coalesced_pseudo_reg_slot_compare(), ira_create_object(), ira_reuse_stack_slot(), and process_bb_for_costs().

ira_loop_tree_node_t ira_bb_nodes

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

ira_copy_t* ira_copies

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.

int ira_copies_num

Size of the previous array.

Referenced by print_allocno_prefs().

ira_loop_tree_node_t ira_curr_loop_tree_node

ira-build.c The current loop tree node and its regno allocno map.

The current loop tree node and its regno allocno map.

ira_allocno_t* ira_curr_regno_allocno_map

Referenced by mark_pseudo_reg_live().

live_range_t * ira_finish_point_ranges
int ira_load_cost
ira_loop_tree_node_t ira_loop_nodes

All nodes representing loops are referred through the following array.

int ira_loop_tree_height

Height of the loop tree.

ira_loop_tree_node_t ira_loop_tree_root

The root of the loop tree corresponding to the all function.

Referenced by add_copies(), fix_reg_equiv_init(), print_conflicts(), and process_bb_for_costs().

int ira_max_point

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-2013 Free Software Foundation, Inc. Contributed by Vladimir Makarov vmaka.nosp@m.rov@.nosp@m.redha.nosp@m.t.co.nosp@m.m.

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

int ira_mem_cost
int ira_move_loops_num
ira_object_t* ira_object_id_map

Map a conflict id to its corresponding ira_object structure.

Map a conflict id to its conflict record.

Referenced by dec_register_pressure(), process_bb_node_lives(), and propagate_copies().

int ira_objects_num

The size of the previous array.

Count of conflict record structures we've created, used when creating a new conflict id.

Referenced by ira_print_live_range_list(), modify_move_list(), and update_bad_spill_attribute().

int ira_overall_cost

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

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

Referenced by split_live_ranges_for_shrink_wrap().

ira_pref_t* ira_prefs

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

int ira_prefs_num

Size of the previous array.

int ira_reg_cost
ira_allocno_t* ira_regno_allocno_map

Map regno -> allocnos with given regno (see comments for allocno member `next_regno_allocno').

Referenced by coalesced_pseudo_reg_slot_compare(), ira_create_new_reg(), ira_reassign_pseudos(), merge_allocnos(), and slot_coalesced_allocno_live_ranges_intersect_p().

int ira_shuffle_cost
struct ira_spilled_reg_stack_slot* ira_spilled_reg_stack_slots

The following array contains info about spilled pseudo-registers stack slots used in current function so far.

int ira_spilled_reg_stack_slots_num

The number of elements in the following array.

live_range_t* ira_start_point_ranges

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

int ira_store_cost
int last_moveable_pseudo