From: David Malcolm Date: Tue, 9 Sep 2014 15:10:39 +0000 (+0000) Subject: struct ira_reg_equiv_s's "init_insns" is an rtx_insn_list X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0cc97fc5522a17788b0d47550f37d592ffca56ff;p=gcc.git struct ira_reg_equiv_s's "init_insns" is an rtx_insn_list gcc/ChangeLog: 2014-09-09 David Malcolm * ira.c (ira_update_equiv_info_by_shuffle_insn): Use NULL rather than NULL_RTX. (no_equiv): Likewise. (update_equiv_regs): Likewise. (setup_reg_equiv): Likewise. Strengthen locals "elem", "prev_elem", "next_elem" from rtx to rtx_insn_list *, and "insn" from rtx to rtx_insn *. Use methods of "elem" for typesafety and clarity. * ira.h (struct ira_reg_equiv_s): Strengthen field "init_insns" from rtx to rtx_insn_list *. * lra-assigns.c (spill_for): Strengthen local "x" from rtx to rtx_insn_list * and use methods for clarity and typesafety. * lra-constraints.c (contains_deleted_insn_p): Likewise for param "list". (init_insn_rhs_dead_pseudo_p): Likewise for local "insns". Remove redundant check on INSN_P (insns): this cannot hold, as "insns" is an INSN_LIST, not an insn. (reverse_equiv_p): Strengthen local "insns" from rtx to rtx_insn_list * and use methods for clarity and typesafety. (contains_reloaded_insn_p): Likewise for local "list". From-SVN: r215082 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 930085de784..4427243913f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,26 @@ +2014-09-09 David Malcolm + + * ira.c (ira_update_equiv_info_by_shuffle_insn): Use NULL rather + than NULL_RTX. + (no_equiv): Likewise. + (update_equiv_regs): Likewise. + (setup_reg_equiv): Likewise. Strengthen locals "elem", + "prev_elem", "next_elem" from rtx to rtx_insn_list *, and "insn" + from rtx to rtx_insn *. Use methods of "elem" for typesafety and + clarity. + * ira.h (struct ira_reg_equiv_s): Strengthen field "init_insns" + from rtx to rtx_insn_list *. + * lra-assigns.c (spill_for): Strengthen local "x" from rtx to + rtx_insn_list * and use methods for clarity and typesafety. + * lra-constraints.c (contains_deleted_insn_p): Likewise for param + "list". + (init_insn_rhs_dead_pseudo_p): Likewise for local "insns". Remove + redundant check on INSN_P (insns): this cannot hold, as "insns" is + an INSN_LIST, not an insn. + (reverse_equiv_p): Strengthen local "insns" from rtx to + rtx_insn_list * and use methods for clarity and typesafety. + (contains_reloaded_insn_p): Likewise for local "list". + 2014-09-09 Jiong Wang * config/arm/arm.c (NEON_COPYSIGNF): New enum. diff --git a/gcc/ira.c b/gcc/ira.c index 757819ded34..a04ec2b38bc 100644 --- a/gcc/ira.c +++ b/gcc/ira.c @@ -2605,7 +2605,7 @@ ira_update_equiv_info_by_shuffle_insn (int to_regno, int from_regno, rtx_insn *i ira_reg_equiv[to_regno].memory = ira_reg_equiv[to_regno].constant = ira_reg_equiv[to_regno].invariant - = ira_reg_equiv[to_regno].init_insns = NULL_RTX; + = ira_reg_equiv[to_regno].init_insns = NULL; if (internal_flag_ira_verbose > 3 && ira_dump_file != NULL) fprintf (ira_dump_file, " Invalidating equiv info for reg %d\n", to_regno); @@ -3259,7 +3259,7 @@ no_equiv (rtx reg, const_rtx store ATTRIBUTE_UNUSED, if (reg_equiv[regno].is_arg_equivalence) return; ira_reg_equiv[regno].defined_p = false; - ira_reg_equiv[regno].init_insns = NULL_RTX; + ira_reg_equiv[regno].init_insns = NULL; for (; list; list = XEXP (list, 1)) { rtx insn = XEXP (list, 0); @@ -3732,7 +3732,7 @@ update_equiv_regs (void) reg_equiv[regno].init_insns = XEXP (reg_equiv[regno].init_insns, 1); - ira_reg_equiv[regno].init_insns = NULL_RTX; + ira_reg_equiv[regno].init_insns = NULL; bitmap_set_bit (cleared_regs, regno); } /* Move the initialization of the register to just before @@ -3820,15 +3820,17 @@ static void setup_reg_equiv (void) { int i; - rtx elem, prev_elem, next_elem, insn, set, x; + rtx_insn_list *elem, *prev_elem, *next_elem; + rtx_insn *insn; + rtx set, x; for (i = FIRST_PSEUDO_REGISTER; i < ira_reg_equiv_len; i++) for (prev_elem = NULL, elem = ira_reg_equiv[i].init_insns; elem; prev_elem = elem, elem = next_elem) { - next_elem = XEXP (elem, 1); - insn = XEXP (elem, 0); + next_elem = elem->next (); + insn = elem->insn (); set = single_set (insn); /* Init insns can set up equivalence when the reg is a destination or @@ -3897,7 +3899,7 @@ setup_reg_equiv (void) if (ira_reg_equiv[i].memory == NULL_RTX) { ira_reg_equiv[i].defined_p = false; - ira_reg_equiv[i].init_insns = NULL_RTX; + ira_reg_equiv[i].init_insns = NULL; break; } } @@ -3907,7 +3909,7 @@ setup_reg_equiv (void) } } ira_reg_equiv[i].defined_p = false; - ira_reg_equiv[i].init_insns = NULL_RTX; + ira_reg_equiv[i].init_insns = NULL; break; } } diff --git a/gcc/ira.h b/gcc/ira.h index 138b763def3..66030d6f00b 100644 --- a/gcc/ira.h +++ b/gcc/ira.h @@ -166,7 +166,7 @@ struct ira_reg_equiv_s rtx constant; rtx invariant; /* Always NULL_RTX if defined_p is false. */ - rtx init_insns; + rtx_insn_list *init_insns; }; /* The length of the following array. */ diff --git a/gcc/lra-assigns.c b/gcc/lra-assigns.c index 88e0b1d2e49..c7164cde68c 100644 --- a/gcc/lra-assigns.c +++ b/gcc/lra-assigns.c @@ -951,15 +951,15 @@ spill_for (int regno, bitmap spilled_pseudo_bitmap, bool first_p) } EXECUTE_IF_SET_IN_BITMAP (&spill_pseudos_bitmap, 0, spill_regno, bi) { - rtx x; + rtx_insn_list *x; cost += lra_reg_info[spill_regno].freq; if (ira_reg_equiv[spill_regno].memory != NULL || ira_reg_equiv[spill_regno].constant != NULL) for (x = ira_reg_equiv[spill_regno].init_insns; x != NULL; - x = XEXP (x, 1)) - cost -= REG_FREQ_FROM_BB (BLOCK_FOR_INSN (XEXP (x, 0))); + x = x->next ()) + cost -= REG_FREQ_FROM_BB (BLOCK_FOR_INSN (x->insn ())); } if (best_insn_pseudos_num > insn_pseudos_num || (best_insn_pseudos_num == insn_pseudos_num diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index b0385274f07..d5287d1d50d 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -3897,11 +3897,11 @@ multi_block_pseudo_p (int regno) /* Return true if LIST contains a deleted insn. */ static bool -contains_deleted_insn_p (rtx list) +contains_deleted_insn_p (rtx_insn_list *list) { - for (; list != NULL_RTX; list = XEXP (list, 1)) - if (NOTE_P (XEXP (list, 0)) - && NOTE_KIND (XEXP (list, 0)) == NOTE_INSN_DELETED) + for (; list != NULL_RTX; list = list->next ()) + if (NOTE_P (list->insn ()) + && NOTE_KIND (list->insn ()) == NOTE_INSN_DELETED) return true; return false; } @@ -3952,14 +3952,12 @@ insn_rhs_dead_pseudo_p (rtx insn) static bool init_insn_rhs_dead_pseudo_p (int regno) { - rtx insns = ira_reg_equiv[regno].init_insns; + rtx_insn_list *insns = ira_reg_equiv[regno].init_insns; if (insns == NULL) return false; - if (INSN_P (insns)) - return insn_rhs_dead_pseudo_p (insns); - for (; insns != NULL_RTX; insns = XEXP (insns, 1)) - if (insn_rhs_dead_pseudo_p (XEXP (insns, 0))) + for (; insns != NULL_RTX; insns = insns->next ()) + if (insn_rhs_dead_pseudo_p (insns->insn ())) return true; return false; } @@ -3970,14 +3968,15 @@ init_insn_rhs_dead_pseudo_p (int regno) static bool reverse_equiv_p (int regno) { - rtx insns, set; + rtx_insn_list *insns = ira_reg_equiv[regno].init_insns; + rtx set; - if ((insns = ira_reg_equiv[regno].init_insns) == NULL_RTX) + if (insns == NULL) return false; - if (! INSN_P (XEXP (insns, 0)) - || XEXP (insns, 1) != NULL_RTX) + if (! INSN_P (insns->insn ()) + || insns->next () != NULL) return false; - if ((set = single_set (XEXP (insns, 0))) == NULL_RTX) + if ((set = single_set (insns->insn ())) == NULL_RTX) return false; return REG_P (SET_SRC (set)) && (int) REGNO (SET_SRC (set)) == regno; } @@ -3988,10 +3987,10 @@ static bool contains_reloaded_insn_p (int regno) { rtx set; - rtx list = ira_reg_equiv[regno].init_insns; + rtx_insn_list *list = ira_reg_equiv[regno].init_insns; - for (; list != NULL_RTX; list = XEXP (list, 1)) - if ((set = single_set (XEXP (list, 0))) == NULL_RTX + for (; list != NULL; list = list->next ()) + if ((set = single_set (list->insn ())) == NULL_RTX || ! REG_P (SET_DEST (set)) || (int) REGNO (SET_DEST (set)) != regno) return true;