Lines Matching defs:loop

40 /* This file implements the loop unswitching, i.e. transformation of loops like
53 where inv is the loop invariant, into
73 tree-ssa-loop-im.c ensures that all the suitable conditions are in this
76 static struct loop *tree_unswitch_loop (struct loops *, struct loop *, basic_block,
78 static bool tree_unswitch_single_loop (struct loops *, struct loop *, int);
79 static tree tree_may_unswitch_on (basic_block, struct loop *);
81 /* Main entry point. Perform loop unswitching on all suitable LOOPS. */
87 struct loop *loop;
95 /* Removed loop? */
96 loop = loops->parray[i];
97 if (!loop)
100 if (loop->inner)
103 changed |= tree_unswitch_single_loop (loops, loop, 0);
115 tree_may_unswitch_on (basic_block bb, struct loop *loop)
132 && flow_bb_inside_loop_p (loop, def_bb))
138 but just replace tests with 0/1. Prevent the infinite loop where we
147 simplish (sufficient to prevent us from duplicating loop in unswitching
151 simplify_using_entry_checks (struct loop *loop, tree cond)
153 edge e = loop_preheader_edge (loop);
180 tree_unswitch_single_loop (struct loops *loops, struct loop *loop, int num)
183 struct loop *nloop;
197 if (loop->inner)
200 fprintf (dump_file, ";; Not unswitching, not innermost loop\n");
204 /* The loop should not be too large, to limit code growth. */
205 if (tree_num_loop_insns (loop)
209 fprintf (dump_file, ";; Not unswitching, loop too big\n");
214 bbs = get_loop_body (loop);
219 for (; i < loop->num_nodes; i++)
220 if ((cond = tree_may_unswitch_on (bbs[i], loop)))
223 if (i == loop->num_nodes)
229 cond = simplify_using_entry_checks (loop, cond);
251 fprintf (dump_file, ";; Unswitching loop\n");
254 /* Unswitch the loop on this condition. */
255 nloop = tree_unswitch_loop (loops, loop, bbs[i], cond);
269 tree_unswitch_single_loop (loops, loop, num + 1);
276 loop is entered -- the new loop is entered if COND is true. Returns NULL
277 if impossible, new loop otherwise. */
279 static struct loop *
280 tree_unswitch_loop (struct loops *loops, struct loop *loop,
286 gcc_assert (flow_bb_inside_loop_p (loop, unswitch_on));
288 gcc_assert (loop->inner == NULL);
290 return loop_version (loops, loop, unshare_expr (cond),