Lines Matching refs:loop

1 /* Natural loop functions
59 /* The structure describing a bound on number of iterations of a loop. */
74 /* True if the statement will cause the loop to be leaved the (at most)
83 /* Description of the loop exit. */
89 /* Previous and next exit in the list of the exits of the loop. */
106 typedef struct loop *loop_p;
119 /* Structure to hold information for each natural loop. */
120 struct GTY ((chain_next ("%h.next"))) loop {
124 /* Number of loop insns. */
127 /* Basic block of loop header. */
130 /* Basic block of loop latch. */
133 /* For loop unrolling/peeling decision. */
139 /* Number of blocks contained within the loop. */
142 /* Superloops of the loop, starting with the outermost loop. */
145 /* The first inner (child) loop or NULL if innermost loop. */
146 struct loop *inner;
148 /* Link to the next (sibling) loop. */
149 struct loop *next;
154 /* The number of times the latch of the loop is executed. This can be an
175 /* True if the loop can be parallel. */
178 /* True if -Waggressive-loop-optimizations warned about this loop
189 of the loop can be safely evaluated concurrently. */
192 /* True if this loop should never be vectorized. */
195 /* True if we should try harder to vectorize this loop. */
198 /* For SIMD loops, this is a unique identifier of the loop, referenced
203 /* Upper bound on number of iterations of a loop. */
206 /* Head of the cyclic list of the exits of the loop. */
212 /* For sanity checking during loop fixup we record here the former
213 loop header for loops marked for removal. Note that this prevents
219 /* Flags for state of loop structure. */
244 /* Maps edges to the list of their descriptions as loop exits. Edges
249 /* Pointer to root of loop hierarchy tree. */
250 struct loop *tree_root;
260 void (*)(const struct loop *, FILE *, int), int);
261 extern void flow_loop_dump (const struct loop *, FILE *,
262 void (*)(const struct loop *, FILE *, int), int);
263 struct loop *alloc_loop (void);
264 extern void flow_loop_free (struct loop *);
265 int flow_loop_nodes_find (basic_block, struct loop *);
273 extern void flow_loop_tree_node_add (struct loop *, struct loop *);
274 extern void flow_loop_tree_node_remove (struct loop *);
275 extern bool flow_loop_nested_p (const struct loop *, const struct loop *);
276 extern bool flow_bb_inside_loop_p (const struct loop *, const_basic_block);
277 extern struct loop * find_common_loop (struct loop *, struct loop *);
278 struct loop *superloop_at_depth (struct loop *, unsigned);
280 extern int num_loop_insns (const struct loop *);
281 extern int average_num_loop_insns (const struct loop *);
282 extern unsigned get_loop_level (const struct loop *);
283 extern bool loop_exit_edge_p (const struct loop *, const_edge);
284 extern bool loop_exits_to_bb_p (struct loop *, basic_block);
285 extern bool loop_exits_from_bb_p (struct loop *, basic_block);
287 extern location_t get_loop_location (struct loop *loop);
290 extern basic_block *get_loop_body (const struct loop *);
291 extern unsigned get_loop_body_with_size (const struct loop *, basic_block *,
293 extern basic_block *get_loop_body_in_dom_order (const struct loop *);
294 extern basic_block *get_loop_body_in_bfs_order (const struct loop *);
295 extern basic_block *get_loop_body_in_custom_order (const struct loop *,
298 extern vec<edge> get_loop_exit_edges (const struct loop *);
299 extern edge single_exit (const struct loop *);
300 extern edge single_likely_exit (struct loop *loop);
301 extern unsigned num_loop_branches (const struct loop *);
303 extern edge loop_preheader_edge (const struct loop *);
304 extern edge loop_latch_edge (const struct loop *);
306 extern void add_bb_to_loop (basic_block, struct loop *);
309 extern void cancel_loop_tree (struct loop *);
310 extern void delete_loop (struct loop *);
316 extern bool just_once_each_iteration_p (const struct loop *, const_basic_block);
317 gcov_type expected_loop_iterations_unbounded (const struct loop *);
318 extern unsigned expected_loop_iterations (const struct loop *);
367 /* The description of an exit from the loop and of the number of iterations
372 /* The edge out of the loop. */
379 loop. */
382 /* True if the loop iterates the constant number of times. */
391 /* Assumptions under that the loop ends before reaching the latch,
395 /* Condition under that the loop is infinite. */
404 /* The number of iterations of the loop. */
408 extern void iv_analysis_loop_init (struct loop *);
415 extern void find_simple_exit (struct loop *, struct niter_desc *);
418 extern struct niter_desc *get_simple_loop_desc (struct loop *loop);
419 extern void free_simple_loop_desc (struct loop *loop);
422 simple_loop_desc (struct loop *loop)
424 return loop->simple_loop_desc;
427 /* Accessors for the loop structures. */
429 /* Returns the loop with index NUM from FNs loop tree. */
431 static inline struct loop *
440 loop_depth (const struct loop *loop)
442 return vec_safe_length (loop->superloops);
446 loop. */
448 static inline struct loop *
449 loop_outer (const struct loop *loop)
451 unsigned n = vec_safe_length (loop->superloops);
456 return (*loop->superloops)[n - 1];
462 loop_has_exit_edges (const struct loop *loop)
464 return loop->exits->next->e != NULL;
480 ones and the fake loop that forms the root of the loop tree). */
521 /* Flags for loop iteration. */
525 LI_INCLUDE_ROOT = 1, /* Include the fake root of the loop tree. */
535 loop_iterator (loop_p *loop, unsigned flags);
543 /* The index of the actual loop. */
555 loop_p loop = get_loop (cfun, anum);
556 if (loop)
557 return loop;
564 loop_iterator::loop_iterator (loop_p *loop, unsigned flags)
566 struct loop *aloop;
574 *loop = NULL;
637 *loop = this->next ();
688 /* Register pressure estimation for induction variable optimizations & loop
706 extern vec<basic_block> get_loop_hot_path (const struct loop *loop);
708 /* Returns the outermost loop of the loop nest that contains LOOP.*/
709 static inline struct loop *
710 loop_outermost (struct loop *loop)
712 unsigned n = vec_safe_length (loop->superloops);
715 return loop;
717 return (*loop->superloops)[1];
720 extern void record_niter_bound (struct loop *, const widest_int &, bool, bool);
721 extern HOST_WIDE_INT get_estimated_loop_iterations_int (struct loop *);
722 extern HOST_WIDE_INT get_max_loop_iterations_int (struct loop *);
723 extern bool get_estimated_loop_iterations (struct loop *loop, widest_int *nit);
724 extern bool get_max_loop_iterations (struct loop *loop, widest_int *nit);