GCC Middle and Back End API Reference
ira-lives.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "target.h"
#include "rtl.h"
#include "predict.h"
#include "df.h"
#include "memmodel.h"
#include "tm_p.h"
#include "insn-config.h"
#include "regs.h"
#include "ira.h"
#include "ira-int.h"
#include "sparseset.h"
#include "function-abi.h"
#include "except.h"
Include dependency graph for ira-lives.cc:

Functions

static void make_hard_regno_live (int regno)
 
static void make_hard_regno_dead (int regno)
 
static void make_object_live (ira_object_t obj)
 
static void update_allocno_pressure_excess_length (ira_object_t obj)
 
static void make_object_dead (ira_object_t obj)
 
static void inc_register_pressure (enum reg_class pclass, int n)
 
static void dec_register_pressure (enum reg_class pclass, int nregs)
 
static bool pseudo_regno_single_word_and_live_p (int regno)
 
static void mark_pseudo_regno_live (int regno)
 
static void mark_pseudo_regno_subword_live (int regno, int subword)
 
static void mark_hard_reg_live (rtx reg)
 
static void mark_pseudo_reg_live (rtx orig_reg, unsigned regno)
 
static void mark_ref_live (df_ref ref)
 
static void mark_pseudo_regno_dead (int regno)
 
static void mark_pseudo_regno_subword_dead (int regno, int subword)
 
static void mark_hard_reg_dead (rtx reg)
 
static void mark_pseudo_reg_dead (rtx orig_reg, unsigned regno)
 
static void mark_ref_dead (df_ref def)
 
static bool make_pseudo_conflict (rtx reg, enum reg_class cl, rtx dreg, rtx orig_dreg, bool advance_p)
 
static bool check_and_make_def_use_conflict (rtx dreg, rtx orig_dreg, enum reg_class def_cl, int use, enum reg_class use_cl, bool advance_p)
 
static void check_and_make_def_conflict (int alt, int def, enum reg_class def_cl, bool for_tie_p)
 
static void make_early_clobber_and_input_conflicts (void)
 
static bool mark_hard_reg_early_clobbers (rtx_insn *insn, bool live_p)
 
static enum reg_class single_reg_class (const char *constraints, rtx op, rtx equiv_const)
 
static enum reg_class single_reg_operand_class (int op_num)
 
void ira_implicitly_set_insn_hard_regs (HARD_REG_SET *set, alternative_mask preferred)
 
static void process_single_reg_class_operands (bool in_p, int freq)
 
static void process_register_constraint_filters ()
 
static rtx find_call_crossed_cheap_reg (rtx_insn *insn)
 
rtx non_conflicting_reg_copy_p (rtx_insn *insn)
 
static void add_conflict_from_region_landing_pads (eh_region region, ira_object_t obj, function_abi callee_abi)
 
static void process_bb_node_lives (ira_loop_tree_node_t loop_tree_node)
 
static void create_start_finish_chains (void)
 
void ira_rebuild_start_finish_chains (void)
 
static void remove_some_program_points_and_update_live_ranges (void)
 
void ira_print_live_range_list (FILE *f, live_range_t r)
 
DEBUG_FUNCTION void debug (live_range &ref)
 
DEBUG_FUNCTION void debug (live_range *ptr)
 
void ira_debug_live_range_list (live_range_t r)
 
static void print_object_live_ranges (FILE *f, ira_object_t obj)
 
static void print_allocno_live_ranges (FILE *f, ira_allocno_t a)
 
void ira_debug_allocno_live_ranges (ira_allocno_t a)
 
static void print_live_ranges (FILE *f)
 
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)
 

Variables

int ira_max_point
 
live_range_tira_start_point_ranges
 
live_range_tira_finish_point_ranges
 
static int curr_point
 
static int high_pressure_start_point [N_REG_CLASSES]
 
static sparseset objects_live
 
static sparseset allocnos_processed
 
static HARD_REG_SET hard_regs_live
 
static ira_loop_tree_node_t curr_bb_node
 
static int last_call_num
 
static int * allocno_saved_at_call
 
