+2014-08-22 David Malcolm <dmalcolm@redhat.com>
+
+ * ree.c (struct ext_cand): Strengthen field "insn" from rtx to
+ rtx_insn *.
+ (combine_set_extension): Likewise for param "curr_insn".
+ (transform_ifelse): Likewise for param "def_insn".
+ (get_defs): Likewise for param "def_insn". Strengthen param "dest"
+ from vec<rtx> * to vec<rtx_insn *> *.
+ (is_cond_copy_insn): Likewise for param "insn".
+ (struct ext_state): Strengthen the four vec fields from vec<rtx>
+ to vec<rtx_insn *>.
+ (make_defs_and_copies_lists): Strengthen param "extend_insn" and
+ local "def_insn" from rtx to rtx_insn *.
+ (get_sub_rtx): Likewise for param "def_insn".
+ (merge_def_and_ext): Likewise.
+ (combine_reaching_defs): Likewise.
+ (add_removable_extension): Likewise for param "insn".
+ (find_removable_extensions): Likewise for local "insn".
+ (find_and_remove_re): Likewise for locals "curr_insn" and
+ "def_insn". Strengthen locals "reinsn_del_list" and
+ "reinsn_del_list" from auto_vec<rtx> to auto_vec<rtx_insn *>.
+
2014-08-22 David Malcolm <dmalcolm@redhat.com>
* recog.c (split_insn): Strengthen param "insn" and locals
enum machine_mode mode;
/* The instruction where it lives. */
- rtx insn;
+ rtx_insn *insn;
} ext_cand;
assign it to the register. */
static bool
-combine_set_extension (ext_cand *cand, rtx curr_insn, rtx *orig_set)
+combine_set_extension (ext_cand *cand, rtx_insn *curr_insn, rtx *orig_set)
{
rtx orig_src = SET_SRC (*orig_set);
rtx new_set;
DEF_INSN is the if_then_else insn. */
static bool
-transform_ifelse (ext_cand *cand, rtx def_insn)
+transform_ifelse (ext_cand *cand, rtx_insn *def_insn)
{
rtx set_insn = PATTERN (def_insn);
rtx srcreg, dstreg, srcreg2;
of the definitions onto DEST. */
static struct df_link *
-get_defs (rtx insn, rtx reg, vec<rtx> *dest)
+get_defs (rtx_insn *insn, rtx reg, vec<rtx_insn *> *dest)
{
df_ref use;
struct df_link *ref_chain, *ref_link;
and store x1 and x2 in REG_1 and REG_2. */
static bool
-is_cond_copy_insn (rtx insn, rtx *reg1, rtx *reg2)
+is_cond_copy_insn (rtx_insn *insn, rtx *reg1, rtx *reg2)
{
rtx expr = single_set (insn);
/* In order to avoid constant alloc/free, we keep these
4 vectors live through the entire find_and_remove_re and just
truncate them each time. */
- vec<rtx> defs_list;
- vec<rtx> copies_list;
- vec<rtx> modified_list;
- vec<rtx> work_list;
+ vec<rtx_insn *> defs_list;
+ vec<rtx_insn *> copies_list;
+ vec<rtx_insn *> modified_list;
+ vec<rtx_insn *> work_list;
/* For instructions that have been successfully modified, this is
the original mode from which the insn is extending and
success. */
static bool
-make_defs_and_copies_lists (rtx extend_insn, const_rtx set_pat,
+make_defs_and_copies_lists (rtx_insn *extend_insn, const_rtx set_pat,
ext_state *state)
{
rtx src_reg = XEXP (SET_SRC (set_pat), 0);
/* Perform transitive closure for conditional copies. */
while (!state->work_list.is_empty ())
{
- rtx def_insn = state->work_list.pop ();
+ rtx_insn *def_insn = state->work_list.pop ();
rtx reg1, reg2;
gcc_assert (INSN_UID (def_insn) < max_insn_uid);
return NULL. This is similar to single_set, except that
single_set allows multiple SETs when all but one is dead. */
static rtx *
-get_sub_rtx (rtx def_insn)
+get_sub_rtx (rtx_insn *def_insn)
{
enum rtx_code code = GET_CODE (PATTERN (def_insn));
rtx *sub_rtx = NULL;
on the SET pattern. */
static bool
-merge_def_and_ext (ext_cand *cand, rtx def_insn, ext_state *state)
+merge_def_and_ext (ext_cand *cand, rtx_insn *def_insn, ext_state *state)
{
enum machine_mode ext_src_mode;
rtx *sub_rtx;
static bool
combine_reaching_defs (ext_cand *cand, const_rtx set_pat, ext_state *state)
{
- rtx def_insn;
+ rtx_insn *def_insn;
bool merge_successful = true;
int i;
int defs_ix;
return false;
/* There's only one reaching def. */
- rtx def_insn = state->defs_list[0];
+ rtx_insn *def_insn = state->defs_list[0];
/* The defining statement must not have been modified either. */
if (state->modified[INSN_UID (def_insn)].kind != EXT_MODIFIED_NONE)
/* Add an extension pattern that could be eliminated. */
static void
-add_removable_extension (const_rtx expr, rtx insn,
+add_removable_extension (const_rtx expr, rtx_insn *insn,
vec<ext_cand> *insn_list,
unsigned *def_map)
{
{
vec<ext_cand> insn_list = vNULL;
basic_block bb;
- rtx insn, set;
+ rtx_insn *insn;
+ rtx set;
unsigned *def_map = XCNEWVEC (unsigned, max_insn_uid);
FOR_EACH_BB_FN (bb, cfun)
find_and_remove_re (void)
{
ext_cand *curr_cand;
- rtx curr_insn = NULL_RTX;
+ rtx_insn *curr_insn = NULL;
int num_re_opportunities = 0, num_realized = 0, i;
vec<ext_cand> reinsn_list;
- auto_vec<rtx> reinsn_del_list;
- auto_vec<rtx> reinsn_copy_list;
+ auto_vec<rtx_insn *> reinsn_del_list;
+ auto_vec<rtx_insn *> reinsn_copy_list;
ext_state state;
/* Construct DU chain to get all reaching definitions of each
from the new destination to the old destination. */
for (unsigned int i = 0; i < reinsn_copy_list.length (); i += 2)
{
- rtx curr_insn = reinsn_copy_list[i];
- rtx def_insn = reinsn_copy_list[i + 1];
+ rtx_insn *curr_insn = reinsn_copy_list[i];
+ rtx_insn *def_insn = reinsn_copy_list[i + 1];
/* Use the mode of the destination of the defining insn
for the mode of the copy. This is necessary if the