diff options
Diffstat (limited to 'gcc/lra.c')
-rw-r--r-- | gcc/lra.c | 74 |
1 files changed, 39 insertions, 35 deletions
@@ -125,8 +125,9 @@ HARD_REG_SET lra_no_alloc_regs; static int get_new_reg_value (void); static void expand_reg_info (void); static void invalidate_insn_recog_data (int); -static int get_insn_freq (rtx); -static void invalidate_insn_data_regno_info (lra_insn_recog_data_t, rtx, int); +static int get_insn_freq (rtx_insn *); +static void invalidate_insn_data_regno_info (lra_insn_recog_data_t, + rtx_insn *, int); /* Expand all regno related info needed for LRA. */ static void @@ -210,7 +211,7 @@ lra_set_regno_unique_value (int regno) /* Invalidate INSN related info used by LRA. The info should never be used after that. */ void -lra_invalidate_insn_data (rtx insn) +lra_invalidate_insn_data (rtx_insn *insn) { lra_invalidate_insn_regno_info (insn); invalidate_insn_recog_data (INSN_UID (insn)); @@ -219,7 +220,7 @@ lra_invalidate_insn_data (rtx insn) /* Mark INSN deleted and invalidate the insn related info used by LRA. */ void -lra_set_insn_deleted (rtx insn) +lra_set_insn_deleted (rtx_insn *insn) { lra_invalidate_insn_data (insn); SET_INSN_DELETED (insn); @@ -228,9 +229,9 @@ lra_set_insn_deleted (rtx insn) /* Delete an unneeded INSN and any previous insns who sole purpose is loading data that is dead in INSN. */ void -lra_delete_dead_insn (rtx insn) +lra_delete_dead_insn (rtx_insn *insn) { - rtx prev = prev_real_insn (insn); + rtx_insn *prev = prev_real_insn (insn); rtx prev_dest; /* If the previous insn sets a register that dies in our insn, @@ -503,7 +504,8 @@ init_insn_regs (void) in the insn (EARLY_CLOBBER), and reference to the next insn reg info (NEXT). */ static struct lra_insn_reg * -new_insn_reg (rtx insn, int regno, enum op_type type, enum machine_mode mode, +new_insn_reg (rtx_insn *insn, int regno, enum op_type type, + enum machine_mode mode, bool subreg_p, bool early_clobber, struct lra_insn_reg *next) { struct lra_insn_reg *ir; @@ -886,7 +888,7 @@ collect_non_operand_hard_regs (rtx *x, lra_insn_recog_data_t data, /* Set up and return info about INSN. Set up the info if it is not set up yet. */ lra_insn_recog_data_t -lra_set_insn_recog_data (rtx insn) +lra_set_insn_recog_data (rtx_insn *insn) { lra_insn_recog_data_t data; int i, n, icode; @@ -1123,7 +1125,7 @@ invalidate_insn_recog_data (int uid) /* Update all the insn info about INSN. It is usually called when something in the insn was changed. Return the updated info. */ lra_insn_recog_data_t -lra_update_insn_recog_data (rtx insn) +lra_update_insn_recog_data (rtx_insn *insn) { lra_insn_recog_data_t data; int n; @@ -1227,7 +1229,7 @@ lra_update_insn_recog_data (rtx insn) /* Set up that INSN is using alternative ALT now. */ void -lra_set_used_insn_alternative (rtx insn, int alt) +lra_set_used_insn_alternative (rtx_insn *insn, int alt) { lra_insn_recog_data_t data; @@ -1521,7 +1523,7 @@ add_regs_to_insn_regno_info (lra_insn_recog_data_t data, rtx x, int uid, /* Return execution frequency of INSN. */ static int -get_insn_freq (rtx insn) +get_insn_freq (rtx_insn *insn) { basic_block bb = BLOCK_FOR_INSN (insn); @@ -1532,7 +1534,7 @@ get_insn_freq (rtx insn) /* Invalidate all reg info of INSN with DATA and execution frequency FREQ. Update common info about the invalidated registers. */ static void -invalidate_insn_data_regno_info (lra_insn_recog_data_t data, rtx insn, +invalidate_insn_data_regno_info (lra_insn_recog_data_t data, rtx_insn *insn, int freq) { int uid; @@ -1561,7 +1563,7 @@ invalidate_insn_data_regno_info (lra_insn_recog_data_t data, rtx insn, /* Invalidate all reg info of INSN. Update common info about the invalidated registers. */ void -lra_invalidate_insn_regno_info (rtx insn) +lra_invalidate_insn_regno_info (rtx_insn *insn) { invalidate_insn_data_regno_info (lra_get_insn_recog_data (insn), insn, get_insn_freq (insn)); @@ -1586,7 +1588,7 @@ setup_insn_reg_info (lra_insn_recog_data_t data, int freq) /* Set up insn reg info of INSN. Update common reg info from reg info of INSN. */ void -lra_update_insn_regno_info (rtx insn) +lra_update_insn_regno_info (rtx_insn *insn) { int i, uid, freq; lra_insn_recog_data_t data; @@ -1630,13 +1632,13 @@ lra_get_insn_regs (int uid) static sbitmap lra_constraint_insn_stack_bitmap; /* The stack itself. */ -vec<rtx> lra_constraint_insn_stack; +vec<rtx_insn *> lra_constraint_insn_stack; /* Put INSN on the stack. If ALWAYS_UPDATE is true, always update the reg info for INSN, otherwise only update it if INSN is not already on the stack. */ static inline void -lra_push_insn_1 (rtx insn, bool always_update) +lra_push_insn_1 (rtx_insn *insn, bool always_update) { unsigned int uid = INSN_UID (insn); if (always_update) @@ -1654,14 +1656,14 @@ lra_push_insn_1 (rtx insn, bool always_update) /* Put INSN on the stack. */ void -lra_push_insn (rtx insn) +lra_push_insn (rtx_insn *insn) { lra_push_insn_1 (insn, false); } /* Put INSN on the stack and update its reg info. */ void -lra_push_insn_and_update_insn_regno_info (rtx insn) +lra_push_insn_and_update_insn_regno_info (rtx_insn *insn) { lra_push_insn_1 (insn, true); } @@ -1674,10 +1676,10 @@ lra_push_insn_by_uid (unsigned int uid) } /* Take the last-inserted insns off the stack and return it. */ -rtx +rtx_insn * lra_pop_insn (void) { - rtx insn = lra_constraint_insn_stack.pop (); + rtx_insn *insn = lra_constraint_insn_stack.pop (); bitmap_clear_bit (lra_constraint_insn_stack_bitmap, INSN_UID (insn)); return insn; } @@ -1691,9 +1693,9 @@ lra_insn_stack_length (void) /* Push insns FROM to TO (excluding it) going in reverse order. */ static void -push_insns (rtx from, rtx to) +push_insns (rtx_insn *from, rtx_insn *to) { - rtx insn; + rtx_insn *insn; if (from == NULL_RTX) return; @@ -1706,13 +1708,13 @@ push_insns (rtx from, rtx to) taken from the next BB insn after LAST or zero if there in such insn. */ static void -setup_sp_offset (rtx from, rtx last) +setup_sp_offset (rtx_insn *from, rtx_insn *last) { - rtx before = next_nonnote_insn_bb (last); + rtx_insn *before = next_nonnote_insn_bb (last); HOST_WIDE_INT offset = (before == NULL_RTX || ! INSN_P (before) ? 0 : lra_get_insn_recog_data (before)->sp_offset); - for (rtx insn = from; insn != NEXT_INSN (last); insn = NEXT_INSN (insn)) + for (rtx_insn *insn = from; insn != NEXT_INSN (last); insn = NEXT_INSN (insn)) lra_get_insn_recog_data (insn)->sp_offset = offset; } @@ -1720,9 +1722,10 @@ setup_sp_offset (rtx from, rtx last) insns onto the stack. Print about emitting the insns with TITLE. */ void -lra_process_new_insns (rtx insn, rtx before, rtx after, const char *title) +lra_process_new_insns (rtx_insn *insn, rtx_insn *before, rtx_insn *after, + const char *title) { - rtx last; + rtx_insn *last; if (before == NULL_RTX && after == NULL_RTX) return; @@ -1772,7 +1775,7 @@ lra_process_new_insns (rtx insn, rtx before, rtx after, const char *title) /* Description of location of a former scratch operand. */ struct sloc { - rtx insn; /* Insn where the scratch was. */ + rtx_insn *insn; /* Insn where the scratch was. */ int nop; /* Number of the operand which was a scratch. */ }; @@ -1796,7 +1799,7 @@ lra_former_scratch_p (int regno) /* Return true if the operand NOP of INSN is a former scratch. */ bool -lra_former_scratch_operand_p (rtx insn, int nop) +lra_former_scratch_operand_p (rtx_insn *insn, int nop) { return bitmap_bit_p (&scratch_operand_bitmap, INSN_UID (insn) * MAX_RECOG_OPERANDS + nop) != 0; @@ -1809,7 +1812,8 @@ remove_scratches (void) int i; bool insn_changed_p; basic_block bb; - rtx insn, reg; + rtx_insn *insn; + rtx reg; sloc_t loc; lra_insn_recog_data_t id; struct lra_static_insn_data *static_id; @@ -1860,7 +1864,7 @@ restore_scratches (void) int regno; unsigned i; sloc_t loc; - rtx last = NULL_RTX; + rtx_insn *last = NULL; lra_insn_recog_data_t id = NULL; for (i = 0; scratches.iterate (i, &loc); i++) @@ -1903,7 +1907,7 @@ static void check_rtl (bool final_p) { basic_block bb; - rtx insn; + rtx_insn *insn; lra_assert (! final_p || reload_completed); FOR_EACH_BB_FN (bb, cfun) @@ -1985,7 +1989,7 @@ has_nonexceptional_receiver (void) /* Process recursively X of INSN and add REG_INC notes if necessary. */ static void -add_auto_inc_notes (rtx insn, rtx x) +add_auto_inc_notes (rtx_insn *insn, rtx x) { enum rtx_code code = GET_CODE (x); const char *fmt; @@ -2020,7 +2024,7 @@ update_inc_notes (void) { rtx *pnote; basic_block bb; - rtx insn; + rtx_insn *insn; FOR_EACH_BB_FN (bb, cfun) FOR_BB_INSNS (bb, insn) @@ -2165,7 +2169,7 @@ lra (FILE *f) lra_live_ranges_init (); lra_constraints_init (); lra_curr_reload_num = 0; - push_insns (get_last_insn (), NULL_RTX); + push_insns (get_last_insn (), NULL); /* It is needed for the 1st coalescing. */ lra_constraint_new_insn_uid_start = get_max_uid (); bitmap_initialize (&lra_inheritance_pseudos, ®_obstack); |