Lines Matching refs:loops

43 static void flow_loops_cfg_dump (const struct loops *, FILE *);
45 static void flow_loops_level_compute (struct loops *);
54 flow_loops_cfg_dump (const struct loops *loops, FILE *file)
59 if (! loops->num || ! file)
74 if (loops->cfg.dfs_order)
78 fprintf (file, "%d ", loops->cfg.dfs_order[i]);
84 if (loops->cfg.rc_order)
88 fprintf (file, "%d ", loops->cfg.rc_order[i]);
104 loops within LOOP. */
154 flow_loops_dump (const struct loops *loops, FILE *file, void (*loop_dump_aux) (const struct loop *, FILE *, int), int verbose)
159 num_loops = loops->num;
163 fprintf (file, ";; %d loops found\n", num_loops);
167 struct loop *loop = loops->parray[i];
176 flow_loops_cfg_dump (loops, file);
191 flow_loops_free (struct loops *loops)
193 if (loops->parray)
197 gcc_assert (loops->num);
200 for (i = 0; i < loops->num; i++)
202 struct loop *loop = loops->parray[i];
210 free (loops->parray);
211 loops->parray = NULL;
213 if (loops->cfg.dfs_order)
214 free (loops->cfg.dfs_order);
215 if (loops->cfg.rc_order)
216 free (loops->cfg.rc_order);
274 mark_single_exit_loops (struct loops *loops)
281 for (i = 1; i < loops->num; i++)
283 loop = loops->parray[i];
291 if (bb->loop_father == loops->tree_root)
315 for (i = 1; i < loops->num; i++)
317 loop = loops->parray[i];
325 loops->state |= LOOPS_HAVE_MARKED_SINGLE_EXITS;
399 maximum level of all the inner loops of this loop. The loop
420 flow_loops_level_compute (struct loops *loops)
422 flow_loop_level_compute (loops->tree_root);
459 /* Takes care of merging natural loops with shared headers. */
575 /* Initialize all the parallel_p fields of the loops structure to true. */
578 initialize_loops_parallel_p (struct loops *loops)
582 for (i = 0; i < loops->num; i++)
584 struct loop *loop = loops->parray[i];
589 /* Find all the natural loops in the function and save in LOOPS structure and
591 Return the number of natural loops found. */
594 flow_loops_find (struct loops *loops)
605 memset (loops, 0, sizeof *loops);
622 /* Join loops with shared headers. */
626 same as the number of natural loops. */
670 loops->parray = XCNEWVEC (struct loop *, num_loops + 1);
673 loops->parray[0] = XCNEW (struct loop);
674 loops->parray[0]->next = NULL;
675 loops->parray[0]->inner = NULL;
676 loops->parray[0]->outer = NULL;
677 loops->parray[0]->depth = 0;
678 loops->parray[0]->pred = NULL;
679 loops->parray[0]->num_nodes = n_basic_blocks;
680 loops->parray[0]->latch = EXIT_BLOCK_PTR;
681 loops->parray[0]->header = ENTRY_BLOCK_PTR;
682 ENTRY_BLOCK_PTR->loop_father = loops->parray[0];
683 EXIT_BLOCK_PTR->loop_father = loops->parray[0];
685 loops->tree_root = loops->parray[0];
687 /* Find and record information about all the natural loops
689 loops->num = 1;
691 bb->loop_father = loops->tree_root;
696 natural loops will be found before inner natural loops. */
702 loops->cfg.dfs_order = dfs_order;
703 loops->cfg.rc_order = rc_order;
713 so that we can find outer loops first. */
719 loop = loops->parray[num_loops] = XCNEW (struct loop);
744 flow_loops_level_compute (loops);
746 loops->num = num_loops;
747 initialize_loops_parallel_p (loops);
752 loops->state = 0;
755 verify_loop_structure (loops);
758 return loops->num;
980 /* Remove basic block BB from loops. */
994 /* Finds nearest common ancestor in loop tree for given loops. */
1017 cancel_loop (struct loops *loops, struct loop *loop)
1032 /* Remove loop from loops array. */
1033 loops->parray[loop->num] = NULL;
1041 cancel_loop_tree (struct loops *loops, struct loop *loop)
1044 cancel_loop_tree (loops, loop->inner);
1045 cancel_loop (loops, loop);
1049 -- sizes of loops are all right
1053 -- irreducible loops are correctly marked
1056 verify_loop_structure (struct loops *loops)
1066 sizes = XCNEWVEC (unsigned, loops->num);
1073 for (i = 0; i < loops->num; i++)
1075 if (!loops->parray[i])
1078 if (loops->parray[i]->num_nodes != sizes[i])
1081 i, sizes[i], loops->parray[i]->num_nodes);
1087 for (i = 1; i < loops->num; i++)
1089 loop = loops->parray[i];
1105 for (i = 1; i < loops->num; i++)
1107 loop = loops->parray[i];
1111 if ((loops->state & LOOPS_HAVE_PREHEADERS)
1117 if (loops->state & LOOPS_HAVE_SIMPLE_LATCHES)
1140 if ((loops->state & LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS)
1148 /* Check irreducible loops. */
1149 if (loops->state & LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS)
1166 mark_irreducible_loops (loops);
1208 if (loops->state & LOOPS_HAVE_MARKED_SINGLE_EXITS)
1210 memset (sizes, 0, sizeof (unsigned) * loops->num);
1214 if (bb->loop_father == loops->tree_root)
1244 for (i = 1; i < loops->num; i++)
1246 loop = loops->parray[i];