Lines Matching refs:latch
89 /* Returns the list of the latch edges of LOOP. */
126 if (loop->latch)
127 fprintf (file, "latch %d\n", loop->latch->index);
142 if (loop->latch)
237 edge latch;
242 FOR_EACH_EDGE (latch, latch_ei, loop->header->preds)
244 if (latch->src->loop_father == loop
245 || !dominated_by_p (CDI_DOMINATORS, latch->src, loop->header))
249 stack.safe_push (latch->src);
250 latch->src->loop_father = loop;
377 root->latch = EXIT_BLOCK_PTR_FOR_FN (fn);
403 from a latch node. */
406 basic_block latch = e->src;
407 if (latch != ENTRY_BLOCK_PTR_FOR_FN (cfun)
408 && dominated_by_p (CDI_DOMINATORS, latch, header))
492 /* Reset latch, we recompute it below. */
493 loop->latch = NULL;
515 /* Look for the latch for this header block, if it has just a
519 basic_block latch = e->src;
521 if (flow_bb_inside_loop_p (loop, latch))
523 if (loop->latch != NULL)
525 /* More than one latch edge. */
526 loop->latch = NULL;
529 loop->latch = latch;
588 /* Ratio of frequencies of edges so that one of more latch edges is
628 "Found latch
633 /* Among LATCHES, guesses a latch edge of LOOP corresponding to subloop, based
640 situation: The source of the chosen latch edge dominates sources of all
641 the other latch edges. Additionally, the header does not contain a phi node
648 edge e, latch = latches[0];
655 /* Find the candidate for the latch edge. */
657 if (dominated_by_p (CDI_DOMINATORS, latch->src, e->src))
658 latch = e;
660 /* Verify that it dominates all the latch edges. */
662 if (!dominated_by_p (CDI_DOMINATORS, e->src, latch->src))
665 /* Check for a phi node that would deny that this is a latch edge of
670 lop = PHI_ARG_DEF_FROM_EDGE (phi, latch);
681 if (e != latch
688 "Found latch edge %d -> %d using iv structure.\n",
689 latch->src->index, latch->dest->index);
690 return latch;
693 /* If we can determine that one of the several latch edges of LOOP behaves
694 as a latch edge of a separate subloop, returns this edge. Otherwise
701 edge latch = NULL;
705 latch = find_subloop_latch_edge_by_profile (latches);
707 if (!latch
708 /* We consider ivs to guess the latch edge only in SSA. Perhaps we
712 latch = find_subloop_latch_edge_by_ivs (loop, latches);
716 return latch;
729 /* Creates a subloop of LOOP with latch edge LATCH. */
732 form_subloop (class loop *loop, edge latch)
741 if (e != latch)
754 new_loop->latch = latch->src;
758 /* Make all the latch edges of LOOP to go to a single forwarder block --
759 a new latch of LOOP. */
765 edge latch, e;
771 loop->latch = latches[0]->src;
775 fprintf (dump_file, "Merged latch edges of loop %d\n", loop->num);
780 latch = make_forwarder_block (loop->header, mfb_redirect_edges_in_set,
784 loop->header = latch->dest;
785 loop->latch = latch->src;
791 /* LOOP may have several latch edges. Transform it into (possibly several)
792 loops with single latch edge. */
802 1) If there is a latch edge E that corresponds to a subloop (we guess
807 2) If there is no such edge, we redirect all latch edges to F, and the
808 entry edges to R, thus making F the single latch of the loop. */
814 /* During latch merging, we may need to redirect the entry edges to a new
834 /* Split loops with multiple latch edges. */
841 if (!loop->latch)
870 order against direction of edges from latch. Specially, if
871 header != latch, latch is the 1-st block. LOOP cannot be the fake
885 order against direction of edges from latch. Specially, if
886 header != latch, latch is the 1-st block. */
898 if (loop->latch == EXIT_BLOCK_PTR_FOR_FN (cfun))
932 if (dominated_by_p (CDI_DOMINATORS, loop->latch, son))
946 the latch, then only blocks dominated by s are be after it. */
958 gcc_assert (loop->latch != EXIT_BLOCK_PTR_FOR_FN (cfun));
1005 gcc_assert (loop->latch != EXIT_BLOCK_PTR_FOR_FN (cfun));
1212 gcc_assert (loop->latch != EXIT_BLOCK_PTR_FOR_FN (cfun));
1250 gcc_assert (loop->latch != EXIT_BLOCK_PTR_FOR_FN (cfun));
1394 -- loop header have just single entry edge and single latch edge
1424 || current_loops->tree_root->latch != EXIT_BLOCK_PTR_FOR_FN (cfun)
1519 if (loop->latch)
1521 if (!find_edge (loop->latch, loop->header))
1523 error ("loop %d%'s latch does not have an edge to its header", i);
1526 if (!dominated_by_p (CDI_DOMINATORS, loop->latch, loop->header))
1528 error ("loop %d%'s latch is not dominated by its header", i);
1534 if (!single_succ_p (loop->latch))
1536 error ("loop %d%'s latch does not have exactly 1 successor", i);
1539 if (single_succ (loop->latch) != loop->header)
1541 error ("loop %d%'s latch does not have header as successor", i);
1544 if (loop->latch->loop_father != loop)
1546 error ("loop %d%'s latch does not belong directly to it", i);
1562 error ("loop %d%'s latch is marked as part of irreducible"
1759 /* Returns latch edge of LOOP. */
1763 return find_edge (loop->latch, loop->header);
1777 if (e->src != loop->latch)
1880 /* Next check the latch, to see if it is non-empty. */
1881 FOR_BB_INSNS_REVERSE (loop->latch, insn)
1971 the number of execution of the latch by one. */
1990 the number of execution of the latch by one. */
2007 /* Sets NIT to the estimated number of executions of the latch of the
2032 latch of the LOOP. If we have no reliable estimate, the function returns
2066 latch of the LOOP. If we have no reliable estimate, the function returns
2116 loop->latch = NULL;