static alternative_mask preferred_alternatives
 
static rtx ignore_reg_for_conflicts
 
static int curr_reg_pressure [N_REG_CLASSES]
 

Function Documentation

◆ add_conflict_from_region_landing_pads()

static void add_conflict_from_region_landing_pads ( eh_region region,
ira_object_t obj,
function_abi callee_abi )
static

◆ check_and_make_def_conflict()

static void check_and_make_def_conflict ( int alt,
int def,
enum reg_class def_cl,
bool for_tie_p )
static
Check and make if necessary conflicts for definition DEF of class DEF_CL of the current insn with input operands. Process only constraints of alternative ALT. One of three things is true when this function is called: (1) DEF is an earlyclobber for alternative ALT. Input operands then conflict with DEF in ALT unless they explicitly match DEF via 0-9 constraints. (2) DEF matches (via 0-9 constraints) an operand that is an earlyclobber for alternative ALT. Other input operands then conflict with DEF in ALT. (3) [FOR_TIE_P] Some input operand X matches DEF for alternative ALT. Input operands with a different value from X then conflict with DEF in ALT. However, there's still a judgement call to make when deciding whether a conflict in ALT is important enough to be reflected in the pan-alternative allocno conflict set.

References a, ALLOCNO_CLASS, alternative_class(), check_and_make_def_use_conflict(), operand_alternative::cl, gcc_checking_assert, GET_CODE, ira_curr_regno_allocno_map, operand_alternative::matched, operand_alternative::matches, n_operands, OP_OUT, preferred_alternatives, recog_data, recog_op_alt, reg_classes_intersect_p(), REG_P, REGNO, rtx_equal_p(), SUBREG_REG, targetm, and TEST_BIT.

Referenced by make_early_clobber_and_input_conflicts().

◆ check_and_make_def_use_conflict()

static bool check_and_make_def_use_conflict ( rtx dreg,
rtx orig_dreg,
enum reg_class def_cl,
int use,
enum reg_class use_cl,
bool advance_p )
static
Check and make if necessary conflicts for pseudo DREG of class DEF_CL of the current insn with input operand USE of class USE_CL. ORIG_DREG is the rtx actually accessed, it may be identical to DREG or a subreg of it. Advance the current program point before making the conflict if ADVANCE_P. Return TRUE if we will need to advance the current program point.

References make_pseudo_conflict(), recog_data, and reg_classes_intersect_p().

Referenced by check_and_make_def_conflict().

◆ create_start_finish_chains()

static void create_start_finish_chains ( void )
static
Create and set up IRA_START_POINT_RANGES and IRA_FINISH_POINT_RANGES.

References FOR_EACH_OBJECT, ira_allocate(), ira_finish_point_ranges, ira_max_point, ira_start_point_ranges, NULL, OBJECT_LIVE_RANGES, and r.

Referenced by ira_create_allocno_live_ranges(), and ira_rebuild_start_finish_chains().

◆ debug() [1/2]

DEBUG_FUNCTION void debug ( live_range & ref)

◆ debug() [2/2]

DEBUG_FUNCTION void debug ( live_range * ptr)

References debug.

◆ dec_register_pressure()

static void dec_register_pressure ( enum reg_class pclass,
int nregs )
static
Record that register pressure for PCLASS has decreased by NREGS registers; update current register pressure, start point of the register pressure excess, and register pressure excess length for living allocnos.

References curr_reg_pressure, EXECUTE_IF_SET_IN_SPARSESET, high_pressure_start_point, i, ira_assert, ira_class_hard_regs_num, ira_object_id_map, ira_reg_class_super_classes, ira_reg_pressure_class_p, objects_live, and update_allocno_pressure_excess_length().

Referenced by mark_hard_reg_dead(), mark_pseudo_regno_dead(), and mark_pseudo_regno_subword_dead().

◆ find_call_crossed_cheap_reg()

static rtx find_call_crossed_cheap_reg ( rtx_insn * insn)
static
Look through the CALL_INSN_FUNCTION_USAGE of a call insn INSN, and see if we find a SET rtx that we can use to deduce that a register can be cheaply caller-saved. Return such a register, or NULL_RTX if none is found.

References BLOCK_FOR_INSN(), CALL_INSN_FUNCTION_USAGE, exp(), GET_CODE, HARD_REGISTER_P, INSN_P, modified_between_p(), NONDEBUG_INSN_P, NULL, NULL_RTX, PREV_INSN(), pseudo_regno_single_word_and_live_p(), REG_P, reg_set_p(), REGNO, rtx_equal_p(), SET, SET_DEST, SET_SRC, single_set(), and XEXP.

Referenced by process_bb_node_lives().

◆ inc_register_pressure()

static void inc_register_pressure ( enum reg_class pclass,
int n )
static
Record that register pressure for PCLASS increased by N registers. Update the current register pressure, maximal register pressure for the current BB and the start point of the register pressure excess.

References curr_bb_node, curr_point, curr_reg_pressure, high_pressure_start_point, i, ira_class_hard_regs_num, ira_reg_class_super_classes, and ira_reg_pressure_class_p.

Referenced by mark_hard_reg_live(), mark_pseudo_regno_live(), and mark_pseudo_regno_subword_live().

◆ ira_compress_allocno_live_ranges()

void ira_compress_allocno_live_ranges ( void )

◆ ira_create_allocno_live_ranges()

void ira_create_allocno_live_ranges ( void )

◆ ira_debug_allocno_live_ranges()

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

References a, and print_allocno_live_ranges().

◆ ira_debug_live_range_list()

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

References ira_print_live_range_list(), and r.

◆ ira_debug_live_ranges()

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

References print_live_ranges().

◆ ira_finish_allocno_live_ranges()

void ira_finish_allocno_live_ranges ( void )
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_implicitly_set_insn_hard_regs()

void ira_implicitly_set_insn_hard_regs ( HARD_REG_SET * set,
alternative_mask preferred )
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(), ALTERNATIVE_BIT, CLEAR_HARD_REG_SET, GET_CODE, GET_MODE, i, ira_class_singleton, PSEUDO_REGNO_MODE, recog_data, REG_P, REGNO, and SUBREG_REG.

◆ ira_print_live_range_list()

void ira_print_live_range_list ( FILE * f,
live_range_t r )
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_rebuild_start_finish_chains()

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

◆ make_early_clobber_and_input_conflicts()

static void make_early_clobber_and_input_conflicts ( void )
static
Make conflicts of early clobber pseudo registers of the current insn with its inputs. Avoid introducing unnecessary conflicts by checking classes of the constraints and pseudos because otherwise significant code degradation is possible for some targets. For these purposes, tying an input to an output makes that output act like an earlyclobber for inputs with a different value, since the output register then has a predetermined purpose on input to the instruction.

References check_and_make_def_conflict(), operand_alternative::cl, n_alternatives(), n_operands, preferred_alternatives, recog_data, recog_op_alt, targetm, and TEST_BIT.

Referenced by process_bb_node_lives().

◆ make_hard_regno_dead()

static void make_hard_regno_dead ( int regno)
static
Process the definition of hard register REGNO. This updates hard_regs_live and hard reg conflict information for living allocnos.

References ALLOCNO_REGNO, CLEAR_HARD_REG_BIT, EXECUTE_IF_SET_IN_SPARSESET, hard_regs_live, i, ignore_reg_for_conflicts, ira_object_id_map, NULL_RTX, OBJECT_ALLOCNO, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, objects_live, REGNO, and SET_HARD_REG_BIT.

Referenced by mark_hard_reg_dead(), and mark_regno_dead().

◆ make_hard_regno_live()

static void make_hard_regno_live ( int regno)
static
Record hard register REGNO as now being live.

References hard_regs_live, and SET_HARD_REG_BIT.

Referenced by mark_hard_reg_live(), mark_regno_live(), and process_bb_node_lives().

◆ make_object_dead()

◆ make_object_live()

static void make_object_live ( ira_object_t obj)
static
Record object OBJ as now being live. Set a bit for it in objects_live, and start a new live range for it if necessary.

