Commit c483db37 by Alexandre Oliva Committed by Alexandre Oliva

[SFN] next/prev_nonnote_insn_bb are no more, even for ports

The patch that added _nondebug to next_ and prev_nonnote_insn_bb
failed to find and adjust uses within config.  Fixed.

for  gcc/ChangeLog

	PR bootstrap/83396
	* config/arc/arc.c (hwloop_optimize): Skip debug insns.
	* config/sh/sh-protos.h (sh_find_set_of_reg): Adjust.
	* config/sh/sh.c: Skip debug insns besides notes.
	* config/sh/sh.md: Likewise.
	* config/sh/sh_treg_combine.cc: Likewise.
	* config/sh/sync.md: Likewise.

From-SVN: r255638
parent aadd37c8
2017-12-14 Alexandre Oliva <aoliva@redhat.com>
PR bootstrap/83396
* config/arc/arc.c (hwloop_optimize): Skip debug insns.
* config/sh/sh-protos.h (sh_find_set_of_reg): Adjust.
* config/sh/sh.c: Skip debug insns besides notes.
* config/sh/sh.md: Likewise.
* config/sh/sh_treg_combine.cc: Likewise.
* config/sh/sync.md: Likewise.
2017-12-14 Tom de Vries <tom@codesourcery.com> 2017-12-14 Tom de Vries <tom@codesourcery.com>
* doc/sourcebuild.texi (Effective-Target Keywords, Other attributes): * doc/sourcebuild.texi (Effective-Target Keywords, Other attributes):
...@@ -7499,7 +7499,7 @@ hwloop_optimize (hwloop_info loop) ...@@ -7499,7 +7499,7 @@ hwloop_optimize (hwloop_info loop)
&& NOTE_KIND (entry_after) != NOTE_INSN_CALL_ARG_LOCATION)) && NOTE_KIND (entry_after) != NOTE_INSN_CALL_ARG_LOCATION))
entry_after = NEXT_INSN (entry_after); entry_after = NEXT_INSN (entry_after);
#endif #endif
entry_after = next_nonnote_insn_bb (entry_after); entry_after = next_nonnote_nondebug_insn_bb (entry_after);
gcc_assert (entry_after); gcc_assert (entry_after);
emit_insn_before (seq, entry_after); emit_insn_before (seq, entry_after);
......
...@@ -120,10 +120,10 @@ struct set_of_reg ...@@ -120,10 +120,10 @@ struct set_of_reg
rtx set_src; rtx set_src;
}; };
/* Given a reg rtx and a start insn, try to find the insn that sets the /* Given a reg rtx and a start insn, try to find the insn that sets
specified reg by using the specified insn stepping function, such as the specified reg by using the specified insn stepping function,
'prev_nonnote_insn_bb'. When the insn is found, try to extract the rtx such as 'prev_nonnote_nondebug_insn_bb'. When the insn is found,
of the reg set. */ try to extract the rtx of the reg set. */
template <typename F> inline set_of_reg template <typename F> inline set_of_reg
sh_find_set_of_reg (rtx reg, rtx_insn* insn, F stepfunc, sh_find_set_of_reg (rtx reg, rtx_insn* insn, F stepfunc,
bool ignore_reg_reg_copies = false) bool ignore_reg_reg_copies = false)
......
...@@ -11896,8 +11896,8 @@ sh_is_logical_t_store_expr (rtx op, rtx_insn* insn) ...@@ -11896,8 +11896,8 @@ sh_is_logical_t_store_expr (rtx op, rtx_insn* insn)
else else
{ {
set_of_reg op_set = sh_find_set_of_reg (ops[i], insn, set_of_reg op_set = sh_find_set_of_reg
prev_nonnote_insn_bb); (ops[i], insn, prev_nonnote_nondebug_insn_bb);
if (op_set.set_src == NULL_RTX) if (op_set.set_src == NULL_RTX)
continue; continue;
...@@ -11929,7 +11929,8 @@ sh_try_omit_signzero_extend (rtx extended_op, rtx_insn* insn) ...@@ -11929,7 +11929,8 @@ sh_try_omit_signzero_extend (rtx extended_op, rtx_insn* insn)
if (GET_MODE (extended_op) != SImode) if (GET_MODE (extended_op) != SImode)
return NULL_RTX; return NULL_RTX;
set_of_reg s = sh_find_set_of_reg (extended_op, insn, prev_nonnote_insn_bb); set_of_reg s = sh_find_set_of_reg (extended_op, insn,
prev_nonnote_nondebug_insn_bb);
if (s.set_src == NULL_RTX) if (s.set_src == NULL_RTX)
return NULL_RTX; return NULL_RTX;
...@@ -11965,10 +11966,10 @@ sh_split_movrt_negc_to_movt_xor (rtx_insn* curr_insn, rtx operands[]) ...@@ -11965,10 +11966,10 @@ sh_split_movrt_negc_to_movt_xor (rtx_insn* curr_insn, rtx operands[])
if (!can_create_pseudo_p ()) if (!can_create_pseudo_p ())
return false; return false;
set_of_reg t_before_negc = sh_find_set_of_reg (get_t_reg_rtx (), curr_insn, set_of_reg t_before_negc = sh_find_set_of_reg
prev_nonnote_insn_bb); (get_t_reg_rtx (), curr_insn, prev_nonnote_nondebug_insn_bb);
set_of_reg t_after_negc = sh_find_set_of_reg (get_t_reg_rtx (), curr_insn, set_of_reg t_after_negc = sh_find_set_of_reg
next_nonnote_insn_bb); (get_t_reg_rtx (), curr_insn, next_nonnote_nondebug_insn_bb);
if (t_before_negc.set_rtx != NULL_RTX && t_after_negc.set_rtx != NULL_RTX if (t_before_negc.set_rtx != NULL_RTX && t_after_negc.set_rtx != NULL_RTX
&& rtx_equal_p (t_before_negc.set_rtx, t_after_negc.set_rtx) && rtx_equal_p (t_before_negc.set_rtx, t_after_negc.set_rtx)
...@@ -12009,8 +12010,8 @@ sh_find_extending_set_of_reg (rtx reg, rtx_insn* curr_insn) ...@@ -12009,8 +12010,8 @@ sh_find_extending_set_of_reg (rtx reg, rtx_insn* curr_insn)
Also try to look through the first extension that we hit. There are some Also try to look through the first extension that we hit. There are some
cases, where a zero_extend is followed an (implicit) sign_extend, and it cases, where a zero_extend is followed an (implicit) sign_extend, and it
fails to see the sign_extend. */ fails to see the sign_extend. */
sh_extending_set_of_reg result = sh_extending_set_of_reg result = sh_find_set_of_reg
sh_find_set_of_reg (reg, curr_insn, prev_nonnote_insn_bb, true); (reg, curr_insn, prev_nonnote_nondebug_insn_bb, true);
if (result.set_src != NULL) if (result.set_src != NULL)
{ {
......
...@@ -848,7 +848,7 @@ ...@@ -848,7 +848,7 @@
/* FIXME: Maybe also search the predecessor basic blocks to catch /* FIXME: Maybe also search the predecessor basic blocks to catch
more cases. */ more cases. */
set_of_reg op = sh_find_set_of_reg (operands[0], curr_insn, set_of_reg op = sh_find_set_of_reg (operands[0], curr_insn,
prev_nonnote_insn_bb); prev_nonnote_nondebug_insn_bb);
if (op.set_src != NULL && GET_CODE (op.set_src) == AND if (op.set_src != NULL && GET_CODE (op.set_src) == AND
&& !sh_insn_operands_modified_between_p (op.insn, op.insn, curr_insn)) && !sh_insn_operands_modified_between_p (op.insn, op.insn, curr_insn))
...@@ -939,7 +939,7 @@ ...@@ -939,7 +939,7 @@
if (dump_file) if (dump_file)
fprintf (dump_file, "cmpgesi_t: trying to optimize for const_int 0\n"); fprintf (dump_file, "cmpgesi_t: trying to optimize for const_int 0\n");
rtx_insn* i = next_nonnote_insn_bb (curr_insn); rtx_insn* i = next_nonnote_nondebug_insn_bb (curr_insn);
if (dump_file) if (dump_file)
{ {
...@@ -3094,7 +3094,7 @@ ...@@ -3094,7 +3094,7 @@
&& ! sh_dynamicalize_shift_p (shift_count)) && ! sh_dynamicalize_shift_p (shift_count))
{ {
if (prev_set_t_insn == NULL) if (prev_set_t_insn == NULL)
prev_set_t_insn = prev_nonnote_insn_bb (curr_insn); prev_set_t_insn = prev_nonnote_nondebug_insn_bb (curr_insn);
/* Skip the nott insn, which was probably inserted by the splitter /* Skip the nott insn, which was probably inserted by the splitter
of *rotcr_neg_t. Don't use one of the recog functions of *rotcr_neg_t. Don't use one of the recog functions
...@@ -3106,7 +3106,8 @@ ...@@ -3106,7 +3106,8 @@
if (GET_CODE (pat) == SET if (GET_CODE (pat) == SET
&& t_reg_operand (XEXP (pat, 0), SImode) && t_reg_operand (XEXP (pat, 0), SImode)
&& negt_reg_operand (XEXP (pat, 1), SImode)) && negt_reg_operand (XEXP (pat, 1), SImode))
prev_set_t_insn = prev_nonnote_insn_bb (prev_set_t_insn); prev_set_t_insn = prev_nonnote_nondebug_insn_bb
(prev_set_t_insn);
} }
if (! (prev_set_t_insn != NULL_RTX if (! (prev_set_t_insn != NULL_RTX
...@@ -3194,7 +3195,7 @@ ...@@ -3194,7 +3195,7 @@
if (sh_ashlsi_clobbers_t_reg_p (shift_count) if (sh_ashlsi_clobbers_t_reg_p (shift_count)
&& ! sh_dynamicalize_shift_p (shift_count)) && ! sh_dynamicalize_shift_p (shift_count))
{ {
prev_set_t_insn = prev_nonnote_insn_bb (curr_insn); prev_set_t_insn = prev_nonnote_nondebug_insn_bb (curr_insn);
/* Skip the nott insn, which was probably inserted by the splitter /* Skip the nott insn, which was probably inserted by the splitter
of *rotcl_neg_t. Don't use one of the recog functions of *rotcl_neg_t. Don't use one of the recog functions
...@@ -3206,7 +3207,8 @@ ...@@ -3206,7 +3207,8 @@
if (GET_CODE (pat) == SET if (GET_CODE (pat) == SET
&& t_reg_operand (XEXP (pat, 0), SImode) && t_reg_operand (XEXP (pat, 0), SImode)
&& negt_reg_operand (XEXP (pat, 1), SImode)) && negt_reg_operand (XEXP (pat, 1), SImode))
prev_set_t_insn = prev_nonnote_insn_bb (prev_set_t_insn); prev_set_t_insn = prev_nonnote_nondebug_insn_bb
(prev_set_t_insn);
} }
if (! (prev_set_t_insn != NULL_RTX if (! (prev_set_t_insn != NULL_RTX
...@@ -4423,7 +4425,7 @@ ...@@ -4423,7 +4425,7 @@
When we're here, the not:SI pattern obviously has been matched already When we're here, the not:SI pattern obviously has been matched already
and we only have to see whether the following insn is the left shift. */ and we only have to see whether the following insn is the left shift. */
rtx_insn *i = next_nonnote_insn_bb (curr_insn); rtx_insn *i = next_nonnote_nondebug_insn_bb (curr_insn);
if (i == NULL_RTX || !NONJUMP_INSN_P (i)) if (i == NULL_RTX || !NONJUMP_INSN_P (i))
FAIL; FAIL;
...@@ -10751,8 +10753,8 @@ ...@@ -10751,8 +10753,8 @@
{ {
rtx t_reg = get_t_reg_rtx (); rtx t_reg = get_t_reg_rtx ();
for (rtx_insn* i = prev_nonnote_insn_bb (curr_insn); i != NULL; for (rtx_insn* i = prev_nonnote_nondebug_insn_bb (curr_insn); i != NULL;
i = prev_nonnote_insn_bb (i)) i = prev_nonnote_nondebug_insn_bb (i))
{ {
if (!INSN_P (i) || DEBUG_INSN_P (i)) if (!INSN_P (i) || DEBUG_INSN_P (i))
continue; continue;
......
...@@ -291,7 +291,7 @@ find_set_of_reg_bb (rtx reg, rtx_insn *insn) ...@@ -291,7 +291,7 @@ find_set_of_reg_bb (rtx reg, rtx_insn *insn)
return result; return result;
for (result.insn = insn; result.insn != NULL; for (result.insn = insn; result.insn != NULL;
result.insn = prev_nonnote_insn_bb (result.insn)) result.insn = prev_nonnote_nondebug_insn_bb (result.insn))
{ {
if (BARRIER_P (result.insn)) if (BARRIER_P (result.insn))
return result; return result;
...@@ -748,9 +748,8 @@ sh_treg_combine::record_set_of_reg (rtx reg, rtx_insn *start_insn, ...@@ -748,9 +748,8 @@ sh_treg_combine::record_set_of_reg (rtx reg, rtx_insn *start_insn,
// Now see how the ccreg was set. // Now see how the ccreg was set.
// For now it must be in the same BB. // For now it must be in the same BB.
log_msg ("tracing ccreg\n"); log_msg ("tracing ccreg\n");
new_entry.setcc = new_entry.setcc = find_set_of_reg_bb
find_set_of_reg_bb (m_ccreg, (m_ccreg, prev_nonnote_nondebug_insn_bb (new_entry.cstore.insn));
prev_nonnote_insn_bb (new_entry.cstore.insn));
// If cstore was found but setcc was not found continue anyway, as // If cstore was found but setcc was not found continue anyway, as
// for some of the optimization types the setcc is irrelevant. // for some of the optimization types the setcc is irrelevant.
...@@ -1353,7 +1352,8 @@ sh_treg_combine::try_optimize_cbranch (rtx_insn *insn) ...@@ -1353,7 +1352,8 @@ sh_treg_combine::try_optimize_cbranch (rtx_insn *insn)
// (set (reg ccreg) (eq (reg) (const_int 0))) // (set (reg ccreg) (eq (reg) (const_int 0)))
// The testing insn could also be outside of the current basic block, but // The testing insn could also be outside of the current basic block, but
// for now we limit the search to the current basic block. // for now we limit the search to the current basic block.
trace.setcc = find_set_of_reg_bb (m_ccreg, prev_nonnote_insn_bb (insn)); trace.setcc = find_set_of_reg_bb
(m_ccreg, prev_nonnote_nondebug_insn_bb (insn));
if (trace.setcc.set_src () == NULL_RTX) if (trace.setcc.set_src () == NULL_RTX)
log_return_void ("could not find set of ccreg in current BB\n"); log_return_void ("could not find set of ccreg in current BB\n");
...@@ -1412,9 +1412,9 @@ sh_treg_combine::try_optimize_cbranch (rtx_insn *insn) ...@@ -1412,9 +1412,9 @@ sh_treg_combine::try_optimize_cbranch (rtx_insn *insn)
// If we find it here there's no point in checking other BBs. // If we find it here there's no point in checking other BBs.
trace.bb_entries.push_front (bb_entry (trace.bb ())); trace.bb_entries.push_front (bb_entry (trace.bb ()));
record_return_t res = record_return_t res = record_set_of_reg
record_set_of_reg (trace_reg, prev_nonnote_insn_bb (trace.setcc.insn), (trace_reg, prev_nonnote_nondebug_insn_bb (trace.setcc.insn),
trace.bb_entries.front ()); trace.bb_entries.front ());
if (res == other_set_found) if (res == other_set_found)
log_return_void ("other set found - aborting trace\n"); log_return_void ("other set found - aborting trace\n");
......
...@@ -294,7 +294,7 @@ ...@@ -294,7 +294,7 @@
/* FIXME: Sometimes the 'expected value' operand is not propagated as /* FIXME: Sometimes the 'expected value' operand is not propagated as
immediate value. See PR 64974. */ immediate value. See PR 64974. */
set_of_reg op2 = sh_find_set_of_reg (operands[2], curr_insn, set_of_reg op2 = sh_find_set_of_reg (operands[2], curr_insn,
prev_nonnote_insn_bb); prev_nonnote_nondebug_insn_bb);
if (op2.set_src != NULL && satisfies_constraint_I08 (op2.set_src)) if (op2.set_src != NULL && satisfies_constraint_I08 (op2.set_src))
{ {
rtx* r = &XVECEXP (XEXP (XVECEXP (PATTERN (curr_insn), 0, 0), 1), 0, 1); rtx* r = &XVECEXP (XEXP (XVECEXP (PATTERN (curr_insn), 0, 0), 1), 0, 1);
......
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