Use rtx_expr_list in various places

gcc/
2014-08-27  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (free_EXPR_LIST_list): Strengthen param from rtx * to
	rtx_expr_list **.
	(alloc_EXPR_LIST): Strengthen return type from rtx to
	rtx_expr_list *.
	(remove_free_EXPR_LIST_node): Likewise for param.
	* reload.h (struct reg_equivs_t): Strengthen field "alt_mem_list"
	from rtx to rtx_expr_list *.
	* sched-int.h (struct deps_desc): Strengthen fields
	"pending_read_mems" and "pending_write_mems" from rtx to
	rtx_expr_list *.

	* dwarf2out.c (decl_piece_varloc_ptr): Strengthen return type from
	rtx to rtx_expr_list *.
	* lists.c (alloc_INSN_LIST): Likewise, also for local "r".
	(free_EXPR_LIST_list): Strengthen param "listp" from rtx * to
	rtx_expr_list **.
	(remove_free_EXPR_LIST_node): Likewise.  Strengthen local "node"
	from rtx to rtx_expr_list *.
	* loop-iv.c (simplify_using_initial_values): Strengthen local
	"cond_list" from rtx to rtx_expr_list *, and locals "pnode",
	"pnote_next" from rtx * to rtx_expr_list **.
	* sched-deps.c (remove_from_both_dependence_lists):  Strengthen
	param "exprp" from rtx * to rtx_expr_list **.
	(add_insn_mem_dependence): Strengthen local "mem_list" from
	rtx * to rtx_expr_list **.  Strengthen local "mem_node" from rtx
	to rtx_expr_list *.
	* sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_mems"
	and local "new_mems" from rtx to rtx_expr_list *.  Strengthen
	param "old_mems_p" from rtx * to rtx_expr_list **.
	* var-tracking.c (struct adjust_mem_data): Strengthen field
	"side_effects" from rtx to rtx_expr_list *.
	(adjust_insn): Replace NULL_RTX with NULL when assigning to
	rtx_expr_list *.
	(prepare_call_arguments): Likewise.

From-SVN: r214605
This commit is contained in:
David Malcolm 2014-08-27 20:40:05 +00:00 committed by David Malcolm
parent 0f4783c7f7
commit 2f33ff0a9d
10 changed files with 74 additions and 35 deletions

View File

@ -1,3 +1,40 @@
2014-08-27 David Malcolm <dmalcolm@redhat.com>
* rtl.h (free_EXPR_LIST_list): Strengthen param from rtx * to
rtx_expr_list **.
(alloc_EXPR_LIST): Strengthen return type from rtx to
rtx_expr_list *.
(remove_free_EXPR_LIST_node): Likewise for param.
* reload.h (struct reg_equivs_t): Strengthen field "alt_mem_list"
from rtx to rtx_expr_list *.
* sched-int.h (struct deps_desc): Strengthen fields
"pending_read_mems" and "pending_write_mems" from rtx to
rtx_expr_list *.
* dwarf2out.c (decl_piece_varloc_ptr): Strengthen return type from
rtx to rtx_expr_list *.
* lists.c (alloc_INSN_LIST): Likewise, also for local "r".
(free_EXPR_LIST_list): Strengthen param "listp" from rtx * to
rtx_expr_list **.
(remove_free_EXPR_LIST_node): Likewise. Strengthen local "node"
from rtx to rtx_expr_list *.
* loop-iv.c (simplify_using_initial_values): Strengthen local
"cond_list" from rtx to rtx_expr_list *, and locals "pnode",
"pnote_next" from rtx * to rtx_expr_list **.
* sched-deps.c (remove_from_both_dependence_lists): Strengthen
param "exprp" from rtx * to rtx_expr_list **.
(add_insn_mem_dependence): Strengthen local "mem_list" from
rtx * to rtx_expr_list **. Strengthen local "mem_node" from rtx
to rtx_expr_list *.
* sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_mems"
and local "new_mems" from rtx to rtx_expr_list *. Strengthen
param "old_mems_p" from rtx * to rtx_expr_list **.
* var-tracking.c (struct adjust_mem_data): Strengthen field
"side_effects" from rtx to rtx_expr_list *.
(adjust_insn): Replace NULL_RTX with NULL when assigning to
rtx_expr_list *.
(prepare_call_arguments): Likewise.
2014-08-27 David Malcolm <dmalcolm@redhat.com>
* function.h (struct rtl_data): Strengthen field

View File