References curr_point, live_range::finish, ira_add_live_range_to_object(), NULL, OBJECT_CONFLICT_ID, OBJECT_LIVE_RANGES, objects_live, and sparseset_set_bit().

Referenced by mark_pseudo_regno_live(), and mark_pseudo_regno_subword_live().

◆ make_pseudo_conflict()

static bool make_pseudo_conflict ( rtx reg,
enum reg_class cl,
rtx dreg,
rtx orig_dreg,
bool advance_p )
static
If REG is a pseudo or a subreg of it, and the class of its allocno intersects CL, make a conflict with pseudo DREG. ORIG_DREG is the rtx actually accessed, it may be identical to DREG or a subreg of it. Advance the current program point before making the conflict if ADVANCE_P. Return TRUE if we will need to advance the current program point.

References a, ALLOCNO_CLASS, curr_point, GET_CODE, ira_curr_regno_allocno_map, mark_pseudo_reg_dead(), mark_pseudo_reg_live(), reg_classes_intersect_p(), REG_P, REGNO, and SUBREG_REG.

Referenced by check_and_make_def_use_conflict().

◆ mark_hard_reg_dead()

static void mark_hard_reg_dead ( rtx reg)
static
Process the definition of hard register REG. This updates hard_regs_live and hard reg conflict information for living allocnos.

References dec_register_pressure(), END_REGNO(), hard_regs_live, ira_hard_regno_allocno_class, ira_no_alloc_regs, ira_pressure_class_translate, last, make_hard_regno_dead(), REGNO, and TEST_HARD_REG_BIT.

Referenced by mark_ref_dead().

◆ mark_hard_reg_early_clobbers()

static bool mark_hard_reg_early_clobbers ( rtx_insn * insn,
bool live_p )
static
Mark early clobber hard registers of the current INSN as live (if LIVE_P) or dead. Return true if there are such registers.

References DF_REF_FLAGS_IS_SET, DF_REF_MUST_CLOBBER, DF_REF_REG, FOR_EACH_INSN_DEF, GET_CODE, mark_ref_dead(), mark_ref_live(), REG_P, REGNO, and SUBREG_REG.

Referenced by process_bb_node_lives().

◆ mark_hard_reg_live()

static void mark_hard_reg_live ( rtx reg)
static
Mark the register REG as live. Store a 1 in hard_regs_live for this register, record how many consecutive hardware registers it actually needs.

References eliminable_regset, END_REGNO(), hard_regs_live, inc_register_pressure(), ira_hard_regno_allocno_class, ira_no_alloc_regs, ira_pressure_class_translate, last, make_hard_regno_live(), REGNO, and TEST_HARD_REG_BIT.

Referenced by mark_ref_live().

◆ mark_pseudo_reg_dead()

static void mark_pseudo_reg_dead ( rtx orig_reg,
unsigned regno )
static
Mark a pseudo, or one of its subwords, as dead. REGNO is the pseudo's register number; ORIG_REG is the access in the insn, which may be a subreg.

References mark_pseudo_regno_dead(), mark_pseudo_regno_subword_dead(), read_modify_subreg_p(), and subreg_lowpart_p().

Referenced by make_pseudo_conflict(), and mark_ref_dead().

◆ mark_pseudo_reg_live()

static void mark_pseudo_reg_live ( rtx orig_reg,
unsigned regno )
static
Mark a pseudo, or one of its subwords, as live. REGNO is the pseudo's register number; ORIG_REG is the access in the insn, which may be a subreg.

References mark_pseudo_regno_live(), mark_pseudo_regno_subword_live(), read_modify_subreg_p(), and subreg_lowpart_p().

Referenced by make_pseudo_conflict(), and mark_ref_live().

◆ mark_pseudo_regno_dead()

static void mark_pseudo_regno_dead ( int regno)
static

◆ mark_pseudo_regno_live()

static void mark_pseudo_regno_live ( int regno)
static

◆ mark_pseudo_regno_subword_dead()

