Lines Matching refs:insn

47 #include "insn-config.h"
48 #include "insn-attr.h"
84 rtx insn;
94 for (insn = forced_labels; insn; insn = XEXP (insn, 1))
95 if (LABEL_P (XEXP (insn, 0)))
96 LABEL_NUSES (XEXP (insn, 0))++;
102 non-fallthru insn. This is not generally true, as multiple barriers
104 real insn by one or more NOTEs.
112 rtx insn, next, prev;
113 for (insn = get_insns (); insn; insn = next)
115 next = NEXT_INSN (insn);
116 if (BARRIER_P (insn))
118 prev = prev_nonnote_insn (insn);
120 delete_insn (insn);
121 else if (prev != PREV_INSN (insn))
122 reorder_insns (insn, insn, prev);
149 rtx insn;
155 for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
156 if (NOTE_P (insn))
158 if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG)
162 else if (NOTE_LINE_NUMBER (insn) >= 0)
167 && NOTE_SOURCE_LOCATION (insn) == NOTE_SOURCE_LOCATION (last_note)
169 && NOTE_SOURCE_FILE (insn) == NOTE_SOURCE_FILE (last_note)
170 && NOTE_LINE_NUMBER (insn) == NOTE_LINE_NUMBER (last_note)
174 delete_related_insns (insn);
178 last_note = insn;
204 notes whose labels don't occur in the insn any more. Returns the
209 rtx insn;
211 for (insn = f; insn; insn = NEXT_INSN (insn))
212 if (LABEL_P (insn))
213 LABEL_NUSES (insn) = (LABEL_PRESERVE_P (insn) != 0);
214 else if (JUMP_P (insn))
215 JUMP_LABEL (insn) = 0;
216 else if (NONJUMP_INSN_P (insn) || CALL_P (insn))
220 for (note = REG_NOTES (insn); note; note = next)
224 && ! reg_mentioned_p (XEXP (note, 0), PATTERN (insn)))
225 remove_note (insn, note);
236 rtx insn;
238 for (insn = f; insn; insn = NEXT_INSN (insn))
239 if (INSN_P (insn))
241 mark_jump_label (PATTERN (insn), insn, 0);
242 if (! INSN_DELETED_P (insn) && JUMP_P (insn))
247 if (JUMP_LABEL (insn) == 0)
249 rtx label_note = find_reg_note (insn, REG_LABEL, NULL_RTX);
257 mark_jump_label (label_ref, insn, 0);
259 JUMP_LABEL (insn) = XEXP (label_note, 0);
279 rtx insn;
284 for (insn = start; insn != past_end; insn = next)
286 next = NEXT_INSN (insn);
287 if (NOTE_P (insn)
288 && (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END
289 || NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_BEG))
292 gcc_assert (NOTE_LINE_NUMBER (insn) != NOTE_INSN_BLOCK_BEG
293 && NOTE_LINE_NUMBER (insn) != NOTE_INSN_BLOCK_END);
295 if (insn == start)
299 rtx prev = PREV_INSN (insn);
300 PREV_INSN (insn) = PREV_INSN (start);
301 NEXT_INSN (insn) = start;
302 NEXT_INSN (PREV_INSN (insn)) = insn;
303 PREV_INSN (NEXT_INSN (insn)) = insn;
309 last = insn;
327 get_label_before (rtx insn)
333 label = prev_nonnote_insn (insn);
337 rtx prev = PREV_INSN (insn);
349 get_label_after (rtx insn)
355 label = next_nonnote_insn (insn);
360 emit_label_after (label, insn);
367 /* Given a comparison (CODE ARG0 ARG1), inside an insn, INSN, return a code
374 reversed_comparison_code_parts (enum rtx_code code, rtx arg0, rtx arg1, rtx insn)
436 if (! insn)
439 for (prev = prev_nonnote_insn (insn);
487 reversed_comparison_code (rtx comparison, rtx insn)
493 XEXP (comparison, 1), insn);
798 simplejump_p (rtx insn)
800 return (JUMP_P (insn)
801 && GET_CODE (PATTERN (insn)) == SET
802 && GET_CODE (SET_DEST (PATTERN (insn))) == PC
803 && GET_CODE (SET_SRC (PATTERN (insn))) == LABEL_REF);
813 condjump_p (rtx insn)
815 rtx x = PATTERN (insn);
841 condjump_in_parallel_p (rtx insn)
843 rtx x = PATTERN (insn);
872 pc_set (rtx insn)
875 if (!JUMP_P (insn))
877 pat = PATTERN (insn);
879 /* The set is allowed to appear either as the insn pattern or
889 /* Return true when insn is an unconditional direct jump,
893 any_uncondjump_p (rtx insn)
895 rtx x = pc_set (insn);
900 if (find_reg_note (insn, REG_NON_LOCAL_GOTO, NULL_RTX))
905 /* Return true when insn is a conditional jump. This function works for
913 any_condjump_p (rtx insn)
915 rtx x = pc_set (insn);
933 condjump_label (rtx insn)
935 rtx x = pc_set (insn);
951 /* Return true if INSN is a (possibly conditional) return insn. */
963 returnjump_p (rtx insn)
965 if (!JUMP_P (insn))
967 return for_each_rtx (&PATTERN (insn), returnjump_p_1, NULL);
974 onlyjump_p (rtx insn)
978 if (!JUMP_P (insn))
981 set = single_set (insn);
1050 since that tells caller to avoid changing the insn.
1057 rtx insn;
1064 && (insn = next_active_insn (value)) != 0
1065 && JUMP_P (insn)
1066 && ((JUMP_LABEL (insn) != 0 && any_uncondjump_p (insn)
1067 && onlyjump_p (insn))
1068 || GET_CODE (PATTERN (insn)) == RETURN)
1069 && (next = NEXT_INSN (insn))
1078 for (tem = value; tem != insn; tem = NEXT_INSN (tem))
1083 /* If we have found a cycle, make the insn jump to itself. */
1084 if (JUMP_LABEL (insn) == label)
1087 tem = next_active_insn (JUMP_LABEL (insn));
1092 value = JUMP_LABEL (insn);
1115 mark_jump_label (rtx x, rtx insn, int in_mem)
1142 mark_jump_label (get_pool_constant (x), insn, in_mem);
1162 if (! insn || ! INSN_DELETED_P (insn))
1165 if (insn)
1167 if (JUMP_P (insn))
1168 JUMP_LABEL (insn) = label;
1175 if (! find_reg_note (insn, REG_LABEL, label))
1176 REG_NOTES (insn) = gen_rtx_INSN_LIST (REG_LABEL, label,
1177 REG_NOTES (insn));
1187 if (! INSN_DELETED_P (insn))
1204 mark_jump_label (XEXP (x, i), insn, in_mem);
1209 mark_jump_label (XVECEXP (x, i, j), insn, in_mem);
1215 and delete the insn that set the condition codes for it
1219 delete_jump (rtx insn)
1221 rtx set = single_set (insn);
1224 delete_computation (insn);
1232 delete_prior_computation (rtx note, rtx insn)
1237 for (our_prev = prev_nonnote_insn (insn);
1272 delete the insn. */
1334 insn becomes the new place for the REG_DEAD note. */
1350 Otherwise, look at all our REG_DEAD notes. If a previous insn does
1351 nothing other than set a register that dies in this insn, we can delete
1352 that insn as well.
1354 On machines with CC0, if CC0 is used in this insn, we may be able to
1355 delete the insn that set it. */
1358 delete_computation (rtx insn)
1363 if (reg_referenced_p (cc0_rtx, PATTERN (insn)))
1365 rtx prev = prev_nonnote_insn (insn);
1369 will use them. So if the previous insn
1386 for (note = REG_NOTES (insn); note; note = next)
1395 delete_prior_computation (note, insn);
1398 delete_related_insns (insn);
1402 /* Delete insn INSN from the chain of insns and update label ref counts
1405 Returns the first insn after INSN that was not deleted.
1411 delete_related_insns (rtx insn)
1413 int was_code_label = (LABEL_P (insn));
1415 rtx next = NEXT_INSN (insn), prev = PREV_INSN (insn);
1420 /* This insn is already deleted => return first following nondeleted. */
1421 if (INSN_DELETED_P (insn))
1424 delete_insn (insn);
1435 if (JUMP_P (insn) && JUMP_LABEL (insn))
1437 rtx lab = JUMP_LABEL (insn), lab_next;
1448 to find the first insn after INSN that is not now deleted.
1454 else if (tablejump_p (insn, NULL, &lab_next))
1466 if (JUMP_P (insn)
1467 && (GET_CODE (PATTERN (insn)) == ADDR_VEC
1468 || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC))
1470 rtx pat = PATTERN (insn);
1483 if (NONJUMP_INSN_P (insn) || CALL_P (insn))
1484 for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
1499 && NEXT_INSN (insn) != 0
1500 && JUMP_P (NEXT_INSN (insn))
1501 && (GET_CODE (PATTERN (NEXT_INSN (insn))) == ADDR_VEC
1502 || GET_CODE (PATTERN (NEXT_INSN (insn))) == ADDR_DIFF_VEC))
1503 next = delete_related_insns (NEXT_INSN (insn));
1537 peephole insn that will replace them. */
1542 rtx insn = from;
1546 rtx next = NEXT_INSN (insn);
1547 rtx prev = PREV_INSN (insn);
1549 if (!NOTE_P (insn))
1551 INSN_DELETED_P (insn) = 1;
1553 /* Patch this insn out of the chain. */
1563 if (insn == to)
1565 insn = next;
1579 redirect_exp_1 (rtx *loc, rtx olabel, rtx nlabel, rtx insn)
1596 validate_change (insn, loc, n, 1);
1606 if (loc == &PATTERN (insn))
1608 validate_change (insn, loc, x, 1);
1616 validate_change (insn, loc, gen_rtx_RETURN (VOIDmode), 1);
1624 redirect_exp_1 (&XEXP (x, i), olabel, nlabel, insn);
1629 redirect_exp_1 (&XVECEXP (x, i, j), olabel, nlabel, insn);
1658 RETURN insn.
1681 If DELETE_UNUSED is positive, delete related insn to OLABEL if its ref
1715 /* Undefined labels will remain outside the insn stream. */
1722 /* Invert the jump condition X contained in jump insn INSN. Accrue the
1725 invert_exp_1 (rtx x, rtx insn)
1740 reversed_code = reversed_comparison_code (comp, insn);
1744 validate_change (insn, &XEXP (x, 0),
1753 validate_change (insn, &XEXP (x, 1), XEXP (x, 2), 1);
1754 validate_change (insn, &XEXP (x, 2), tem, 1);