- for (j = 0; j < XVECLEN (x, i); j++)
- mark_jump_label (XVECEXP (x, i, j), insn, in_mem);
- }
- }
-}
-
-/* If all INSN does is set the pc, delete it,
- and delete the insn that set the condition codes for it
- if that's what the previous thing was. */
-
-void
-delete_jump (rtx insn)
-{
- rtx set = single_set (insn);
-
- if (set && GET_CODE (SET_DEST (set)) == PC)
- delete_computation (insn);
-}
-
-/* Recursively delete prior insns that compute the value (used only by INSN
- which the caller is deleting) stored in the register mentioned by NOTE
- which is a REG_DEAD note associated with INSN. */
-
-static void
-delete_prior_computation (rtx note, rtx insn)
-{
- rtx our_prev;
- rtx reg = XEXP (note, 0);
-
- for (our_prev = prev_nonnote_insn (insn);
- our_prev && (NONJUMP_INSN_P (our_prev)
- || CALL_P (our_prev));
- our_prev = prev_nonnote_insn (our_prev))
- {
- rtx pat = PATTERN (our_prev);
-
- /* If we reach a CALL which is not calling a const function
- or the callee pops the arguments, then give up. */
- if (CALL_P (our_prev)
- && (! CONST_OR_PURE_CALL_P (our_prev)
- || GET_CODE (pat) != SET || GET_CODE (SET_SRC (pat)) != CALL))
- break;
-
- /* If we reach a SEQUENCE, it is too complex to try to
- do anything with it, so give up. We can be run during
- and after reorg, so SEQUENCE rtl can legitimately show
- up here. */
- if (GET_CODE (pat) == SEQUENCE)
- break;
-
- if (GET_CODE (pat) == USE
- && NONJUMP_INSN_P (XEXP (pat, 0)))
- /* reorg creates USEs that look like this. We leave them
- alone because reorg needs them for its own purposes. */
- break;
-
- if (reg_set_p (reg, pat))
- {
- if (side_effects_p (pat) && !CALL_P (our_prev))
- break;
-
- if (GET_CODE (pat) == PARALLEL)
- {
- /* If we find a SET of something else, we can't
- delete the insn. */
-
- int i;
-
- for (i = 0; i < XVECLEN (pat, 0); i++)
- {
- rtx part = XVECEXP (pat, 0, i);
-
- if (GET_CODE (part) == SET
- && SET_DEST (part) != reg)
- break;
- }
-
- if (i == XVECLEN (pat, 0))
- delete_computation (our_prev);
- }
- else if (GET_CODE (pat) == SET
- && REG_P (SET_DEST (pat)))
- {
- int dest_regno = REGNO (SET_DEST (pat));
- int dest_endregno
- = (dest_regno
- + (dest_regno < FIRST_PSEUDO_REGISTER
- ? hard_regno_nregs[dest_regno]
- [GET_MODE (SET_DEST (pat))] : 1));
- int regno = REGNO (reg);
- int endregno
- = (regno
- + (regno < FIRST_PSEUDO_REGISTER
- ? hard_regno_nregs[regno][GET_MODE (reg)] : 1));
-
- if (dest_regno >= regno
- && dest_endregno <= endregno)
- delete_computation (our_prev);
-
- /* We may have a multi-word hard register and some, but not
- all, of the words of the register are needed in subsequent
- insns. Write REG_UNUSED notes for those parts that were not
- needed. */
- else if (dest_regno <= regno
- && dest_endregno >= endregno)
- {
- int i;
-
- REG_NOTES (our_prev)
- = gen_rtx_EXPR_LIST (REG_UNUSED, reg,
- REG_NOTES (our_prev));
-
- for (i = dest_regno; i < dest_endregno; i++)
- if (! find_regno_note (our_prev, REG_UNUSED, i))
- break;
-
- if (i == dest_endregno)
- delete_computation (our_prev);
- }
- }
-
- break;
- }