static void mark_pseudo_regno_subword_dead ( int regno,
int subword )
static
Like mark_pseudo_regno_dead, but called when we know that only part of the register dies. SUBWORD indicates which; a value of 0 indicates the low part.

References a, ALLOCNO_CLASS, ALLOCNO_MODE, ALLOCNO_NUM, ALLOCNO_NUM_OBJECTS, ALLOCNO_OBJECT, allocno_saved_at_call, dec_register_pressure(), gcc_assert, ira_curr_regno_allocno_map, ira_pressure_class_translate, ira_reg_class_max_nregs, make_object_dead(), NULL, OBJECT_CONFLICT_ID, objects_live, and sparseset_bit_p().

Referenced by mark_pseudo_reg_dead().

◆ mark_pseudo_regno_subword_live()

static void mark_pseudo_regno_subword_live ( int regno,
int subword )
static
Like mark_pseudo_regno_live, but try to only mark one subword of the pseudo as live. SUBWORD indicates which; a value of 0 indicates the low part.

References a, ALLOCNO_CLASS, ALLOCNO_MODE, ALLOCNO_NUM, ALLOCNO_NUM_OBJECTS, ALLOCNO_OBJECT, allocno_saved_at_call, gcc_assert, inc_register_pressure(), ira_curr_regno_allocno_map, ira_pressure_class_translate, ira_reg_class_max_nregs, make_object_live(), mark_pseudo_regno_live(), NULL, OBJECT_CONFLICT_ID, objects_live, and sparseset_bit_p().

Referenced by mark_pseudo_reg_live().

◆ mark_ref_dead()

static void mark_ref_dead ( df_ref def)
static
Mark the register referenced by definition DEF as dead, if the definition is a total one.

References DF_REF_CONDITIONAL, DF_REF_FLAGS_IS_SET, DF_REF_PARTIAL, DF_REF_REG, GET_CODE, mark_hard_reg_dead(), mark_pseudo_reg_dead(), read_modify_subreg_p(), REGNO, and SUBREG_REG.

Referenced by mark_hard_reg_early_clobbers(), and process_bb_node_lives().

◆ mark_ref_live()

static void mark_ref_live ( df_ref ref)
static
Mark the register referenced by use or def REF as live.

References DF_REF_REG, GET_CODE, mark_hard_reg_live(), mark_pseudo_reg_live(), REGNO, and SUBREG_REG.

Referenced by mark_hard_reg_early_clobbers(), and process_bb_node_lives().

◆ non_conflicting_reg_copy_p()

rtx non_conflicting_reg_copy_p ( rtx_insn * insn)
Determine whether INSN is a register to register copy of the type where we do not need to make the source and destiniation registers conflict. If this is a copy instruction, then return the source reg. Otherwise, return NULL_RTX.

References GET_MODE, HARD_REGISTER_NUM_P, hard_regno_nregs(), NULL_RTX, REG_P, REGNO, SET_DEST, SET_SRC, side_effects_p(), single_set(), and targetm.

Referenced by process_bb_lives(), and process_bb_node_lives().

◆ print_allocno_live_ranges()

static void print_allocno_live_ranges ( FILE * f,
ira_allocno_t a )
static
Print live ranges of allocno A to file F.

References a, ALLOCNO_NUM, ALLOCNO_NUM_OBJECTS, ALLOCNO_OBJECT, ALLOCNO_REGNO, i, and print_object_live_ranges().

Referenced by ira_debug_allocno_live_ranges(), and print_live_ranges().

◆ print_live_ranges()

static void print_live_ranges ( FILE * f)
static
Print live ranges of all allocnos to file F.

References a, FOR_EACH_ALLOCNO, and print_allocno_live_ranges().

Referenced by ira_compress_allocno_live_ranges(), ira_create_allocno_live_ranges(), and ira_debug_live_ranges().

◆ print_object_live_ranges()

static void print_object_live_ranges ( FILE * f,
ira_object_t obj )
static
Print live ranges of object OBJ to file F.

References ira_print_live_range_list(), and OBJECT_LIVE_RANGES.

