2013-10-11 Marc Glisse <marc.glisse@inria.fr>
[official-gcc.git] / gcc / tree-ssa-loop-ivcanon.c
blob8db5b9ede7e79834a0d8da6c40a6d7fa1ecd1700
1 /* Induction variable canonicalization and loop peeling.
2 Copyright (C) 2004-2013 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 3, or (at your option) any
9 later version.
11 GCC is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
20 /* This pass detects the loops that iterate a constant number of times,
21 adds a canonical induction variable (step -1, tested against 0)
22 and replaces the exit test. This enables the less powerful rtl
23 level analysis to use this information.
25 This might spoil the code in some cases (by increasing register pressure).
26 Note that in the case the new variable is not needed, ivopts will get rid
27 of it, so it might only be a problem when there are no other linear induction
28 variables. In that case the created optimization possibilities are likely
29 to pay up.
31 Additionally in case we detect that it is beneficial to unroll the
32 loop completely, we do it right here to expose the optimization
33 possibilities to the following passes. */
35 #include "config.h"
36 #include "system.h"
37 #include "coretypes.h"
38 #include "tm.h"
39 #include "tree.h"
40 #include "tm_p.h"
41 #include "basic-block.h"
42 #include "gimple-pretty-print.h"
43 #include "tree-ssa.h"
44 #include "cfgloop.h"
45 #include "tree-pass.h"
46 #include "tree-chrec.h"
47 #include "tree-scalar-evolution.h"
48 #include "params.h"
49 #include "flags.h"
50 #include "tree-inline.h"
51 #include "target.h"
53 /* Specifies types of loops that may be unrolled. */
55 enum unroll_level
57 UL_SINGLE_ITER, /* Only loops that exit immediately in the first
58 iteration. */
59 UL_NO_GROWTH, /* Only loops whose unrolling will not cause increase
60 of code size. */
61 UL_ALL /* All suitable loops. */
64 /* Adds a canonical induction variable to LOOP iterating NITER times. EXIT
65 is the exit edge whose condition is replaced. */
67 static void
68 create_canonical_iv (struct loop *loop, edge exit, tree niter)
70 edge in;
71 tree type, var;
72 gimple cond;
73 gimple_stmt_iterator incr_at;
74 enum tree_code cmp;
76 if (dump_file && (dump_flags & TDF_DETAILS))
78 fprintf (dump_file, "Added canonical iv to loop %d, ", loop->num);
79 print_generic_expr (dump_file, niter, TDF_SLIM);
80 fprintf (dump_file, " iterations.\n");
83 cond = last_stmt (exit->src);
84 in = EDGE_SUCC (exit->src, 0);
85 if (in == exit)
86 in = EDGE_SUCC (exit->src, 1);
88 /* Note that we do not need to worry about overflows, since
89 type of niter is always unsigned and all comparisons are
90 just for equality/nonequality -- i.e. everything works
91 with a modulo arithmetics. */
93 type = TREE_TYPE (niter);
94 niter = fold_build2 (PLUS_EXPR, type,
95 niter,
96 build_int_cst (type, 1));
97 incr_at = gsi_last_bb (in->src);
98 create_iv (niter,
99 build_int_cst (type, -1),
100 NULL_TREE, loop,
101 &incr_at, false, NULL, &var);
103 cmp = (exit->flags & EDGE_TRUE_VALUE) ? EQ_EXPR : NE_EXPR;
104 gimple_cond_set_code (cond, cmp);
105 gimple_cond_set_lhs (cond, var);
106 gimple_cond_set_rhs (cond, build_int_cst (type, 0));
107 update_stmt (cond);
110 /* Describe size of loop as detected by tree_estimate_loop_size. */
111 struct loop_size
113 /* Number of instructions in the loop. */
114 int overall;
116 /* Number of instructions that will be likely optimized out in
117 peeled iterations of loop (i.e. computation based on induction
118 variable where induction variable starts at known constant.) */
119 int eliminated_by_peeling;
121 /* Same statistics for last iteration of loop: it is smaller because
122 instructions after exit are not executed. */
123 int last_iteration;
124 int last_iteration_eliminated_by_peeling;
126 /* If some IV computation will become constant. */
127 bool constant_iv;
129 /* Number of call stmts that are not a builtin and are pure or const
130 present on the hot path. */
131 int num_pure_calls_on_hot_path;
132 /* Number of call stmts that are not a builtin and are not pure nor const
133 present on the hot path. */
134 int num_non_pure_calls_on_hot_path;
135 /* Number of statements other than calls in the loop. */
136 int non_call_stmts_on_hot_path;
137 /* Number of branches seen on the hot path. */
138 int num_branches_on_hot_path;
141 /* Return true if OP in STMT will be constant after peeling LOOP. */
143 static bool
144 constant_after_peeling (tree op, gimple stmt, struct loop *loop)
146 affine_iv iv;
148 if (is_gimple_min_invariant (op))
149 return true;
151 /* We can still fold accesses to constant arrays when index is known. */
152 if (TREE_CODE (op) != SSA_NAME)
154 tree base = op;
156 /* First make fast look if we see constant array inside. */
157 while (handled_component_p (base))
158 base = TREE_OPERAND (base, 0);
159 if ((DECL_P (base)
160 && ctor_for_folding (base) != error_mark_node)
161 || CONSTANT_CLASS_P (base))
163 /* If so, see if we understand all the indices. */
164 base = op;
165 while (handled_component_p (base))
167 if (TREE_CODE (base) == ARRAY_REF
168 && !constant_after_peeling (TREE_OPERAND (base, 1), stmt, loop))
169 return false;
170 base = TREE_OPERAND (base, 0);
172 return true;
174 return false;
177 /* Induction variables are constants. */
178 if (!simple_iv (loop, loop_containing_stmt (stmt), op, &iv, false))
179 return false;
180 if (!is_gimple_min_invariant (iv.base))
181 return false;
182 if (!is_gimple_min_invariant (iv.step))
183 return false;
184 return true;
187 /* Computes an estimated number of insns in LOOP.
188 EXIT (if non-NULL) is an exite edge that will be eliminated in all but last
189 iteration of the loop.
190 EDGE_TO_CANCEL (if non-NULL) is an non-exit edge eliminated in the last iteration
191 of loop.
192 Return results in SIZE, estimate benefits for complete unrolling exiting by EXIT.
193 Stop estimating after UPPER_BOUND is met. Return true in this case. */
195 static bool
196 tree_estimate_loop_size (struct loop *loop, edge exit, edge edge_to_cancel, struct loop_size *size,
197 int upper_bound)
199 basic_block *body = get_loop_body (loop);
200 gimple_stmt_iterator gsi;
201 unsigned int i;
202 bool after_exit;
203 vec<basic_block> path = get_loop_hot_path (loop);
205 size->overall = 0;
206 size->eliminated_by_peeling = 0;
207 size->last_iteration = 0;
208 size->last_iteration_eliminated_by_peeling = 0;
209 size->num_pure_calls_on_hot_path = 0;
210 size->num_non_pure_calls_on_hot_path = 0;
211 size->non_call_stmts_on_hot_path = 0;
212 size->num_branches_on_hot_path = 0;
213 size->constant_iv = 0;
215 if (dump_file && (dump_flags & TDF_DETAILS))
216 fprintf (dump_file, "Estimating sizes for loop %i\n", loop->num);
217 for (i = 0; i < loop->num_nodes; i++)
219 if (edge_to_cancel && body[i] != edge_to_cancel->src
220 && dominated_by_p (CDI_DOMINATORS, body[i], edge_to_cancel->src))
221 after_exit = true;
222 else
223 after_exit = false;
224 if (dump_file && (dump_flags & TDF_DETAILS))
225 fprintf (dump_file, " BB: %i, after_exit: %i\n", body[i]->index, after_exit);
227 for (gsi = gsi_start_bb (body[i]); !gsi_end_p (gsi); gsi_next (&gsi))
229 gimple stmt = gsi_stmt (gsi);
230 int num = estimate_num_insns (stmt, &eni_size_weights);
231 bool likely_eliminated = false;
232 bool likely_eliminated_last = false;
233 bool likely_eliminated_peeled = false;
235 if (dump_file && (dump_flags & TDF_DETAILS))
237 fprintf (dump_file, " size: %3i ", num);
238 print_gimple_stmt (dump_file, gsi_stmt (gsi), 0, 0);
241 /* Look for reasons why we might optimize this stmt away. */
243 if (gimple_has_side_effects (stmt))
245 /* Exit conditional. */
246 else if (exit && body[i] == exit->src
247 && stmt == last_stmt (exit->src))
249 if (dump_file && (dump_flags & TDF_DETAILS))
250 fprintf (dump_file, " Exit condition will be eliminated "
251 "in peeled copies.\n");
252 likely_eliminated_peeled = true;
254 else if (edge_to_cancel && body[i] == edge_to_cancel->src
255 && stmt == last_stmt (edge_to_cancel->src))
257 if (dump_file && (dump_flags & TDF_DETAILS))
258 fprintf (dump_file, " Exit condition will be eliminated "
259 "in last copy.\n");
260 likely_eliminated_last = true;
262 /* Sets of IV variables */
263 else if (gimple_code (stmt) == GIMPLE_ASSIGN
264 && constant_after_peeling (gimple_assign_lhs (stmt), stmt, loop))
266 if (dump_file && (dump_flags & TDF_DETAILS))
267 fprintf (dump_file, " Induction variable computation will"
268 " be folded away.\n");
269 likely_eliminated = true;
271 /* Assignments of IV variables. */
272 else if (gimple_code (stmt) == GIMPLE_ASSIGN
273 && TREE_CODE (gimple_assign_lhs (stmt)) == SSA_NAME
274 && constant_after_peeling (gimple_assign_rhs1 (stmt), stmt, loop)
275 && (gimple_assign_rhs_class (stmt) != GIMPLE_BINARY_RHS
276 || constant_after_peeling (gimple_assign_rhs2 (stmt),
277 stmt, loop)))
279 size->constant_iv = true;
280 if (dump_file && (dump_flags & TDF_DETAILS))
281 fprintf (dump_file, " Constant expression will be folded away.\n");
282 likely_eliminated = true;
284 /* Conditionals. */
285 else if ((gimple_code (stmt) == GIMPLE_COND
286 && constant_after_peeling (gimple_cond_lhs (stmt), stmt, loop)
287 && constant_after_peeling (gimple_cond_rhs (stmt), stmt, loop))
288 || (gimple_code (stmt) == GIMPLE_SWITCH
289 && constant_after_peeling (gimple_switch_index (stmt), stmt, loop)))
291 if (dump_file && (dump_flags & TDF_DETAILS))
292 fprintf (dump_file, " Constant conditional.\n");
293 likely_eliminated = true;
296 size->overall += num;
297 if (likely_eliminated || likely_eliminated_peeled)
298 size->eliminated_by_peeling += num;
299 if (!after_exit)
301 size->last_iteration += num;
302 if (likely_eliminated || likely_eliminated_last)
303 size->last_iteration_eliminated_by_peeling += num;
305 if ((size->overall * 3 / 2 - size->eliminated_by_peeling
306 - size->last_iteration_eliminated_by_peeling) > upper_bound)
308 free (body);
309 path.release ();
310 return true;
314 while (path.length ())
316 basic_block bb = path.pop ();
317 for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
319 gimple stmt = gsi_stmt (gsi);
320 if (gimple_code (stmt) == GIMPLE_CALL)
322 int flags = gimple_call_flags (stmt);
323 tree decl = gimple_call_fndecl (stmt);
325 if (decl && DECL_IS_BUILTIN (decl)
326 && is_inexpensive_builtin (decl))
328 else if (flags & (ECF_PURE | ECF_CONST))
329 size->num_pure_calls_on_hot_path++;
330 else
331 size->num_non_pure_calls_on_hot_path++;
332 size->num_branches_on_hot_path ++;
334 else if (gimple_code (stmt) != GIMPLE_CALL
335 && gimple_code (stmt) != GIMPLE_DEBUG)
336 size->non_call_stmts_on_hot_path++;
337 if (((gimple_code (stmt) == GIMPLE_COND
338 && (!constant_after_peeling (gimple_cond_lhs (stmt), stmt, loop)
339 || constant_after_peeling (gimple_cond_rhs (stmt), stmt, loop)))
340 || (gimple_code (stmt) == GIMPLE_SWITCH
341 && !constant_after_peeling (gimple_switch_index (stmt), stmt, loop)))
342 && (!exit || bb != exit->src))
343 size->num_branches_on_hot_path++;
346 path.release ();
347 if (dump_file && (dump_flags & TDF_DETAILS))
348 fprintf (dump_file, "size: %i-%i, last_iteration: %i-%i\n", size->overall,
349 size->eliminated_by_peeling, size->last_iteration,
350 size->last_iteration_eliminated_by_peeling);
352 free (body);
353 return false;
356 /* Estimate number of insns of completely unrolled loop.
357 It is (NUNROLL + 1) * size of loop body with taking into account
358 the fact that in last copy everything after exit conditional
359 is dead and that some instructions will be eliminated after
360 peeling.
362 Loop body is likely going to simplify further, this is difficult
363 to guess, we just decrease the result by 1/3. */
365 static unsigned HOST_WIDE_INT
366 estimated_unrolled_size (struct loop_size *size,
367 unsigned HOST_WIDE_INT nunroll)
369 HOST_WIDE_INT unr_insns = ((nunroll)
370 * (HOST_WIDE_INT) (size->overall
371 - size->eliminated_by_peeling));
372 if (!nunroll)
373 unr_insns = 0;
374 unr_insns += size->last_iteration - size->last_iteration_eliminated_by_peeling;
376 unr_insns = unr_insns * 2 / 3;
377 if (unr_insns <= 0)
378 unr_insns = 1;
380 return unr_insns;
383 /* Loop LOOP is known to not loop. See if there is an edge in the loop
384 body that can be remove to make the loop to always exit and at
385 the same time it does not make any code potentially executed
386 during the last iteration dead.
388 After complette unrolling we still may get rid of the conditional
389 on the exit in the last copy even if we have no idea what it does.
390 This is quite common case for loops of form
392 int a[5];
393 for (i=0;i<b;i++)
394 a[i]=0;
396 Here we prove the loop to iterate 5 times but we do not know
397 it from induction variable.
399 For now we handle only simple case where there is exit condition
400 just before the latch block and the latch block contains no statements
401 with side effect that may otherwise terminate the execution of loop
402 (such as by EH or by terminating the program or longjmp).
404 In the general case we may want to cancel the paths leading to statements
405 loop-niter identified as having undefined effect in the last iteration.
406 The other cases are hopefully rare and will be cleaned up later. */
408 static edge
409 loop_edge_to_cancel (struct loop *loop)
411 vec<edge> exits;
412 unsigned i;
413 edge edge_to_cancel;
414 gimple_stmt_iterator gsi;
416 /* We want only one predecestor of the loop. */
417 if (EDGE_COUNT (loop->latch->preds) > 1)
418 return NULL;
420 exits = get_loop_exit_edges (loop);
422 FOR_EACH_VEC_ELT (exits, i, edge_to_cancel)
424 /* Find the other edge than the loop exit
425 leaving the conditoinal. */
426 if (EDGE_COUNT (edge_to_cancel->src->succs) != 2)
427 continue;
428 if (EDGE_SUCC (edge_to_cancel->src, 0) == edge_to_cancel)
429 edge_to_cancel = EDGE_SUCC (edge_to_cancel->src, 1);
430 else
431 edge_to_cancel = EDGE_SUCC (edge_to_cancel->src, 0);
433 /* We only can handle conditionals. */
434 if (!(edge_to_cancel->flags & (EDGE_TRUE_VALUE | EDGE_FALSE_VALUE)))
435 continue;
437 /* We should never have conditionals in the loop latch. */
438 gcc_assert (edge_to_cancel->dest != loop->header);
440 /* Check that it leads to loop latch. */
441 if (edge_to_cancel->dest != loop->latch)
442 continue;
444 exits.release ();
446 /* Verify that the code in loop latch does nothing that may end program
447 execution without really reaching the exit. This may include
448 non-pure/const function calls, EH statements, volatile ASMs etc. */
449 for (gsi = gsi_start_bb (loop->latch); !gsi_end_p (gsi); gsi_next (&gsi))
450 if (gimple_has_side_effects (gsi_stmt (gsi)))
451 return NULL;
452 return edge_to_cancel;
454 exits.release ();
455 return NULL;
458 /* Remove all tests for exits that are known to be taken after LOOP was
459 peeled NPEELED times. Put gcc_unreachable before every statement
460 known to not be executed. */
462 static bool
463 remove_exits_and_undefined_stmts (struct loop *loop, unsigned int npeeled)
465 struct nb_iter_bound *elt;
466 bool changed = false;
468 for (elt = loop->bounds; elt; elt = elt->next)
470 /* If statement is known to be undefined after peeling, turn it
471 into unreachable (or trap when debugging experience is supposed
472 to be good). */
473 if (!elt->is_exit
474 && elt->bound.ult (double_int::from_uhwi (npeeled)))
476 gimple_stmt_iterator gsi = gsi_for_stmt (elt->stmt);
477 gimple stmt = gimple_build_call
478 (builtin_decl_implicit (BUILT_IN_UNREACHABLE), 0);
480 gimple_set_location (stmt, gimple_location (elt->stmt));
481 gsi_insert_before (&gsi, stmt, GSI_NEW_STMT);
482 changed = true;
483 if (dump_file && (dump_flags & TDF_DETAILS))
485 fprintf (dump_file, "Forced statement unreachable: ");
486 print_gimple_stmt (dump_file, elt->stmt, 0, 0);
489 /* If we know the exit will be taken after peeling, update. */
490 else if (elt->is_exit
491 && elt->bound.ule (double_int::from_uhwi (npeeled)))
493 basic_block bb = gimple_bb (elt->stmt);
494 edge exit_edge = EDGE_SUCC (bb, 0);
496 if (dump_file && (dump_flags & TDF_DETAILS))
498 fprintf (dump_file, "Forced exit to be taken: ");
499 print_gimple_stmt (dump_file, elt->stmt, 0, 0);
501 if (!loop_exit_edge_p (loop, exit_edge))
502 exit_edge = EDGE_SUCC (bb, 1);
503 gcc_checking_assert (loop_exit_edge_p (loop, exit_edge));
504 if (exit_edge->flags & EDGE_TRUE_VALUE)
505 gimple_cond_make_true (elt->stmt);
506 else
507 gimple_cond_make_false (elt->stmt);
508 update_stmt (elt->stmt);
509 changed = true;
512 return changed;
515 /* Remove all exits that are known to be never taken because of the loop bound
516 discovered. */
518 static bool
519 remove_redundant_iv_tests (struct loop *loop)
521 struct nb_iter_bound *elt;
522 bool changed = false;
524 if (!loop->any_upper_bound)
525 return false;
526 for (elt = loop->bounds; elt; elt = elt->next)
528 /* Exit is pointless if it won't be taken before loop reaches
529 upper bound. */
530 if (elt->is_exit && loop->any_upper_bound
531 && loop->nb_iterations_upper_bound.ult (elt->bound))
533 basic_block bb = gimple_bb (elt->stmt);
534 edge exit_edge = EDGE_SUCC (bb, 0);
535 struct tree_niter_desc niter;
537 if (!loop_exit_edge_p (loop, exit_edge))
538 exit_edge = EDGE_SUCC (bb, 1);
540 /* Only when we know the actual number of iterations, not
541 just a bound, we can remove the exit. */
542 if (!number_of_iterations_exit (loop, exit_edge,
543 &niter, false, false)
544 || !integer_onep (niter.assumptions)
545 || !integer_zerop (niter.may_be_zero)
546 || !niter.niter
547 || TREE_CODE (niter.niter) != INTEGER_CST
548 || !loop->nb_iterations_upper_bound.ult
549 (tree_to_double_int (niter.niter)))
550 continue;
552 if (dump_file && (dump_flags & TDF_DETAILS))
554 fprintf (dump_file, "Removed pointless exit: ");
555 print_gimple_stmt (dump_file, elt->stmt, 0, 0);
557 if (exit_edge->flags & EDGE_TRUE_VALUE)
558 gimple_cond_make_false (elt->stmt);
559 else
560 gimple_cond_make_true (elt->stmt);
561 update_stmt (elt->stmt);
562 changed = true;
565 return changed;
568 /* Stores loops that will be unlooped after we process whole loop tree. */
569 static vec<loop_p> loops_to_unloop;
570 static vec<int> loops_to_unloop_nunroll;
572 /* Cancel all fully unrolled loops by putting __builtin_unreachable
573 on the latch edge.
574 We do it after all unrolling since unlooping moves basic blocks
575 across loop boundaries trashing loop closed SSA form as well
576 as SCEV info needed to be intact during unrolling.
578 IRRED_INVALIDATED is used to bookkeep if information about
579 irreducible regions may become invalid as a result
580 of the transformation.
581 LOOP_CLOSED_SSA_INVALIDATED is used to bookkepp the case
582 when we need to go into loop closed SSA form. */
584 static void
585 unloop_loops (bitmap loop_closed_ssa_invalidated,
586 bool *irred_invalidated)
588 while (loops_to_unloop.length ())
590 struct loop *loop = loops_to_unloop.pop ();
591 int n_unroll = loops_to_unloop_nunroll.pop ();
592 basic_block latch = loop->latch;
593 edge latch_edge = loop_latch_edge (loop);
594 int flags = latch_edge->flags;
595 location_t locus = latch_edge->goto_locus;
596 gimple stmt;
597 gimple_stmt_iterator gsi;
599 remove_exits_and_undefined_stmts (loop, n_unroll);
601 /* Unloop destroys the latch edge. */
602 unloop (loop, irred_invalidated, loop_closed_ssa_invalidated);
604 /* Create new basic block for the latch edge destination and wire
605 it in. */
606 stmt = gimple_build_call (builtin_decl_implicit (BUILT_IN_UNREACHABLE), 0);
607 latch_edge = make_edge (latch, create_basic_block (NULL, NULL, latch), flags);
608 latch_edge->probability = 0;
609 latch_edge->count = 0;
610 latch_edge->flags |= flags;
611 latch_edge->goto_locus = locus;
613 latch_edge->dest->loop_father = current_loops->tree_root;
614 latch_edge->dest->count = 0;
615 latch_edge->dest->frequency = 0;
616 set_immediate_dominator (CDI_DOMINATORS, latch_edge->dest, latch_edge->src);
618 gsi = gsi_start_bb (latch_edge->dest);
619 gsi_insert_after (&gsi, stmt, GSI_NEW_STMT);
621 loops_to_unloop.release ();
622 loops_to_unloop_nunroll.release ();
625 /* Tries to unroll LOOP completely, i.e. NITER times.
626 UL determines which loops we are allowed to unroll.
627 EXIT is the exit of the loop that should be eliminated.
628 MAXITER specfy bound on number of iterations, -1 if it is
629 not known or too large for HOST_WIDE_INT. The location
630 LOCUS corresponding to the loop is used when emitting
631 a summary of the unroll to the dump file. */
633 static bool
634 try_unroll_loop_completely (struct loop *loop,
635 edge exit, tree niter,
636 enum unroll_level ul,
637 HOST_WIDE_INT maxiter,
638 location_t locus)
640 unsigned HOST_WIDE_INT n_unroll, ninsns, max_unroll, unr_insns;
641 gimple cond;
642 struct loop_size size;
643 bool n_unroll_found = false;
644 edge edge_to_cancel = NULL;
646 /* See if we proved number of iterations to be low constant.
648 EXIT is an edge that will be removed in all but last iteration of
649 the loop.
651 EDGE_TO_CACNEL is an edge that will be removed from the last iteration
652 of the unrolled sequence and is expected to make the final loop not
653 rolling.
655 If the number of execution of loop is determined by standard induction
656 variable test, then EXIT and EDGE_TO_CANCEL are the two edges leaving
657 from the iv test. */
658 if (host_integerp (niter, 1))
660 n_unroll = tree_low_cst (niter, 1);
661 n_unroll_found = true;
662 edge_to_cancel = EDGE_SUCC (exit->src, 0);
663 if (edge_to_cancel == exit)
664 edge_to_cancel = EDGE_SUCC (exit->src, 1);
666 /* We do not know the number of iterations and thus we can not eliminate
667 the EXIT edge. */
668 else
669 exit = NULL;
671 /* See if we can improve our estimate by using recorded loop bounds. */
672 if (maxiter >= 0
673 && (!n_unroll_found || (unsigned HOST_WIDE_INT)maxiter < n_unroll))
675 n_unroll = maxiter;
676 n_unroll_found = true;
677 /* Loop terminates before the IV variable test, so we can not
678 remove it in the last iteration. */
679 edge_to_cancel = NULL;
682 if (!n_unroll_found)
683 return false;
685 max_unroll = PARAM_VALUE (PARAM_MAX_COMPLETELY_PEEL_TIMES);
686 if (n_unroll > max_unroll)
687 return false;
689 if (!edge_to_cancel)
690 edge_to_cancel = loop_edge_to_cancel (loop);
692 if (n_unroll)
694 sbitmap wont_exit;
695 edge e;
696 unsigned i;
697 bool large;
698 vec<edge> to_remove = vNULL;
699 if (ul == UL_SINGLE_ITER)
700 return false;
702 large = tree_estimate_loop_size
703 (loop, exit, edge_to_cancel, &size,
704 PARAM_VALUE (PARAM_MAX_COMPLETELY_PEELED_INSNS));
705 ninsns = size.overall;
706 if (large)
708 if (dump_file && (dump_flags & TDF_DETAILS))
709 fprintf (dump_file, "Not unrolling loop %d: it is too large.\n",
710 loop->num);
711 return false;
714 unr_insns = estimated_unrolled_size (&size, n_unroll);
715 if (dump_file && (dump_flags & TDF_DETAILS))
717 fprintf (dump_file, " Loop size: %d\n", (int) ninsns);
718 fprintf (dump_file, " Estimated size after unrolling: %d\n",
719 (int) unr_insns);
722 /* If the code is going to shrink, we don't need to be extra cautious
723 on guessing if the unrolling is going to be profitable. */
724 if (unr_insns
725 /* If there is IV variable that will become constant, we save
726 one instruction in the loop prologue we do not account
727 otherwise. */
728 <= ninsns + (size.constant_iv != false))
730 /* We unroll only inner loops, because we do not consider it profitable
731 otheriwse. We still can cancel loopback edge of not rolling loop;
732 this is always a good idea. */
733 else if (ul == UL_NO_GROWTH)
735 if (dump_file && (dump_flags & TDF_DETAILS))
736 fprintf (dump_file, "Not unrolling loop %d: size would grow.\n",
737 loop->num);
738 return false;
740 /* Outer loops tend to be less interesting candidates for complette
741 unrolling unless we can do a lot of propagation into the inner loop
742 body. For now we disable outer loop unrolling when the code would
743 grow. */
744 else if (loop->inner)
746 if (dump_file && (dump_flags & TDF_DETAILS))
747 fprintf (dump_file, "Not unrolling loop %d: "
748 "it is not innermost and code would grow.\n",
749 loop->num);
750 return false;
752 /* If there is call on a hot path through the loop, then
753 there is most probably not much to optimize. */
754 else if (size.num_non_pure_calls_on_hot_path)
756 if (dump_file && (dump_flags & TDF_DETAILS))
757 fprintf (dump_file, "Not unrolling loop %d: "
758 "contains call and code would grow.\n",
759 loop->num);
760 return false;
762 /* If there is pure/const call in the function, then we
763 can still optimize the unrolled loop body if it contains
764 some other interesting code than the calls and code
765 storing or cumulating the return value. */
766 else if (size.num_pure_calls_on_hot_path
767 /* One IV increment, one test, one ivtmp store
768 and one useful stmt. That is about minimal loop
769 doing pure call. */
770 && (size.non_call_stmts_on_hot_path
771 <= 3 + size.num_pure_calls_on_hot_path))
773 if (dump_file && (dump_flags & TDF_DETAILS))
774 fprintf (dump_file, "Not unrolling loop %d: "
775 "contains just pure calls and code would grow.\n",
776 loop->num);
777 return false;
779 /* Complette unrolling is major win when control flow is removed and
780 one big basic block is created. If the loop contains control flow
781 the optimization may still be a win because of eliminating the loop
782 overhead but it also may blow the branch predictor tables.
783 Limit number of branches on the hot path through the peeled
784 sequence. */
785 else if (size.num_branches_on_hot_path * (int)n_unroll
786 > PARAM_VALUE (PARAM_MAX_PEEL_BRANCHES))
788 if (dump_file && (dump_flags & TDF_DETAILS))
789 fprintf (dump_file, "Not unrolling loop %d: "
790 " number of branches on hot path in the unrolled sequence"
791 " reach --param max-peel-branches limit.\n",
792 loop->num);
793 return false;
795 else if (unr_insns
796 > (unsigned) PARAM_VALUE (PARAM_MAX_COMPLETELY_PEELED_INSNS))
798 if (dump_file && (dump_flags & TDF_DETAILS))
799 fprintf (dump_file, "Not unrolling loop %d: "
800 "(--param max-completely-peeled-insns limit reached).\n",
801 loop->num);
802 return false;
805 initialize_original_copy_tables ();
806 wont_exit = sbitmap_alloc (n_unroll + 1);
807 bitmap_ones (wont_exit);
808 bitmap_clear_bit (wont_exit, 0);
810 if (!gimple_duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
811 n_unroll, wont_exit,
812 exit, &to_remove,
813 DLTHE_FLAG_UPDATE_FREQ
814 | DLTHE_FLAG_COMPLETTE_PEEL))
816 free_original_copy_tables ();
817 free (wont_exit);
818 if (dump_file && (dump_flags & TDF_DETAILS))
819 fprintf (dump_file, "Failed to duplicate the loop\n");
820 return false;
823 FOR_EACH_VEC_ELT (to_remove, i, e)
825 bool ok = remove_path (e);
826 gcc_assert (ok);
829 to_remove.release ();
830 free (wont_exit);
831 free_original_copy_tables ();
835 /* Remove the conditional from the last copy of the loop. */
836 if (edge_to_cancel)
838 cond = last_stmt (edge_to_cancel->src);
839 if (edge_to_cancel->flags & EDGE_TRUE_VALUE)
840 gimple_cond_make_false (cond);
841 else
842 gimple_cond_make_true (cond);
843 update_stmt (cond);
844 /* Do not remove the path. Doing so may remove outer loop
845 and confuse bookkeeping code in tree_unroll_loops_completelly. */
848 /* Store the loop for later unlooping and exit removal. */
849 loops_to_unloop.safe_push (loop);
850 loops_to_unloop_nunroll.safe_push (n_unroll);
852 if (dump_enabled_p ())
854 if (!n_unroll)
855 dump_printf_loc (MSG_OPTIMIZED_LOCATIONS | TDF_DETAILS, locus,
856 "loop turned into non-loop; it never loops\n");
857 else
859 dump_printf_loc (MSG_OPTIMIZED_LOCATIONS | TDF_DETAILS, locus,
860 "loop with %d iterations completely unrolled",
861 (int) (n_unroll + 1));
862 if (profile_info)
863 dump_printf (MSG_OPTIMIZED_LOCATIONS | TDF_DETAILS,
864 " (header execution count %d)",
865 (int)loop->header->count);
866 dump_printf (MSG_OPTIMIZED_LOCATIONS | TDF_DETAILS, "\n");
870 if (dump_file && (dump_flags & TDF_DETAILS))
872 if (exit)
873 fprintf (dump_file, "Exit condition of peeled iterations was "
874 "eliminated.\n");
875 if (edge_to_cancel)
876 fprintf (dump_file, "Last iteration exit edge was proved true.\n");
877 else
878 fprintf (dump_file, "Latch of last iteration was marked by "
879 "__builtin_unreachable ().\n");
882 return true;
885 /* Adds a canonical induction variable to LOOP if suitable.
886 CREATE_IV is true if we may create a new iv. UL determines
887 which loops we are allowed to completely unroll. If TRY_EVAL is true, we try
888 to determine the number of iterations of a loop by direct evaluation.
889 Returns true if cfg is changed. */
891 static bool
892 canonicalize_loop_induction_variables (struct loop *loop,
893 bool create_iv, enum unroll_level ul,
894 bool try_eval)
896 edge exit = NULL;
897 tree niter;
898 HOST_WIDE_INT maxiter;
899 bool modified = false;
900 location_t locus = UNKNOWN_LOCATION;
902 niter = number_of_latch_executions (loop);
903 exit = single_exit (loop);
904 if (TREE_CODE (niter) == INTEGER_CST)
905 locus = gimple_location (last_stmt (exit->src));
906 else
908 /* If the loop has more than one exit, try checking all of them
909 for # of iterations determinable through scev. */
910 if (!exit)
911 niter = find_loop_niter (loop, &exit);
913 /* Finally if everything else fails, try brute force evaluation. */
914 if (try_eval
915 && (chrec_contains_undetermined (niter)
916 || TREE_CODE (niter) != INTEGER_CST))
917 niter = find_loop_niter_by_eval (loop, &exit);
919 if (exit)
920 locus = gimple_location (last_stmt (exit->src));
922 if (TREE_CODE (niter) != INTEGER_CST)
923 exit = NULL;
926 /* We work exceptionally hard here to estimate the bound
927 by find_loop_niter_by_eval. Be sure to keep it for future. */
928 if (niter && TREE_CODE (niter) == INTEGER_CST)
930 record_niter_bound (loop, tree_to_double_int (niter),
931 exit == single_likely_exit (loop), true);
934 /* Force re-computation of loop bounds so we can remove redundant exits. */
935 maxiter = max_loop_iterations_int (loop);
937 if (dump_file && (dump_flags & TDF_DETAILS)
938 && TREE_CODE (niter) == INTEGER_CST)
940 fprintf (dump_file, "Loop %d iterates ", loop->num);
941 print_generic_expr (dump_file, niter, TDF_SLIM);
942 fprintf (dump_file, " times.\n");
944 if (dump_file && (dump_flags & TDF_DETAILS)
945 && maxiter >= 0)
947 fprintf (dump_file, "Loop %d iterates at most %i times.\n", loop->num,
948 (int)maxiter);
951 /* Remove exits that are known to be never taken based on loop bound.
952 Needs to be called after compilation of max_loop_iterations_int that
953 populates the loop bounds. */
954 modified |= remove_redundant_iv_tests (loop);
956 if (try_unroll_loop_completely (loop, exit, niter, ul, maxiter, locus))
957 return true;
959 if (create_iv
960 && niter && !chrec_contains_undetermined (niter)
961 && exit && just_once_each_iteration_p (loop, exit->src))
962 create_canonical_iv (loop, exit, niter);
964 return modified;
967 /* The main entry point of the pass. Adds canonical induction variables
968 to the suitable loops. */
970 unsigned int
971 canonicalize_induction_variables (void)
973 loop_iterator li;
974 struct loop *loop;
975 bool changed = false;
976 bool irred_invalidated = false;
977 bitmap loop_closed_ssa_invalidated = BITMAP_ALLOC (NULL);
979 free_numbers_of_iterations_estimates ();
980 estimate_numbers_of_iterations ();
982 FOR_EACH_LOOP (li, loop, LI_FROM_INNERMOST)
984 changed |= canonicalize_loop_induction_variables (loop,
985 true, UL_SINGLE_ITER,
986 true);
988 gcc_assert (!need_ssa_update_p (cfun));
990 unloop_loops (loop_closed_ssa_invalidated, &irred_invalidated);
991 if (irred_invalidated
992 && loops_state_satisfies_p (LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS))
993 mark_irreducible_loops ();
995 /* Clean up the information about numbers of iterations, since brute force
996 evaluation could reveal new information. */
997 scev_reset ();
999 if (!bitmap_empty_p (loop_closed_ssa_invalidated))
1001 gcc_checking_assert (loops_state_satisfies_p (LOOP_CLOSED_SSA));
1002 rewrite_into_loop_closed_ssa (NULL, TODO_update_ssa);
1004 BITMAP_FREE (loop_closed_ssa_invalidated);
1006 if (changed)
1007 return TODO_cleanup_cfg;
1008 return 0;
1011 /* Propagate VAL into all uses of SSA_NAME. */
1013 static void
1014 propagate_into_all_uses (tree ssa_name, tree val)
1016 imm_use_iterator iter;
1017 gimple use_stmt;
1019 FOR_EACH_IMM_USE_STMT (use_stmt, iter, ssa_name)
1021 gimple_stmt_iterator use_stmt_gsi = gsi_for_stmt (use_stmt);
1022 use_operand_p use;
1024 FOR_EACH_IMM_USE_ON_STMT (use, iter)
1025 SET_USE (use, val);
1027 if (is_gimple_assign (use_stmt)
1028 && get_gimple_rhs_class (gimple_assign_rhs_code (use_stmt))
1029 == GIMPLE_SINGLE_RHS)
1031 tree rhs = gimple_assign_rhs1 (use_stmt);
1033 if (TREE_CODE (rhs) == ADDR_EXPR)
1034 recompute_tree_invariant_for_addr_expr (rhs);
1037 fold_stmt_inplace (&use_stmt_gsi);
1038 update_stmt (use_stmt);
1039 maybe_clean_or_replace_eh_stmt (use_stmt, use_stmt);
1043 /* Propagate constant SSA_NAMEs defined in basic block BB. */
1045 static void
1046 propagate_constants_for_unrolling (basic_block bb)
1048 gimple_stmt_iterator gsi;
1050 /* Look for degenerate PHI nodes with constant argument. */
1051 for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); )
1053 gimple phi = gsi_stmt (gsi);
1054 tree result = gimple_phi_result (phi);
1055 tree arg = gimple_phi_arg_def (phi, 0);
1057 if (gimple_phi_num_args (phi) == 1 && TREE_CODE (arg) == INTEGER_CST)
1059 propagate_into_all_uses (result, arg);
1060 gsi_remove (&gsi, true);
1061 release_ssa_name (result);
1063 else
1064 gsi_next (&gsi);
1067 /* Look for assignments to SSA names with constant RHS. */
1068 for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); )
1070 gimple stmt = gsi_stmt (gsi);
1071 tree lhs;
1073 if (is_gimple_assign (stmt)
1074 && gimple_assign_rhs_code (stmt) == INTEGER_CST
1075 && (lhs = gimple_assign_lhs (stmt), TREE_CODE (lhs) == SSA_NAME)
1076 && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
1078 propagate_into_all_uses (lhs, gimple_assign_rhs1 (stmt));
1079 gsi_remove (&gsi, true);
1080 release_ssa_name (lhs);
1082 else
1083 gsi_next (&gsi);
1087 /* Process loops from innermost to outer, stopping at the innermost
1088 loop we unrolled. */
1090 static bool
1091 tree_unroll_loops_completely_1 (bool may_increase_size, bool unroll_outer,
1092 vec<loop_p, va_stack>& father_stack,
1093 struct loop *loop)
1095 struct loop *loop_father;
1096 bool changed = false;
1097 struct loop *inner;
1098 enum unroll_level ul;
1100 /* Process inner loops first. */
1101 for (inner = loop->inner; inner != NULL; inner = inner->next)
1102 changed |= tree_unroll_loops_completely_1 (may_increase_size,
1103 unroll_outer, father_stack,
1104 inner);
1106 /* If we changed an inner loop we cannot process outer loops in this
1107 iteration because SSA form is not up-to-date. Continue with
1108 siblings of outer loops instead. */
1109 if (changed)
1110 return true;
1112 /* Don't unroll #pragma omp simd loops until the vectorizer
1113 attempts to vectorize those. */
1114 if (loop->force_vect)
1115 return false;
1117 /* Try to unroll this loop. */
1118 loop_father = loop_outer (loop);
1119 if (!loop_father)
1120 return false;
1122 if (may_increase_size && optimize_loop_nest_for_speed_p (loop)
1123 /* Unroll outermost loops only if asked to do so or they do
1124 not cause code growth. */
1125 && (unroll_outer || loop_outer (loop_father)))
1126 ul = UL_ALL;
1127 else
1128 ul = UL_NO_GROWTH;
1130 if (canonicalize_loop_induction_variables
1131 (loop, false, ul, !flag_tree_loop_ivcanon))
1133 /* If we'll continue unrolling, we need to propagate constants
1134 within the new basic blocks to fold away induction variable
1135 computations; otherwise, the size might blow up before the
1136 iteration is complete and the IR eventually cleaned up. */
1137 if (loop_outer (loop_father) && !loop_father->aux)
1139 father_stack.safe_push (loop_father);
1140 loop_father->aux = loop_father;
1143 return true;
1146 return false;
1149 /* Unroll LOOPS completely if they iterate just few times. Unless
1150 MAY_INCREASE_SIZE is true, perform the unrolling only if the
1151 size of the code does not increase. */
1153 unsigned int
1154 tree_unroll_loops_completely (bool may_increase_size, bool unroll_outer)
1156 vec<loop_p, va_stack> father_stack;
1157 bool changed;
1158 int iteration = 0;
1159 bool irred_invalidated = false;
1161 vec_stack_alloc (loop_p, father_stack, 16);
1164 changed = false;
1165 bitmap loop_closed_ssa_invalidated = NULL;
1167 if (loops_state_satisfies_p (LOOP_CLOSED_SSA))
1168 loop_closed_ssa_invalidated = BITMAP_ALLOC (NULL);
1170 free_numbers_of_iterations_estimates ();
1171 estimate_numbers_of_iterations ();
1173 changed = tree_unroll_loops_completely_1 (may_increase_size,
1174 unroll_outer, father_stack,
1175 current_loops->tree_root);
1176 if (changed)
1178 struct loop **iter;
1179 unsigned i;
1181 /* Be sure to skip unlooped loops while procesing father_stack
1182 array. */
1183 FOR_EACH_VEC_ELT (loops_to_unloop, i, iter)
1184 (*iter)->aux = NULL;
1185 FOR_EACH_VEC_ELT (father_stack, i, iter)
1186 if (!(*iter)->aux)
1187 *iter = NULL;
1188 unloop_loops (loop_closed_ssa_invalidated, &irred_invalidated);
1190 /* We can not use TODO_update_ssa_no_phi because VOPS gets confused. */
1191 if (loop_closed_ssa_invalidated
1192 && !bitmap_empty_p (loop_closed_ssa_invalidated))
1193 rewrite_into_loop_closed_ssa (loop_closed_ssa_invalidated,
1194 TODO_update_ssa);
1195 else
1196 update_ssa (TODO_update_ssa);
1198 /* Propagate the constants within the new basic blocks. */
1199 FOR_EACH_VEC_ELT (father_stack, i, iter)
1200 if (*iter)
1202 unsigned j;
1203 basic_block *body = get_loop_body_in_dom_order (*iter);
1204 for (j = 0; j < (*iter)->num_nodes; j++)
1205 propagate_constants_for_unrolling (body[j]);
1206 free (body);
1207 (*iter)->aux = NULL;
1209 father_stack.truncate (0);
1211 /* This will take care of removing completely unrolled loops
1212 from the loop structures so we can continue unrolling now
1213 innermost loops. */
1214 if (cleanup_tree_cfg ())
1215 update_ssa (TODO_update_ssa_only_virtuals);
1217 /* Clean up the information about numbers of iterations, since
1218 complete unrolling might have invalidated it. */
1219 scev_reset ();
1220 #ifdef ENABLE_CHECKING
1221 if (loops_state_satisfies_p (LOOP_CLOSED_SSA))
1222 verify_loop_closed_ssa (true);
1223 #endif
1225 if (loop_closed_ssa_invalidated)
1226 BITMAP_FREE (loop_closed_ssa_invalidated);
1228 while (changed
1229 && ++iteration <= PARAM_VALUE (PARAM_MAX_UNROLL_ITERATIONS));
1231 father_stack.release ();
1233 if (irred_invalidated
1234 && loops_state_satisfies_p (LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS))
1235 mark_irreducible_loops ();
1237 return 0;
1240 /* Canonical induction variable creation pass. */
1242 static unsigned int
1243 tree_ssa_loop_ivcanon (void)
1245 if (number_of_loops (cfun) <= 1)
1246 return 0;
1248 return canonicalize_induction_variables ();
1251 static bool
1252 gate_tree_ssa_loop_ivcanon (void)
1254 return flag_tree_loop_ivcanon != 0;
1257 namespace {
1259 const pass_data pass_data_iv_canon =
1261 GIMPLE_PASS, /* type */
1262 "ivcanon", /* name */
1263 OPTGROUP_LOOP, /* optinfo_flags */
1264 true, /* has_gate */
1265 true, /* has_execute */
1266 TV_TREE_LOOP_IVCANON, /* tv_id */
1267 ( PROP_cfg | PROP_ssa ), /* properties_required */
1268 0, /* properties_provided */
1269 0, /* properties_destroyed */
1270 0, /* todo_flags_start */
1271 0, /* todo_flags_finish */
1274 class pass_iv_canon : public gimple_opt_pass
1276 public:
1277 pass_iv_canon (gcc::context *ctxt)
1278 : gimple_opt_pass (pass_data_iv_canon, ctxt)
1281 /* opt_pass methods: */
1282 bool gate () { return gate_tree_ssa_loop_ivcanon (); }
1283 unsigned int execute () { return tree_ssa_loop_ivcanon (); }
1285 }; // class pass_iv_canon
1287 } // anon namespace
1289 gimple_opt_pass *
1290 make_pass_iv_canon (gcc::context *ctxt)
1292 return new pass_iv_canon (ctxt);
1295 /* Complete unrolling of loops. */
1297 static unsigned int
1298 tree_complete_unroll (void)
1300 if (number_of_loops (cfun) <= 1)
1301 return 0;
1303 return tree_unroll_loops_completely (flag_unroll_loops
1304 || flag_peel_loops
1305 || optimize >= 3, true);
1308 static bool
1309 gate_tree_complete_unroll (void)
1311 return true;
1314 namespace {
1316 const pass_data pass_data_complete_unroll =
1318 GIMPLE_PASS, /* type */
1319 "cunroll", /* name */
1320 OPTGROUP_LOOP, /* optinfo_flags */
1321 true, /* has_gate */
1322 true, /* has_execute */
1323 TV_COMPLETE_UNROLL, /* tv_id */
1324 ( PROP_cfg | PROP_ssa ), /* properties_required */
1325 0, /* properties_provided */
1326 0, /* properties_destroyed */
1327 0, /* todo_flags_start */
1328 0, /* todo_flags_finish */
1331 class pass_complete_unroll : public gimple_opt_pass
1333 public:
1334 pass_complete_unroll (gcc::context *ctxt)
1335 : gimple_opt_pass (pass_data_complete_unroll, ctxt)
1338 /* opt_pass methods: */
1339 bool gate () { return gate_tree_complete_unroll (); }
1340 unsigned int execute () { return tree_complete_unroll (); }
1342 }; // class pass_complete_unroll
1344 } // anon namespace
1346 gimple_opt_pass *
1347 make_pass_complete_unroll (gcc::context *ctxt)
1349 return new pass_complete_unroll (ctxt);
1352 /* Complete unrolling of inner loops. */
1354 static unsigned int
1355 tree_complete_unroll_inner (void)
1357 unsigned ret = 0;
1359 loop_optimizer_init (LOOPS_NORMAL
1360 | LOOPS_HAVE_RECORDED_EXITS);
1361 if (number_of_loops (cfun) > 1)
1363 scev_initialize ();
1364 ret = tree_unroll_loops_completely (optimize >= 3, false);
1365 free_numbers_of_iterations_estimates ();
1366 scev_finalize ();
1368 loop_optimizer_finalize ();
1370 return ret;
1373 static bool
1374 gate_tree_complete_unroll_inner (void)
1376 return optimize >= 2;
1379 namespace {
1381 const pass_data pass_data_complete_unrolli =
1383 GIMPLE_PASS, /* type */
1384 "cunrolli", /* name */
1385 OPTGROUP_LOOP, /* optinfo_flags */
1386 true, /* has_gate */
1387 true, /* has_execute */
1388 TV_COMPLETE_UNROLL, /* tv_id */
1389 ( PROP_cfg | PROP_ssa ), /* properties_required */
1390 0, /* properties_provided */
1391 0, /* properties_destroyed */
1392 0, /* todo_flags_start */
1393 TODO_verify_flow, /* todo_flags_finish */
1396 class pass_complete_unrolli : public gimple_opt_pass
1398 public:
1399 pass_complete_unrolli (gcc::context *ctxt)
1400 : gimple_opt_pass (pass_data_complete_unrolli, ctxt)
1403 /* opt_pass methods: */
1404 bool gate () { return gate_tree_complete_unroll_inner (); }
1405 unsigned int execute () { return tree_complete_unroll_inner (); }
1407 }; // class pass_complete_unrolli
1409 } // anon namespace
1411 gimple_opt_pass *
1412 make_pass_complete_unrolli (gcc::context *ctxt)
1414 return new pass_complete_unrolli (ctxt);