Commit 71e88baf by David Malcolm Committed by David Malcolm

combine-stack-adj.c: Use rtx_insn

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

	* combine-stack-adj.c (struct csa_reflist): Strengthen field
	"insn" from rtx to rtx_insn *.
	(single_set_for_csa): Likewise for param "insn".
	(record_one_stack_ref): Likewise.
	(try_apply_stack_adjustment): Likewise.
	(struct record_stack_refs_data): Likewise for field "insn".
	(maybe_move_args_size_note): Likewise for params "last" and "insn".
	(prev_active_insn_bb): Likewise for return type and param "insn".
	(next_active_insn_bb): Likewise.
	(force_move_args_size_note): Likewise for params "prev" and "last"
	and locals "test", "next_candidate", "prev_candidate".
	(combine_stack_adjustments_for_block): Strengthen locals
	"last_sp_set", "last2_sp_set", "insn", "next" from rtx to
	rtx_insn *.

From-SVN: r214301
parent f66ac4c9
2014-08-22 David Malcolm <dmalcolm@redhat.com>
* combine-stack-adj.c (struct csa_reflist): Strengthen field
"insn" from rtx to rtx_insn *.
(single_set_for_csa): Likewise for param "insn".
(record_one_stack_ref): Likewise.
(try_apply_stack_adjustment): Likewise.
(struct record_stack_refs_data): Likewise for field "insn".
(maybe_move_args_size_note): Likewise for params "last" and "insn".
(prev_active_insn_bb): Likewise for return type and param "insn".
(next_active_insn_bb): Likewise.
(force_move_args_size_note): Likewise for params "prev" and "last"
and locals "test", "next_candidate", "prev_candidate".
(combine_stack_adjustments_for_block): Strengthen locals
"last_sp_set", "last2_sp_set", "insn", "next" from rtx to
rtx_insn *.
2014-08-21 David Malcolm <dmalcolm@redhat.com> 2014-08-21 David Malcolm <dmalcolm@redhat.com>
* combine.c (i2mod): Strengthen this variable from rtx to rtx_insn *. * combine.c (i2mod): Strengthen this variable from rtx to rtx_insn *.
......
...@@ -73,16 +73,17 @@ along with GCC; see the file COPYING3. If not see ...@@ -73,16 +73,17 @@ along with GCC; see the file COPYING3. If not see
struct csa_reflist struct csa_reflist
{ {
HOST_WIDE_INT sp_offset; HOST_WIDE_INT sp_offset;
rtx insn, *ref; rtx_insn *insn;
rtx *ref;
struct csa_reflist *next; struct csa_reflist *next;
}; };
static int stack_memref_p (rtx); static int stack_memref_p (rtx);
static rtx single_set_for_csa (rtx); static rtx single_set_for_csa (rtx_insn *);
static void free_csa_reflist (struct csa_reflist *); static void free_csa_reflist (struct csa_reflist *);
static struct csa_reflist *record_one_stack_ref (rtx, rtx *, static struct csa_reflist *record_one_stack_ref (rtx_insn *, rtx *,
struct csa_reflist *); struct csa_reflist *);
static int try_apply_stack_adjustment (rtx, struct csa_reflist *, static int try_apply_stack_adjustment (rtx_insn *, struct csa_reflist *,
HOST_WIDE_INT, HOST_WIDE_INT); HOST_WIDE_INT, HOST_WIDE_INT);
static void combine_stack_adjustments_for_block (basic_block); static void combine_stack_adjustments_for_block (basic_block);
static int record_stack_refs (rtx *, void *); static int record_stack_refs (rtx *, void *);
...@@ -122,7 +123,7 @@ stack_memref_p (rtx x) ...@@ -122,7 +123,7 @@ stack_memref_p (rtx x)
tying fp and sp adjustments. */ tying fp and sp adjustments. */
static rtx static rtx
single_set_for_csa (rtx insn) single_set_for_csa (rtx_insn *insn)
{ {
int i; int i;
rtx tmp = single_set (insn); rtx tmp = single_set (insn);
...@@ -171,7 +172,7 @@ free_csa_reflist (struct csa_reflist *reflist) ...@@ -171,7 +172,7 @@ free_csa_reflist (struct csa_reflist *reflist)
predicate stack_memref_p or a REG representing the stack pointer. */ predicate stack_memref_p or a REG representing the stack pointer. */
static struct csa_reflist * static struct csa_reflist *
record_one_stack_ref (rtx insn, rtx *ref, struct csa_reflist *next_reflist) record_one_stack_ref (rtx_insn *insn, rtx *ref, struct csa_reflist *next_reflist)
{ {
struct csa_reflist *ml; struct csa_reflist *ml;
...@@ -194,7 +195,7 @@ record_one_stack_ref (rtx insn, rtx *ref, struct csa_reflist *next_reflist) ...@@ -194,7 +195,7 @@ record_one_stack_ref (rtx insn, rtx *ref, struct csa_reflist *next_reflist)
on success. */ on success. */
static int static int
try_apply_stack_adjustment (rtx insn, struct csa_reflist *reflist, try_apply_stack_adjustment (rtx_insn *insn, struct csa_reflist *reflist,
HOST_WIDE_INT new_adjust, HOST_WIDE_INT delta) HOST_WIDE_INT new_adjust, HOST_WIDE_INT delta)
{ {
struct csa_reflist *ml; struct csa_reflist *ml;
...@@ -240,7 +241,7 @@ try_apply_stack_adjustment (rtx insn, struct csa_reflist *reflist, ...@@ -240,7 +241,7 @@ try_apply_stack_adjustment (rtx insn, struct csa_reflist *reflist,
references in the insn and discard all other stack pointer references. */ references in the insn and discard all other stack pointer references. */
struct record_stack_refs_data struct record_stack_refs_data
{ {
rtx insn; rtx_insn *insn;
struct csa_reflist *reflist; struct csa_reflist *reflist;
}; };
...@@ -297,7 +298,7 @@ record_stack_refs (rtx *xp, void *data) ...@@ -297,7 +298,7 @@ record_stack_refs (rtx *xp, void *data)
AFTER is true iff LAST follows INSN in the instruction stream. */ AFTER is true iff LAST follows INSN in the instruction stream. */
static void static void
maybe_move_args_size_note (rtx last, rtx insn, bool after) maybe_move_args_size_note (rtx_insn *last, rtx_insn *insn, bool after)
{ {
rtx note, last_note; rtx note, last_note;
...@@ -319,35 +320,36 @@ maybe_move_args_size_note (rtx last, rtx insn, bool after) ...@@ -319,35 +320,36 @@ maybe_move_args_size_note (rtx last, rtx insn, bool after)
/* Return the next (or previous) active insn within BB. */ /* Return the next (or previous) active insn within BB. */
static rtx static rtx_insn *
prev_active_insn_bb (basic_block bb, rtx insn) prev_active_insn_bb (basic_block bb, rtx_insn *insn)
{ {
for (insn = PREV_INSN (insn); for (insn = PREV_INSN (insn);
insn != PREV_INSN (BB_HEAD (bb)); insn != PREV_INSN (BB_HEAD (bb));
insn = PREV_INSN (insn)) insn = PREV_INSN (insn))
if (active_insn_p (insn)) if (active_insn_p (insn))
return insn; return insn;
return NULL_RTX; return NULL;
} }
static rtx static rtx_insn *
next_active_insn_bb (basic_block bb, rtx insn) next_active_insn_bb (basic_block bb, rtx_insn *insn)
{ {
for (insn = NEXT_INSN (insn); for (insn = NEXT_INSN (insn);
insn != NEXT_INSN (BB_END (bb)); insn != NEXT_INSN (BB_END (bb));
insn = NEXT_INSN (insn)) insn = NEXT_INSN (insn))
if (active_insn_p (insn)) if (active_insn_p (insn))
return insn; return insn;
return NULL_RTX; return NULL;
} }
/* If INSN has a REG_ARGS_SIZE note, if possible move it to PREV. Otherwise /* If INSN has a REG_ARGS_SIZE note, if possible move it to PREV. Otherwise
search for a nearby candidate within BB where we can stick the note. */ search for a nearby candidate within BB where we can stick the note. */
static void static void
force_move_args_size_note (basic_block bb, rtx prev, rtx insn) force_move_args_size_note (basic_block bb, rtx_insn *prev, rtx_insn *insn)
{ {
rtx note, test, next_candidate, prev_candidate; rtx note;
rtx_insn *test, *next_candidate, *prev_candidate;
/* If PREV exists, tail-call to the logic in the other function. */ /* If PREV exists, tail-call to the logic in the other function. */
if (prev) if (prev)
...@@ -425,10 +427,11 @@ static void ...@@ -425,10 +427,11 @@ static void
combine_stack_adjustments_for_block (basic_block bb) combine_stack_adjustments_for_block (basic_block bb)
{ {
HOST_WIDE_INT last_sp_adjust = 0; HOST_WIDE_INT last_sp_adjust = 0;
rtx last_sp_set = NULL_RTX; rtx_insn *last_sp_set = NULL;
rtx last2_sp_set = NULL_RTX; rtx_insn *last2_sp_set = NULL;
struct csa_reflist *reflist = NULL; struct csa_reflist *reflist = NULL;
rtx insn, next, set; rtx_insn *insn, *next;
rtx set;
struct record_stack_refs_data data; struct record_stack_refs_data data;
bool end_of_block = false; bool end_of_block = false;
...@@ -574,7 +577,7 @@ combine_stack_adjustments_for_block (basic_block bb) ...@@ -574,7 +577,7 @@ combine_stack_adjustments_for_block (basic_block bb)
delete_insn (last_sp_set); delete_insn (last_sp_set);
free_csa_reflist (reflist); free_csa_reflist (reflist);
reflist = NULL; reflist = NULL;
last_sp_set = NULL_RTX; last_sp_set = NULL;
last_sp_adjust = 0; last_sp_adjust = 0;
continue; continue;
} }
...@@ -603,8 +606,8 @@ combine_stack_adjustments_for_block (basic_block bb) ...@@ -603,8 +606,8 @@ combine_stack_adjustments_for_block (basic_block bb)
} }
free_csa_reflist (reflist); free_csa_reflist (reflist);
reflist = NULL; reflist = NULL;
last2_sp_set = NULL_RTX; last2_sp_set = NULL;
last_sp_set = NULL_RTX; last_sp_set = NULL;
last_sp_adjust = 0; last_sp_adjust = 0;
} }
} }
......
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