Referenced by print_allocno_live_ranges().

◆ process_bb_node_lives()

static void process_bb_node_lives ( ira_loop_tree_node_t loop_tree_node)
static
Process insns of the basic block given by its LOOP_TREE_NODE to update allocno live ranges, allocno hard register conflicts, intersected calls, and register pressure info for allocnos for the basic block for and regions containing the basic block.

References a, add_conflict_from_region_landing_pads(), add_reg_note(), ALLOCNO_CALL_FREQ, ALLOCNO_CALLS_CROSSED_NUM, ALLOCNO_CHEAP_CALLS_CROSSED_NUM, ALLOCNO_CROSSED_CALLS_ABIS, ALLOCNO_CROSSED_CALLS_CLOBBERED_REGS, ALLOCNO_NUM, ALLOCNO_REGNO, allocno_saved_at_call, allocnos_processed, ira_loop_tree_node::bb, bb_has_abnormal_pred(), bb_has_eh_pred(), CALL_P, can_throw_internal(), cfun, curr_bb_node, curr_point, curr_reg_pressure, df_get_live_out(), DF_REF_FLAGS_IS_SET, DF_REF_MAY_CLOBBER, DF_REF_REG, eh_edge_abi, EH_RETURN_DATA_REGNO, eliminable_regset, EXECUTE_IF_SET_IN_BITMAP, EXECUTE_IF_SET_IN_SPARSESET, find_call_crossed_cheap_reg(), find_reg_note(), FOR_BB_INSNS_REVERSE, FOR_EACH_INSN_DEF, FOR_EACH_INSN_USE, function_abi::full_and_partial_reg_clobbers(), GET_CODE, get_eh_region_from_rtx(), hard_regs_live, has_abnormal_call_or_eh_pred_edge_p(), high_pressure_start_point, i, function_abi::id(), ignore_reg_for_conflicts, insn_callee_abi(), INSN_UID(), internal_flag_ira_verbose, INVALID_REGNUM, ira_allocno_class_translate, ira_assert, ira_class_hard_regs_num, ira_dump_file, ira_loop_tree_root, ira_no_alloc_regs, ira_object_id_map, ira_pressure_class_translate, ira_pressure_classes, ira_pressure_classes_num, ira_reg_class_super_classes, ira_reg_pressure_class_p, ira_setup_alts(), last_call_num, ira_loop_tree_node::loop_num, make_early_clobber_and_input_conflicts(), make_hard_regno_live(), make_object_dead(), mark_hard_reg_early_clobbers(), mark_pseudo_regno_live(), mark_ref_dead(), mark_ref_live(), multiple_sets(), non_conflicting_reg_copy_p(), NONDEBUG_INSN_P, NULL, NULL_RTX, OBJECT_ALLOCNO, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, objects_live, ira_loop_tree_node::parent, PATTERN(), pic_offset_table_rtx, preferred_alternatives, process_register_constraint_filters(), process_single_reg_class_operands(), r, REG_FREQ_FROM_BB, reg_overlap_mentioned_p(), REG_P, ira_loop_tree_node::reg_pressure, REG_SET_TO_HARD_REG_SET, REGNO, SET, SET_DEST, SET_HARD_REG_SET, sparseset_bit_p(), sparseset_clear(), sparseset_set_bit(), SUBREG_REG, targetm, TEST_HARD_REG_BIT, XVECEXP, and XVECLEN.

Referenced by ira_create_allocno_live_ranges().

◆ process_register_constraint_filters()

static void process_register_constraint_filters ( )
static
Go through the operands of the extracted insn looking for operand alternatives that apply a register filter. Record any such filters in the operand's allocno.

References a, ALLOCNO_CLASS, ALLOCNO_REGISTER_FILTERS, ALLOCNO_SET_REGISTER_FILTERS, alternative_class(), alternative_register_filters(), filters, HARD_REGISTER_P, ira_class_subset_p, ira_curr_regno_allocno_map, preferred_alternatives, recog_data, recog_op_alt, REG_P, REGNO, SUBREG_P, SUBREG_REG, and TEST_BIT.

