Lines Matching defs:insn

28    We compute insn priorities based on data dependencies.  Flow
45 schedule the insn from the end of the list by placing its
47 consider this insn scheduled by setting the pointer to the "end" of
48 the list to point to the previous insn. When an insn has no
60 1. choose insn with the longest path to end of bb, ties
62 2. choose insn with least contribution to register pressure,
66 5. choose insn with largest control flow probability, ties
68 6. choose insn with the least dependences upon the previously
69 scheduled insn, or finally
70 7 choose the insn which has the most insns dependent on it.
71 8. choose insn with lowest UID.
139 #include "insn-config.h"
140 #include "insn-attr.h"
162 N=2: bb's probabilities, detailed ready list info, unit/insn info.
241 has been computed. An insn is maintained in one of four structures:
265 The "Scheduled" list (S) is the new insn chain built by this pass.
268 `schedule_block' when the best insn to schedule is chosen.
279 result. This is the longest time an insn may be queued. */
306 /* The following array is used to find the best insn from ready when
345 /* Returns a class that insn with GET_DEST(insn)=x may belong to,
346 as found by analyzing insn's expression. */
365 /* The insn uses memory: a volatile load. */
385 /* Recursive step: walk the insn... */
412 /* Classifies insn for the purpose of verifying that it can be
414 TRAP_RISKY: store, or risky non-load insn (e.g. division by variable).
415 TRAP_FREE: non-load insn.
422 haifa_classify_insn (rtx insn)
424 rtx pat = PATTERN (insn);
517 added to the insn following it (in save_line_notes()), and the note
523 Before scheduling a region, a pointer to the note is added to the insn
525 computation). After scheduling an insn, the pointer contained in it is
622 so that insns independent of the last scheduled insn will be preferred
627 /* Compute cost of executing INSN given the dependence LINK on the insn USED.
632 insn_cost (rtx insn, rtx link, rtx used)
634 return insn_cost1 (insn, used ? REG_NOTE_KIND (link) : REG_NOTE_MAX,
638 /* Compute cost of executing INSN given the dependence on the insn USED.
647 insn_cost1 (rtx insn, enum reg_note dep_type, rtx link, rtx used)
649 int cost = INSN_COST (insn);
653 /* A USE insn, or something else we don't need to
657 if (recog_memoized (insn) < 0)
659 INSN_COST (insn) = 0;
664 cost = insn_default_latency (insn);
668 INSN_COST (insn) = cost;
672 /* In this case estimate cost without caring how insn is used. */
676 /* A USE insn should never require the value used to be computed.
685 if (INSN_CODE (insn) >= 0)
691 cost = (insn_default_latency (insn)
696 else if (bypass_p (insn))
697 cost = insn_latency (insn, used);
701 cost = targetm.sched.adjust_cost_2 (used, (int) dep_type, insn, cost);
706 cost = targetm.sched.adjust_cost (used, link, insn, cost);
719 priority (rtx insn)
723 if (! INSN_P (insn))
726 if (! INSN_PRIORITY_KNOWN (insn))
730 if (INSN_DEPEND (insn) == 0)
731 this_priority = insn_cost (insn, 0, 0);
742 rec = RECOVERY_BLOCK (insn);
745 prev_first = PREV_INSN (insn);
746 twin = insn;
768 (next, insn)
781 next_priority = insn_cost1 (insn,
782 twin == insn ?
785 twin == insn ? link : 0,
797 INSN_PRIORITY (insn) = this_priority;
798 INSN_PRIORITY_KNOWN (insn) = 1;
801 return INSN_PRIORITY (insn);
828 /* The insn in a schedule group should be issued the first. */
832 /* Prefer insn with higher priority. */
838 /* Prefer speculative insn with greater dependencies weakness. */
862 /* Prefer an insn with smaller contribution to registers-pressure. */
871 /* Compare insns based on their relation to the last-scheduled-insn. */
875 1) Data dependent on last schedule insn.
876 2) Anti/Output dependent on last scheduled insn.
877 3) Independent of last scheduled insn, or has latency of one.
878 Choose the insn from the highest numbered class if different. */
899 /* Prefer the insn which has more later insns that depend on it.
914 /* If insns are equally good, sort by INSN_LUID (original insn order),
925 rtx insn = a[n - 1];
928 while (i >= 0 && rank_for_schedule (a + i, &insn) >= 0)
933 a[i + 1] = insn;
936 /* Add INSN to the insn queue so that it can be executed at least
937 N_CYCLES after the currently executing insn. Preserve insns
941 queue_insn (rtx insn, int n_cycles)
944 rtx link = alloc_INSN_LIST (insn, insn_queue[next_q]);
953 fprintf (sched_dump, ";;\t\tReady-->Q: insn %s: ",
954 (*current_sched_info->print_insn) (insn, 0));
959 QUEUE_INDEX (insn) = next_q;
964 queue_remove (rtx insn)
966 gcc_assert (QUEUE_INDEX (insn) >= 0);
967 remove_free_INSN_LIST_elem (insn, &insn_queue[QUEUE_INDEX (insn)]);
969 QUEUE_INDEX (insn) = QUEUE_NOWHERE;
972 /* Return a pointer to the bottom of the ready list, i.e. the insn
986 ready_add (struct ready_list *ready, rtx insn, bool first_p)
997 ready->vec[ready->first - ready->n_ready] = insn;
1010 ready->vec[++(ready->first)] = insn;
1015 gcc_assert (QUEUE_INDEX (insn) != QUEUE_READY);
1016 QUEUE_INDEX (insn) = QUEUE_READY;
1041 cycle. In other words, we will try to choose ready insn which
1045 insn with the highest priority is 0, and the lowest priority has
1057 for insn with the highest priority is 0, and the lowest priority
1079 ready_remove_insn (rtx insn)
1084 if (ready_element (readyp, i) == insn)
1102 /* PREV is an insn that is ready to execute. Adjust its priority if that
1109 /* ??? There used to be code here to try and estimate how an insn
1139 /* INSN is the "currently executing insn". Launch each insn which was
1142 returns necessary cycle advance after issuing the insn (it is not
1146 schedule_insn (rtx insn)
1155 print_insn (buf, insn, 0);
1159 if (recog_memoized (insn) < 0)
1162 print_reservation (sched_dump, insn);
1168 gcc_assert (INSN_DEP_COUNT (insn) == 0);
1169 gcc_assert (!LOG_LINKS (insn));
1170 gcc_assert (QUEUE_INDEX (insn) == QUEUE_NOWHERE);
1172 QUEUE_INDEX (insn) = QUEUE_SCHEDULED;
1176 free_DEPS_LIST_list (&RESOLVED_DEPS (insn));
1178 free_INSN_LIST_list (&RESOLVED_DEPS (insn));
1180 gcc_assert (INSN_TICK (insn) >= MIN_TICK);
1181 if (INSN_TICK (insn) > clock_var)
1188 INSN_TICK (insn) = clock_var;
1191 for (link = INSN_DEPEND (insn); link; link = XEXP (link, 1))
1195 resolve_dep (next, insn);
1197 if (!IS_SPECULATION_BRANCHY_CHECK_P (insn))
1209 /* Check always has only one forward dependence (to the first insn in
1213 fix_recovery_deps (RECOVERY_BLOCK (insn));
1219 to issue on the same cycle as the previous insn. A machine
1223 && GET_CODE (PATTERN (insn)) != USE
1224 && GET_CODE (PATTERN (insn)) != CLOBBER)
1227 PUT_MODE (insn, clock_var > last_clock_var ? TImode : VOIDmode);
1238 Returns the insn following the notes. */
1241 unlink_other_notes (rtx insn, rtx tail)
1243 rtx prev = PREV_INSN (insn);
1245 while (insn != tail && NOTE_NOT_BB_P (insn))
1247 rtx next = NEXT_INSN (insn);
1248 basic_block bb = BLOCK_FOR_INSN (insn);
1260 gcc_assert (BB_HEAD (bb) != insn);
1262 /* Check if we are removing last insn in the BB. */
1263 if (BB_END (bb) == insn)
1268 if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_EH_REGION_BEG
1269 && NOTE_LINE_NUMBER (insn) != NOTE_INSN_EH_REGION_END)
1272 PREV_INSN (insn) = note_list;
1274 NEXT_INSN (note_list) = insn;
1275 note_list = insn;
1278 insn = next;
1280 return insn;
1284 they can be reused. Returns the insn following the notes. */
1287 unlink_line_notes (rtx insn, rtx tail)
1289 rtx prev = PREV_INSN (insn);
1291 while (insn != tail && NOTE_NOT_BB_P (insn))
1293 rtx next = NEXT_INSN (insn);
1295 if (write_symbols != NO_DEBUG && NOTE_LINE_NUMBER (insn) > 0)
1297 basic_block bb = BLOCK_FOR_INSN (insn);
1309 gcc_assert (BB_HEAD (bb) != insn);
1311 /* Check if we are removing last insn in the BB. */
1312 if (BB_END (bb) == insn)
1317 LINE_NOTE (insn) = insn;
1320 prev = insn;
1322 insn = next;
1324 return insn;
1388 rtx insn;
1391 for (insn = head; insn != next_tail; insn = NEXT_INSN (insn))
1398 if (NOTE_NOT_BB_P (insn))
1400 prev = insn;
1401 insn = unlink_line_notes (insn, next_tail);
1403 gcc_assert (prev != tail && prev != head && insn != next_tail);
1408 /* Save line number notes for each insn in block B. HEAD and TAIL are
1416 /* We must use the true line number for the first insn in the block
1422 rtx insn;
1426 for (insn = head; insn != next_tail; insn = NEXT_INSN (insn))
1427 if (NOTE_P (insn) && NOTE_LINE_NUMBER (insn) > 0)
1428 line = insn;
1430 LINE_NOTE (insn) = line;
1442 rtx next_tail, insn;
1448 line number of the first insn of the block here, in case it is
1450 different, then we need a line number note before the first insn
1459 for (insn = head; insn != next_tail; insn = NEXT_INSN (insn))
1460 if (NOTE_P (insn) && NOTE_LINE_NUMBER (insn) > 0)
1461 line = insn;
1466 else if (!NOTE_P (insn)
1467 && INSN_UID (insn) < old_max_uid
1468 && (note = LINE_NOTE (insn)) != 0
1480 prev = PREV_INSN (insn);
1487 PREV_INSN (insn) = note;
1488 NEXT_INSN (note) = insn;
1489 set_block_for_insn (note, BLOCK_FOR_INSN (insn));
1511 rtx insn = get_insns ();
1518 for (insn = get_last_insn (); insn; insn = PREV_INSN (insn))
1519 if (NOTE_P (insn) && NOTE_LINE_NUMBER (insn) > 0)
1525 SET_INSN_DELETED (insn);
1530 && NOTE_SOURCE_LOCATION (line) == NOTE_SOURCE_LOCATION (insn)
1532 && NOTE_LINE_NUMBER (line) == NOTE_LINE_NUMBER (insn)
1533 && NOTE_SOURCE_FILE (line) == NOTE_SOURCE_FILE (insn)
1539 line = insn;
1542 line = insn;
1545 else if (!((NOTE_P (insn)
1546 && NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED)
1547 || (NONJUMP_INSN_P (insn)
1548 && (GET_CODE (PATTERN (insn)) == USE
1549 || GET_CODE (PATTERN (insn)) == CLOBBER))))
1563 rtx insn;
1570 for (insn = head; insn != next_tail; insn = NEXT_INSN (insn))
1577 if (NOTE_NOT_BB_P (insn))
1579 prev = insn;
1581 insn = unlink_other_notes (insn, next_tail);
1583 gcc_assert (prev != tail && prev != head && insn != next_tail);
1620 rtx insn, next_tail, head, tail;
1625 for (insn = head; insn != next_tail; insn = NEXT_INSN (insn))
1626 find_insn_reg_weight1 (insn);
1633 find_insn_reg_weight1 (rtx insn)
1639 if (! INSN_P (insn))
1643 x = PATTERN (insn);
1650 x = XVECEXP (PATTERN (insn), 0, j);
1655 for (x = REG_NOTES (insn); x; x = XEXP (x, 1))
1662 INSN_REG_WEIGHT (insn) = reg_weight;
1670 rtx insn;
1679 insn = XEXP (link, 0);
1683 fprintf (sched_dump, ";;\t\tQ-->Ready: insn %s: ",
1684 (*current_sched_info->print_insn) (insn, 0));
1686 /* If the ready list is full, delay the insn for 1 cycle.
1690 && !SCHED_GROUP_P (insn))
1694 queue_insn (insn, 1);
1698 ready_add (ready, insn, false);
1717 insn = XEXP (link, 0);
1721 fprintf (sched_dump, ";;\t\tQ-->Ready: insn %s: ",
1722 (*current_sched_info->print_insn) (insn, 0));
1724 ready_add (ready, insn, false);
1755 ok_for_early_queue_removal (rtx insn)
1771 dep_link = find_insn_list (insn, INSN_DEPEND (prev_insn));
1774 dep_cost = insn_cost (prev_insn, dep_link, insn) ;
1775 if (targetm.sched.is_costly_dependence (prev_insn, insn,
1802 rtx insn;
1840 insn = XEXP (link, 0);
1841 if (insn && sched_verbose > 6)
1842 print_rtl_single (sched_dump, insn);
1845 if (recog_memoized (insn) < 0)
1850 cost = state_transition (temp_state, insn);
1858 move_to_ready = ok_for_early_queue_removal (insn);
1863 ready_add (ready, insn, false);
1873 fprintf (sched_dump, ";;\t\tEarly Q-->Ready: insn %s\n",
1874 (*current_sched_info->print_insn) (insn, 0));
1924 reemit_notes (rtx insn)
1926 rtx note, last = insn;
1928 for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
1935 remove_note (insn, note);
1942 move_insn (rtx insn)
1946 if (PREV_INSN (insn) != last)
1952 bb = BLOCK_FOR_INSN (insn);
1955 gcc_assert (BB_HEAD (bb) != insn);
1957 if (BB_END (bb) == insn)
1962 jump_p = control_flow_insn_p (insn);
1966 && IS_SPECULATION_BRANCHY_CHECK_P (insn))
1969 gcc_assert (BLOCK_FOR_INSN (PREV_INSN (insn)) == bb);
1971 BB_END (bb) = PREV_INSN (insn);
1982 note = NEXT_INSN (insn);
1994 note = insn;
1996 NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (note);
1997 PREV_INSN (NEXT_INSN (note)) = PREV_INSN (insn);
2002 NEXT_INSN (last) = insn;
2003 PREV_INSN (insn) = last;
2009 fix_jump_move (insn);
2011 if (BLOCK_FOR_INSN (insn) != bb)
2012 move_block_after_check (insn);
2017 set_block_for_insn (insn, bb);
2021 BB_END (bb) = insn;
2024 reemit_notes (insn);
2026 SCHED_GROUP_P (insn) = 0;
2032 /* Ordinal number of the issued insn in the ready queue. */
2038 /* State after issuing the insn. */
2047 the current cycle. An insn is essential one if it changes the
2052 insns for the first cycle multipass insn scheduling. We define
2057 might be incomplete and such insn might occur. For such
2073 insns is insns with the best rank (the first insn in READY). To
2079 INDEX will contain index of the best insn in READY. The following
2086 rtx insn;
2123 insn = ready_element (ready, i);
2124 delay = state_transition (curr_state, insn);
2133 n += ISSUE_POINTS (insn);
2153 fprintf (sched_dump, ";;\t\tChoosed insn : %s; points: %d/%d\n",
2161 /* The following function chooses insn from READY and modifies
2176 /* Try to choose the better insn. */
2178 rtx insn;
2188 insn = ready_element (ready, 0);
2189 if (INSN_CODE (insn) < 0)
2223 if ((!try_data && (TODO_SPEC (insn) & DATA_SPEC))
2224 || (!try_control && (TODO_SPEC (insn) & CONTROL_SPEC))
2227 (insn)))
2231 change_queue_index (insn, 1);
2235 max_points = ISSUE_POINTS (insn);
2240 insn = ready_element (ready, i);
2242 = (INSN_CODE (insn) < 0
2243 || (!try_data && (TODO_SPEC (insn) & DATA_SPEC))
2244 || (!try_control && (TODO_SPEC (insn) & CONTROL_SPEC))
2247 (insn)));
2250 max_points += ISSUE_POINTS (insn);
2284 had different notions of what the "head" insn was. */
2342 /* Find first free-standing insn past MAX_SCHED_READY_INSNS. */
2424 rtx insn;
2454 /* Select and remove the insn from the ready list. */
2457 insn = choose_ready (&ready);
2458 if (!insn)
2462 insn = ready_remove_first (&ready);
2466 insn, last_clock_var,
2471 the insn will be issued next. As we need the insn
2474 ready_add (&ready, insn, true).
2480 ready_add (&ready, insn, true);
2486 if (recog_memoized (insn) < 0)
2488 asm_p = (GET_CODE (PATTERN (insn)) == ASM_INPUT
2489 || asm_noperands (PATTERN (insn)) >= 0);
2491 /* This is asm insn which is tryed to be issued on the
2495 /* A USE insn, or something else we don't need to
2503 cost = state_transition (temp_state, insn);
2512 queue_insn (insn, cost);
2513 if (SCHED_GROUP_P (insn))
2523 && ! (*current_sched_info->can_schedule_ready_p) (insn))
2525 insn from the split block. */
2527 TODO_SPEC (insn) = (TODO_SPEC (insn) & ~SPECULATIVE) | HARD_DEP;
2533 if (TODO_SPEC (insn) & SPECULATIVE)
2534 generate_recovery_code (insn);
2542 || current_sched_info->advance_target_bb (*target_bb, insn))
2560 (*current_sched_info->begin_schedule_ready) (insn,
2563 move_insn (insn);
2564 last_scheduled_insn = insn;
2575 insn, can_issue_more);
2578 else if (GET_CODE (PATTERN (insn)) != USE
2579 && GET_CODE (PATTERN (insn)) != CLOBBER)
2582 advance = schedule_insn (insn);
2584 /* After issuing an asm insn we should start a new cycle. */
2653 /* INSN_TICK (minimum clock tick at which the insn becomes
2654 ready) may be not correct for the insn in the subsequent
2713 /* Set_priorities: compute priority of each insn in the block. */
2718 rtx insn;
2730 for (insn = tail; insn != prev_head; insn = PREV_INSN (insn))
2732 if (!INSN_P (insn))
2736 (void) priority (insn);
2738 if (INSN_PRIORITY_KNOWN (insn))
2740 MAX (sched_max_insns_priority, INSN_PRIORITY (insn));
2757 rtx insn;
2837 for (insn = BB_HEAD (b); ; insn = NEXT_INSN (insn))
2839 INSN_LUID (insn) = luid;
2846 if (!NOTE_P (insn))
2849 if (insn == BB_END (b))
2883 /* Free global data used during insn scheduling. */
3056 /* * if !(old_ts & SPECULATIVE) (e.g. HARD_DEP or 0), then insn might
3059 * But if (old_ts & SPECULATIVE), then we are pretty sure that insn
3088 /* We follow the rule, that every speculative insn
3096 /* If we gonna to overwrite the original pattern of insn,
3139 fprintf (sched_dump, ";;\t\tdependencies resolved: insn %s",
3237 fprintf (sched_dump, ";;\t\ttick updated: insn %s",
3251 resolve_dep (rtx next, rtx insn)
3257 dep = remove_list_elem (insn, &LOG_LINKS (next));
3269 /* We use LUID 0 for the fake insn (UID 0) which holds dependencies for
3305 extend_global (rtx insn)
3307 gcc_assert (INSN_P (insn));
3310 init_h_i_d (insn);
3318 extend_all (rtx insn)
3320 extend_global (insn);
3325 (*current_sched_info->add_remove_insn) (insn, 0);
3331 init_h_i_d (rtx insn)
3333 INSN_LUID (insn) = luid++;
3334 INSN_COST (insn) = -1;
3335 TODO_SPEC (insn) = HARD_DEP;
3336 QUEUE_INDEX (insn) = QUEUE_NOWHERE;
3337 INSN_TICK (insn) = INVALID_TICK;
3338 INTER_TICK (insn) = INVALID_TICK;
3339 find_insn_reg_weight1 (insn);
3344 generate_recovery_code (rtx insn)
3346 if (TODO_SPEC (insn) & BEGIN_SPEC)
3347 begin_speculative_block (insn);
3349 /* Here we have insn with no dependencies to
3352 if (TODO_SPEC (insn) & BE_IN_SPEC)
3353 add_to_speculative_block (insn);
3383 if (/* In try_ready we assert that if insn once became ready
3402 begin_speculative_block (rtx insn)
3404 if (TODO_SPEC (insn) & BEGIN_DATA)
3406 if (TODO_SPEC (insn) & BEGIN_CONTROL)
3409 create_check_block_twin (insn, false);
3411 TODO_SPEC (insn) &= ~BEGIN_SPEC;
3416 add_to_speculative_block (rtx insn)
3421 ts = TODO_SPEC (insn);
3429 TODO_SPEC (insn) &= ~BE_IN_SPEC;
3430 gcc_assert (!TODO_SPEC (insn));
3432 DONE_SPEC (insn) |= ts;
3435 for (link = LOG_LINKS (insn); link;)
3444 link = LOG_LINKS (insn);
3450 clear_priorities (insn);
3457 link = LOG_LINKS (insn);
3469 twin = emit_insn_before (copy_rtx (PATTERN (insn)), BB_END (rec));
3472 RESOLVED_DEPS (twin) = copy_DEPS_LIST_list (RESOLVED_DEPS (insn));
3475 /* INSN_BB (insn) isn't determined for twin insns yet.
3477 fprintf (spec_info->dump, ";;\t\tGenerated twin insn : %d/rec%d\n",
3504 process_insn_depend_be_in_spec (INSN_DEPEND (insn), twin, ts);
3506 for (link = LOG_LINKS (insn); link;)
3512 delete_back_forw_dep (insn, check);
3513 link = LOG_LINKS (insn);
3519 while (LOG_LINKS (insn));
3521 /* We can't add the dependence between insn and twin earlier because
3522 that would make twin appear in the INSN_DEPEND (insn). */
3529 add_back_forw_dep (twin, insn, REG_DEP_OUTPUT, DEP_OUTPUT);
3712 create_check_block_twin (rtx insn, bool mutate_p)
3718 gcc_assert (ORIG_PAT (insn)
3720 || (IS_SPECULATION_SIMPLE_CHECK_P (insn)
3721 && !(TODO_SPEC (insn) & SPECULATIVE))));
3724 if (mutate_p || targetm.sched.needs_block_p (insn))
3736 check = targetm.sched.gen_check (insn, label, mutate_p);
3741 we emit check BEFORE insn, so insn after splitting
3742 insn will be at the beginning of second_bb, which will
3744 check = emit_jump_insn_before (check, insn);
3749 check = emit_insn_before (check, insn);
3756 fprintf (spec_info->dump, ";;\t\tGenerated check insn : %s\n",
3759 gcc_assert (ORIG_PAT (insn));
3767 for (link = RESOLVED_DEPS (insn); link; link = XEXP (link, 1))
3775 twin = emit_insn_after (ORIG_PAT (insn), BB_END (rec));
3779 /* INSN_BB (insn) isn't determined for twin insns yet.
3781 fprintf (spec_info->dump, ";;\t\tGenerated twin insn : %d/rec%d\n",
3786 ORIG_PAT (check) = ORIG_PAT (insn);
3793 RESOLVED_DEPS (twin) = copy_DEPS_LIST_list (RESOLVED_DEPS (insn));
3856 for (link = LOG_LINKS (insn); link; link = XEXP (link, 1))
3860 /* If BEGIN_DATA: [insn ~~TRUE~~> producer]:
3865 If BEGIN_CONTROL: [insn ~~ANTI~~> producer]:
3870 If BE_IN_SPEC: [insn ~~TRUE~~> producer]:
3892 for (link = LOG_LINKS (insn); link;)
3898 delete_back_forw_dep (insn, XEXP (link, 0));
3899 link = LOG_LINKS (insn);
3909 gcc_assert (!DONE_SPEC (insn));
3913 ds_t ts = TODO_SPEC (insn);
3915 DONE_SPEC (insn) = ts & BEGIN_SPEC;
3924 CHECK_SPEC (check) = CHECK_SPEC (insn);
3927 process_insn_depend_be_in_spec (INSN_DEPEND (insn), twin, fs);
3937 add_back_forw_dep (check, insn, REG_DEP_TRUE, DEP_TRUE);
3938 add_back_forw_dep (twin, insn, REG_DEP_OUTPUT, DEP_OUTPUT);
3944 (*current_sched_info->print_insn) (insn, 0));
3946 for (link = INSN_DEPEND (insn); link; link = INSN_DEPEND (insn))
3947 delete_back_forw_dep (XEXP (link, 0), insn);
3949 if (QUEUE_INDEX (insn) != QUEUE_NOWHERE)
3952 sched_remove_insn (insn);
3958 add_back_forw_dep (check, insn, REG_DEP_TRUE, DEP_TRUE | DEP_OUTPUT);
3975 rtx note, insn, link, jump, ready_list = 0;
3983 insn = BB_END (rec);
3984 gcc_assert (JUMP_P (insn));
3985 insn = PREV_INSN (insn);
3989 for (link = INSN_DEPEND (insn); link;)
3997 delete_back_forw_dep (consumer, insn);
4005 link = INSN_DEPEND (insn);
4015 insn = PREV_INSN (insn);
4017 while (insn != note);
4027 insn = BB_HEAD (rec);
4030 gcc_assert (LABEL_P (insn));
4031 insn = NEXT_INSN (insn);
4033 gcc_assert (NOTE_INSN_BASIC_BLOCK_P (insn));
4034 add_jump_dependencies (insn, jump);
4062 change_pattern (rtx insn, rtx new_pat)
4066 t = validate_change (insn, &PATTERN (insn), new_pat, 0);
4069 INSN_COST (insn) = -1;
4071 INSN_TICK (insn) = INVALID_TICK;
4072 dfa_clear_single_insn_cache (insn);
4081 speculate_insn (rtx insn, ds_t request, rtx *new_pat)
4086 if (!NONJUMP_INSN_P (insn)
4087 || HAS_INTERNAL_DEP (insn)
4088 || SCHED_GROUP_P (insn)
4089 || side_effects_p (PATTERN (insn))
4093 gcc_assert (!IS_SPECULATION_CHECK_P (insn));
4097 if (may_trap_p (PATTERN (insn)))
4104 return targetm.sched.speculate_insn (insn, request & BEGIN_SPEC, new_pat);
4224 rtx insn;
4232 determine the correct line number for the first insn of the block. */
4255 insn = BB_END (EXIT_BLOCK_PTR->prev_bb);
4256 if (NEXT_INSN (insn) == 0
4257 || (!NOTE_P (insn)
4258 && !LABEL_P (insn)
4260 && !BARRIER_P (NEXT_INSN (insn))))
4262 emit_note_after (NOTE_INSN_DELETED, insn);
4263 /* Make insn to appear outside BB. */
4264 BB_END (EXIT_BLOCK_PTR->prev_bb) = insn;
4482 sched_remove_insn (rtx insn)
4484 change_queue_index (insn, QUEUE_NOWHERE);
4485 current_sched_info->add_remove_insn (insn, 1);
4486 remove_insn (insn);
4492 clear_priorities (rtx insn)
4496 for (link = LOG_LINKS (insn); link; link = XEXP (link, 1))
4512 calc_priorities (rtx insn)
4516 for (link = LOG_LINKS (insn); link; link = XEXP (link, 1))
4531 block. INSN is the first insn the recovery block. */
4533 add_jump_dependencies (rtx insn, rtx jump)
4537 insn = NEXT_INSN (insn);
4538 if (insn == jump)
4541 if (!INSN_DEPEND (insn))
4542 add_back_forw_dep (jump, insn, REG_DEP_ANTI, DEP_ANTI);