Lines Matching refs:loops

34 static void duplicate_subloops (struct loops *, struct loop *, struct loop *);
35 static void copy_loops_to (struct loops *, struct loop **, int,
43 static void add_loop (struct loops *, struct loop *);
44 static void fix_loop_placements (struct loops *, struct loop *, bool *);
45 static bool fix_bb_placement (struct loops *, basic_block);
46 static void fix_bb_placements (struct loops *, basic_block, bool *);
47 static void place_new_loop (struct loops *, struct loop *);
50 static void unloop (struct loops *, struct loop *, bool *);
100 fix_bb_placement (struct loops *loops, basic_block bb)
104 struct loop *loop = loops->tree_root, *act;
128 /* Fix placements of basic blocks inside loop hierarchy stored in loops; i.e.
135 successors we consider edges coming out of the loops.
141 fix_bb_placements (struct loops *loops, basic_block from,
157 if (base_loop == loops->tree_root)
190 if (!fix_bb_placement (loops, from))
246 remove_path (struct loops *loops, edge e)
272 /* It may happen that by removing path we remove one or more loops
273 we belong to. In this case first unloop the loops, then proceed
279 unloop (loops, e->src->loop_father, &irred_invalidated);
313 /* Cancel loops contained in the path. */
316 cancel_loop_tree (loops, rem_bbs[i]->loop_father);
347 /* Fix placements of basic blocks inside loops and the placement of
348 loops in the loop tree. */
349 fix_bb_placements (loops, from, &irred_invalidated);
350 fix_loop_placements (loops, from->loop_father, &irred_invalidated);
353 && (loops->state & LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS) != 0)
354 mark_irreducible_loops (loops);
369 add_loop (struct loops *loops, struct loop *loop)
375 place_new_loop (loops, loop);
411 loopify (struct loops *loops, edge latch_edge, edge header_edge,
456 add_loop (loops, loop);
511 unloop (struct loops *loops, struct loop *loop, bool *irred_invalidated)
524 is the placement of loops and basic blocks inside the loop tree. We
547 loops->parray[loop->num] = NULL;
555 fix_bb_placements (loops, latch, &dummy);
603 fix_loop_placements (struct loops *loops, struct loop *loop,
619 fix_bb_placements (loops, loop_preheader_edge (loop)->src,
627 place_new_loop (struct loops *loops, struct loop *loop)
629 loops->parray =
630 xrealloc (loops->parray, (loops->num + 1) * sizeof (struct loop *));
631 loops->parray[loops->num] = loop;
633 loop->num = loops->num++;
639 duplicate_loop (struct loops *loops, struct loop *loop, struct loop *target)
643 place_new_loop (loops, cloop);
658 newly created loops into loop tree stored in LOOPS. */
660 duplicate_subloops (struct loops *loops, struct loop *loop, struct loop *target)
666 cloop = duplicate_loop (loops, aloop, target);
667 duplicate_subloops (loops, aloop, cloop);
671 /* Copies structure of subloops of N loops, stored in array COPIED_LOOPS,
672 into TARGET loop, placing newly created loops into loop tree LOOPS. */
674 copy_loops_to (struct loops *loops, struct loop **copied_loops, int n, struct loop *target)
681 aloop = duplicate_loop (loops, copied_loops[i], target);
682 duplicate_subloops (loops, copied_loops[i], aloop);
776 unique, as the loops must have preheaders for this function to work
784 duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops,
914 /* Original loops. */
932 if (loops->state & LOOPS_HAVE_MARKED_SINGLE_EXITS)
945 /* Copy loops. */
946 copy_loops_to (loops, orig_loops, n_orig_loops, target);
1176 create_preheaders (struct loops *loops, int flags)
1179 for (i = 1; i < loops->num; i++)
1180 create_preheader (loops->parray[i], flags);
1181 loops->state |= LOOPS_HAVE_PREHEADERS;
1184 /* Forces all loop latches of loops from loop tree LOOPS to have only single
1187 force_single_succ_latches (struct loops *loops)
1193 for (i = 1; i < loops->num; i++)
1195 loop = loops->parray[i];
1203 loops->state |= LOOPS_HAVE_SIMPLE_LATCHES;
1294 loop_version (struct loops *loops, struct loop * loop,
1317 if (!cfg_hook_duplicate_loop_to_header_edge (loop, entry, loops, 1,
1340 nloop = loopify (loops,
1389 /* The structure of LOOPS might have changed. Some loops might get removed
1393 to be correct). But still for the remaining loops the header dominates
1394 the latch, and loops did not get new subloobs (new loops might possibly
1401 fix_loop_structure (struct loops *loops, bitmap changed_bbs)
1411 bb->loop_father = loops->tree_root;
1414 /* Remove the dead loops from structures. */
1415 loops->tree_root->num_nodes = n_basic_blocks;
1416 for (i = 1; i < loops->num; i++)
1418 loop = loops->parray[i];
1435 loops->parray[loop->num] = NULL;
1439 /* Rescan the bodies of loops, starting from the outermost. */
1440 loop = loops->tree_root;
1448 && loop != loops->tree_root)
1450 if (loop == loops->tree_root)
1460 for (i = 1; i < loops->num; i++)
1462 loop = loops->parray[i];
1484 if (loops->state & LOOPS_HAVE_MARKED_SINGLE_EXITS)
1485 mark_single_exit_loops (loops);
1486 if (loops->state & LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS)
1487 mark_irreducible_loops (loops);