2015-05-05 Yvan Roux <yvan.roux@linaro.org>
[official-gcc.git] / gcc / tree-vectorizer.c
blobe216114fb608f53e4e775ad159aab8077f15f579
1 /* Vectorizer
2 Copyright (C) 2003-2015 Free Software Foundation, Inc.
3 Contributed by Dorit Naishlos <dorit@il.ibm.com>
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 3, or (at your option) any later
10 version.
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
21 /* Loop and basic block vectorizer.
23 This file contains drivers for the three vectorizers:
24 (1) loop vectorizer (inter-iteration parallelism),
25 (2) loop-aware SLP (intra-iteration parallelism) (invoked by the loop
26 vectorizer)
27 (3) BB vectorizer (out-of-loops), aka SLP
29 The rest of the vectorizer's code is organized as follows:
30 - tree-vect-loop.c - loop specific parts such as reductions, etc. These are
31 used by drivers (1) and (2).
32 - tree-vect-loop-manip.c - vectorizer's loop control-flow utilities, used by
33 drivers (1) and (2).
34 - tree-vect-slp.c - BB vectorization specific analysis and transformation,
35 used by drivers (2) and (3).
36 - tree-vect-stmts.c - statements analysis and transformation (used by all).
37 - tree-vect-data-refs.c - vectorizer specific data-refs analysis and
38 manipulations (used by all).
39 - tree-vect-patterns.c - vectorizable code patterns detector (used by all)
41 Here's a poor attempt at illustrating that:
43 tree-vectorizer.c:
44 loop_vect() loop_aware_slp() slp_vect()
45 | / \ /
46 | / \ /
47 tree-vect-loop.c tree-vect-slp.c
48 | \ \ / / |
49 | \ \/ / |
50 | \ /\ / |
51 | \ / \ / |
52 tree-vect-stmts.c tree-vect-data-refs.c
53 \ /
54 tree-vect-patterns.c
57 #include "config.h"
58 #include "system.h"
59 #include "coretypes.h"
60 #include "dumpfile.h"
61 #include "tm.h"
62 #include "hash-set.h"
63 #include "machmode.h"
64 #include "vec.h"
65 #include "double-int.h"
66 #include "input.h"
67 #include "alias.h"
68 #include "symtab.h"
69 #include "wide-int.h"
70 #include "inchash.h"
71 #include "tree.h"
72 #include "fold-const.h"
73 #include "stor-layout.h"
74 #include "tree-pretty-print.h"
75 #include "predict.h"
76 #include "hard-reg-set.h"
77 #include "input.h"
78 #include "function.h"
79 #include "dominance.h"
80 #include "cfg.h"
81 #include "basic-block.h"
82 #include "tree-ssa-alias.h"
83 #include "internal-fn.h"
84 #include "gimple-expr.h"
85 #include "is-a.h"
86 #include "gimple.h"
87 #include "gimple-iterator.h"
88 #include "gimple-walk.h"
89 #include "gimple-ssa.h"
90 #include "hash-map.h"
91 #include "plugin-api.h"
92 #include "ipa-ref.h"
93 #include "cgraph.h"
94 #include "tree-phinodes.h"
95 #include "ssa-iterators.h"
96 #include "tree-ssa-loop-manip.h"
97 #include "tree-cfg.h"
98 #include "cfgloop.h"
99 #include "tree-vectorizer.h"
100 #include "tree-pass.h"
101 #include "tree-ssa-propagate.h"
102 #include "dbgcnt.h"
103 #include "gimple-fold.h"
104 #include "tree-scalar-evolution.h"
107 /* Loop or bb location. */
108 source_location vect_location;
110 /* Vector mapping GIMPLE stmt to stmt_vec_info. */
111 vec<vec_void_p> stmt_vec_info_vec;
113 /* For mapping simduid to vectorization factor. */
115 struct simduid_to_vf : typed_free_remove<simduid_to_vf>
117 unsigned int simduid;
118 int vf;
120 /* hash_table support. */
121 typedef simduid_to_vf *value_type;
122 typedef simduid_to_vf *compare_type;
123 static inline hashval_t hash (const simduid_to_vf *);
124 static inline int equal (const simduid_to_vf *, const simduid_to_vf *);
127 inline hashval_t
128 simduid_to_vf::hash (const simduid_to_vf *p)
130 return p->simduid;
133 inline int
134 simduid_to_vf::equal (const simduid_to_vf *p1, const simduid_to_vf *p2)
136 return p1->simduid == p2->simduid;
139 /* This hash maps the OMP simd array to the corresponding simduid used
140 to index into it. Like thus,
142 _7 = GOMP_SIMD_LANE (simduid.0)
145 D.1737[_7] = stuff;
148 This hash maps from the OMP simd array (D.1737[]) to DECL_UID of
149 simduid.0. */
151 struct simd_array_to_simduid : typed_free_remove<simd_array_to_simduid>
153 tree decl;
154 unsigned int simduid;
156 /* hash_table support. */
157 typedef simd_array_to_simduid *value_type;
158 typedef simd_array_to_simduid *compare_type;
159 static inline hashval_t hash (const simd_array_to_simduid *);
160 static inline int equal (const simd_array_to_simduid *,
161 const simd_array_to_simduid *);
164 inline hashval_t
165 simd_array_to_simduid::hash (const simd_array_to_simduid *p)
167 return DECL_UID (p->decl);
170 inline int
171 simd_array_to_simduid::equal (const simd_array_to_simduid *p1,
172 const simd_array_to_simduid *p2)
174 return p1->decl == p2->decl;
177 /* Fold IFN_GOMP_SIMD_LANE, IFN_GOMP_SIMD_VF and IFN_GOMP_SIMD_LAST_LANE
178 into their corresponding constants. */
180 static void
181 adjust_simduid_builtins (hash_table<simduid_to_vf> **htab)
183 basic_block bb;
185 FOR_EACH_BB_FN (bb, cfun)
187 gimple_stmt_iterator i;
189 for (i = gsi_start_bb (bb); !gsi_end_p (i); gsi_next (&i))
191 unsigned int vf = 1;
192 enum internal_fn ifn;
193 gimple stmt = gsi_stmt (i);
194 tree t;
195 if (!is_gimple_call (stmt)
196 || !gimple_call_internal_p (stmt))
197 continue;
198 ifn = gimple_call_internal_fn (stmt);
199 switch (ifn)
201 case IFN_GOMP_SIMD_LANE:
202 case IFN_GOMP_SIMD_VF:
203 case IFN_GOMP_SIMD_LAST_LANE:
204 break;
205 default:
206 continue;
208 tree arg = gimple_call_arg (stmt, 0);
209 gcc_assert (arg != NULL_TREE);
210 gcc_assert (TREE_CODE (arg) == SSA_NAME);
211 simduid_to_vf *p = NULL, data;
212 data.simduid = DECL_UID (SSA_NAME_VAR (arg));
213 if (*htab)
214 p = (*htab)->find (&data);
215 if (p)
216 vf = p->vf;
217 switch (ifn)
219 case IFN_GOMP_SIMD_VF:
220 t = build_int_cst (unsigned_type_node, vf);
221 break;
222 case IFN_GOMP_SIMD_LANE:
223 t = build_int_cst (unsigned_type_node, 0);
224 break;
225 case IFN_GOMP_SIMD_LAST_LANE:
226 t = gimple_call_arg (stmt, 1);
227 break;
228 default:
229 gcc_unreachable ();
231 update_call_from_tree (&i, t);
236 /* Helper structure for note_simd_array_uses. */
238 struct note_simd_array_uses_struct
240 hash_table<simd_array_to_simduid> **htab;
241 unsigned int simduid;
244 /* Callback for note_simd_array_uses, called through walk_gimple_op. */
246 static tree
247 note_simd_array_uses_cb (tree *tp, int *walk_subtrees, void *data)
249 struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
250 struct note_simd_array_uses_struct *ns
251 = (struct note_simd_array_uses_struct *) wi->info;
253 if (TYPE_P (*tp))
254 *walk_subtrees = 0;
255 else if (VAR_P (*tp)
256 && lookup_attribute ("omp simd array", DECL_ATTRIBUTES (*tp))
257 && DECL_CONTEXT (*tp) == current_function_decl)
259 simd_array_to_simduid data;
260 if (!*ns->htab)
261 *ns->htab = new hash_table<simd_array_to_simduid> (15);
262 data.decl = *tp;
263 data.simduid = ns->simduid;
264 simd_array_to_simduid **slot = (*ns->htab)->find_slot (&data, INSERT);
265 if (*slot == NULL)
267 simd_array_to_simduid *p = XNEW (simd_array_to_simduid);
268 *p = data;
269 *slot = p;
271 else if ((*slot)->simduid != ns->simduid)
272 (*slot)->simduid = -1U;
273 *walk_subtrees = 0;
275 return NULL_TREE;
278 /* Find "omp simd array" temporaries and map them to corresponding
279 simduid. */
281 static void
282 note_simd_array_uses (hash_table<simd_array_to_simduid> **htab)
284 basic_block bb;
285 gimple_stmt_iterator gsi;
286 struct walk_stmt_info wi;
287 struct note_simd_array_uses_struct ns;
289 memset (&wi, 0, sizeof (wi));
290 wi.info = &ns;
291 ns.htab = htab;
293 FOR_EACH_BB_FN (bb, cfun)
294 for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
296 gimple stmt = gsi_stmt (gsi);
297 if (!is_gimple_call (stmt) || !gimple_call_internal_p (stmt))
298 continue;
299 switch (gimple_call_internal_fn (stmt))
301 case IFN_GOMP_SIMD_LANE:
302 case IFN_GOMP_SIMD_VF:
303 case IFN_GOMP_SIMD_LAST_LANE:
304 break;
305 default:
306 continue;
308 tree lhs = gimple_call_lhs (stmt);
309 if (lhs == NULL_TREE)
310 continue;
311 imm_use_iterator use_iter;
312 gimple use_stmt;
313 ns.simduid = DECL_UID (SSA_NAME_VAR (gimple_call_arg (stmt, 0)));
314 FOR_EACH_IMM_USE_STMT (use_stmt, use_iter, lhs)
315 if (!is_gimple_debug (use_stmt))
316 walk_gimple_op (use_stmt, note_simd_array_uses_cb, &wi);
320 /* A helper function to free data refs. */
322 void
323 vect_destroy_datarefs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo)
325 vec<data_reference_p> datarefs;
326 struct data_reference *dr;
327 unsigned int i;
329 if (loop_vinfo)
330 datarefs = LOOP_VINFO_DATAREFS (loop_vinfo);
331 else
332 datarefs = BB_VINFO_DATAREFS (bb_vinfo);
334 FOR_EACH_VEC_ELT (datarefs, i, dr)
335 if (dr->aux)
337 free (dr->aux);
338 dr->aux = NULL;
341 free_data_refs (datarefs);
345 /* If LOOP has been versioned during ifcvt, return the internal call
346 guarding it. */
348 static gimple
349 vect_loop_vectorized_call (struct loop *loop)
351 basic_block bb = loop_preheader_edge (loop)->src;
352 gimple g;
355 g = last_stmt (bb);
356 if (g)
357 break;
358 if (!single_pred_p (bb))
359 break;
360 bb = single_pred (bb);
362 while (1);
363 if (g && gimple_code (g) == GIMPLE_COND)
365 gimple_stmt_iterator gsi = gsi_for_stmt (g);
366 gsi_prev (&gsi);
367 if (!gsi_end_p (gsi))
369 g = gsi_stmt (gsi);
370 if (is_gimple_call (g)
371 && gimple_call_internal_p (g)
372 && gimple_call_internal_fn (g) == IFN_LOOP_VECTORIZED
373 && (tree_to_shwi (gimple_call_arg (g, 0)) == loop->num
374 || tree_to_shwi (gimple_call_arg (g, 1)) == loop->num))
375 return g;
378 return NULL;
381 /* Fold LOOP_VECTORIZED internal call G to VALUE and
382 update any immediate uses of it's LHS. */
384 static void
385 fold_loop_vectorized_call (gimple g, tree value)
387 tree lhs = gimple_call_lhs (g);
388 use_operand_p use_p;
389 imm_use_iterator iter;
390 gimple use_stmt;
391 gimple_stmt_iterator gsi = gsi_for_stmt (g);
393 update_call_from_tree (&gsi, value);
394 FOR_EACH_IMM_USE_STMT (use_stmt, iter, lhs)
396 FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
397 SET_USE (use_p, value);
398 update_stmt (use_stmt);
401 /* Set the uids of all the statements in basic blocks inside loop
402 represented by LOOP_VINFO. LOOP_VECTORIZED_CALL is the internal
403 call guarding the loop which has been if converted. */
404 static void
405 set_uid_loop_bbs (loop_vec_info loop_vinfo, gimple loop_vectorized_call)
407 tree arg = gimple_call_arg (loop_vectorized_call, 1);
408 basic_block *bbs;
409 unsigned int i;
410 struct loop *scalar_loop = get_loop (cfun, tree_to_shwi (arg));
412 LOOP_VINFO_SCALAR_LOOP (loop_vinfo) = scalar_loop;
413 gcc_checking_assert (vect_loop_vectorized_call
414 (LOOP_VINFO_SCALAR_LOOP (loop_vinfo))
415 == loop_vectorized_call);
416 bbs = get_loop_body (scalar_loop);
417 for (i = 0; i < scalar_loop->num_nodes; i++)
419 basic_block bb = bbs[i];
420 gimple_stmt_iterator gsi;
421 for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
423 gimple phi = gsi_stmt (gsi);
424 gimple_set_uid (phi, 0);
426 for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
428 gimple stmt = gsi_stmt (gsi);
429 gimple_set_uid (stmt, 0);
432 free (bbs);
435 /* Function vectorize_loops.
437 Entry point to loop vectorization phase. */
439 unsigned
440 vectorize_loops (void)
442 unsigned int i;
443 unsigned int num_vectorized_loops = 0;
444 unsigned int vect_loops_num;
445 struct loop *loop;
446 hash_table<simduid_to_vf> *simduid_to_vf_htab = NULL;
447 hash_table<simd_array_to_simduid> *simd_array_to_simduid_htab = NULL;
448 bool any_ifcvt_loops = false;
449 unsigned ret = 0;
451 vect_loops_num = number_of_loops (cfun);
453 /* Bail out if there are no loops. */
454 if (vect_loops_num <= 1)
456 if (cfun->has_simduid_loops)
457 adjust_simduid_builtins (&simduid_to_vf_htab);
458 return 0;
461 if (cfun->has_simduid_loops)
462 note_simd_array_uses (&simd_array_to_simduid_htab);
464 init_stmt_vec_info_vec ();
466 /* ----------- Analyze loops. ----------- */
468 /* If some loop was duplicated, it gets bigger number
469 than all previously defined loops. This fact allows us to run
470 only over initial loops skipping newly generated ones. */
471 FOR_EACH_LOOP (loop, 0)
472 if (loop->dont_vectorize)
473 any_ifcvt_loops = true;
474 else if ((flag_tree_loop_vectorize
475 && optimize_loop_nest_for_speed_p (loop))
476 || loop->force_vectorize)
478 loop_vec_info loop_vinfo;
479 vect_location = find_loop_location (loop);
480 if (LOCATION_LOCUS (vect_location) != UNKNOWN_LOCATION
481 && dump_enabled_p ())
482 dump_printf (MSG_NOTE, "\nAnalyzing loop at %s:%d\n",
483 LOCATION_FILE (vect_location),
484 LOCATION_LINE (vect_location));
486 loop_vinfo = vect_analyze_loop (loop);
487 loop->aux = loop_vinfo;
489 if (!loop_vinfo || !LOOP_VINFO_VECTORIZABLE_P (loop_vinfo))
490 continue;
492 if (!dbg_cnt (vect_loop))
493 break;
495 gimple loop_vectorized_call = vect_loop_vectorized_call (loop);
496 if (loop_vectorized_call)
497 set_uid_loop_bbs (loop_vinfo, loop_vectorized_call);
498 if (LOCATION_LOCUS (vect_location) != UNKNOWN_LOCATION
499 && dump_enabled_p ())
500 dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
501 "loop vectorized\n");
502 vect_transform_loop (loop_vinfo);
503 num_vectorized_loops++;
504 /* Now that the loop has been vectorized, allow it to be unrolled
505 etc. */
506 loop->force_vectorize = false;
508 if (loop->simduid)
510 simduid_to_vf *simduid_to_vf_data = XNEW (simduid_to_vf);
511 if (!simduid_to_vf_htab)
512 simduid_to_vf_htab = new hash_table<simduid_to_vf> (15);
513 simduid_to_vf_data->simduid = DECL_UID (loop->simduid);
514 simduid_to_vf_data->vf = loop_vinfo->vectorization_factor;
515 *simduid_to_vf_htab->find_slot (simduid_to_vf_data, INSERT)
516 = simduid_to_vf_data;
519 if (loop_vectorized_call)
521 fold_loop_vectorized_call (loop_vectorized_call, boolean_true_node);
522 ret |= TODO_cleanup_cfg;
526 vect_location = UNKNOWN_LOCATION;
528 statistics_counter_event (cfun, "Vectorized loops", num_vectorized_loops);
529 if (dump_enabled_p ()
530 || (num_vectorized_loops > 0 && dump_enabled_p ()))
531 dump_printf_loc (MSG_NOTE, vect_location,
532 "vectorized %u loops in function.\n",
533 num_vectorized_loops);
535 /* ----------- Finalize. ----------- */
537 if (any_ifcvt_loops)
538 for (i = 1; i < vect_loops_num; i++)
540 loop = get_loop (cfun, i);
541 if (loop && loop->dont_vectorize)
543 gimple g = vect_loop_vectorized_call (loop);
544 if (g)
546 fold_loop_vectorized_call (g, boolean_false_node);
547 ret |= TODO_cleanup_cfg;
552 for (i = 1; i < vect_loops_num; i++)
554 loop_vec_info loop_vinfo;
556 loop = get_loop (cfun, i);
557 if (!loop)
558 continue;
559 loop_vinfo = (loop_vec_info) loop->aux;
560 destroy_loop_vec_info (loop_vinfo, true);
561 loop->aux = NULL;
564 free_stmt_vec_info_vec ();
566 /* Fold IFN_GOMP_SIMD_{VF,LANE,LAST_LANE} builtins. */
567 if (cfun->has_simduid_loops)
568 adjust_simduid_builtins (&simduid_to_vf_htab);
570 /* Shrink any "omp array simd" temporary arrays to the
571 actual vectorization factors. */
572 if (simd_array_to_simduid_htab)
574 for (hash_table<simd_array_to_simduid>::iterator iter
575 = simd_array_to_simduid_htab->begin ();
576 iter != simd_array_to_simduid_htab->end (); ++iter)
577 if ((*iter)->simduid != -1U)
579 tree decl = (*iter)->decl;
580 int vf = 1;
581 if (simduid_to_vf_htab)
583 simduid_to_vf *p = NULL, data;
584 data.simduid = (*iter)->simduid;
585 p = simduid_to_vf_htab->find (&data);
586 if (p)
587 vf = p->vf;
589 tree atype
590 = build_array_type_nelts (TREE_TYPE (TREE_TYPE (decl)), vf);
591 TREE_TYPE (decl) = atype;
592 relayout_decl (decl);
595 delete simd_array_to_simduid_htab;
597 delete simduid_to_vf_htab;
598 simduid_to_vf_htab = NULL;
600 if (num_vectorized_loops > 0)
602 /* If we vectorized any loop only virtual SSA form needs to be updated.
603 ??? Also while we try hard to update loop-closed SSA form we fail
604 to properly do this in some corner-cases (see PR56286). */
605 rewrite_into_loop_closed_ssa (NULL, TODO_update_ssa_only_virtuals);
606 return TODO_cleanup_cfg;
609 return ret;
613 /* Entry point to basic block SLP phase. */
615 namespace {
617 const pass_data pass_data_slp_vectorize =
619 GIMPLE_PASS, /* type */
620 "slp", /* name */
621 OPTGROUP_LOOP | OPTGROUP_VEC, /* optinfo_flags */
622 TV_TREE_SLP_VECTORIZATION, /* tv_id */
623 ( PROP_ssa | PROP_cfg ), /* properties_required */
624 0, /* properties_provided */
625 0, /* properties_destroyed */
626 0, /* todo_flags_start */
627 TODO_update_ssa, /* todo_flags_finish */
630 class pass_slp_vectorize : public gimple_opt_pass
632 public:
633 pass_slp_vectorize (gcc::context *ctxt)
634 : gimple_opt_pass (pass_data_slp_vectorize, ctxt)
637 /* opt_pass methods: */
638 opt_pass * clone () { return new pass_slp_vectorize (m_ctxt); }
639 virtual bool gate (function *) { return flag_tree_slp_vectorize != 0; }
640 virtual unsigned int execute (function *);
642 }; // class pass_slp_vectorize
644 unsigned int
645 pass_slp_vectorize::execute (function *fun)
647 basic_block bb;
649 bool in_loop_pipeline = scev_initialized_p ();
650 if (!in_loop_pipeline)
652 loop_optimizer_init (LOOPS_NORMAL);
653 scev_initialize ();
656 init_stmt_vec_info_vec ();
658 FOR_EACH_BB_FN (bb, fun)
660 vect_location = find_bb_location (bb);
662 if (vect_slp_analyze_bb (bb))
664 if (!dbg_cnt (vect_slp))
665 break;
667 vect_slp_transform_bb (bb);
668 if (dump_enabled_p ())
669 dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
670 "basic block vectorized\n");
674 free_stmt_vec_info_vec ();
676 if (!in_loop_pipeline)
678 scev_finalize ();
679 loop_optimizer_finalize ();
682 return 0;
685 } // anon namespace
687 gimple_opt_pass *
688 make_pass_slp_vectorize (gcc::context *ctxt)
690 return new pass_slp_vectorize (ctxt);
694 /* Increase alignment of global arrays to improve vectorization potential.
695 TODO:
696 - Consider also structs that have an array field.
697 - Use ipa analysis to prune arrays that can't be vectorized?
698 This should involve global alignment analysis and in the future also
699 array padding. */
701 static unsigned int
702 increase_alignment (void)
704 varpool_node *vnode;
706 vect_location = UNKNOWN_LOCATION;
708 /* Increase the alignment of all global arrays for vectorization. */
709 FOR_EACH_DEFINED_VARIABLE (vnode)
711 tree vectype, decl = vnode->decl;
712 tree t;
713 unsigned int alignment;
715 t = TREE_TYPE (decl);
716 if (TREE_CODE (t) != ARRAY_TYPE)
717 continue;
718 vectype = get_vectype_for_scalar_type (strip_array_types (t));
719 if (!vectype)
720 continue;
721 alignment = TYPE_ALIGN (vectype);
722 if (DECL_ALIGN (decl) >= alignment)
723 continue;
725 if (vect_can_force_dr_alignment_p (decl, alignment))
727 vnode->increase_alignment (TYPE_ALIGN (vectype));
728 dump_printf (MSG_NOTE, "Increasing alignment of decl: ");
729 dump_generic_expr (MSG_NOTE, TDF_SLIM, decl);
730 dump_printf (MSG_NOTE, "\n");
733 return 0;
737 namespace {
739 const pass_data pass_data_ipa_increase_alignment =
741 SIMPLE_IPA_PASS, /* type */
742 "increase_alignment", /* name */
743 OPTGROUP_LOOP | OPTGROUP_VEC, /* optinfo_flags */
744 TV_IPA_OPT, /* tv_id */
745 0, /* properties_required */
746 0, /* properties_provided */
747 0, /* properties_destroyed */
748 0, /* todo_flags_start */
749 0, /* todo_flags_finish */
752 class pass_ipa_increase_alignment : public simple_ipa_opt_pass
754 public:
755 pass_ipa_increase_alignment (gcc::context *ctxt)
756 : simple_ipa_opt_pass (pass_data_ipa_increase_alignment, ctxt)
759 /* opt_pass methods: */
760 virtual bool gate (function *)
762 return flag_section_anchors && flag_tree_loop_vectorize;
765 virtual unsigned int execute (function *) { return increase_alignment (); }
767 }; // class pass_ipa_increase_alignment
769 } // anon namespace
771 simple_ipa_opt_pass *
772 make_pass_ipa_increase_alignment (gcc::context *ctxt)
774 return new pass_ipa_increase_alignment (ctxt);