Commit 59a0c032 by David Malcolm Committed by David Malcolm

ree.c: Use rtx_insn

gcc/
	* 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 *>.

From-SVN: r214364
parent e06ed0c4
2014-08-22 David Malcolm <dmalcolm@redhat.com> 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 * recog.c (split_insn): Strengthen param "insn" and locals
"first", "last" from rtx to rtx_insn *. "first", "last" from rtx to rtx_insn *.
(split_all_insns): Likewise for locals "insn", "next". (split_all_insns): Likewise for locals "insn", "next".
......
...@@ -255,7 +255,7 @@ typedef struct ext_cand ...@@ -255,7 +255,7 @@ typedef struct ext_cand
enum machine_mode mode; enum machine_mode mode;
/* The instruction where it lives. */ /* The instruction where it lives. */
rtx insn; rtx_insn *insn;
} ext_cand; } ext_cand;
...@@ -279,7 +279,7 @@ static int max_insn_uid; ...@@ -279,7 +279,7 @@ static int max_insn_uid;
assign it to the register. */ assign it to the register. */
static bool 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 orig_src = SET_SRC (*orig_set);
rtx new_set; rtx new_set;
...@@ -383,7 +383,7 @@ combine_set_extension (ext_cand *cand, rtx curr_insn, rtx *orig_set) ...@@ -383,7 +383,7 @@ combine_set_extension (ext_cand *cand, rtx curr_insn, rtx *orig_set)
DEF_INSN is the if_then_else insn. */ DEF_INSN is the if_then_else insn. */
static bool 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 set_insn = PATTERN (def_insn);
rtx srcreg, dstreg, srcreg2; rtx srcreg, dstreg, srcreg2;
...@@ -429,7 +429,7 @@ transform_ifelse (ext_cand *cand, rtx def_insn) ...@@ -429,7 +429,7 @@ transform_ifelse (ext_cand *cand, rtx def_insn)
of the definitions onto DEST. */ of the definitions onto DEST. */
static struct df_link * 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; df_ref use;
struct df_link *ref_chain, *ref_link; struct df_link *ref_chain, *ref_link;
...@@ -467,7 +467,7 @@ get_defs (rtx insn, rtx reg, vec<rtx> *dest) ...@@ -467,7 +467,7 @@ get_defs (rtx insn, rtx reg, vec<rtx> *dest)
and store x1 and x2 in REG_1 and REG_2. */ and store x1 and x2 in REG_1 and REG_2. */
static bool 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); rtx expr = single_set (insn);
...@@ -516,10 +516,10 @@ typedef struct ext_state ...@@ -516,10 +516,10 @@ typedef struct ext_state
/* In order to avoid constant alloc/free, we keep these /* In order to avoid constant alloc/free, we keep these
4 vectors live through the entire find_and_remove_re and just 4 vectors live through the entire find_and_remove_re and just
truncate them each time. */ truncate them each time. */
vec<rtx> defs_list; vec<rtx_insn *> defs_list;
vec<rtx> copies_list; vec<rtx_insn *> copies_list;
vec<rtx> modified_list; vec<rtx_insn *> modified_list;
vec<rtx> work_list; vec<rtx_insn *> work_list;
/* For instructions that have been successfully modified, this is /* For instructions that have been successfully modified, this is
the original mode from which the insn is extending and the original mode from which the insn is extending and
...@@ -540,7 +540,7 @@ typedef struct ext_state ...@@ -540,7 +540,7 @@ typedef struct ext_state
success. */ success. */
static bool 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) ext_state *state)
{ {
rtx src_reg = XEXP (SET_SRC (set_pat), 0); rtx src_reg = XEXP (SET_SRC (set_pat), 0);
...@@ -558,7 +558,7 @@ make_defs_and_copies_lists (rtx extend_insn, const_rtx set_pat, ...@@ -558,7 +558,7 @@ make_defs_and_copies_lists (rtx extend_insn, const_rtx set_pat,
/* Perform transitive closure for conditional copies. */ /* Perform transitive closure for conditional copies. */
while (!state->work_list.is_empty ()) while (!state->work_list.is_empty ())
{ {
rtx def_insn = state->work_list.pop (); rtx_insn *def_insn = state->work_list.pop ();
rtx reg1, reg2; rtx reg1, reg2;
gcc_assert (INSN_UID (def_insn) < max_insn_uid); gcc_assert (INSN_UID (def_insn) < max_insn_uid);
...@@ -594,7 +594,7 @@ make_defs_and_copies_lists (rtx extend_insn, const_rtx set_pat, ...@@ -594,7 +594,7 @@ make_defs_and_copies_lists (rtx extend_insn, const_rtx set_pat,
return NULL. This is similar to single_set, except that return NULL. This is similar to single_set, except that
single_set allows multiple SETs when all but one is dead. */ single_set allows multiple SETs when all but one is dead. */
static rtx * static rtx *
get_sub_rtx (rtx def_insn) get_sub_rtx (rtx_insn *def_insn)
{ {
enum rtx_code code = GET_CODE (PATTERN (def_insn)); enum rtx_code code = GET_CODE (PATTERN (def_insn));
rtx *sub_rtx = NULL; rtx *sub_rtx = NULL;
...@@ -632,7 +632,7 @@ get_sub_rtx (rtx def_insn) ...@@ -632,7 +632,7 @@ get_sub_rtx (rtx def_insn)
on the SET pattern. */ on the SET pattern. */
static bool 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; enum machine_mode ext_src_mode;
rtx *sub_rtx; rtx *sub_rtx;
...@@ -693,7 +693,7 @@ get_extended_src_reg (rtx src) ...@@ -693,7 +693,7 @@ get_extended_src_reg (rtx src)
static bool static bool
combine_reaching_defs (ext_cand *cand, const_rtx set_pat, ext_state *state) combine_reaching_defs (ext_cand *cand, const_rtx set_pat, ext_state *state)
{ {
rtx def_insn; rtx_insn *def_insn;
bool merge_successful = true; bool merge_successful = true;
int i; int i;
int defs_ix; int defs_ix;
...@@ -744,7 +744,7 @@ combine_reaching_defs (ext_cand *cand, const_rtx set_pat, ext_state *state) ...@@ -744,7 +744,7 @@ combine_reaching_defs (ext_cand *cand, const_rtx set_pat, ext_state *state)
return false; return false;
/* There's only one reaching def. */ /* 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. */ /* The defining statement must not have been modified either. */
if (state->modified[INSN_UID (def_insn)].kind != EXT_MODIFIED_NONE) if (state->modified[INSN_UID (def_insn)].kind != EXT_MODIFIED_NONE)
...@@ -909,7 +909,7 @@ combine_reaching_defs (ext_cand *cand, const_rtx set_pat, ext_state *state) ...@@ -909,7 +909,7 @@ combine_reaching_defs (ext_cand *cand, const_rtx set_pat, ext_state *state)
/* Add an extension pattern that could be eliminated. */ /* Add an extension pattern that could be eliminated. */
static void static void
add_removable_extension (const_rtx expr, rtx insn, add_removable_extension (const_rtx expr, rtx_insn *insn,
vec<ext_cand> *insn_list, vec<ext_cand> *insn_list,
unsigned *def_map) unsigned *def_map)
{ {
...@@ -982,7 +982,8 @@ find_removable_extensions (void) ...@@ -982,7 +982,8 @@ find_removable_extensions (void)
{ {
vec<ext_cand> insn_list = vNULL; vec<ext_cand> insn_list = vNULL;
basic_block bb; basic_block bb;
rtx insn, set; rtx_insn *insn;
rtx set;
unsigned *def_map = XCNEWVEC (unsigned, max_insn_uid); unsigned *def_map = XCNEWVEC (unsigned, max_insn_uid);
FOR_EACH_BB_FN (bb, cfun) FOR_EACH_BB_FN (bb, cfun)
...@@ -1009,11 +1010,11 @@ static void ...@@ -1009,11 +1010,11 @@ static void
find_and_remove_re (void) find_and_remove_re (void)
{ {
ext_cand *curr_cand; ext_cand *curr_cand;
rtx curr_insn = NULL_RTX; rtx_insn *curr_insn = NULL;
int num_re_opportunities = 0, num_realized = 0, i; int num_re_opportunities = 0, num_realized = 0, i;
vec<ext_cand> reinsn_list; vec<ext_cand> reinsn_list;
auto_vec<rtx> reinsn_del_list; auto_vec<rtx_insn *> reinsn_del_list;
auto_vec<rtx> reinsn_copy_list; auto_vec<rtx_insn *> reinsn_copy_list;
ext_state state; ext_state state;
/* Construct DU chain to get all reaching definitions of each /* Construct DU chain to get all reaching definitions of each
...@@ -1082,8 +1083,8 @@ find_and_remove_re (void) ...@@ -1082,8 +1083,8 @@ find_and_remove_re (void)
from the new destination to the old destination. */ from the new destination to the old destination. */
for (unsigned int i = 0; i < reinsn_copy_list.length (); i += 2) for (unsigned int i = 0; i < reinsn_copy_list.length (); i += 2)
{ {
rtx curr_insn = reinsn_copy_list[i]; rtx_insn *curr_insn = reinsn_copy_list[i];
rtx def_insn = reinsn_copy_list[i + 1]; rtx_insn *def_insn = reinsn_copy_list[i + 1];
/* Use the mode of the destination of the defining insn /* Use the mode of the destination of the defining insn
for the mode of the copy. This is necessary if the for the mode of the copy. This is necessary if the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment