Lines Matching refs:loop

33    loop completely, we do it right here to expose the optimization
73 create_canonical_iv (struct loop *loop, edge exit, tree niter)
82 fprintf (dump_file, "Added canonical iv to loop %d, ", loop->num);
104 NULL_TREE, loop,
117 tree_num_loop_insns (struct loop *loop)
119 basic_block *body = get_loop_body (loop);
123 for (i = 0; i < loop->num_nodes; i++)
131 /* Estimate number of insns of completely unrolled loop. We assume
132 that the size of the unrolled loop is decreased in the
142 NINSNS is the number of insns in the loop before unrolling.
143 NUNROLL is the number of times the loop is unrolled. */
158 loop tree. UL determines which loops we are allowed to unroll.
159 EXIT is the exit of the loop that should be eliminated. */
163 struct loop *loop,
170 if (loop->inner)
186 ninsns = tree_num_loop_insns (loop);
206 fprintf (dump_file, "Not unrolling loop %d:\n", loop->num);
239 if (!tree_duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
264 fprintf (dump_file, "Unrolled loop %d completely.\n", loop->num);
272 to determine the number of iterations of a loop by direct evaluation.
276 canonicalize_loop_induction_variables (struct loops *loops, struct loop *loop,
283 niter = number_of_iterations_in_loop (loop);
286 exit = loop->single_exit;
287 if (!just_once_each_iteration_p (loop, exit->src))
292 condition, not of the loop latch edge). */
298 /* If the loop has more than one exit, try checking all of them
300 if (!loop->single_exit)
301 niter = find_loop_niter (loop, &exit);
307 niter = find_loop_niter_by_eval (loop, &exit);
316 fprintf (dump_file, "Loop %d iterates ", loop->num);
321 if (try_unroll_loop_completely (loops, loop, exit, niter, ul))
325 create_canonical_iv (loop, exit, niter);
337 struct loop *loop;
342 loop = loops->parray[i];
344 if (loop)
345 changed |= canonicalize_loop_induction_variables (loops, loop,
367 struct loop *loop;
373 loop = loops->parray[i];
375 if (!loop)
378 if (may_increase_size && maybe_hot_bb_p (loop->header))
382 changed |= canonicalize_loop_induction_variables (loops, loop,
399 empty_loop_p (struct loop *loop)
409 /* If the loop has multiple exits, it is too hard for us to handle.
411 whether the loop is not infinite. */
412 exit = single_dom_exit (loop);
416 /* The loop must be finite. */
417 if (!number_of_iterations_exit (loop, exit, &niter, false))
420 /* Values of all loop exit phi nodes must be invariants. */
428 if (!expr_invariant_in_loop_p (loop, def))
434 body = get_loop_body (loop);
435 for (i = 0; i < loop->num_nodes; i++)
494 remove_empty_loop (struct loop *loop)
496 edge exit = single_dom_exit (loop), non_exit;
523 and FREQ_H is the frequency of the loop header.
525 freq_h = loop->header->frequency;
526 freq_in = EDGE_FREQUENCY (loop_preheader_edge (loop));
529 body = get_loop_body_in_dom_order (loop);
530 for (n_before = 1; n_before <= loop->num_nodes; n_before++)
534 scale_bbs_frequencies_int (body + n_before, loop->num_nodes - n_before,
548 try_remove_empty_loop (struct loop *loop, bool *changed)
551 struct loop *sub;
554 for (sub = loop->inner; sub; sub = sub->next)
557 if (nonempty_subloop || !empty_loop_p (loop))
560 remove_empty_loop (loop);
571 struct loop *loop;
573 for (loop = loops->tree_root->inner; loop; loop = loop->next)
574 try_remove_empty_loop (loop, &changed);