@ -5024,7 +5024,7 @@ decl_piece_varloc_ptr (rtx piece)
/* Create an EXPR_LIST for location note LOC_NOTE covering BITSIZE bits.
Next is the chain of following piece nodes. */
static rtx
static rtx_expr_list *
decl_piece_node (rtx loc_note, HOST_WIDE_INT bitsize, rtx next)
{
if (bitsize <= (int) MAX_MACHINE_MODE)

View File

@ -125,14 +125,14 @@ alloc_INSN_LIST (rtx val, rtx next)
/* This call is used in place of a gen_rtx_EXPR_LIST. If there is a cached
node available, we'll use it, otherwise a call to gen_rtx_EXPR_LIST
is made. */
rtx
rtx_expr_list *
alloc_EXPR_LIST (int kind, rtx val, rtx next)
{
rtx r;
rtx_expr_list *r;
if (unused_expr_list)
{
r = unused_expr_list;
r = as_a <rtx_expr_list *> (unused_expr_list);
unused_expr_list = XEXP (r, 1);
XEXP (r, 0) = val;
XEXP (r, 1) = next;
@ -146,11 +146,11 @@ alloc_EXPR_LIST (int kind, rtx val, rtx next)
/* This function will free up an entire list of EXPR_LIST nodes. */
void
free_EXPR_LIST_list (rtx *listp)
free_EXPR_LIST_list (rtx_expr_list **listp)
{
if (*listp == 0)
return;
free_list (listp, &unused_expr_list);
free_list ((rtx *)listp, &unused_expr_list);
}
/* This function will free up an entire list of INSN_LIST nodes. */
@ -233,12 +233,12 @@ remove_free_INSN_LIST_node (rtx_insn_list **listp)
/* Remove and free the first node in the EXPR_LIST pointed to by LISTP. */
rtx
remove_free_EXPR_LIST_node (rtx *listp)
remove_free_EXPR_LIST_node (rtx_expr_list **listp)
{
rtx node = *listp;
rtx_expr_list *node = *listp;
rtx elem = XEXP (node, 0);
remove_list_node (listp);
remove_list_node ((rtx *)listp);
free_EXPR_LIST_node (node);
return elem;

View File

@ -1873,7 +1873,8 @@ static void
simplify_using_initial_values (struct loop *loop, enum rtx_code op, rtx *expr)
{
bool expression_valid;
rtx head, tail, cond_list, last_valid_expr;
rtx head, tail, last_valid_expr;
rtx_expr_list *cond_list;
rtx_insn *insn;
rtx neutral, aggr;
regset altered, this_altered;
@ -1951,7 +1952,7 @@ simplify_using_initial_values (struct loop *loop, enum rtx_code op, rtx *expr)
expression_valid = true;
last_valid_expr = *expr;
cond_list = NULL_RTX;
cond_list = NULL;
while (1)
{
insn = BB_END (e->src);
@ -2003,7 +2004,7 @@ simplify_using_initial_values (struct loop *loop, enum rtx_code op, rtx *expr)
if (suitable_set_for_replacement (insn, &dest, &src))
{
rtx *pnote, *pnote_next;
rtx_expr_list **pnote, **pnote_next;
replace_in_expr (expr, dest, src);
if (CONSTANT_P (*expr))
@ -2014,7 +2015,7 @@ simplify_using_initial_values (struct loop *loop, enum rtx_code op, rtx *expr)
rtx note = *pnote;
rtx old_cond = XEXP (note, 0);
pnote_next = &XEXP (note, 1);
pnote_next = (rtx_expr_list **)&XEXP (note, 1);
replace_in_expr (&XEXP (note, 0), dest, src);
/* We can no longer use a condition that has been simplified
@ -2034,7 +2035,7 @@ simplify_using_initial_values (struct loop *loop, enum rtx_code op, rtx *expr)
}
else
{
rtx *pnote, *pnote_next;
rtx_expr_list **pnote, **pnote_next;
/* If we did not use this insn to make a replacement, any overlap
between stores in this insn and our expression will cause the
@ -2048,7 +2049,7 @@ simplify_using_initial_values (struct loop *loop, enum rtx_code op, rtx *expr)
rtx note = *pnote;
rtx old_cond = XEXP (note, 0);
pnote_next = &XEXP (note, 1);
pnote_next = (rtx_expr_list **)&XEXP (note, 1);
if (for_each_rtx (&old_cond, altered_reg_used, this_altered))
{
*pnote = *pnote_next;

View File

@ -233,7 +233,7 @@ struct reg_equivs_t
/* An EXPR_LIST of REG_EQUIVs containing MEMs with
alternate representations of the location of pseudo reg N. */
rtx alt_mem_list;
rtx_expr_list *alt_mem_list;
/* The list of insns that initialized reg N from its equivalent
constant or memory slot. */

View File

@ -2862,18 +2862,18 @@ extern void subreg_get_info (unsigned int, enum machine_mode,
/* lists.c */
extern void free_EXPR_LIST_list (rtx *);
extern void free_EXPR_LIST_list (rtx_expr_list **);
extern void free_INSN_LIST_list (rtx_insn_list **);
extern void free_EXPR_LIST_node (rtx);
extern void free_INSN_LIST_node (rtx);
extern rtx_insn_list *alloc_INSN_LIST (rtx, rtx);
extern rtx_insn_list *copy_INSN_LIST (rtx_insn_list *);
extern rtx_insn_list *concat_INSN_LIST (rtx_insn_list *, rtx_insn_list *);
extern rtx alloc_EXPR_LIST (int, rtx, rtx);
extern rtx_expr_list *alloc_EXPR_LIST (int, rtx, rtx);
extern void remove_free_INSN_LIST_elem (rtx_insn *, rtx_insn_list **);
extern rtx remove_list_elem (rtx, rtx *);
extern rtx_insn *remove_free_INSN_LIST_node (rtx_insn_list **);
extern rtx remove_free_EXPR_LIST_node (rtx *);
extern rtx remove_free_EXPR_LIST_node (rtx_expr_list **);
/* reginfo.c */

View File

@ -1622,7 +1622,7 @@ remove_from_dependence_list (rtx insn, rtx_insn_list **listp)
static int
remove_from_both_dependence_lists (rtx insn,
rtx_insn_list **listp,
rtx *exprp)
rtx_expr_list **exprp)
{
int removed = 0;
@ -1637,7 +1637,7 @@ remove_from_both_dependence_lists (rtx insn,
}
listp = (rtx_insn_list **)&XEXP (*listp, 1);
exprp = &XEXP (*exprp, 1);
exprp = (rtx_expr_list **)&XEXP (*exprp, 1);
}
return removed;
@ -1719,8 +1719,8 @@ add_insn_mem_dependence (struct deps_desc *deps, bool read_p,
{
rtx_insn_list **insn_list;
rtx_insn_list *insn_node;
rtx *mem_list;
rtx mem_node;
rtx_expr_list **mem_list;
rtx_expr_list *mem_node;
gcc_assert (!deps->readonly);
if (read_p)

View File

@ -474,13 +474,13 @@ struct deps_desc
rtx_insn_list *pending_read_insns;
/* An EXPR_LIST containing all MEM rtx's which are pending reads. */
rtx pending_read_mems;
rtx_expr_list *pending_read_mems;
/* An INSN_LIST containing all insns with pending write operations. */
rtx_insn_list *pending_write_insns;
/* An EXPR_LIST containing all MEM rtx's which are pending writes. */
rtx pending_write_mems;
rtx_expr_list *pending_write_mems;
/* An INSN_LIST containing all jump insns. */
rtx_insn_list *pending_jump_insns;

View File

@ -240,8 +240,8 @@ static void add_branch_dependences (rtx_insn *, rtx_insn *);
static void compute_block_dependences (int);
static void schedule_region (int);
static void concat_insn_mem_list (rtx_insn_list *, rtx,
rtx_insn_list **, rtx *);
static void concat_insn_mem_list (rtx_insn_list *, rtx_expr_list *,
rtx_insn_list **, rtx_expr_list **);
static void propagate_deps (int, struct deps_desc *);
static void free_pending_lists (void);
@ -2585,19 +2585,20 @@ add_branch_dependences (rtx_insn *head, rtx_insn *tail)
static struct deps_desc *bb_deps;
static void
concat_insn_mem_list (rtx_insn_list *copy_insns, rtx copy_mems,
concat_insn_mem_list (rtx_insn_list *copy_insns,
rtx_expr_list *copy_mems,
rtx_insn_list **old_insns_p,
rtx *old_mems_p)
rtx_expr_list **old_mems_p)
{
rtx_insn_list *new_insns = *old_insns_p;
rtx new_mems = *old_mems_p;
rtx_expr_list *new_mems = *old_mems_p;
while (copy_insns)
{
new_insns = alloc_INSN_LIST (copy_insns->insn (), new_insns);
new_mems = alloc_EXPR_LIST (VOIDmode, XEXP (copy_mems, 0), new_mems);
new_mems = alloc_EXPR_LIST (VOIDmode, copy_mems->element (), new_mems);
copy_insns = copy_insns->next ();
copy_mems = XEXP (copy_mems, 1);
copy_mems = copy_mems->next ();
}
*old_insns_p = new_insns;

View File

@ -948,7 +948,7 @@ struct adjust_mem_data
bool store;
enum machine_mode mem_mode;
HOST_WIDE_INT stack_adjust;
rtx side_effects;
rtx_expr_list *side_effects;
};
/* Helper for adjust_mems. Return 1 if *loc is unsuitable for
@ -1231,7 +1231,7 @@ adjust_insn (basic_block bb, rtx_insn *insn)
amd.mem_mode = VOIDmode;
amd.stack_adjust = -VTI (bb)->out.stack_adjust;
amd.side_effects = NULL_RTX;
amd.side_effects = NULL;
amd.store = true;
note_stores (PATTERN (insn), adjust_mem_stores, &amd);
@ -6277,7 +6277,7 @@ prepare_call_arguments (basic_block bb, rtx_insn *insn)
struct adjust_mem_data amd;
amd.mem_mode = VOIDmode;
amd.stack_adjust = -VTI (bb)->out.stack_adjust;
amd.side_effects = NULL_RTX;
amd.side_effects = NULL;
amd.store = true;
mem = simplify_replace_fn_rtx (mem, NULL_RTX, adjust_mems,
&amd);