GCC Middle and Back End API Reference
|
Data Structures | |
struct | elim_table |
struct | elim_table_1 |
Functions | |
static void | print_elim_table () |
void | lra_debug_elim_table () |
static void | setup_can_eliminate () |
static void | setup_elimination_map () |
static rtx | form_sum () |
int | lra_get_elimination_hard_regno () |
static struct elim_table * | get_elimination () |
rtx | lra_eliminate_regs_1 (rtx x, enum machine_mode mem_mode, bool subst_p, bool update_p, bool full_p) |
rtx | lra_eliminate_regs (rtx x, enum machine_mode mem_mode, rtx insn) |
static void | mark_not_eliminable () |
static void | eliminate_regs_in_insn () |
static void | spill_pseudos () |
static bool | update_reg_eliminate () |
static void | init_elim_table () |
void | lra_init_elimination () |
void | lra_eliminate_reg_if_possible () |
static void | process_insn_for_elimination () |
void | lra_eliminate () |
Variables | |
static struct elim_table * | reg_eliminate = 0 |
static struct elim_table_1 | reg_eliminate_1 [] |
static struct elim_table * | elimination_map [FIRST_PSEUDO_REGISTER] |
static struct elim_table | self_elim_table |
static HOST_WIDE_INT | self_elim_offsets [FIRST_PSEUDO_REGISTER] |
static rtx | eliminable_reg_rtx [FIRST_PSEUDO_REGISTER] |
|
static |
Scan INSN and eliminate all eliminable hard registers in it. If REPLACE_P is true, do the replacement destructively. Also delete the insn as dead it if it is setting an eliminable register. If REPLACE_P is false, just update the offsets while keeping the base register the same.
References apply_change_group(), asm_noperands(), elim_table::can_eliminate, lra_insn_recog_data::dup_loc, lra_static_insn_data::dup_num, elim_table::from, elim_table::from_rtx, get_elimination(), HOST_WIDE_INT, insn_data, lra_delete_dead_insn(), lra_eliminate_regs_1(), lra_get_insn_recog_data(), lra_update_insn_recog_data(), lra_static_insn_data::n_dups, lra_static_insn_data::n_operands, elim_table::offset, offset, OP_IN, lra_static_insn_data::operand, lra_insn_recog_data::operand_loc, plus_constant(), prev_nonnote_insn(), elim_table::previous_offset, recog_memoized(), rtx_equal_p(), subreg_lowpart_p(), elim_table::to, elim_table::to_rtx, trunc_int_for_mode(), and validate_change().
Referenced by calculate_needs_all_insns(), process_insn_for_elimination(), and reload_as_needed().
|
static |
Compute the sum of X and Y, making canonicalizations assumed in an address, namely: sum constant integers, surround the sum of two constants with a CONST, put the constant as the second operand, and group the constant on the outermost sum. This routine assumes both inputs are already in canonical form.
References plus_constant().
Referenced by eliminate_regs_1(), form_sum(), lra_eliminate_regs_1(), and subst_indexed_address().
|
staticread |
Return elimination which will be used for hard reg REG, NULL otherwise.
References eliminable_reg_rtx, elim_table::from, elim_table::from_rtx, HOST_WIDE_INT, elim_table::offset, offset, self_elim_offsets, self_elim_table, elim_table::to, and elim_table::to_rtx.
Referenced by eliminate_regs_in_insn(), lra_eliminate_reg_if_possible(), and lra_eliminate_regs_1().
|
static |
Initialize the table of hard registers to eliminate. Pre-condition: global flag frame_pointer_needed has been set before calling this function.
References elim_table::can_eliminate, eliminable_reg_rtx, elim_table::from, elim_table_1::from, elim_table::from_rtx, gen_rtx_REG(), memset(), elim_table::offset, elim_table::prev_can_eliminate, elim_table::previous_offset, reg_eliminate_1, self_elim_offsets, self_elim_table, setup_can_eliminate(), targetm, elim_table::to, elim_table_1::to, and elim_table::to_rtx.
Referenced by lra_init_elimination().
void lra_debug_elim_table | ( | void | ) |
Print info about elimination table to stderr.
References print_elim_table().
void lra_eliminate | ( | ) |
Entry function to do final elimination if FINAL_P or to update elimination register offsets.
References bitmap_clear(), bitmap_empty_p(), bitmap_ior_into(), elim_table::from, lra_reg::insn_bitmap, ira_reg_equiv::invariant, lra_dump_file, lra_eliminate_regs_1(), lra_reg_info, max_reg_num(), ira_reg_equiv::memory, print_elim_table(), process_insn_for_elimination(), reg_obstack, regs_num, timevar_pop(), timevar_push(), and update_reg_eliminate().
Referenced by lra(), and lra_constraints().
void lra_eliminate_reg_if_possible | ( | ) |
Eliminate hard reg given by its location LOC.
References get_elimination(), lra_no_alloc_regs, and elim_table::to_rtx.
Referenced by in_class_p(), and valid_address_p().
This function is used externally in subsequent passes of GCC. It always does a full elimination of X.
References lra_eliminate_regs_1().
Referenced by based_loc_descr(), and compute_frame_pointer_to_fb_displacement().
rtx lra_eliminate_regs_1 | ( | rtx | x, |
enum machine_mode | mem_mode, | ||
bool | subst_p, | ||
bool | update_p, | ||
bool | full_p | ||
) |
Scan X and replace any eliminable registers (such as fp) with a replacement (such as sp) if SUBST_P, plus an offset. The offset is a change in the offset between the eliminable register and its substitution if UPDATE_P, or the full offset if FULL_P, or otherwise zero. MEM_MODE is the mode of an enclosing MEM. We need this to know how much to adjust a register for, e.g., PRE_DEC. Also, if we are inside a MEM, we are allowed to replace a sum of a hard register and the constant zero with the hard register, which we cannot do outside a MEM. In addition, we need to record the fact that a hard register is referenced outside a MEM. Alternatively, INSN may be a note (an EXPR_LIST or INSN_LIST). That's used when we eliminate in expressions stored in notes.
References alloc_reg_note(), alter_subreg(), current_function_decl, form_sum(), elim_table::from_rtx, gen_rtvec_v(), get_elimination(), HOST_WIDE_INT, lra_eliminate_regs_1(), elim_table::offset, offset, plus_constant(), elim_table::previous_offset, replace_equiv_address_nv(), SET, simplify_gen_subreg(), elim_table::to, and elim_table::to_rtx.
Referenced by assign_mem_slot(), eliminate_regs_in_insn(), lra_eliminate(), lra_eliminate_regs(), and lra_eliminate_regs_1().
int lra_get_elimination_hard_regno | ( | ) |
Return the current substitution hard register of the elimination of HARD_REGNO. If HARD_REGNO is not eliminable, return itself.
References elim_table::to.
Referenced by get_final_hard_regno().
void lra_init_elimination | ( | void | ) |
Entry function for initialization of elimination once per function.
References init_elim_table(), mark_not_eliminable(), and setup_elimination_map().
Referenced by ira_setup_eliminable_regset().
|
static |
Scan rtx X for references to elimination source or target registers in contexts that would prevent the elimination from happening. Update the table of eliminables to reflect the changed state. MEM_MODE is the mode of an enclosing MEM rtx, or VOIDmode if not within a MEM.
References elim_table::from_rtx, SET, setup_can_eliminate(), and elim_table::to_rtx.
Referenced by lra_init_elimination(), and reload().
|
static |
Print info about elimination table to file F.
References elim_table::can_eliminate, elim_table::from, HOST_WIDE_INT_PRINT_DEC, elim_table::offset, elim_table::previous_offset, and elim_table::to.
Referenced by lra_debug_elim_table(), and lra_eliminate().
|
static |
Do (final if FINAL_P) elimination in INSN. Add the insn for subsequent processing in the constraint pass, update the insn info.
References eliminate_regs_in_insn(), lra_push_insn(), lra_set_used_insn_alternative(), lra_update_insn_recog_data(), lra_update_insn_regno_info(), and recog().
Referenced by lra_eliminate().
|
static |
Setup possibility of elimination in elimination table element EP to VALUE. Setup FRAME_POINTER_NEEDED if elimination from frame pointer to stack pointer is not possible anymore.
References elim_table::can_eliminate, elim_table::from, elim_table::prev_can_eliminate, and elim_table::to.
Referenced by init_elim_table(), mark_not_eliminable(), and update_reg_eliminate().
|
static |
Set up ELIMINATION_MAP of the currently used eliminations.
References elim_table::can_eliminate, and elim_table::from.
Referenced by lra_init_elimination(), and update_reg_eliminate().
|
static |
Spill pseudos which are assigned to hard registers in SET. Add affected insns for processing in the subsequent constraint pass.
References bitmap_bit_p(), bitmap_clear(), bitmap_ior_into(), get_insns(), hard_reg_set_empty_p(), lra_dump_file, lra_no_alloc_regs, lra_push_insn(), lra_reg_info, lra_set_used_insn_alternative(), max_reg_num(), overlaps_hard_reg_set_p(), reg_obstack, and reg_renumber.
Referenced by update_reg_eliminate().
|
static |
Update all offsets and possibility for elimination on eliminable registers. Spill pseudos assigned to registers which became uneliminable, update LRA_NO_ALLOC_REGS and ELIMINABLE_REG_SET. Add insns to INSNS_WITH_CHANGED_OFFSETS containing eliminable hard registers whose offsets should be changed. Return true if any elimination offset changed.
References bitmap_ior_into(), elim_table::can_eliminate, eliminable_regset, elim_table::from, lra_reg::insn_bitmap, lra_dump_file, lra_no_alloc_regs, lra_reg_info, lra_update_reg_val_offset(), elim_table::offset, elim_table::prev_can_eliminate, elim_table::previous_offset, self_elim_offsets, setup_can_eliminate(), setup_elimination_map(), spill_pseudos(), targetm, elim_table::to, and lra_reg::val.
Referenced by lra_eliminate().
|
static |
Map: hard regno -> RTL presentation. RTL presentations of all potentially eliminable hard registers are stored in the map.
Referenced by get_elimination(), and init_elim_table().
|
static |
Map: eliminable "from" register -> its current elimination, or NULL if none. The elimination table may contain more than one elimination for the same hard register, but this map specifies the one that we are currently using.
|
static |
The elimination table. Each array entry describes one possible way of eliminating a register in favor of another. If there is more than one way of eliminating a particular register, the most preferred should be specified first.
|
static |
Referenced by init_elim_table().
|
static |
Offsets should be used to restore original offsets for eliminable hard register which just became not eliminable. Zero, otherwise.
Referenced by get_elimination(), init_elim_table(), and update_reg_eliminate().
|
static |
When an eliminable hard register becomes not eliminable, we use the following special structure to restore original offsets for the register.
Referenced by get_elimination(), and init_elim_table().