+2014-09-09 David Malcolm <dmalcolm@redhat.com>
+
+ * 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 <jiong.wang@arm.com>
* config/arm/arm.c (NEON_COPYSIGNF): New enum.
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);
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);
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
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
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;
}
}
}
}
ira_reg_equiv[i].defined_p = false;
- ira_reg_equiv[i].init_insns = NULL_RTX;
+ ira_reg_equiv[i].init_insns = NULL;
break;
}
}
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. */
}
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
/* 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;
}
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;
}
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;
}
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;