Commit 1c9b6043 by David Malcolm Committed by David Malcolm

Use rtx_insn more within peep2

gcc/ChangeLog:
2014-09-05  David Malcolm  <dmalcolm@redhat.com>

	* recog.c (peep2_attempt): Strengthen return type from rtx to
	rtx_insn *.
	(peep2_update_life): Likewise for params "last", "prev", removing
	a checked cast made redundant by this.
	(peephole2_optimize): Likewise for local "last".

From-SVN: r214966
parent a7188cc6
2014-09-05 David Malcolm <dmalcolm@redhat.com> 2014-09-05 David Malcolm <dmalcolm@redhat.com>
* recog.c (peep2_attempt): Strengthen return type from rtx to
rtx_insn *.
(peep2_update_life): Likewise for params "last", "prev", removing
a checked cast made redundant by this.
(peephole2_optimize): Likewise for local "last".
2014-09-05 David Malcolm <dmalcolm@redhat.com>
* basic-block.h (set_block_for_insn): Eliminate this macro in * basic-block.h (set_block_for_insn): Eliminate this macro in
favor of... favor of...
* rtl.h (set_block_for_insn): New inline function, imposing the * rtl.h (set_block_for_insn): New inline function, imposing the
...@@ -3160,7 +3160,7 @@ peep2_reinit_state (regset live) ...@@ -3160,7 +3160,7 @@ peep2_reinit_state (regset live)
replacing them with ATTEMPT. Returns the last insn emitted, or NULL replacing them with ATTEMPT. Returns the last insn emitted, or NULL
if the replacement is rejected. */ if the replacement is rejected. */
static rtx static rtx_insn *
peep2_attempt (basic_block bb, rtx uncast_insn, int match_len, rtx_insn *attempt) peep2_attempt (basic_block bb, rtx uncast_insn, int match_len, rtx_insn *attempt)
{ {
rtx_insn *insn = safe_as_a <rtx_insn *> (uncast_insn); rtx_insn *insn = safe_as_a <rtx_insn *> (uncast_insn);
...@@ -3396,7 +3396,8 @@ peep2_attempt (basic_block bb, rtx uncast_insn, int match_len, rtx_insn *attempt ...@@ -3396,7 +3396,8 @@ peep2_attempt (basic_block bb, rtx uncast_insn, int match_len, rtx_insn *attempt
matched, and which now need to be replaced in the buffer. */ matched, and which now need to be replaced in the buffer. */
static void static void
peep2_update_life (basic_block bb, int match_len, rtx last, rtx prev) peep2_update_life (basic_block bb, int match_len, rtx_insn *last,
rtx_insn *prev)
{ {
int i = peep2_buf_position (peep2_current + match_len + 1); int i = peep2_buf_position (peep2_current + match_len + 1);
rtx_insn *x; rtx_insn *x;
...@@ -3408,7 +3409,7 @@ peep2_update_life (basic_block bb, int match_len, rtx last, rtx prev) ...@@ -3408,7 +3409,7 @@ peep2_update_life (basic_block bb, int match_len, rtx last, rtx prev)
gcc_assert (peep2_current_count >= match_len + 1); gcc_assert (peep2_current_count >= match_len + 1);
peep2_current_count -= match_len + 1; peep2_current_count -= match_len + 1;
x = as_a <rtx_insn *> (last); x = last;
do do
{ {
if (INSN_P (x)) if (INSN_P (x))
...@@ -3538,7 +3539,7 @@ peephole2_optimize (void) ...@@ -3538,7 +3539,7 @@ peephole2_optimize (void)
peephole2_insns (PATTERN (head), head, &match_len)); peephole2_insns (PATTERN (head), head, &match_len));
if (attempt != NULL) if (attempt != NULL)
{ {
rtx last = peep2_attempt (bb, head, match_len, attempt); rtx_insn *last = peep2_attempt (bb, head, match_len, attempt);
if (last) if (last)
{ {
peep2_update_life (bb, match_len, last, PREV_INSN (attempt)); peep2_update_life (bb, match_len, last, PREV_INSN (attempt));
......
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