GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "target.h"
#include "rtl.h"
#include "tree.h"
#include "cfghooks.h"
#include "df.h"
#include "memmodel.h"
#include "tm_p.h"
#include "insn-config.h"
#include "regs.h"
#include "ira.h"
#include "recog.h"
#include "cfgrtl.h"
#include "cfgloop.h"
#include "expr.h"
#include "rtl-iter.h"
#include "dumpfile.h"
Data Structures | |
class | loop_data |
struct | use |
struct | def |
struct | invariant |
struct | invariant_expr_entry |
struct | invariant_expr_hasher |
Macros | |
#define | LOOP_DATA(LOOP) |
#define | MAX_CANON_ADDR_PARTS (5) |
Typedefs | |
typedef struct invariant * | invariant_p |
typedef hash_table< invariant_expr_hasher > | invariant_htab_type |
Functions | |
static void | check_invariant_table_size (void) |
static bool | check_maybe_invariant (rtx x) |
static struct invariant * | invariant_for_use (df_ref use) |
static hashval_t | hash_invariant_expr_1 (rtx_insn *insn, rtx x) |
static bool | invariant_expr_equal_p (rtx_insn *insn1, rtx e1, rtx_insn *insn2, rtx e2) |
static struct invariant * | find_or_insert_inv (invariant_htab_type *eq, rtx expr, machine_mode mode, struct invariant *inv) |
static void | find_identical_invariants (invariant_htab_type *eq, struct invariant *inv) |
static void | merge_identical_invariants (void) |
static void | compute_always_reached (class loop *loop, basic_block *body, bitmap may_exit, bitmap always_reached) |
static void | find_exits (class loop *loop, basic_block *body, bitmap may_exit, bitmap has_exit) |
static bool | may_assign_reg_p (rtx x) |
static void | find_defs (class loop *loop) |
static struct invariant * | create_new_invariant (struct def *def, rtx_insn *insn, bitmap depends_on, bool always_executed) |
static void | canonicalize_address_mult (rtx x) |
static void | collect_address_parts (rtx x, vec< rtx > *addr_parts) |
static int | compare_address_parts (const void *x, const void *y) |
static rtx | canonicalize_address (rtx x) |
static bool | inv_can_prop_to_addr_use (struct def *def, df_ref use) |
static void | record_use (struct def *def, df_ref use) |
static bool | check_dependency (basic_block bb, df_ref use, bitmap depends_on) |
static bool | check_dependencies (rtx_insn *insn, bitmap depends_on) |
static bool | pre_check_invariant_p (bool simple, rtx dest) |
static void | find_invariant_insn (rtx_insn *insn, bool always_reached, bool always_executed) |
static void | record_uses (rtx_insn *insn) |
static void | find_invariants_insn (rtx_insn *insn, bool always_reached, bool always_executed) |
static void | find_invariants_bb (class loop *loop, basic_block bb, bool always_reached, bool always_executed) |
static void | find_invariants_body (class loop *loop, basic_block *body, bitmap always_reached, bitmap always_executed) |
static void | find_invariants (class loop *loop) |
static void | free_use_list (struct use *use) |
static enum reg_class | get_pressure_class_and_nregs (rtx_insn *insn, int *nregs) |
static int | get_inv_cost (struct invariant *inv, int *comp_cost, unsigned *regs_needed, enum reg_class *cl) |
static int | gain_for_invariant (struct invariant *inv, unsigned *regs_needed, unsigned *new_regs, unsigned regs_used, bool speed, bool call_p) |
static int | best_gain_for_invariant (struct invariant **best, unsigned *regs_needed, unsigned *new_regs, unsigned regs_used, bool speed, bool call_p) |
static void | set_move_mark (unsigned invno, int gain) |
static void | find_invariants_to_move (bool speed, bool call_p) |
static int | replace_uses (struct invariant *inv, rtx reg, bool in_group) |
static bool | can_move_invariant_reg (class loop *loop, struct invariant *inv, rtx reg) |
static bool | move_invariant_reg (class loop *loop, unsigned invno) |
static void | move_invariants (class loop *loop) |
static void | init_inv_motion_data (void) |
static void | free_inv_motion_data (void) |
static void | move_single_loop_invariants (class loop *loop) |
static void | free_loop_data (class loop *loop) |
static enum reg_class | get_regno_pressure_class (int regno, int *nregs) |
static void | change_pressure (int regno, bool incr_p) |
static void | mark_regno_live (int regno) |
static void | mark_regno_death (int regno) |
static void | mark_reg_store (rtx reg, const_rtx setter, void *data) |
static void | mark_reg_clobber (rtx reg, const_rtx setter, void *data) |
static void | mark_reg_death (rtx reg) |
static void | mark_ref_regs (rtx x) |
static void | calculate_loop_reg_pressure (void) |
void | move_loop_invariants (void) |
Variables | |
static class loop * | curr_loop |
static unsigned int | invariant_table_size = 0 |
static struct invariant ** | invariant_table |
static unsigned | actual_stamp |
static vec< invariant_p > | invariants |
static bitmap_head | curr_regs_live |
static int | curr_reg_pressure [N_REG_CLASSES] |
static rtx | regs_set [(FIRST_PSEUDO_REGISTER > MAX_RECOG_OPERANDS ? FIRST_PSEUDO_REGISTER :MAX_RECOG_OPERANDS) *2] |
static int | n_regs_set |
#define LOOP_DATA | ( | LOOP | ) |
Referenced by calculate_loop_reg_pressure(), change_pressure(), find_exits(), free_loop_data(), gain_for_invariant(), mark_ref_regs(), mark_regno_live(), and move_single_loop_invariants().
#define MAX_CANON_ADDR_PARTS (5) |
Maximum number of sub expressions in address. We set it to a small integer since it's unlikely to have a complicated address expression.
Referenced by canonicalize_address().
typedef struct invariant* invariant_p |
|
static |
Finds invariant with best gain for moving. Returns the gain, stores the invariant in *BEST and number of registers needed for it to *REGS_NEEDED. REGS_USED is the number of registers used in the loop. NEW_REGS is the number of new variables already added due to invariant motion.
References invariant::eqto, FOR_EACH_VEC_ELT, gain_for_invariant(), i, invariants, invariant::invno, ira_pressure_classes, ira_pressure_classes_num, and invariant::move.
Referenced by find_invariants_to_move().
|
static |
Calculate register pressure in the loops.
References AUTO_INC_DEC, loop::aux, bitmap_bit_p, bitmap_copy(), bitmap_initialize(), bitmap_ior_into(), bitmap_release(), cfun, change_pressure(), curr_loop, curr_reg_pressure, curr_regs_live, current_loops, DF_LR_IN, dump_file, EXECUTE_IF_SET_IN_BITMAP, find_regno_note(), FOR_BB_INSNS, FOR_EACH_BB_FN, get_regno_pressure_class(), loop::header, i, basic_block_def::index, ira_pressure_classes, ira_pressure_classes_num, IRA_REGION_ALL, IRA_REGION_MIXED, ira_setup_eliminable_regset(), LOOP_DATA, loop_depth(), basic_block_def::loop_father, loop_outer(), mark_ref_regs(), mark_reg_clobber(), mark_reg_death(), mark_reg_store(), n_regs_set, NONDEBUG_INSN_P, note_stores(), NULL, NULL_RTX, loop::num, PATTERN(), reg_class_names, REG_NOTE_KIND, REG_NOTES, reg_obstack, REGNO, regs_set, and XEXP.
Referenced by move_loop_invariants().
Whether invariant INV setting REG can be moved out of LOOP, at the end of the block preceding its header.
References invariant::always_executed, BLOCK_FOR_INSN(), CDI_DOMINATORS, DEBUG_INSN_P, DF_INSN_LUID, df_insn_rescan(), DF_REF_BB, DF_REF_INSN, DF_REF_NEXT_REG, DF_REG_DEF_CHAIN, DF_REG_USE_CHAIN, dominated_by_p(), flow_bb_inside_loop_p(), gen_rtx_UNKNOWN_VAR_LOC, HARD_REGISTER_P, invariant::insn, use::insn, INSN_VAR_LOCATION_LOC, REG_P, REGNO, single_succ(), and single_succ_p().
Referenced by move_invariant_reg().
Return a canonical version address for X by following steps: 1) Rewrite ASHIFT into MULT recursively. 2) Divide address into sub expressions with PLUS as the separator. 3) Sort sub expressions according to precedence defined for communative operations. 4) Simplify CONST_INT_P sub expressions. 5) Create new canonicalized address and return. Callers should prepare a copy of X because this function may modify it in place.
References canonicalize_address_mult(), collect_address_parts(), compare_address_parts(), CONST_INT_P, gcc_assert, GET_MODE, i, MAX_CANON_ADDR_PARTS, and simplify_gen_binary().
Referenced by inv_can_prop_to_addr_use().
|
static |
Return a canonical version of X for the address, from the point of view, that all multiplications are represented as MULT instead of the multiply by a power of 2 being represented as ASHIFT. Callers should prepare a copy of X because this function may modify it in place.
References CONST_INT_P, FOR_EACH_SUBRTX_VAR, gen_int_mode(), GET_CODE, GET_MODE, GET_MODE_BITSIZE(), HOST_WIDE_INT_1, INTVAL, is_a(), PUT_CODE, shift, and XEXP.
Referenced by canonicalize_address().
|
static |
Increase (if INCR_P) or decrease current register pressure for register REGNO.
References curr_loop, curr_reg_pressure, get_regno_pressure_class(), LOOP_DATA, and loop_data::max_reg_pressure.
Referenced by calculate_loop_reg_pressure(), mark_regno_death(), and mark_regno_live().
Finds the invariants INSN depends on and store them to the DEPENDS_ON bitmap. Returns true if all dependencies of INSN are known to be loop invariants, false otherwise.
References BLOCK_FOR_INSN(), check_dependency(), DF_INSN_INFO_GET, FOR_EACH_INSN_INFO_EQ_USE, FOR_EACH_INSN_INFO_USE, and df_insn_info::insn.
Referenced by find_invariant_insn().
|
static |
Finds the invariants USE depends on and store them to the DEPENDS_ON bitmap. Returns true if all dependencies of USE are known to be loop invariants, false otherwise.
References bitmap_set_bit, CDI_DOMINATORS, check_invariant_table_size(), invariant::def, defs, invariant::depends_on, DF_HARD_REG_LIVE, DF_REF_BB, DF_REF_CHAIN, DF_REF_FLAGS, DF_REF_ID, DF_REF_READ_WRITE, DF_REF_REGNO, dominated_by_p(), gcc_assert, invariant_table, def::invno, insn_def::next, NULL, and targetm.
Referenced by check_dependencies().
|
static |
Check the size of the invariant table and realloc if necessary.
References DF_DEFS_TABLE_SIZE, invariant_table, and invariant_table_size.
Referenced by check_dependency(), find_defs(), find_invariant_insn(), free_inv_motion_data(), and invariant_for_use().
Test for possibility of invariantness of X.
References CASE_CONST_ANY, check_maybe_invariant(), GET_CODE, GET_RTX_FORMAT, GET_RTX_LENGTH, i, MEM_READONLY_P, MEM_VOLATILE_P, XEXP, XVECEXP, and XVECLEN.
Referenced by check_maybe_invariant(), find_invariant_insn(), and move_invariant_reg().
Collect sub expressions in address X with PLUS as the seperator. Sub expressions are stored in vector ADDR_PARTS.
References FOR_EACH_SUBRTX_VAR, and GET_CODE.
Referenced by canonicalize_address().
|
static |
Compare function for sorting sub expressions X and Y based on precedence defined for communitive operations.
References commutative_operand_precedence(), and y.
Referenced by canonicalize_address().
|
static |
Determines the basic blocks inside LOOP that are always executed and stores their bitmap to ALWAYS_REACHED. MAY_EXIT is a bitmap of basic blocks that may either exit the loop, or contain the call that does not have to return. BODY is body of the loop obtained by get_loop_body_in_dom_order.
References bitmap_bit_p, bitmap_set_bit, CDI_DOMINATORS, dominated_by_p(), i, loop::latch, and loop::num_nodes.
Referenced by find_invariants().
|
static |
Creates a new invariant for definition DEF in INSN, depending on invariants in DEPENDS_ON. ALWAYS_EXECUTED is true if the insn is always executed, unless the program ends due to a function call. The newly created invariant is returned.
References ADDR_SPACE_GENERIC, address_cost(), invariant::always_executed, BLOCK_FOR_INSN(), invariant::cheap_address, invariant::cost, invariant::def, invariant::depends_on, dump_bitmap(), dump_file, invariant::eqno, invariant::eqto, GET_MODE, invariant::insn, INSN_UID(), invariants, def::invno, invariant::invno, invariant::move, NULL_RTX, optimize_bb_for_speed_p(), invariant::orig_regno, invariant::reg, SCALAR_INT_MODE_P, SET_DEST, set_rtx_cost(), SET_SRC, set_src_cost(), single_set(), invariant::stamp, and word_mode.
Referenced by find_invariant_insn().
|
static |
Finds definitions that may correspond to invariants in LOOP with body BODY.
References check_invariant_table_size(), df_analyze_loop(), df_chain_add_problem(), df_dump_region(), DF_RD_PRUNE_DEAD_DEFS, df_set_flags(), DF_UD_CHAIN, dump_file, and loop::num.
Referenced by find_invariants().
|
static |
Finds exits out of the LOOP with body BODY. Marks blocks in that we may exit the loop by cfg edge to HAS_EXIT and MAY_EXIT. In MAY_EXIT additionally mark blocks that may exit due to a call.
References loop::aux, bitmap_initialize(), bitmap_set_bit, CALL_P, find_common_loop(), flow_bb_inside_loop_p(), flow_loop_nested_p(), FOR_BB_INSNS, FOR_EACH_EDGE, i, LOOP_DATA, NULL, loop::num_nodes, reg_obstack, RTL_CONST_OR_PURE_CALL_P, and RTL_LOOPING_CONST_OR_PURE_CALL_P.
Referenced by find_invariants().
|
static |
Finds invariants identical to INV and records the equivalence. EQ is the hash table of the invariants.
References invariant::always_executed, invariant::depends_on, dump_file, invariant::eqno, invariant::eqto, EXECUTE_IF_SET_IN_BITMAP, expr, find_identical_invariants(), find_or_insert_inv(), GET_MODE, invariant::insn, invariants, invariant::invno, SET_DEST, SET_SRC, and single_set().
Referenced by find_identical_invariants(), and merge_identical_invariants().
|
static |
Finds invariant in INSN. ALWAYS_REACHED is true if the insn is always executed. ALWAYS_EXECUTED is true if the insn is always executed, unless the program ends due to a function call.
References invariant::always_executed, BITMAP_ALLOC, BITMAP_FREE, can_throw_internal(), check_dependencies(), check_invariant_table_size(), check_maybe_invariant(), create_new_invariant(), invariant::depends_on, df_find_def(), DF_REF_ID, HARD_REGISTER_P, invariant::insn, invariant_table, JUMP_P, may_assign_reg_p(), may_trap_or_fault_p(), NULL, PATTERN(), pre_check_invariant_p(), REG_P, SET_DEST, SET_SRC, and single_set().
Referenced by find_invariants_insn().
|
static |
Finds invariants in LOOP.
References invariant::always_executed, compute_always_reached(), find_defs(), find_exits(), find_invariants_body(), free(), get_loop_body_in_dom_order(), and merge_identical_invariants().
Referenced by move_single_loop_invariants().
|
static |
Finds invariants in basic block BB. ALWAYS_REACHED is true if the basic block is always executed. ALWAYS_EXECUTED is true if the basic block is always executed, unless the program ends due to a function call.
References invariant::always_executed, CALL_P, basic_block_def::count, dump_file, find_invariants_insn(), FOR_BB_INSNS, basic_block_def::index, invariant::insn, loop_preheader_edge(), NONDEBUG_INSN_P, loop::num, RTL_CONST_OR_PURE_CALL_P, and RTL_LOOPING_CONST_OR_PURE_CALL_P.
Referenced by find_invariants_body().
|
static |
Finds invariants in LOOP with body BODY. ALWAYS_REACHED is the bitmap of basic blocks in BODY that are always executed. ALWAYS_EXECUTED is the bitmap of basic blocks in BODY that are always executed unless the program ends due to a function call.
References invariant::always_executed, bitmap_bit_p, find_invariants_bb(), i, and loop::num_nodes.
Referenced by find_invariants().
|
static |
Finds invariants in INSN. ALWAYS_REACHED is true if the insn is always executed. ALWAYS_EXECUTED is true if the insn is always executed, unless the program ends due to a function call.
References invariant::always_executed, find_invariant_insn(), invariant::insn, and record_uses().
Referenced by find_invariants_bb().
Determines which invariants to move.
References best_gain_for_invariant(), df, DF_REG_SIZE, DF_REGNO_FIRST_DEF, DF_REGNO_LAST_USE, i, invariants, invariant::invno, ira_pressure_classes, ira_pressure_classes_num, NULL, and set_move_mark().
Referenced by move_single_loop_invariants().
|
static |
Checks whether invariant with value EXPR in machine mode MODE is recorded in EQ. If this is the case, return the invariant. Otherwise insert INV to the table for this expression and return INV.
References expr, invariant_expr_entry::expr, hash_table< Descriptor, Lazy, Allocator >::find_slot_with_hash(), invariant_expr_entry::hash, hash_invariant_expr_1(), invariant::insn, invariant_expr_entry::inv, and invariant_expr_entry::mode.
Referenced by find_identical_invariants().
|
static |
Frees the data allocated by invariant motion.
References BITMAP_FREE, check_invariant_table_size(), invariant::def, invariant::depends_on, DF_DEFS_TABLE_SIZE, FOR_EACH_VEC_ELT, free(), free_use_list(), gcc_assert, i, invariant_table, invariants, NULL, and def::uses.
Referenced by move_single_loop_invariants().
|
static |
Releases the auxiliary data for LOOP.
References loop::aux, bitmap_clear(), free(), LOOP_DATA, NULL, loop_data::regs_live, and loop_data::regs_ref.
Referenced by move_loop_invariants().
|
static |
|
static |
Calculates gain for eliminating invariant INV. REGS_USED is the number of registers used in the loop, NEW_REGS is the number of new variables already added due to the invariant motion. The number of registers needed for it is stored in *REGS_NEEDED. SPEED and CALL_P are flags passed through to estimate_reg_pressure_cost.
References actual_stamp, curr_loop, estimate_reg_pressure_cost(), get_inv_cost(), i, ira_class_hard_regs_num, ira_pressure_classes, ira_pressure_classes_num, LOOP_DATA, and reg_classes_intersect_p().
Referenced by best_gain_for_invariant().
|
static |
Calculates cost and number of registers needed for moving invariant INV out of the loop and stores them to *COST and *REGS_NEEDED. *CL will be the REG_CLASS of INV. Return -1: if INV is invalid. 0: if INV and its depends_on have same reg_class 1: if INV and its depends_on have different reg_classes.
References actual_stamp, invariant::always_executed, def::can_prop_to_addr_uses, invariant::cheap_address, constant_pool_constant_p(), invariant::cost, invariant::def, invariant::depends_on, invariant::eqno, invariant::eqto, EXECUTE_IF_SET_IN_BITMAP, get_inv_cost(), GET_MODE, get_pressure_class_and_nregs(), i, invariant::insn, invariants, ira_pressure_classes, ira_pressure_classes_num, ira_stack_reg_pressure_class, invariant::move, def::n_addr_uses, def::n_uses, use::next, SET_SRC, single_set(), invariant::stamp, and def::uses.
Referenced by gain_for_invariant(), and get_inv_cost().
|
static |
Return pressure class and number of hard registers (through *NREGS) for destination of INSN.
References gcc_assert, GET_CODE, GET_MODE, use::insn, ira_pressure_class_translate, ira_reg_class_max_nregs, MEM_P, NULL_RTX, reg_allocno_class(), REG_P, REGNO, SET_DEST, SET_SRC, single_set(), and SUBREG_REG.
Referenced by get_inv_cost().
|
static |
Return pressure class and number of needed hard registers (through *NREGS) of register REGNO.
References eliminable_regset, ira_no_alloc_regs, ira_pressure_class_translate, ira_reg_class_max_nregs, PSEUDO_REGNO_MODE, reg_allocno_class(), and TEST_HARD_REG_BIT.
Referenced by calculate_loop_reg_pressure(), and change_pressure().
Computes hash value for invariant expression X in INSN.
References CASE_CONST_ANY, df_find_use(), invariant::eqto, gcc_assert, GET_CODE, GET_MODE, GET_RTX_FORMAT, GET_RTX_LENGTH, hash_invariant_expr_1(), hash_rtx(), i, invariant::insn, invariant_for_use(), NULL, SUBREG_BYTE, XEXP, XINT, XVECEXP, and XVECLEN.
Referenced by find_or_insert_inv(), and hash_invariant_expr_1().
|
static |
Initializes invariant motion data.
References actual_stamp, and invariants.
Referenced by move_single_loop_invariants().
Given invariant DEF and its address USE, check if the corresponding invariant expr can be propagated into the use or not.
References cancel_changes(), canonicalize_address(), invariant::cheap_address, copy_rtx(), DF_REF_INSN, DF_REF_REAL_LOC, GET_MODE, invariant::insn, invariants, def::invno, MEM_ADDR_SPACE, MEM_P, memory_address_addr_space_p(), NULL_RTX, SET_DEST, SET_SRC, single_set(), validate_unshare_change(), verify_changes(), and XEXP.
Referenced by record_use().
Returns true if the invariant expressions E1 and E2 used in insns INSN1 and INSN2 have always the same value.
References CASE_CONST_ANY, df_find_use(), invariant::eqto, gcc_assert, GET_CODE, GET_MODE, GET_RTX_FORMAT, GET_RTX_LENGTH, i, invariant_expr_equal_p(), invariant_for_use(), NULL, rtx_equal_p(), SUBREG_BYTE, XEXP, XINT, XVECEXP, and XVECLEN.
Referenced by invariant_expr_hasher::equal(), and invariant_expr_equal_p().
Returns the invariant definition for USE, or NULL if USE is not invariant.
References CDI_DOMINATORS, check_invariant_table_size(), defs, DF_REF_BB, DF_REF_CHAIN, DF_REF_FLAGS, DF_REF_ID, DF_REF_READ_WRITE, dominated_by_p(), invariant_table, insn_def::next, and NULL.
Referenced by hash_invariant_expr_1(), invariant_expr_equal_p(), and record_uses().
|
static |
Mark occurrence of registers in X for the current loop.
References bitmap_set_bit, curr_loop, current_loops, GET_CODE, GET_RTX_FORMAT, GET_RTX_LENGTH, i, LOOP_DATA, loop_outer(), mark_ref_regs(), REGNO, RTX_CODE, XEXP, XVECEXP, and XVECLEN.
Referenced by calculate_loop_reg_pressure(), and mark_ref_regs().
Mark clobbering register REG.
References GET_CODE, and mark_reg_store().
Referenced by calculate_loop_reg_pressure().
|
static |
Mark register REG death.
References END_REGNO(), mark_regno_death(), and REGNO.
Referenced by calculate_loop_reg_pressure().
Mark setting register REG.
References END_REGNO(), GET_CODE, mark_regno_live(), n_regs_set, REG_P, REGNO, regs_set, and SUBREG_REG.
Referenced by calculate_loop_reg_pressure(), and mark_reg_clobber().
|
static |
Mark REGNO death.
References bitmap_clear_bit(), change_pressure(), and curr_regs_live.
Referenced by mark_reg_death().
|
static |
Mark REGNO birth.
References bitmap_set_bit, change_pressure(), curr_loop, curr_regs_live, current_loops, LOOP_DATA, and loop_outer().
Referenced by mark_reg_store().
Check whether we may assign a value to X from a register.
References can_copy_p(), frame_pointer_rtx, GET_MODE, HARD_REGISTER_P, REG_P, and REGNO.
Referenced by find_invariant_insn().
|
static |
Find invariants with the same value and record the equivalences.
References find_identical_invariants(), FOR_EACH_VEC_ELT, i, and invariants.
Referenced by find_invariants().
Move invariant INVNO out of the LOOP. Returns true if this succeeds, false otherwise.
References invariant::always_executed, apply_change_group(), BB_END, can_move_invariant_reg(), check_maybe_invariant(), delete_insn(), invariant::depends_on, df_recompute_luids(), dump_file, emit_insn_after(), invariant::eqto, EXECUTE_IF_SET_IN_BITMAP, find_reg_note(), gen_move_insn(), gen_reg_rtx_and_attrs(), GET_CODE, i, invariant::insn, invariants, invariant::invno, JUMP_P, loop_preheader_edge(), invariant::move, move_invariant_reg(), NULL_RTX, invariant::orig_regno, invariant::reg, REG_P, REGNO, remove_note(), reorder_insns(), replace_uses(), SET_DEST, single_set(), split_edge(), SUBREG_REG, validate_change(), and XEXP.
Referenced by move_invariant_reg(), and move_invariants().
|
static |
Move selected invariant out of the LOOP. Newly created regs are marked in TEMPORARY_REGS.
References df_chain, df_process_deferred_rescans(), df_remove_problem(), FOR_EACH_VEC_ELT, i, invariants, move_invariant_reg(), NULL_RTX, invariant::orig_regno, invariant::reg, reg_allocno_class(), reg_alternate_class(), reg_preferred_class(), REGNO, resize_reg_info(), and setup_reg_classes().
Referenced by move_single_loop_invariants().
void move_loop_invariants | ( | void | ) |
Move the invariants out of the loops.
References calculate_loop_reg_pressure(), cfun, checking_verify_flow_info(), curr_loop, df_analyze(), DF_DEFER_INSN_RESCAN, DF_EQ_NOTES, df_live, df_live_add_problem(), df_live_set_all_dirty(), df_remove_problem(), df_set_flags(), dump_file, free(), free_loop_data(), free_reg_info(), invariant_table, invariant_table_size, ira_set_pseudo_classes(), LI_FROM_INNERMOST, move_single_loop_invariants(), NULL, loop::num_nodes, regstat_free_n_sets_and_refs(), and regstat_init_n_sets_and_refs().
|
static |
Move the invariants out of the LOOP.
References find_invariants(), find_invariants_to_move(), free_inv_motion_data(), init_inv_motion_data(), LOOP_DATA, move_invariants(), and optimize_loop_for_speed_p().
Referenced by move_loop_invariants().
Pre-check candidate DEST to skip the one which cannot make a valid insn during move_invariant_reg. SIMPLE is to skip HARD_REGISTER.
References DF_INSN_INFO_GET, DF_REF_INSN, DF_REF_NEXT_REG, DF_REF_REGNO, DF_REG_DEF_COUNT, DF_REG_USE_CHAIN, FOR_EACH_INSN_INFO_DEF, i, REG_P, and REGNO.
Referenced by find_invariant_insn().
Record USE at DEF.
References use::addr_use_p, def::can_prop_to_addr_uses, DF_REF_INSN, DF_REF_REAL_LOC, DF_REF_REG_MEM_LOAD, DF_REF_REG_MEM_STORE, DF_REF_TYPE, use::insn, inv_can_prop_to_addr_use(), def::n_addr_uses, def::n_uses, use::next, use::pos, and def::uses.
Referenced by record_uses().
|
static |
Record registers used in INSN that have a unique invariant definition.
References invariant::def, DF_INSN_INFO_GET, FOR_EACH_INSN_INFO_EQ_USE, FOR_EACH_INSN_INFO_USE, df_insn_info::insn, invariant_for_use(), and record_use().
Referenced by find_invariants_insn().
Replace the uses, reached by the definition of invariant INV, by REG. IN_GROUP is nonzero if this is part of a group of changes that must be performed as a group. In that case, the changes will be stored. The function `apply_change_group' will validate and apply the changes.
References apply_change_group(), invariant::def, use::insn, use::next, use::pos, def::uses, and validate_change().
Referenced by move_invariant_reg().
|
static |
Marks invariant INVNO and all its dependencies for moving.
References invariant::depends_on, dump_file, invariant::eqto, EXECUTE_IF_SET_IN_BITMAP, invariants, invariant::invno, invariant::move, and set_move_mark().
Referenced by find_invariants_to_move(), and set_move_mark().
|
static |
The actual stamp for marking already visited invariants during determining costs of movements.
Referenced by gain_for_invariant(), get_inv_cost(), and init_inv_motion_data().
|
static |
Currently processed loop.
Referenced by calculate_loop_reg_pressure(), jt_path_registry::cancel_invalid_paths(), change_pressure(), loops_list::Iter< T >::fill_curr_loop(), gain_for_invariant(), mark_ref_regs(), mark_regno_live(), move_loop_invariants(), and scan_omp_for().
|
static |
Current reg pressure for each pressure class.
Referenced by calculate_loop_reg_pressure(), and change_pressure().
|
static |
Registers currently living.
Referenced by calculate_bb_reg_pressure(), calculate_loop_reg_pressure(), mark_regno_death(), and mark_regno_live().
|
static |
|
static |
Table of invariants indexed by the df_ref uid field.
Referenced by check_invariant_table_size(), and move_loop_invariants().
|
static |
The invariants.
Referenced by best_gain_for_invariant(), clear_invariants(), create_new_invariant(), find_identical_invariants(), find_invariants_to_move(), finish_invariants(), free_inv_motion_data(), get_inv_cost(), init_inv_motion_data(), initiate_invariants(), insert_invariant(), inv_can_prop_to_addr_use(), merge_identical_invariants(), move_invariant_reg(), move_invariants(), and set_move_mark().
|
static |
Number of regs stored in the previous array.
Referenced by calculate_loop_reg_pressure(), and mark_reg_store().
|
static |
Record all regs that are set in any one insn. Communication from mark_reg_{store,clobber} and global_conflicts. Asm can refer to all hard-registers.
Referenced by calculate_loop_reg_pressure(), look_for_hardregs(), mark_reg_store(), replace_read(), and store_ops_ok().