21 #ifndef GCC_TREE_VECTORIZER_H
22 #define GCC_TREE_VECTORIZER_H
28 typedef source_location
LOC;
29 #define UNKNOWN_LOC UNKNOWN_LOCATION
30 #define EXPR_LOC(e) EXPR_LOCATION(e)
31 #define LOC_FILE(l) LOCATION_FILE (l)
32 #define LOC_LINE(l) LOCATION_LINE (l)
70 #define VECTORIZABLE_CYCLE_DEF(D) (((D) == vect_reduction_def) \
71 || ((D) == vect_double_reduction_def) \
72 || ((D) == vect_nested_cycle))
95 stmt_cost_vec->safe_push (si);
148 #define SLP_INSTANCE_TREE(S) (S)->root
149 #define SLP_INSTANCE_GROUP_SIZE(S) (S)->group_size
150 #define SLP_INSTANCE_UNROLLING_FACTOR(S) (S)->unrolling_factor
151 #define SLP_INSTANCE_BODY_COST_VEC(S) (S)->body_cost_vec
152 #define SLP_INSTANCE_LOADS(S) (S)->loads
153 #define SLP_INSTANCE_FIRST_LOAD_STMT(S) (S)->first_load
155 #define SLP_TREE_CHILDREN(S) (S)->children
156 #define SLP_TREE_SCALAR_STMTS(S) (S)->stmts
157 #define SLP_TREE_VEC_STMTS(S) (S)->vec_stmts
158 #define SLP_TREE_NUMBER_OF_VEC_STMTS(S) (S)->vec_stmts_size
159 #define SLP_TREE_LOAD_PERMUTATION(S) (S)->load_permutation
207 return (hashval_t) peel_info->
npeel;
320 #define LOOP_VINFO_LOOP(L) (L)->loop
321 #define LOOP_VINFO_BBS(L) (L)->bbs
322 #define LOOP_VINFO_NITERS(L) (L)->num_iters
325 #define LOOP_VINFO_NITERS_UNCHANGED(L) (L)->num_iters_unchanged
326 #define LOOP_VINFO_COST_MODEL_MIN_ITERS(L) (L)->min_profitable_iters
327 #define LOOP_VINFO_VECTORIZABLE_P(L) (L)->vectorizable
328 #define LOOP_VINFO_VECT_FACTOR(L) (L)->vectorization_factor
329 #define LOOP_VINFO_PTR_MASK(L) (L)->ptr_mask
330 #define LOOP_VINFO_LOOP_NEST(L) (L)->loop_nest
331 #define LOOP_VINFO_DATAREFS(L) (L)->datarefs
332 #define LOOP_VINFO_DDRS(L) (L)->ddrs
333 #define LOOP_VINFO_INT_NITERS(L) (TREE_INT_CST_LOW ((L)->num_iters))
334 #define LOOP_PEELING_FOR_ALIGNMENT(L) (L)->peeling_for_alignment
335 #define LOOP_VINFO_UNALIGNED_DR(L) (L)->unaligned_dr
336 #define LOOP_VINFO_MAY_MISALIGN_STMTS(L) (L)->may_misalign_stmts
337 #define LOOP_VINFO_LOC(L) (L)->loop_line_number
338 #define LOOP_VINFO_MAY_ALIAS_DDRS(L) (L)->may_alias_ddrs
339 #define LOOP_VINFO_GROUPED_STORES(L) (L)->grouped_stores
340 #define LOOP_VINFO_SLP_INSTANCES(L) (L)->slp_instances
341 #define LOOP_VINFO_SLP_UNROLLING_FACTOR(L) (L)->slp_unrolling_factor
342 #define LOOP_VINFO_REDUCTIONS(L) (L)->reductions
343 #define LOOP_VINFO_REDUCTION_CHAINS(L) (L)->reduction_chains
344 #define LOOP_VINFO_PEELING_HTAB(L) (L)->peeling_htab
345 #define LOOP_VINFO_TARGET_COST_DATA(L) (L)->target_cost_data
346 #define LOOP_VINFO_PEELING_FOR_GAPS(L) (L)->peeling_for_gaps
347 #define LOOP_VINFO_OPERANDS_SWAPPED(L) (L)->operands_swapped
349 #define LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT(L) \
350 (L)->may_misalign_stmts.length () > 0
351 #define LOOP_REQUIRES_VERSIONING_FOR_ALIAS(L) \
352 (L)->may_alias_ddrs.length () > 0
354 #define NITERS_KNOWN_P(n) \
355 (host_integerp ((n),0) \
356 && TREE_INT_CST_LOW ((n)) > 0)
358 #define LOOP_VINFO_NITERS_KNOWN_P(L) \
359 NITERS_KNOWN_P((L)->num_iters)
396 #define BB_VINFO_BB(B) (B)->bb
397 #define BB_VINFO_GROUPED_STORES(B) (B)->grouped_stores
398 #define BB_VINFO_SLP_INSTANCES(B) (B)->slp_instances
399 #define BB_VINFO_DATAREFS(B) (B)->datarefs
400 #define BB_VINFO_DDRS(B) (B)->ddrs
401 #define BB_VINFO_TARGET_COST_DATA(B) (B)->target_cost_data
585 #define STMT_VINFO_TYPE(S) (S)->type
586 #define STMT_VINFO_STMT(S) (S)->stmt
587 #define STMT_VINFO_LOOP_VINFO(S) (S)->loop_vinfo
588 #define STMT_VINFO_BB_VINFO(S) (S)->bb_vinfo
589 #define STMT_VINFO_RELEVANT(S) (S)->relevant
590 #define STMT_VINFO_LIVE_P(S) (S)->live
591 #define STMT_VINFO_VECTYPE(S) (S)->vectype
592 #define STMT_VINFO_VEC_STMT(S) (S)->vectorized_stmt
593 #define STMT_VINFO_VECTORIZABLE(S) (S)->vectorizable
594 #define STMT_VINFO_DATA_REF(S) (S)->data_ref_info
595 #define STMT_VINFO_GATHER_P(S) (S)->gather_p
596 #define STMT_VINFO_STRIDE_LOAD_P(S) (S)->stride_load_p
597 #define STMT_VINFO_SIMD_LANE_ACCESS_P(S) (S)->simd_lane_access_p
599 #define STMT_VINFO_DR_BASE_ADDRESS(S) (S)->dr_base_address
600 #define STMT_VINFO_DR_INIT(S) (S)->dr_init
601 #define STMT_VINFO_DR_OFFSET(S) (S)->dr_offset
602 #define STMT_VINFO_DR_STEP(S) (S)->dr_step
603 #define STMT_VINFO_DR_ALIGNED_TO(S) (S)->dr_aligned_to
605 #define STMT_VINFO_IN_PATTERN_P(S) (S)->in_pattern_p
606 #define STMT_VINFO_RELATED_STMT(S) (S)->related_stmt
607 #define STMT_VINFO_PATTERN_DEF_SEQ(S) (S)->pattern_def_seq
608 #define STMT_VINFO_SAME_ALIGN_REFS(S) (S)->same_align_refs
609 #define STMT_VINFO_DEF_TYPE(S) (S)->def_type
610 #define STMT_VINFO_GROUP_FIRST_ELEMENT(S) (S)->first_element
611 #define STMT_VINFO_GROUP_NEXT_ELEMENT(S) (S)->next_element
612 #define STMT_VINFO_GROUP_SIZE(S) (S)->size
613 #define STMT_VINFO_GROUP_STORE_COUNT(S) (S)->store_count
614 #define STMT_VINFO_GROUP_GAP(S) (S)->gap
615 #define STMT_VINFO_GROUP_SAME_DR_STMT(S) (S)->same_dr_stmt
616 #define STMT_VINFO_GROUPED_ACCESS(S) ((S)->first_element != NULL && (S)->data_ref_info)
617 #define STMT_VINFO_LOOP_PHI_EVOLUTION_PART(S) (S)->loop_phi_evolution_part
619 #define GROUP_FIRST_ELEMENT(S) (S)->first_element
620 #define GROUP_NEXT_ELEMENT(S) (S)->next_element
621 #define GROUP_SIZE(S) (S)->size
622 #define GROUP_STORE_COUNT(S) (S)->store_count
623 #define GROUP_GAP(S) (S)->gap
624 #define GROUP_SAME_DR_STMT(S) (S)->same_dr_stmt
626 #define STMT_VINFO_RELEVANT_P(S) ((S)->relevant != vect_unused_in_scope)
628 #define HYBRID_SLP_STMT(S) ((S)->slp_type == hybrid)
629 #define PURE_SLP_STMT(S) ((S)->slp_type == pure_slp)
630 #define STMT_SLP_TYPE(S) (S)->slp_type
632 #define VECT_MAX_COST 1000
636 #define MAX_INTERM_CVT_STEPS 3
639 #define MAX_VECTORIZATION_FACTOR 32
669 gcc_checking_assert (info);
670 uid = stmt_vec_info_vec.length () + 1;
672 stmt_vec_info_vec.safe_push ((
vec_void_p) info);
675 stmt_vec_info_vec[uid - 1] = (
vec_void_p) info;
683 unsigned int uid1, uid2;
694 if (uid1 == 0 || uid2 == 0)
697 gcc_checking_assert (uid1 <= stmt_vec_info_vec.length ()
698 && uid2 <= stmt_vec_info_vec.length ());
711 unsigned int uid1, uid2;
722 if (uid1 == 0 || uid2 == 0)
725 gcc_assert (uid1 <= stmt_vec_info_vec.length ());
726 gcc_assert (uid2 <= stmt_vec_info_vec.length ());
743 related_stmt = STMT_VINFO_RELATED_STMT (stmt_info);
746 && STMT_VINFO_IN_PATTERN_P (related_stmt_info))
759 gcc_checking_assert (EDGE_COUNT (bb->
preds) == 1);
770 for (i = 0; i < x; i++)
780 tree vectype,
int misalign)
782 return targetm.vectorize.builtin_vectorization_cost (type_of_cost,
799 return targetm.vectorize.init_cost (loop_info);
804 static inline unsigned
809 return targetm.vectorize.add_stmt_cost (data, count, kind,
810 stmt_info, misalign, where);
817 unsigned *body_cost,
unsigned *epilogue_cost)
819 targetm.vectorize.finish_cost (data, prologue_cost, body_cost, epilogue_cost);
827 targetm.vectorize.destroy_cost_data (data);
837 #define DR_MISALIGNMENT(DR) ((int) (size_t) (DR)->aux)
838 #define SET_DR_MISALIGNMENT(DR, VAL) ((DR)->aux = (void *) (size_t) (VAL))
845 return (DR_MISALIGNMENT (data_ref_info) == 0);
854 return (DR_MISALIGNMENT (data_ref_info) != -1);
920 tree,
int, slp_tree);
922 unsigned int *,
unsigned int *,
1012 #define NUM_PATTERNS 11