Referenced by process_bb_node_lives().

◆ process_single_reg_class_operands()

static void process_single_reg_class_operands ( bool in_p,
int freq )
static

◆ pseudo_regno_single_word_and_live_p()

static bool pseudo_regno_single_word_and_live_p ( int regno)
static
Determine from the objects_live bitmap whether REGNO is currently live, and occupies only one object. Return false if we have no information.

References a, ALLOCNO_NUM_OBJECTS, ALLOCNO_OBJECT, ira_curr_regno_allocno_map, NULL, OBJECT_CONFLICT_ID, objects_live, and sparseset_bit_p().

Referenced by find_call_crossed_cheap_reg().

◆ remove_some_program_points_and_update_live_ranges()

static void remove_some_program_points_and_update_live_ranges ( void )
static

◆ single_reg_class()

static enum reg_class single_reg_class ( const char * constraints,
rtx op,
rtx equiv_const )
static
Checks that CONSTRAINTS permits to use only one hard register. If it is so, the function returns the class of the hard register. Otherwise it returns NO_REGS.

References ALTERNATIVE_BIT, CONSTANT_P, constraints, end(), GET_MODE, ira_class_singleton, NULL_RTX, preferred_alternatives, recog_data, and single_reg_class().

Referenced by single_reg_class(), and single_reg_operand_class().

◆ single_reg_operand_class()

static enum reg_class single_reg_operand_class ( int op_num)
static
The function checks that operand OP_NUM of the current insn can use only one hard register. If it is so, the function returns the class of the hard register. Otherwise it returns NO_REGS.

References NULL_RTX, recog_data, and single_reg_class().

Referenced by process_single_reg_class_operands().

◆ update_allocno_pressure_excess_length()

static void update_allocno_pressure_excess_length ( ira_object_t obj)
static

Variable Documentation

◆ allocno_saved_at_call

int* allocno_saved_at_call
static

◆ allocnos_processed

sparseset allocnos_processed
static
A temporary bitmap used in functions that wish to avoid visiting an allocno multiple times.

Referenced by ira_create_allocno_live_ranges(), and process_bb_node_lives().

◆ curr_bb_node

ira_loop_tree_node_t curr_bb_node
static
The loop tree node corresponding to the current basic block.

Referenced by inc_register_pressure(), and process_bb_node_lives().

◆ curr_point

◆ curr_reg_pressure

int curr_reg_pressure[N_REG_CLASSES]
static
The current register pressures for each pressure class for the current basic block.

◆ hard_regs_live

◆ high_pressure_start_point

int high_pressure_start_point[N_REG_CLASSES]
static
Point where register pressure excess started or -1 if there is no register pressure excess. Excess pressure for a register class at some point means that there are more allocnos of given register class living at the point than number of hard-registers of the class available for the allocation. It is defined only for pressure classes.

Referenced by dec_register_pressure(), inc_register_pressure(), process_bb_node_lives(), and update_allocno_pressure_excess_length().

◆ ignore_reg_for_conflicts

rtx ignore_reg_for_conflicts
static
If non-NULL, the source operand of a register to register copy for which we should not add a conflict with the copy's destination operand.

Referenced by make_hard_regno_dead(), make_object_dead(), and process_bb_node_lives().

◆ ira_finish_point_ranges

live_range_t * ira_finish_point_ranges

◆ ira_max_point

int ira_max_point
IRA processing allocno lives to build allocno live ranges. Copyright (C) 2006-2025 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_start_point_ranges

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.

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

◆ last_call_num

int last_call_num
static
The number of the last processed call.

Referenced by ira_create_allocno_live_ranges(), and process_bb_node_lives().

◆ objects_live

◆ preferred_alternatives

alternative_mask preferred_alternatives
static
The value returned by ira_setup_alts for the current instruction; i.e. the set of alternatives that we should consider to be likely candidates during reloading.

Referenced by check_and_make_def_conflict(), make_early_clobber_and_input_conflicts(), process_bb_node_lives(), process_register_constraint_filters(), and single_reg_class().