annotate gcc/tree-vectorizer.h @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents f6334be47118
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1 /* Vectorizer
111
kono
parents: 67
diff changeset
2 Copyright (C) 2003-2017 Free Software Foundation, Inc.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 Contributed by Dorit Naishlos <dorit@il.ibm.com>
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 This file is part of GCC.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 GCC is free software; you can redistribute it and/or modify it under
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 the terms of the GNU General Public License as published by the Free
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 Software Foundation; either version 3, or (at your option) any later
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 version.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 for more details.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 along with GCC; see the file COPYING3. If not see
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 <http://www.gnu.org/licenses/>. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 #ifndef GCC_TREE_VECTORIZER_H
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 #define GCC_TREE_VECTORIZER_H
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
24 #include "tree-data-ref.h"
111
kono
parents: 67
diff changeset
25 #include "tree-hash-traits.h"
kono
parents: 67
diff changeset
26 #include "target.h"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 /* Used for naming of new temporaries. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 enum vect_var_kind {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 vect_simple_var,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 vect_pointer_var,
111
kono
parents: 67
diff changeset
32 vect_scalar_var,
kono
parents: 67
diff changeset
33 vect_mask_var
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 };
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 /* Defines type of operation. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 enum operation_type {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 unary_op = 1,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 binary_op,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 ternary_op
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 };
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 /* Define type of available alignment support. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 enum dr_alignment_support {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 dr_unaligned_unsupported,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 dr_unaligned_supported,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 dr_explicit_realign,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 dr_explicit_realign_optimized,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 dr_aligned
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 };
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 /* Define type of def-use cross-iteration cycle. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 enum vect_def_type {
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
54 vect_uninitialized_def = 0,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 vect_constant_def = 1,
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
56 vect_external_def,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
57 vect_internal_def,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 vect_induction_def,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 vect_reduction_def,
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
60 vect_double_reduction_def,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
61 vect_nested_cycle,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 vect_unknown_def_type
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 };
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64
111
kono
parents: 67
diff changeset
65 /* Define type of reduction. */
kono
parents: 67
diff changeset
66 enum vect_reduction_type {
kono
parents: 67
diff changeset
67 TREE_CODE_REDUCTION,
kono
parents: 67
diff changeset
68 COND_REDUCTION,
kono
parents: 67
diff changeset
69 INTEGER_INDUC_COND_REDUCTION,
kono
parents: 67
diff changeset
70 CONST_COND_REDUCTION
kono
parents: 67
diff changeset
71 };
kono
parents: 67
diff changeset
72
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
73 #define VECTORIZABLE_CYCLE_DEF(D) (((D) == vect_reduction_def) \
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
74 || ((D) == vect_double_reduction_def) \
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
75 || ((D) == vect_nested_cycle))
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
76
111
kono
parents: 67
diff changeset
77 /* Structure to encapsulate information about a group of like
kono
parents: 67
diff changeset
78 instructions to be presented to the target cost model. */
kono
parents: 67
diff changeset
79 struct stmt_info_for_cost {
kono
parents: 67
diff changeset
80 int count;
kono
parents: 67
diff changeset
81 enum vect_cost_for_stmt kind;
kono
parents: 67
diff changeset
82 gimple *stmt;
kono
parents: 67
diff changeset
83 int misalign;
kono
parents: 67
diff changeset
84 };
kono
parents: 67
diff changeset
85
kono
parents: 67
diff changeset
86 typedef vec<stmt_info_for_cost> stmt_vector_for_cost;
kono
parents: 67
diff changeset
87
kono
parents: 67
diff changeset
88 /* Maps base addresses to an innermost_loop_behavior that gives the maximum
kono
parents: 67
diff changeset
89 known alignment for that base. */
kono
parents: 67
diff changeset
90 typedef hash_map<tree_operand_hash,
kono
parents: 67
diff changeset
91 innermost_loop_behavior *> vec_base_alignments;
kono
parents: 67
diff changeset
92
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 /************************************************************************
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 SLP
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 ************************************************************************/
111
kono
parents: 67
diff changeset
96 typedef struct _slp_tree *slp_tree;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
97
111
kono
parents: 67
diff changeset
98 /* A computation tree of an SLP instance. Each node corresponds to a group of
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
99 stmts to be packed in a SIMD stmt. */
111
kono
parents: 67
diff changeset
100 struct _slp_tree {
kono
parents: 67
diff changeset
101 /* Nodes that contain def-stmts of this node statements operands. */
kono
parents: 67
diff changeset
102 vec<slp_tree> children;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
103 /* A group of scalar stmts to be vectorized together. */
111
kono
parents: 67
diff changeset
104 vec<gimple *> stmts;
kono
parents: 67
diff changeset
105 /* Load permutation relative to the stores, NULL if there is no
kono
parents: 67
diff changeset
106 permutation. */
kono
parents: 67
diff changeset
107 vec<unsigned> load_permutation;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 /* Vectorized stmt/s. */
111
kono
parents: 67
diff changeset
109 vec<gimple *> vec_stmts;
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
110 /* Number of vector stmts that are created to replace the group of scalar
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
111 stmts. It is calculated during the transformation phase as the number of
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
112 scalar elements in one scalar iteration (GROUP_SIZE) multiplied by VF
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 divided by vector size. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 unsigned int vec_stmts_size;
111
kono
parents: 67
diff changeset
115 /* Whether the scalar computations use two different operators. */
kono
parents: 67
diff changeset
116 bool two_operators;
kono
parents: 67
diff changeset
117 /* The DEF type of this node. */
kono
parents: 67
diff changeset
118 enum vect_def_type def_type;
kono
parents: 67
diff changeset
119 };
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
120
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
121
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
122 /* SLP instance is a sequence of stmts in a loop that can be packed into
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
123 SIMD stmts. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
124 typedef struct _slp_instance {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
125 /* The root of SLP tree. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
126 slp_tree root;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
127
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
128 /* Size of groups of scalar stmts that will be replaced by SIMD stmt/s. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
129 unsigned int group_size;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
130
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
131 /* The unrolling factor required to vectorized this SLP instance. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
132 unsigned int unrolling_factor;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
133
111
kono
parents: 67
diff changeset
134 /* The group of nodes that contain loads of this SLP instance. */
kono
parents: 67
diff changeset
135 vec<slp_tree> loads;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
136
111
kono
parents: 67
diff changeset
137 /* The SLP node containing the reduction PHIs. */
kono
parents: 67
diff changeset
138 slp_tree reduc_phis;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
139 } *slp_instance;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
140
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
141
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
142 /* Access Functions. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
143 #define SLP_INSTANCE_TREE(S) (S)->root
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
144 #define SLP_INSTANCE_GROUP_SIZE(S) (S)->group_size
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
145 #define SLP_INSTANCE_UNROLLING_FACTOR(S) (S)->unrolling_factor
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
146 #define SLP_INSTANCE_LOADS(S) (S)->loads
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
147
111
kono
parents: 67
diff changeset
148 #define SLP_TREE_CHILDREN(S) (S)->children
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
149 #define SLP_TREE_SCALAR_STMTS(S) (S)->stmts
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
150 #define SLP_TREE_VEC_STMTS(S) (S)->vec_stmts
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
151 #define SLP_TREE_NUMBER_OF_VEC_STMTS(S) (S)->vec_stmts_size
111
kono
parents: 67
diff changeset
152 #define SLP_TREE_LOAD_PERMUTATION(S) (S)->load_permutation
kono
parents: 67
diff changeset
153 #define SLP_TREE_TWO_OPERATORS(S) (S)->two_operators
kono
parents: 67
diff changeset
154 #define SLP_TREE_DEF_TYPE(S) (S)->def_type
kono
parents: 67
diff changeset
155
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
156
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
157
111
kono
parents: 67
diff changeset
158 /* Describes two objects whose addresses must be unequal for the vectorized
kono
parents: 67
diff changeset
159 loop to be valid. */
kono
parents: 67
diff changeset
160 typedef std::pair<tree, tree> vec_object_pair;
kono
parents: 67
diff changeset
161
kono
parents: 67
diff changeset
162 /* Vectorizer state common between loop and basic-block vectorization. */
kono
parents: 67
diff changeset
163 struct vec_info {
kono
parents: 67
diff changeset
164 enum vec_kind { bb, loop };
kono
parents: 67
diff changeset
165
kono
parents: 67
diff changeset
166 vec_info (vec_kind, void *);
kono
parents: 67
diff changeset
167 ~vec_info ();
kono
parents: 67
diff changeset
168
kono
parents: 67
diff changeset
169 /* The type of vectorization. */
kono
parents: 67
diff changeset
170 vec_kind kind;
kono
parents: 67
diff changeset
171
kono
parents: 67
diff changeset
172 /* All SLP instances. */
kono
parents: 67
diff changeset
173 auto_vec<slp_instance> slp_instances;
kono
parents: 67
diff changeset
174
kono
parents: 67
diff changeset
175 /* All data references. Freed by free_data_refs, so not an auto_vec. */
kono
parents: 67
diff changeset
176 vec<data_reference_p> datarefs;
kono
parents: 67
diff changeset
177
kono
parents: 67
diff changeset
178 /* Maps base addresses to an innermost_loop_behavior that gives the maximum
kono
parents: 67
diff changeset
179 known alignment for that base. */
kono
parents: 67
diff changeset
180 vec_base_alignments base_alignments;
kono
parents: 67
diff changeset
181
kono
parents: 67
diff changeset
182 /* All data dependences. Freed by free_dependence_relations, so not
kono
parents: 67
diff changeset
183 an auto_vec. */
kono
parents: 67
diff changeset
184 vec<ddr_p> ddrs;
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
185
111
kono
parents: 67
diff changeset
186 /* All interleaving chains of stores, represented by the first
kono
parents: 67
diff changeset
187 stmt in the chain. */
kono
parents: 67
diff changeset
188 auto_vec<gimple *> grouped_stores;
kono
parents: 67
diff changeset
189
kono
parents: 67
diff changeset
190 /* Cost data used by the target cost model. */
kono
parents: 67
diff changeset
191 void *target_cost_data;
kono
parents: 67
diff changeset
192 };
kono
parents: 67
diff changeset
193
kono
parents: 67
diff changeset
194 struct _loop_vec_info;
kono
parents: 67
diff changeset
195 struct _bb_vec_info;
kono
parents: 67
diff changeset
196
kono
parents: 67
diff changeset
197 template<>
kono
parents: 67
diff changeset
198 template<>
kono
parents: 67
diff changeset
199 inline bool
kono
parents: 67
diff changeset
200 is_a_helper <_loop_vec_info *>::test (vec_info *i)
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
201 {
111
kono
parents: 67
diff changeset
202 return i->kind == vec_info::loop;
kono
parents: 67
diff changeset
203 }
kono
parents: 67
diff changeset
204
kono
parents: 67
diff changeset
205 template<>
kono
parents: 67
diff changeset
206 template<>
kono
parents: 67
diff changeset
207 inline bool
kono
parents: 67
diff changeset
208 is_a_helper <_bb_vec_info *>::test (vec_info *i)
kono
parents: 67
diff changeset
209 {
kono
parents: 67
diff changeset
210 return i->kind == vec_info::bb;
kono
parents: 67
diff changeset
211 }
kono
parents: 67
diff changeset
212
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
213
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
214 /*-----------------------------------------------------------------*/
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
215 /* Info on vectorized loops. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
216 /*-----------------------------------------------------------------*/
111
kono
parents: 67
diff changeset
217 typedef struct _loop_vec_info : public vec_info {
kono
parents: 67
diff changeset
218 _loop_vec_info (struct loop *);
kono
parents: 67
diff changeset
219 ~_loop_vec_info ();
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
220
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
221 /* The loop to which this info struct refers to. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
222 struct loop *loop;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
223
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
224 /* The loop basic blocks. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
225 basic_block *bbs;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
226
111
kono
parents: 67
diff changeset
227 /* Number of latch executions. */
kono
parents: 67
diff changeset
228 tree num_itersm1;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
229 /* Number of iterations. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
230 tree num_iters;
111
kono
parents: 67
diff changeset
231 /* Number of iterations of the original loop. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
232 tree num_iters_unchanged;
111
kono
parents: 67
diff changeset
233 /* Condition under which this loop is analyzed and versioned. */
kono
parents: 67
diff changeset
234 tree num_iters_assumptions;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
235
111
kono
parents: 67
diff changeset
236 /* Threshold of number of iterations below which vectorzation will not be
kono
parents: 67
diff changeset
237 performed. It is calculated from MIN_PROFITABLE_ITERS and
kono
parents: 67
diff changeset
238 PARAM_MIN_VECT_LOOP_BOUND. */
kono
parents: 67
diff changeset
239 unsigned int th;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
240
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
241 /* Unrolling factor */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
242 int vectorization_factor;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
243
111
kono
parents: 67
diff changeset
244 /* Maximum runtime vectorization factor, or MAX_VECTORIZATION_FACTOR
kono
parents: 67
diff changeset
245 if there is no particular limit. */
kono
parents: 67
diff changeset
246 unsigned HOST_WIDE_INT max_vectorization_factor;
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
247
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
248 /* Unknown DRs according to which loop was peeled. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
249 struct data_reference *unaligned_dr;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
250
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
251 /* peeling_for_alignment indicates whether peeling for alignment will take
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
252 place, and what the peeling factor should be:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
253 peeling_for_alignment = X means:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
254 If X=0: Peeling for alignment will not be applied.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
255 If X>0: Peel first X iterations.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
256 If X=-1: Generate a runtime test to calculate the number of iterations
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
257 to be peeled, using the dataref recorded in the field
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
258 unaligned_dr. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
259 int peeling_for_alignment;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
260
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
261 /* The mask used to check the alignment of pointers or arrays. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
262 int ptr_mask;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
263
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
264 /* The loop nest in which the data dependences are computed. */
111
kono
parents: 67
diff changeset
265 auto_vec<loop_p> loop_nest;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
266
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
267 /* Data Dependence Relations defining address ranges that are candidates
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
268 for a run-time aliasing check. */
111
kono
parents: 67
diff changeset
269 auto_vec<ddr_p> may_alias_ddrs;
kono
parents: 67
diff changeset
270
kono
parents: 67
diff changeset
271 /* Data Dependence Relations defining address ranges together with segment
kono
parents: 67
diff changeset
272 lengths from which the run-time aliasing check is built. */
kono
parents: 67
diff changeset
273 auto_vec<dr_with_seg_len_pair_t> comp_alias_ddrs;
kono
parents: 67
diff changeset
274
kono
parents: 67
diff changeset
275 /* Check that the addresses of each pair of objects is unequal. */
kono
parents: 67
diff changeset
276 auto_vec<vec_object_pair> check_unequal_addrs;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
277
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
278 /* Statements in the loop that have data references that are candidates for a
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
279 runtime (loop versioning) misalignment check. */
111
kono
parents: 67
diff changeset
280 auto_vec<gimple *> may_misalign_stmts;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
281
111
kono
parents: 67
diff changeset
282 /* Reduction cycles detected in the loop. Used in loop-aware SLP. */
kono
parents: 67
diff changeset
283 auto_vec<gimple *> reductions;
kono
parents: 67
diff changeset
284
kono
parents: 67
diff changeset
285 /* All reduction chains in the loop, represented by the first
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
286 stmt in the chain. */
111
kono
parents: 67
diff changeset
287 auto_vec<gimple *> reduction_chains;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
288
111
kono
parents: 67
diff changeset
289 /* Cost vector for a single scalar iteration. */
kono
parents: 67
diff changeset
290 auto_vec<stmt_info_for_cost> scalar_cost_vec;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
291
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
292 /* The unrolling factor needed to SLP the loop. In case of that pure SLP is
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
293 applied to the loop, i.e., no unrolling is needed, this is 1. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
294 unsigned slp_unrolling_factor;
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
295
111
kono
parents: 67
diff changeset
296 /* Cost of a single scalar iteration. */
kono
parents: 67
diff changeset
297 int single_scalar_iteration_cost;
kono
parents: 67
diff changeset
298
kono
parents: 67
diff changeset
299 /* Is the loop vectorizable? */
kono
parents: 67
diff changeset
300 bool vectorizable;
kono
parents: 67
diff changeset
301
kono
parents: 67
diff changeset
302 /* When we have grouped data accesses with gaps, we may introduce invalid
kono
parents: 67
diff changeset
303 memory accesses. We peel the last iteration of the loop to prevent
kono
parents: 67
diff changeset
304 this. */
kono
parents: 67
diff changeset
305 bool peeling_for_gaps;
kono
parents: 67
diff changeset
306
kono
parents: 67
diff changeset
307 /* When the number of iterations is not a multiple of the vector size
kono
parents: 67
diff changeset
308 we need to peel off iterations at the end to form an epilogue loop. */
kono
parents: 67
diff changeset
309 bool peeling_for_niter;
kono
parents: 67
diff changeset
310
kono
parents: 67
diff changeset
311 /* Reductions are canonicalized so that the last operand is the reduction
kono
parents: 67
diff changeset
312 operand. If this places a constant into RHS1, this decanonicalizes
kono
parents: 67
diff changeset
313 GIMPLE for other phases, so we must track when this has occurred and
kono
parents: 67
diff changeset
314 fix it up. */
kono
parents: 67
diff changeset
315 bool operands_swapped;
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
316
111
kono
parents: 67
diff changeset
317 /* True if there are no loop carried data dependencies in the loop.
kono
parents: 67
diff changeset
318 If loop->safelen <= 1, then this is always true, either the loop
kono
parents: 67
diff changeset
319 didn't have any loop carried data dependencies, or the loop is being
kono
parents: 67
diff changeset
320 vectorized guarded with some runtime alias checks, or couldn't
kono
parents: 67
diff changeset
321 be vectorized at all, but then this field shouldn't be used.
kono
parents: 67
diff changeset
322 For loop->safelen >= 2, the user has asserted that there are no
kono
parents: 67
diff changeset
323 backward dependencies, but there still could be loop carried forward
kono
parents: 67
diff changeset
324 dependencies in such loops. This flag will be false if normal
kono
parents: 67
diff changeset
325 vectorizer data dependency analysis would fail or require versioning
kono
parents: 67
diff changeset
326 for alias, but because of loop->safelen >= 2 it has been vectorized
kono
parents: 67
diff changeset
327 even without versioning for alias. E.g. in:
kono
parents: 67
diff changeset
328 #pragma omp simd
kono
parents: 67
diff changeset
329 for (int i = 0; i < m; i++)
kono
parents: 67
diff changeset
330 a[i] = a[i + k] * c;
kono
parents: 67
diff changeset
331 (or #pragma simd or #pragma ivdep) we can vectorize this and it will
kono
parents: 67
diff changeset
332 DTRT even for k > 0 && k < m, but without safelen we would not
kono
parents: 67
diff changeset
333 vectorize this, so this field would be false. */
kono
parents: 67
diff changeset
334 bool no_data_dependencies;
kono
parents: 67
diff changeset
335
kono
parents: 67
diff changeset
336 /* Mark loops having masked stores. */
kono
parents: 67
diff changeset
337 bool has_mask_store;
kono
parents: 67
diff changeset
338
kono
parents: 67
diff changeset
339 /* If if-conversion versioned this loop before conversion, this is the
kono
parents: 67
diff changeset
340 loop version without if-conversion. */
kono
parents: 67
diff changeset
341 struct loop *scalar_loop;
kono
parents: 67
diff changeset
342
kono
parents: 67
diff changeset
343 /* For loops being epilogues of already vectorized loops
kono
parents: 67
diff changeset
344 this points to the original vectorized loop. Otherwise NULL. */
kono
parents: 67
diff changeset
345 _loop_vec_info *orig_loop_info;
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
346
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
347 } *loop_vec_info;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
348
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
349 /* Access Functions. */
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
350 #define LOOP_VINFO_LOOP(L) (L)->loop
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
351 #define LOOP_VINFO_BBS(L) (L)->bbs
111
kono
parents: 67
diff changeset
352 #define LOOP_VINFO_NITERSM1(L) (L)->num_itersm1
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
353 #define LOOP_VINFO_NITERS(L) (L)->num_iters
111
kono
parents: 67
diff changeset
354 /* Since LOOP_VINFO_NITERS and LOOP_VINFO_NITERSM1 can change after
kono
parents: 67
diff changeset
355 prologue peeling retain total unchanged scalar loop iterations for
kono
parents: 67
diff changeset
356 cost model. */
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
357 #define LOOP_VINFO_NITERS_UNCHANGED(L) (L)->num_iters_unchanged
111
kono
parents: 67
diff changeset
358 #define LOOP_VINFO_NITERS_ASSUMPTIONS(L) (L)->num_iters_assumptions
kono
parents: 67
diff changeset
359 #define LOOP_VINFO_COST_MODEL_THRESHOLD(L) (L)->th
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
360 #define LOOP_VINFO_VECTORIZABLE_P(L) (L)->vectorizable
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
361 #define LOOP_VINFO_VECT_FACTOR(L) (L)->vectorization_factor
111
kono
parents: 67
diff changeset
362 #define LOOP_VINFO_MAX_VECT_FACTOR(L) (L)->max_vectorization_factor
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
363 #define LOOP_VINFO_PTR_MASK(L) (L)->ptr_mask
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
364 #define LOOP_VINFO_LOOP_NEST(L) (L)->loop_nest
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
365 #define LOOP_VINFO_DATAREFS(L) (L)->datarefs
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
366 #define LOOP_VINFO_DDRS(L) (L)->ddrs
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
367 #define LOOP_VINFO_INT_NITERS(L) (TREE_INT_CST_LOW ((L)->num_iters))
111
kono
parents: 67
diff changeset
368 #define LOOP_VINFO_PEELING_FOR_ALIGNMENT(L) (L)->peeling_for_alignment
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
369 #define LOOP_VINFO_UNALIGNED_DR(L) (L)->unaligned_dr
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
370 #define LOOP_VINFO_MAY_MISALIGN_STMTS(L) (L)->may_misalign_stmts
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
371 #define LOOP_VINFO_MAY_ALIAS_DDRS(L) (L)->may_alias_ddrs
111
kono
parents: 67
diff changeset
372 #define LOOP_VINFO_COMP_ALIAS_DDRS(L) (L)->comp_alias_ddrs
kono
parents: 67
diff changeset
373 #define LOOP_VINFO_CHECK_UNEQUAL_ADDRS(L) (L)->check_unequal_addrs
kono
parents: 67
diff changeset
374 #define LOOP_VINFO_GROUPED_STORES(L) (L)->grouped_stores
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
375 #define LOOP_VINFO_SLP_INSTANCES(L) (L)->slp_instances
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
376 #define LOOP_VINFO_SLP_UNROLLING_FACTOR(L) (L)->slp_unrolling_factor
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
377 #define LOOP_VINFO_REDUCTIONS(L) (L)->reductions
111
kono
parents: 67
diff changeset
378 #define LOOP_VINFO_REDUCTION_CHAINS(L) (L)->reduction_chains
kono
parents: 67
diff changeset
379 #define LOOP_VINFO_TARGET_COST_DATA(L) (L)->target_cost_data
kono
parents: 67
diff changeset
380 #define LOOP_VINFO_PEELING_FOR_GAPS(L) (L)->peeling_for_gaps
kono
parents: 67
diff changeset
381 #define LOOP_VINFO_OPERANDS_SWAPPED(L) (L)->operands_swapped
kono
parents: 67
diff changeset
382 #define LOOP_VINFO_PEELING_FOR_NITER(L) (L)->peeling_for_niter
kono
parents: 67
diff changeset
383 #define LOOP_VINFO_NO_DATA_DEPENDENCIES(L) (L)->no_data_dependencies
kono
parents: 67
diff changeset
384 #define LOOP_VINFO_SCALAR_LOOP(L) (L)->scalar_loop
kono
parents: 67
diff changeset
385 #define LOOP_VINFO_HAS_MASK_STORE(L) (L)->has_mask_store
kono
parents: 67
diff changeset
386 #define LOOP_VINFO_SCALAR_ITERATION_COST(L) (L)->scalar_cost_vec
kono
parents: 67
diff changeset
387 #define LOOP_VINFO_SINGLE_SCALAR_ITERATION_COST(L) (L)->single_scalar_iteration_cost
kono
parents: 67
diff changeset
388 #define LOOP_VINFO_ORIG_LOOP_INFO(L) (L)->orig_loop_info
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
389
111
kono
parents: 67
diff changeset
390 #define LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT(L) \
kono
parents: 67
diff changeset
391 ((L)->may_misalign_stmts.length () > 0)
kono
parents: 67
diff changeset
392 #define LOOP_REQUIRES_VERSIONING_FOR_ALIAS(L) \
kono
parents: 67
diff changeset
393 ((L)->comp_alias_ddrs.length () > 0 \
kono
parents: 67
diff changeset
394 || (L)->check_unequal_addrs.length () > 0)
kono
parents: 67
diff changeset
395 #define LOOP_REQUIRES_VERSIONING_FOR_NITERS(L) \
kono
parents: 67
diff changeset
396 (LOOP_VINFO_NITERS_ASSUMPTIONS (L))
kono
parents: 67
diff changeset
397 #define LOOP_REQUIRES_VERSIONING(L) \
kono
parents: 67
diff changeset
398 (LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT (L) \
kono
parents: 67
diff changeset
399 || LOOP_REQUIRES_VERSIONING_FOR_ALIAS (L) \
kono
parents: 67
diff changeset
400 || LOOP_REQUIRES_VERSIONING_FOR_NITERS (L))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
401
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
402 #define LOOP_VINFO_NITERS_KNOWN_P(L) \
111
kono
parents: 67
diff changeset
403 (tree_fits_shwi_p ((L)->num_iters) && tree_to_shwi ((L)->num_iters) > 0)
kono
parents: 67
diff changeset
404
kono
parents: 67
diff changeset
405 #define LOOP_VINFO_EPILOGUE_P(L) \
kono
parents: 67
diff changeset
406 (LOOP_VINFO_ORIG_LOOP_INFO (L) != NULL)
kono
parents: 67
diff changeset
407
kono
parents: 67
diff changeset
408 #define LOOP_VINFO_ORIG_MAX_VECT_FACTOR(L) \
kono
parents: 67
diff changeset
409 (LOOP_VINFO_MAX_VECT_FACTOR (LOOP_VINFO_ORIG_LOOP_INFO (L)))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
410
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
411 static inline loop_vec_info
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
412 loop_vec_info_for_loop (struct loop *loop)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
413 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
414 return (loop_vec_info) loop->aux;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
415 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
416
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
417 static inline bool
111
kono
parents: 67
diff changeset
418 nested_in_vect_loop_p (struct loop *loop, gimple *stmt)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
419 {
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
420 return (loop->inner
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
421 && (loop->inner == (gimple_bb (stmt))->loop_father));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
422 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
423
111
kono
parents: 67
diff changeset
424 typedef struct _bb_vec_info : public vec_info
kono
parents: 67
diff changeset
425 {
kono
parents: 67
diff changeset
426 _bb_vec_info (gimple_stmt_iterator, gimple_stmt_iterator);
kono
parents: 67
diff changeset
427 ~_bb_vec_info ();
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
428
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
429 basic_block bb;
111
kono
parents: 67
diff changeset
430 gimple_stmt_iterator region_begin;
kono
parents: 67
diff changeset
431 gimple_stmt_iterator region_end;
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
432 } *bb_vec_info;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
433
111
kono
parents: 67
diff changeset
434 #define BB_VINFO_BB(B) (B)->bb
kono
parents: 67
diff changeset
435 #define BB_VINFO_GROUPED_STORES(B) (B)->grouped_stores
kono
parents: 67
diff changeset
436 #define BB_VINFO_SLP_INSTANCES(B) (B)->slp_instances
kono
parents: 67
diff changeset
437 #define BB_VINFO_DATAREFS(B) (B)->datarefs
kono
parents: 67
diff changeset
438 #define BB_VINFO_DDRS(B) (B)->ddrs
kono
parents: 67
diff changeset
439 #define BB_VINFO_TARGET_COST_DATA(B) (B)->target_cost_data
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
440
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
441 static inline bb_vec_info
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
442 vec_info_for_bb (basic_block bb)
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
443 {
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
444 return (bb_vec_info) bb->aux;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
445 }
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
446
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
447 /*-----------------------------------------------------------------*/
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
448 /* Info on vectorized defs. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
449 /*-----------------------------------------------------------------*/
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
450 enum stmt_vec_info_type {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
451 undef_vec_info_type = 0,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
452 load_vec_info_type,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
453 store_vec_info_type,
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
454 shift_vec_info_type,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
455 op_vec_info_type,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
456 call_vec_info_type,
111
kono
parents: 67
diff changeset
457 call_simd_clone_vec_info_type,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
458 assignment_vec_info_type,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
459 condition_vec_info_type,
111
kono
parents: 67
diff changeset
460 comparison_vec_info_type,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
461 reduc_vec_info_type,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
462 induc_vec_info_type,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
463 type_promotion_vec_info_type,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
464 type_demotion_vec_info_type,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
465 type_conversion_vec_info_type,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
466 loop_exit_ctrl_vec_info_type
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
467 };
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
468
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
469 /* Indicates whether/how a variable is used in the scope of loop/basic
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
470 block. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
471 enum vect_relevant {
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
472 vect_unused_in_scope = 0,
111
kono
parents: 67
diff changeset
473
kono
parents: 67
diff changeset
474 /* The def is only used outside the loop. */
kono
parents: 67
diff changeset
475 vect_used_only_live,
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
476 /* The def is in the inner loop, and the use is in the outer loop, and the
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
477 use is a reduction stmt. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
478 vect_used_in_outer_by_reduction,
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
479 /* The def is in the inner loop, and the use is in the outer loop (and is
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
480 not part of reduction). */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
481 vect_used_in_outer,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
482
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
483 /* defs that feed computations that end up (only) in a reduction. These
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
484 defs may be used by non-reduction stmts, but eventually, any
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
485 computations/values that are affected by these defs are used to compute
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
486 a reduction (i.e. don't get stored to memory, for example). We use this
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
487 to identify computations that we can change the order in which they are
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
488 computed. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
489 vect_used_by_reduction,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
490
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
491 vect_used_in_scope
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
492 };
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
493
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
494 /* The type of vectorization that can be applied to the stmt: regular loop-based
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
495 vectorization; pure SLP - the stmt is a part of SLP instances and does not
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
496 have uses outside SLP instances; or hybrid SLP and loop-based - the stmt is
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
497 a part of SLP instance and also must be loop-based vectorized, since it has
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
498 uses outside SLP sequences.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
499
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
500 In the loop context the meanings of pure and hybrid SLP are slightly
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
501 different. By saying that pure SLP is applied to the loop, we mean that we
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
502 exploit only intra-iteration parallelism in the loop; i.e., the loop can be
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
503 vectorized without doing any conceptual unrolling, cause we don't pack
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
504 together stmts from different iterations, only within a single iteration.
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
505 Loop hybrid SLP means that we exploit both intra-iteration and
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
506 inter-iteration parallelism (e.g., number of elements in the vector is 4
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
507 and the slp-group-size is 2, in which case we don't have enough parallelism
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
508 within an iteration, so we obtain the rest of the parallelism from subsequent
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
509 iterations by unrolling the loop by 2). */
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
510 enum slp_vect_type {
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
511 loop_vect = 0,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
512 pure_slp,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
513 hybrid
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
514 };
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
515
111
kono
parents: 67
diff changeset
516 /* Describes how we're going to vectorize an individual load or store,
kono
parents: 67
diff changeset
517 or a group of loads or stores. */
kono
parents: 67
diff changeset
518 enum vect_memory_access_type {
kono
parents: 67
diff changeset
519 /* An access to an invariant address. This is used only for loads. */
kono
parents: 67
diff changeset
520 VMAT_INVARIANT,
kono
parents: 67
diff changeset
521
kono
parents: 67
diff changeset
522 /* A simple contiguous access. */
kono
parents: 67
diff changeset
523 VMAT_CONTIGUOUS,
kono
parents: 67
diff changeset
524
kono
parents: 67
diff changeset
525 /* A contiguous access that goes down in memory rather than up,
kono
parents: 67
diff changeset
526 with no additional permutation. This is used only for stores
kono
parents: 67
diff changeset
527 of invariants. */
kono
parents: 67
diff changeset
528 VMAT_CONTIGUOUS_DOWN,
kono
parents: 67
diff changeset
529
kono
parents: 67
diff changeset
530 /* A simple contiguous access in which the elements need to be permuted
kono
parents: 67
diff changeset
531 after loading or before storing. Only used for loop vectorization;
kono
parents: 67
diff changeset
532 SLP uses separate permutes. */
kono
parents: 67
diff changeset
533 VMAT_CONTIGUOUS_PERMUTE,
kono
parents: 67
diff changeset
534
kono
parents: 67
diff changeset
535 /* A simple contiguous access in which the elements need to be reversed
kono
parents: 67
diff changeset
536 after loading or before storing. */
kono
parents: 67
diff changeset
537 VMAT_CONTIGUOUS_REVERSE,
kono
parents: 67
diff changeset
538
kono
parents: 67
diff changeset
539 /* An access that uses IFN_LOAD_LANES or IFN_STORE_LANES. */
kono
parents: 67
diff changeset
540 VMAT_LOAD_STORE_LANES,
kono
parents: 67
diff changeset
541
kono
parents: 67
diff changeset
542 /* An access in which each scalar element is loaded or stored
kono
parents: 67
diff changeset
543 individually. */
kono
parents: 67
diff changeset
544 VMAT_ELEMENTWISE,
kono
parents: 67
diff changeset
545
kono
parents: 67
diff changeset
546 /* A hybrid of VMAT_CONTIGUOUS and VMAT_ELEMENTWISE, used for grouped
kono
parents: 67
diff changeset
547 SLP accesses. Each unrolled iteration uses a contiguous load
kono
parents: 67
diff changeset
548 or store for the whole group, but the groups from separate iterations
kono
parents: 67
diff changeset
549 are combined in the same way as for VMAT_ELEMENTWISE. */
kono
parents: 67
diff changeset
550 VMAT_STRIDED_SLP,
kono
parents: 67
diff changeset
551
kono
parents: 67
diff changeset
552 /* The access uses gather loads or scatter stores. */
kono
parents: 67
diff changeset
553 VMAT_GATHER_SCATTER
kono
parents: 67
diff changeset
554 };
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
555
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
556 typedef struct data_reference *dr_p;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
557
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
558 typedef struct _stmt_vec_info {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
559
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
560 enum stmt_vec_info_type type;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
561
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
562 /* Indicates whether this stmts is part of a computation whose result is
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
563 used outside the loop. */
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
564 bool live;
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
565
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
566 /* Stmt is part of some pattern (computation idiom) */
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
567 bool in_pattern_p;
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
568
111
kono
parents: 67
diff changeset
569 /* Is this statement vectorizable or should it be skipped in (partial)
kono
parents: 67
diff changeset
570 vectorization. */
kono
parents: 67
diff changeset
571 bool vectorizable;
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
572
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
573 /* The stmt to which this info struct refers to. */
111
kono
parents: 67
diff changeset
574 gimple *stmt;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
575
111
kono
parents: 67
diff changeset
576 /* The vec_info with respect to which STMT is vectorized. */
kono
parents: 67
diff changeset
577 vec_info *vinfo;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
578
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
579 /* The vector type to be used for the LHS of this statement. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
580 tree vectype;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
581
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
582 /* The vectorized version of the stmt. */
111
kono
parents: 67
diff changeset
583 gimple *vectorized_stmt;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
584
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
585
111
kono
parents: 67
diff changeset
586 /* The following is relevant only for stmts that contain a non-scalar
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
587 data-ref (array/pointer/struct access). A GIMPLE stmt is expected to have
111
kono
parents: 67
diff changeset
588 at most one such data-ref. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
589
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
590 /* Information about the data-ref (access function, etc),
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
591 relative to the inner-most containing loop. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
592 struct data_reference *data_ref_info;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
593
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
594 /* Information about the data-ref relative to this loop
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
595 nest (the loop that is being considered for vectorization). */
111
kono
parents: 67
diff changeset
596 innermost_loop_behavior dr_wrt_vec_loop;
kono
parents: 67
diff changeset
597
kono
parents: 67
diff changeset
598 /* For loop PHI nodes, the base and evolution part of it. This makes sure
kono
parents: 67
diff changeset
599 this information is still available in vect_update_ivs_after_vectorizer
kono
parents: 67
diff changeset
600 where we may not be able to re-analyze the PHI nodes evolution as
kono
parents: 67
diff changeset
601 peeling for the prologue loop can make it unanalyzable. The evolution
kono
parents: 67
diff changeset
602 part is still correct after peeling, but the base may have changed from
kono
parents: 67
diff changeset
603 the version here. */
kono
parents: 67
diff changeset
604 tree loop_phi_evolution_base_unchanged;
kono
parents: 67
diff changeset
605 tree loop_phi_evolution_part;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
606
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
607 /* Used for various bookkeeping purposes, generally holding a pointer to
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
608 some other stmt S that is in some way "related" to this stmt.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
609 Current use of this field is:
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
610 If this stmt is part of a pattern (i.e. the field 'in_pattern_p' is
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
611 true): S is the "pattern stmt" that represents (and replaces) the
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
612 sequence of stmts that constitutes the pattern. Similarly, the
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
613 related_stmt of the "pattern stmt" points back to this stmt (which is
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
614 the last stmt in the original sequence of stmts that constitutes the
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
615 pattern). */
111
kono
parents: 67
diff changeset
616 gimple *related_stmt;
kono
parents: 67
diff changeset
617
kono
parents: 67
diff changeset
618 /* Used to keep a sequence of def stmts of a pattern stmt if such exists. */
kono
parents: 67
diff changeset
619 gimple_seq pattern_def_seq;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
620
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
621 /* List of datarefs that are known to have the same alignment as the dataref
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
622 of this stmt. */
111
kono
parents: 67
diff changeset
623 vec<dr_p> same_align_refs;
kono
parents: 67
diff changeset
624
kono
parents: 67
diff changeset
625 /* Selected SIMD clone's function info. First vector element
kono
parents: 67
diff changeset
626 is SIMD clone's function decl, followed by a pair of trees (base + step)
kono
parents: 67
diff changeset
627 for linear arguments (pair of NULLs for other arguments). */
kono
parents: 67
diff changeset
628 vec<tree> simd_clone_info;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
629
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
630 /* Classify the def of this stmt. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
631 enum vect_def_type def_type;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
632
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
633 /* Whether the stmt is SLPed, loop-based vectorized, or both. */
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
634 enum slp_vect_type slp_type;
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
635
111
kono
parents: 67
diff changeset
636 /* Interleaving and reduction chains info. */
kono
parents: 67
diff changeset
637 /* First element in the group. */
kono
parents: 67
diff changeset
638 gimple *first_element;
kono
parents: 67
diff changeset
639 /* Pointer to the next element in the group. */
kono
parents: 67
diff changeset
640 gimple *next_element;
kono
parents: 67
diff changeset
641 /* For data-refs, in case that two or more stmts share data-ref, this is the
kono
parents: 67
diff changeset
642 pointer to the previously detected stmt with the same dr. */
kono
parents: 67
diff changeset
643 gimple *same_dr_stmt;
kono
parents: 67
diff changeset
644 /* The size of the group. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
645 unsigned int size;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
646 /* For stores, number of stores from this group seen. We vectorize the last
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
647 one. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
648 unsigned int store_count;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
649 /* For loads only, the gap from the previous load. For consecutive loads, GAP
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
650 is 1. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
651 unsigned int gap;
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
652
111
kono
parents: 67
diff changeset
653 /* The minimum negative dependence distance this stmt participates in
kono
parents: 67
diff changeset
654 or zero if none. */
kono
parents: 67
diff changeset
655 unsigned int min_neg_dist;
kono
parents: 67
diff changeset
656
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
657 /* Not all stmts in the loop need to be vectorized. e.g, the increment
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
658 of the loop induction variable and computation of array indexes. relevant
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
659 indicates whether the stmt needs to be vectorized. */
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
660 enum vect_relevant relevant;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
661
111
kono
parents: 67
diff changeset
662 /* For loads if this is a gather, for stores if this is a scatter. */
kono
parents: 67
diff changeset
663 bool gather_scatter_p;
kono
parents: 67
diff changeset
664
kono
parents: 67
diff changeset
665 /* True if this is an access with loop-invariant stride. */
kono
parents: 67
diff changeset
666 bool strided_p;
kono
parents: 67
diff changeset
667
kono
parents: 67
diff changeset
668 /* For both loads and stores. */
kono
parents: 67
diff changeset
669 bool simd_lane_access_p;
kono
parents: 67
diff changeset
670
kono
parents: 67
diff changeset
671 /* Classifies how the load or store is going to be implemented
kono
parents: 67
diff changeset
672 for loop vectorization. */
kono
parents: 67
diff changeset
673 vect_memory_access_type memory_access_type;
kono
parents: 67
diff changeset
674
kono
parents: 67
diff changeset
675 /* For reduction loops, this is the type of reduction. */
kono
parents: 67
diff changeset
676 enum vect_reduction_type v_reduc_type;
kono
parents: 67
diff changeset
677
kono
parents: 67
diff changeset
678 /* For CONST_COND_REDUCTION, record the reduc code. */
kono
parents: 67
diff changeset
679 enum tree_code const_cond_reduc_code;
kono
parents: 67
diff changeset
680
kono
parents: 67
diff changeset
681 /* On a reduction PHI the reduction type as detected by
kono
parents: 67
diff changeset
682 vect_force_simple_reduction. */
kono
parents: 67
diff changeset
683 enum vect_reduction_type reduc_type;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
684
111
kono
parents: 67
diff changeset
685 /* On a reduction PHI the def returned by vect_force_simple_reduction.
kono
parents: 67
diff changeset
686 On the def returned by vect_force_simple_reduction the
kono
parents: 67
diff changeset
687 corresponding PHI. */
kono
parents: 67
diff changeset
688 gimple *reduc_def;
kono
parents: 67
diff changeset
689
kono
parents: 67
diff changeset
690 /* The number of scalar stmt references from active SLP instances. */
kono
parents: 67
diff changeset
691 unsigned int num_slp_uses;
kono
parents: 67
diff changeset
692 } *stmt_vec_info;
kono
parents: 67
diff changeset
693
kono
parents: 67
diff changeset
694 /* Information about a gather/scatter call. */
kono
parents: 67
diff changeset
695 struct gather_scatter_info {
kono
parents: 67
diff changeset
696 /* The FUNCTION_DECL for the built-in gather/scatter function. */
kono
parents: 67
diff changeset
697 tree decl;
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
698
111
kono
parents: 67
diff changeset
699 /* The loop-invariant base value. */
kono
parents: 67
diff changeset
700 tree base;
kono
parents: 67
diff changeset
701
kono
parents: 67
diff changeset
702 /* The original scalar offset, which is a non-loop-invariant SSA_NAME. */
kono
parents: 67
diff changeset
703 tree offset;
kono
parents: 67
diff changeset
704
kono
parents: 67
diff changeset
705 /* Each offset element should be multiplied by this amount before
kono
parents: 67
diff changeset
706 being added to the base. */
kono
parents: 67
diff changeset
707 int scale;
kono
parents: 67
diff changeset
708
kono
parents: 67
diff changeset
709 /* The definition type for the vectorized offset. */
kono
parents: 67
diff changeset
710 enum vect_def_type offset_dt;
kono
parents: 67
diff changeset
711
kono
parents: 67
diff changeset
712 /* The type of the vectorized offset. */
kono
parents: 67
diff changeset
713 tree offset_vectype;
kono
parents: 67
diff changeset
714 };
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
715
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
716 /* Access Functions. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
717 #define STMT_VINFO_TYPE(S) (S)->type
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
718 #define STMT_VINFO_STMT(S) (S)->stmt
111
kono
parents: 67
diff changeset
719 inline loop_vec_info
kono
parents: 67
diff changeset
720 STMT_VINFO_LOOP_VINFO (stmt_vec_info stmt_vinfo)
kono
parents: 67
diff changeset
721 {
kono
parents: 67
diff changeset
722 if (loop_vec_info loop_vinfo = dyn_cast <loop_vec_info> (stmt_vinfo->vinfo))
kono
parents: 67
diff changeset
723 return loop_vinfo;
kono
parents: 67
diff changeset
724 return NULL;
kono
parents: 67
diff changeset
725 }
kono
parents: 67
diff changeset
726 inline bb_vec_info
kono
parents: 67
diff changeset
727 STMT_VINFO_BB_VINFO (stmt_vec_info stmt_vinfo)
kono
parents: 67
diff changeset
728 {
kono
parents: 67
diff changeset
729 if (bb_vec_info bb_vinfo = dyn_cast <bb_vec_info> (stmt_vinfo->vinfo))
kono
parents: 67
diff changeset
730 return bb_vinfo;
kono
parents: 67
diff changeset
731 return NULL;
kono
parents: 67
diff changeset
732 }
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
733 #define STMT_VINFO_RELEVANT(S) (S)->relevant
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
734 #define STMT_VINFO_LIVE_P(S) (S)->live
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
735 #define STMT_VINFO_VECTYPE(S) (S)->vectype
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
736 #define STMT_VINFO_VEC_STMT(S) (S)->vectorized_stmt
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
737 #define STMT_VINFO_VECTORIZABLE(S) (S)->vectorizable
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
738 #define STMT_VINFO_DATA_REF(S) (S)->data_ref_info
111
kono
parents: 67
diff changeset
739 #define STMT_VINFO_GATHER_SCATTER_P(S) (S)->gather_scatter_p
kono
parents: 67
diff changeset
740 #define STMT_VINFO_STRIDED_P(S) (S)->strided_p
kono
parents: 67
diff changeset
741 #define STMT_VINFO_MEMORY_ACCESS_TYPE(S) (S)->memory_access_type
kono
parents: 67
diff changeset
742 #define STMT_VINFO_SIMD_LANE_ACCESS_P(S) (S)->simd_lane_access_p
kono
parents: 67
diff changeset
743 #define STMT_VINFO_VEC_REDUCTION_TYPE(S) (S)->v_reduc_type
kono
parents: 67
diff changeset
744 #define STMT_VINFO_VEC_CONST_COND_REDUC_CODE(S) (S)->const_cond_reduc_code
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
745
111
kono
parents: 67
diff changeset
746 #define STMT_VINFO_DR_WRT_VEC_LOOP(S) (S)->dr_wrt_vec_loop
kono
parents: 67
diff changeset
747 #define STMT_VINFO_DR_BASE_ADDRESS(S) (S)->dr_wrt_vec_loop.base_address
kono
parents: 67
diff changeset
748 #define STMT_VINFO_DR_INIT(S) (S)->dr_wrt_vec_loop.init
kono
parents: 67
diff changeset
749 #define STMT_VINFO_DR_OFFSET(S) (S)->dr_wrt_vec_loop.offset
kono
parents: 67
diff changeset
750 #define STMT_VINFO_DR_STEP(S) (S)->dr_wrt_vec_loop.step
kono
parents: 67
diff changeset
751 #define STMT_VINFO_DR_BASE_ALIGNMENT(S) (S)->dr_wrt_vec_loop.base_alignment
kono
parents: 67
diff changeset
752 #define STMT_VINFO_DR_BASE_MISALIGNMENT(S) \
kono
parents: 67
diff changeset
753 (S)->dr_wrt_vec_loop.base_misalignment
kono
parents: 67
diff changeset
754 #define STMT_VINFO_DR_OFFSET_ALIGNMENT(S) \
kono
parents: 67
diff changeset
755 (S)->dr_wrt_vec_loop.offset_alignment
kono
parents: 67
diff changeset
756 #define STMT_VINFO_DR_STEP_ALIGNMENT(S) \
kono
parents: 67
diff changeset
757 (S)->dr_wrt_vec_loop.step_alignment
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
758
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
759 #define STMT_VINFO_IN_PATTERN_P(S) (S)->in_pattern_p
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
760 #define STMT_VINFO_RELATED_STMT(S) (S)->related_stmt
111
kono
parents: 67
diff changeset
761 #define STMT_VINFO_PATTERN_DEF_SEQ(S) (S)->pattern_def_seq
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
762 #define STMT_VINFO_SAME_ALIGN_REFS(S) (S)->same_align_refs
111
kono
parents: 67
diff changeset
763 #define STMT_VINFO_SIMD_CLONE_INFO(S) (S)->simd_clone_info
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
764 #define STMT_VINFO_DEF_TYPE(S) (S)->def_type
111
kono
parents: 67
diff changeset
765 #define STMT_VINFO_GROUP_FIRST_ELEMENT(S) (S)->first_element
kono
parents: 67
diff changeset
766 #define STMT_VINFO_GROUP_NEXT_ELEMENT(S) (S)->next_element
kono
parents: 67
diff changeset
767 #define STMT_VINFO_GROUP_SIZE(S) (S)->size
kono
parents: 67
diff changeset
768 #define STMT_VINFO_GROUP_STORE_COUNT(S) (S)->store_count
kono
parents: 67
diff changeset
769 #define STMT_VINFO_GROUP_GAP(S) (S)->gap
kono
parents: 67
diff changeset
770 #define STMT_VINFO_GROUP_SAME_DR_STMT(S) (S)->same_dr_stmt
kono
parents: 67
diff changeset
771 #define STMT_VINFO_GROUPED_ACCESS(S) ((S)->first_element != NULL && (S)->data_ref_info)
kono
parents: 67
diff changeset
772 #define STMT_VINFO_LOOP_PHI_EVOLUTION_BASE_UNCHANGED(S) (S)->loop_phi_evolution_base_unchanged
kono
parents: 67
diff changeset
773 #define STMT_VINFO_LOOP_PHI_EVOLUTION_PART(S) (S)->loop_phi_evolution_part
kono
parents: 67
diff changeset
774 #define STMT_VINFO_MIN_NEG_DIST(S) (S)->min_neg_dist
kono
parents: 67
diff changeset
775 #define STMT_VINFO_NUM_SLP_USES(S) (S)->num_slp_uses
kono
parents: 67
diff changeset
776 #define STMT_VINFO_REDUC_TYPE(S) (S)->reduc_type
kono
parents: 67
diff changeset
777 #define STMT_VINFO_REDUC_DEF(S) (S)->reduc_def
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
778
111
kono
parents: 67
diff changeset
779 #define GROUP_FIRST_ELEMENT(S) (S)->first_element
kono
parents: 67
diff changeset
780 #define GROUP_NEXT_ELEMENT(S) (S)->next_element
kono
parents: 67
diff changeset
781 #define GROUP_SIZE(S) (S)->size
kono
parents: 67
diff changeset
782 #define GROUP_STORE_COUNT(S) (S)->store_count
kono
parents: 67
diff changeset
783 #define GROUP_GAP(S) (S)->gap
kono
parents: 67
diff changeset
784 #define GROUP_SAME_DR_STMT(S) (S)->same_dr_stmt
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
785
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
786 #define STMT_VINFO_RELEVANT_P(S) ((S)->relevant != vect_unused_in_scope)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
787
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
788 #define HYBRID_SLP_STMT(S) ((S)->slp_type == hybrid)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
789 #define PURE_SLP_STMT(S) ((S)->slp_type == pure_slp)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
790 #define STMT_SLP_TYPE(S) (S)->slp_type
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
791
111
kono
parents: 67
diff changeset
792 struct dataref_aux {
kono
parents: 67
diff changeset
793 /* The misalignment in bytes of the reference, or -1 if not known. */
kono
parents: 67
diff changeset
794 int misalignment;
kono
parents: 67
diff changeset
795 /* The byte alignment that we'd ideally like the reference to have,
kono
parents: 67
diff changeset
796 and the value that misalignment is measured against. */
kono
parents: 67
diff changeset
797 int target_alignment;
kono
parents: 67
diff changeset
798 /* If true the alignment of base_decl needs to be increased. */
kono
parents: 67
diff changeset
799 bool base_misaligned;
kono
parents: 67
diff changeset
800 tree base_decl;
kono
parents: 67
diff changeset
801 };
kono
parents: 67
diff changeset
802
kono
parents: 67
diff changeset
803 #define DR_VECT_AUX(dr) ((dataref_aux *)(dr)->aux)
kono
parents: 67
diff changeset
804
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
805 #define VECT_MAX_COST 1000
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
806
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
807 /* The maximum number of intermediate steps required in multi-step type
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
808 conversion. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
809 #define MAX_INTERM_CVT_STEPS 3
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
810
111
kono
parents: 67
diff changeset
811 /* The maximum vectorization factor supported by any target (V64QI). */
kono
parents: 67
diff changeset
812 #define MAX_VECTORIZATION_FACTOR 64
kono
parents: 67
diff changeset
813
kono
parents: 67
diff changeset
814 /* Nonzero if TYPE represents a (scalar) boolean type or type
kono
parents: 67
diff changeset
815 in the middle-end compatible with it (unsigned precision 1 integral
kono
parents: 67
diff changeset
816 types). Used to determine which types should be vectorized as
kono
parents: 67
diff changeset
817 VECTOR_BOOLEAN_TYPE_P. */
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
818
111
kono
parents: 67
diff changeset
819 #define VECT_SCALAR_BOOLEAN_TYPE_P(TYPE) \
kono
parents: 67
diff changeset
820 (TREE_CODE (TYPE) == BOOLEAN_TYPE \
kono
parents: 67
diff changeset
821 || ((TREE_CODE (TYPE) == INTEGER_TYPE \
kono
parents: 67
diff changeset
822 || TREE_CODE (TYPE) == ENUMERAL_TYPE) \
kono
parents: 67
diff changeset
823 && TYPE_PRECISION (TYPE) == 1 \
kono
parents: 67
diff changeset
824 && TYPE_UNSIGNED (TYPE)))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
825
111
kono
parents: 67
diff changeset
826 extern vec<stmt_vec_info> stmt_vec_info_vec;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
827
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
828 void init_stmt_vec_info_vec (void);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
829 void free_stmt_vec_info_vec (void);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
830
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
831 /* Return a stmt_vec_info corresponding to STMT. */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
832
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
833 static inline stmt_vec_info
111
kono
parents: 67
diff changeset
834 vinfo_for_stmt (gimple *stmt)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
835 {
111
kono
parents: 67
diff changeset
836 int uid = gimple_uid (stmt);
kono
parents: 67
diff changeset
837 if (uid <= 0)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
838 return NULL;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
839
111
kono
parents: 67
diff changeset
840 return stmt_vec_info_vec[uid - 1];
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
841 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
842
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
843 /* Set vectorizer information INFO for STMT. */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
844
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
845 static inline void
111
kono
parents: 67
diff changeset
846 set_vinfo_for_stmt (gimple *stmt, stmt_vec_info info)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
847 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
848 unsigned int uid = gimple_uid (stmt);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
849 if (uid == 0)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
850 {
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
851 gcc_checking_assert (info);
111
kono
parents: 67
diff changeset
852 uid = stmt_vec_info_vec.length () + 1;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
853 gimple_set_uid (stmt, uid);
111
kono
parents: 67
diff changeset
854 stmt_vec_info_vec.safe_push (info);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
855 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
856 else
111
kono
parents: 67
diff changeset
857 {
kono
parents: 67
diff changeset
858 gcc_checking_assert (info == NULL);
kono
parents: 67
diff changeset
859 stmt_vec_info_vec[uid - 1] = info;
kono
parents: 67
diff changeset
860 }
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
861 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
862
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
863 /* Return the earlier statement between STMT1 and STMT2. */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
864
111
kono
parents: 67
diff changeset
865 static inline gimple *
kono
parents: 67
diff changeset
866 get_earlier_stmt (gimple *stmt1, gimple *stmt2)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
867 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
868 unsigned int uid1, uid2;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
869
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
870 if (stmt1 == NULL)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
871 return stmt2;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
872
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
873 if (stmt2 == NULL)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
874 return stmt1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
875
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
876 uid1 = gimple_uid (stmt1);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
877 uid2 = gimple_uid (stmt2);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
878
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
879 if (uid1 == 0 || uid2 == 0)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
880 return NULL;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
881
111
kono
parents: 67
diff changeset
882 gcc_checking_assert (uid1 <= stmt_vec_info_vec.length ()
kono
parents: 67
diff changeset
883 && uid2 <= stmt_vec_info_vec.length ());
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
884
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
885 if (uid1 < uid2)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
886 return stmt1;
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
887 else
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
888 return stmt2;
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
889 }
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
890
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
891 /* Return the later statement between STMT1 and STMT2. */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
892
111
kono
parents: 67
diff changeset
893 static inline gimple *
kono
parents: 67
diff changeset
894 get_later_stmt (gimple *stmt1, gimple *stmt2)
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
895 {
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
896 unsigned int uid1, uid2;
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
897
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
898 if (stmt1 == NULL)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
899 return stmt2;
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
900
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
901 if (stmt2 == NULL)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
902 return stmt1;
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
903
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
904 uid1 = gimple_uid (stmt1);
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
905 uid2 = gimple_uid (stmt2);
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
906
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
907 if (uid1 == 0 || uid2 == 0)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
908 return NULL;
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
909
111
kono
parents: 67
diff changeset
910 gcc_assert (uid1 <= stmt_vec_info_vec.length ());
kono
parents: 67
diff changeset
911 gcc_assert (uid2 <= stmt_vec_info_vec.length ());
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
912
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
913 if (uid1 > uid2)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
914 return stmt1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
915 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
916 return stmt2;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
917 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
918
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
919 /* Return TRUE if a statement represented by STMT_INFO is a part of a
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
920 pattern. */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
921
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
922 static inline bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
923 is_pattern_stmt_p (stmt_vec_info stmt_info)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
924 {
111
kono
parents: 67
diff changeset
925 gimple *related_stmt;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
926 stmt_vec_info related_stmt_info;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
927
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
928 related_stmt = STMT_VINFO_RELATED_STMT (stmt_info);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
929 if (related_stmt
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
930 && (related_stmt_info = vinfo_for_stmt (related_stmt))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
931 && STMT_VINFO_IN_PATTERN_P (related_stmt_info))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
932 return true;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
933
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
934 return false;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
935 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
936
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
937 /* Return true if BB is a loop header. */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
938
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
939 static inline bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
940 is_loop_header_bb_p (basic_block bb)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
941 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
942 if (bb == (bb->loop_father)->header)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
943 return true;
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
944 gcc_checking_assert (EDGE_COUNT (bb->preds) == 1);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
945 return false;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
946 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
947
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
948 /* Return pow2 (X). */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
949
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
950 static inline int
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
951 vect_pow2 (int x)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
952 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
953 int i, res = 1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
954
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
955 for (i = 0; i < x; i++)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
956 res *= 2;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
957
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
958 return res;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
959 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
960
111
kono
parents: 67
diff changeset
961 /* Alias targetm.vectorize.builtin_vectorization_cost. */
kono
parents: 67
diff changeset
962
kono
parents: 67
diff changeset
963 static inline int
kono
parents: 67
diff changeset
964 builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost,
kono
parents: 67
diff changeset
965 tree vectype, int misalign)
kono
parents: 67
diff changeset
966 {
kono
parents: 67
diff changeset
967 return targetm.vectorize.builtin_vectorization_cost (type_of_cost,
kono
parents: 67
diff changeset
968 vectype, misalign);
kono
parents: 67
diff changeset
969 }
kono
parents: 67
diff changeset
970
kono
parents: 67
diff changeset
971 /* Get cost by calling cost target builtin. */
kono
parents: 67
diff changeset
972
kono
parents: 67
diff changeset
973 static inline
kono
parents: 67
diff changeset
974 int vect_get_stmt_cost (enum vect_cost_for_stmt type_of_cost)
kono
parents: 67
diff changeset
975 {
kono
parents: 67
diff changeset
976 return builtin_vectorization_cost (type_of_cost, NULL, 0);
kono
parents: 67
diff changeset
977 }
kono
parents: 67
diff changeset
978
kono
parents: 67
diff changeset
979 /* Alias targetm.vectorize.init_cost. */
kono
parents: 67
diff changeset
980
kono
parents: 67
diff changeset
981 static inline void *
kono
parents: 67
diff changeset
982 init_cost (struct loop *loop_info)
kono
parents: 67
diff changeset
983 {
kono
parents: 67
diff changeset
984 return targetm.vectorize.init_cost (loop_info);
kono
parents: 67
diff changeset
985 }
kono
parents: 67
diff changeset
986
kono
parents: 67
diff changeset
987 /* Alias targetm.vectorize.add_stmt_cost. */
kono
parents: 67
diff changeset
988
kono
parents: 67
diff changeset
989 static inline unsigned
kono
parents: 67
diff changeset
990 add_stmt_cost (void *data, int count, enum vect_cost_for_stmt kind,
kono
parents: 67
diff changeset
991 stmt_vec_info stmt_info, int misalign,
kono
parents: 67
diff changeset
992 enum vect_cost_model_location where)
kono
parents: 67
diff changeset
993 {
kono
parents: 67
diff changeset
994 return targetm.vectorize.add_stmt_cost (data, count, kind,
kono
parents: 67
diff changeset
995 stmt_info, misalign, where);
kono
parents: 67
diff changeset
996 }
kono
parents: 67
diff changeset
997
kono
parents: 67
diff changeset
998 /* Alias targetm.vectorize.finish_cost. */
kono
parents: 67
diff changeset
999
kono
parents: 67
diff changeset
1000 static inline void
kono
parents: 67
diff changeset
1001 finish_cost (void *data, unsigned *prologue_cost,
kono
parents: 67
diff changeset
1002 unsigned *body_cost, unsigned *epilogue_cost)
kono
parents: 67
diff changeset
1003 {
kono
parents: 67
diff changeset
1004 targetm.vectorize.finish_cost (data, prologue_cost, body_cost, epilogue_cost);
kono
parents: 67
diff changeset
1005 }
kono
parents: 67
diff changeset
1006
kono
parents: 67
diff changeset
1007 /* Alias targetm.vectorize.destroy_cost_data. */
kono
parents: 67
diff changeset
1008
kono
parents: 67
diff changeset
1009 static inline void
kono
parents: 67
diff changeset
1010 destroy_cost_data (void *data)
kono
parents: 67
diff changeset
1011 {
kono
parents: 67
diff changeset
1012 targetm.vectorize.destroy_cost_data (data);
kono
parents: 67
diff changeset
1013 }
kono
parents: 67
diff changeset
1014
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1015 /*-----------------------------------------------------------------*/
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1016 /* Info on data references alignment. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1017 /*-----------------------------------------------------------------*/
111
kono
parents: 67
diff changeset
1018 inline void
kono
parents: 67
diff changeset
1019 set_dr_misalignment (struct data_reference *dr, int val)
kono
parents: 67
diff changeset
1020 {
kono
parents: 67
diff changeset
1021 dataref_aux *data_aux = DR_VECT_AUX (dr);
kono
parents: 67
diff changeset
1022
kono
parents: 67
diff changeset
1023 if (!data_aux)
kono
parents: 67
diff changeset
1024 {
kono
parents: 67
diff changeset
1025 data_aux = XCNEW (dataref_aux);
kono
parents: 67
diff changeset
1026 dr->aux = data_aux;
kono
parents: 67
diff changeset
1027 }
kono
parents: 67
diff changeset
1028
kono
parents: 67
diff changeset
1029 data_aux->misalignment = val;
kono
parents: 67
diff changeset
1030 }
kono
parents: 67
diff changeset
1031
kono
parents: 67
diff changeset
1032 inline int
kono
parents: 67
diff changeset
1033 dr_misalignment (struct data_reference *dr)
kono
parents: 67
diff changeset
1034 {
kono
parents: 67
diff changeset
1035 return DR_VECT_AUX (dr)->misalignment;
kono
parents: 67
diff changeset
1036 }
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1037
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1038 /* Reflects actual alignment of first access in the vectorized loop,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1039 taking into account peeling/versioning if applied. */
111
kono
parents: 67
diff changeset
1040 #define DR_MISALIGNMENT(DR) dr_misalignment (DR)
kono
parents: 67
diff changeset
1041 #define SET_DR_MISALIGNMENT(DR, VAL) set_dr_misalignment (DR, VAL)
kono
parents: 67
diff changeset
1042 #define DR_MISALIGNMENT_UNKNOWN (-1)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1043
111
kono
parents: 67
diff changeset
1044 /* Only defined once DR_MISALIGNMENT is defined. */
kono
parents: 67
diff changeset
1045 #define DR_TARGET_ALIGNMENT(DR) DR_VECT_AUX (DR)->target_alignment
kono
parents: 67
diff changeset
1046
kono
parents: 67
diff changeset
1047 /* Return true if data access DR is aligned to its target alignment
kono
parents: 67
diff changeset
1048 (which may be less than a full vector). */
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
1049
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1050 static inline bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1051 aligned_access_p (struct data_reference *data_ref_info)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1052 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1053 return (DR_MISALIGNMENT (data_ref_info) == 0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1054 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1055
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
1056 /* Return TRUE if the alignment of the data access is known, and FALSE
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
1057 otherwise. */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
1058
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1059 static inline bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1060 known_alignment_for_access_p (struct data_reference *data_ref_info)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1061 {
111
kono
parents: 67
diff changeset
1062 return (DR_MISALIGNMENT (data_ref_info) != DR_MISALIGNMENT_UNKNOWN);
kono
parents: 67
diff changeset
1063 }
kono
parents: 67
diff changeset
1064
kono
parents: 67
diff changeset
1065 /* Return the minimum alignment in bytes that the vectorized version
kono
parents: 67
diff changeset
1066 of DR is guaranteed to have. */
kono
parents: 67
diff changeset
1067
kono
parents: 67
diff changeset
1068 static inline unsigned int
kono
parents: 67
diff changeset
1069 vect_known_alignment_in_bytes (struct data_reference *dr)
kono
parents: 67
diff changeset
1070 {
kono
parents: 67
diff changeset
1071 if (DR_MISALIGNMENT (dr) == DR_MISALIGNMENT_UNKNOWN)
kono
parents: 67
diff changeset
1072 return TYPE_ALIGN_UNIT (TREE_TYPE (DR_REF (dr)));
kono
parents: 67
diff changeset
1073 if (DR_MISALIGNMENT (dr) == 0)
kono
parents: 67
diff changeset
1074 return DR_TARGET_ALIGNMENT (dr);
kono
parents: 67
diff changeset
1075 return DR_MISALIGNMENT (dr) & -DR_MISALIGNMENT (dr);
kono
parents: 67
diff changeset
1076 }
kono
parents: 67
diff changeset
1077
kono
parents: 67
diff changeset
1078 /* Return the behavior of DR with respect to the vectorization context
kono
parents: 67
diff changeset
1079 (which for outer loop vectorization might not be the behavior recorded
kono
parents: 67
diff changeset
1080 in DR itself). */
kono
parents: 67
diff changeset
1081
kono
parents: 67
diff changeset
1082 static inline innermost_loop_behavior *
kono
parents: 67
diff changeset
1083 vect_dr_behavior (data_reference *dr)
kono
parents: 67
diff changeset
1084 {
kono
parents: 67
diff changeset
1085 gimple *stmt = DR_STMT (dr);
kono
parents: 67
diff changeset
1086 stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
kono
parents: 67
diff changeset
1087 loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
kono
parents: 67
diff changeset
1088 if (loop_vinfo == NULL
kono
parents: 67
diff changeset
1089 || !nested_in_vect_loop_p (LOOP_VINFO_LOOP (loop_vinfo), stmt))
kono
parents: 67
diff changeset
1090 return &DR_INNERMOST (dr);
kono
parents: 67
diff changeset
1091 else
kono
parents: 67
diff changeset
1092 return &STMT_VINFO_DR_WRT_VEC_LOOP (stmt_info);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1093 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1094
111
kono
parents: 67
diff changeset
1095 /* Return true if the vect cost model is unlimited. */
kono
parents: 67
diff changeset
1096 static inline bool
kono
parents: 67
diff changeset
1097 unlimited_cost_model (loop_p loop)
kono
parents: 67
diff changeset
1098 {
kono
parents: 67
diff changeset
1099 if (loop != NULL && loop->force_vectorize
kono
parents: 67
diff changeset
1100 && flag_simd_cost_model != VECT_COST_MODEL_DEFAULT)
kono
parents: 67
diff changeset
1101 return flag_simd_cost_model == VECT_COST_MODEL_UNLIMITED;
kono
parents: 67
diff changeset
1102 return (flag_vect_cost_model == VECT_COST_MODEL_UNLIMITED);
kono
parents: 67
diff changeset
1103 }
kono
parents: 67
diff changeset
1104
kono
parents: 67
diff changeset
1105 /* Return the number of copies needed for loop vectorization when
kono
parents: 67
diff changeset
1106 a statement operates on vectors of type VECTYPE. This is the
kono
parents: 67
diff changeset
1107 vectorization factor divided by the number of elements in
kono
parents: 67
diff changeset
1108 VECTYPE and is always known at compile time. */
kono
parents: 67
diff changeset
1109
kono
parents: 67
diff changeset
1110 static inline unsigned int
kono
parents: 67
diff changeset
1111 vect_get_num_copies (loop_vec_info loop_vinfo, tree vectype)
kono
parents: 67
diff changeset
1112 {
kono
parents: 67
diff changeset
1113 gcc_checking_assert (LOOP_VINFO_VECT_FACTOR (loop_vinfo)
kono
parents: 67
diff changeset
1114 % TYPE_VECTOR_SUBPARTS (vectype) == 0);
kono
parents: 67
diff changeset
1115 return (LOOP_VINFO_VECT_FACTOR (loop_vinfo)
kono
parents: 67
diff changeset
1116 / TYPE_VECTOR_SUBPARTS (vectype));
kono
parents: 67
diff changeset
1117 }
kono
parents: 67
diff changeset
1118
kono
parents: 67
diff changeset
1119 /* Return the size of the value accessed by unvectorized data reference DR.
kono
parents: 67
diff changeset
1120 This is only valid once STMT_VINFO_VECTYPE has been calculated for the
kono
parents: 67
diff changeset
1121 associated gimple statement, since that guarantees that DR accesses
kono
parents: 67
diff changeset
1122 either a scalar or a scalar equivalent. ("Scalar equivalent" here
kono
parents: 67
diff changeset
1123 includes things like V1SI, which can be vectorized in the same way
kono
parents: 67
diff changeset
1124 as a plain SI.) */
kono
parents: 67
diff changeset
1125
kono
parents: 67
diff changeset
1126 inline unsigned int
kono
parents: 67
diff changeset
1127 vect_get_scalar_dr_size (struct data_reference *dr)
kono
parents: 67
diff changeset
1128 {
kono
parents: 67
diff changeset
1129 return tree_to_uhwi (TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (dr))));
kono
parents: 67
diff changeset
1130 }
kono
parents: 67
diff changeset
1131
kono
parents: 67
diff changeset
1132 /* Source location */
kono
parents: 67
diff changeset
1133 extern source_location vect_location;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1134
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1135 /*-----------------------------------------------------------------*/
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1136 /* Function prototypes. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1137 /*-----------------------------------------------------------------*/
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1138
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1139 /* Simple loop peeling and versioning utilities for vectorizer's purposes -
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1140 in tree-vect-loop-manip.c. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1141 extern void slpeel_make_loop_iterate_ntimes (struct loop *, tree);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1142 extern bool slpeel_can_duplicate_loop_p (const struct loop *, const_edge);
111
kono
parents: 67
diff changeset
1143 struct loop *slpeel_tree_duplicate_loop_to_edge_cfg (struct loop *,
kono
parents: 67
diff changeset
1144 struct loop *, edge);
kono
parents: 67
diff changeset
1145 extern void vect_loop_versioning (loop_vec_info, unsigned int, bool);
kono
parents: 67
diff changeset
1146 extern struct loop *vect_do_peeling (loop_vec_info, tree, tree,
kono
parents: 67
diff changeset
1147 tree *, int, bool, bool);
kono
parents: 67
diff changeset
1148 extern source_location find_loop_location (struct loop *);
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1149 extern bool vect_can_advance_ivs_p (loop_vec_info);
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1150
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1151 /* In tree-vect-stmts.c. */
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
1152 extern unsigned int current_vector_size;
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1153 extern tree get_vectype_for_scalar_type (tree);
111
kono
parents: 67
diff changeset
1154 extern tree get_mask_type_for_scalar_type (tree);
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1155 extern tree get_same_sized_vectype (tree, tree);
111
kono
parents: 67
diff changeset
1156 extern bool vect_is_simple_use (tree, vec_info *, gimple **,
kono
parents: 67
diff changeset
1157 enum vect_def_type *);
kono
parents: 67
diff changeset
1158 extern bool vect_is_simple_use (tree, vec_info *, gimple **,
kono
parents: 67
diff changeset
1159 enum vect_def_type *, tree *);
kono
parents: 67
diff changeset
1160 extern bool supportable_widening_operation (enum tree_code, gimple *, tree,
kono
parents: 67
diff changeset
1161 tree, enum tree_code *,
kono
parents: 67
diff changeset
1162 enum tree_code *, int *,
kono
parents: 67
diff changeset
1163 vec<tree> *);
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1164 extern bool supportable_narrowing_operation (enum tree_code, tree, tree,
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1165 enum tree_code *,
111
kono
parents: 67
diff changeset
1166 int *, vec<tree> *);
kono
parents: 67
diff changeset
1167 extern stmt_vec_info new_stmt_vec_info (gimple *stmt, vec_info *);
kono
parents: 67
diff changeset
1168 extern void free_stmt_vec_info (gimple *stmt);
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1169 extern void vect_model_simple_cost (stmt_vec_info, int, enum vect_def_type *,
111
kono
parents: 67
diff changeset
1170 int, stmt_vector_for_cost *,
kono
parents: 67
diff changeset
1171 stmt_vector_for_cost *);
kono
parents: 67
diff changeset
1172 extern void vect_model_store_cost (stmt_vec_info, int, vect_memory_access_type,
kono
parents: 67
diff changeset
1173 enum vect_def_type, slp_tree,
kono
parents: 67
diff changeset
1174 stmt_vector_for_cost *,
kono
parents: 67
diff changeset
1175 stmt_vector_for_cost *);
kono
parents: 67
diff changeset
1176 extern void vect_model_load_cost (stmt_vec_info, int, vect_memory_access_type,
kono
parents: 67
diff changeset
1177 slp_tree, stmt_vector_for_cost *,
kono
parents: 67
diff changeset
1178 stmt_vector_for_cost *);
kono
parents: 67
diff changeset
1179 extern unsigned record_stmt_cost (stmt_vector_for_cost *, int,
kono
parents: 67
diff changeset
1180 enum vect_cost_for_stmt, stmt_vec_info,
kono
parents: 67
diff changeset
1181 int, enum vect_cost_model_location);
kono
parents: 67
diff changeset
1182 extern void vect_finish_stmt_generation (gimple *, gimple *,
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1183 gimple_stmt_iterator *);
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1184 extern bool vect_mark_stmts_to_be_vectorized (loop_vec_info);
111
kono
parents: 67
diff changeset
1185 extern tree vect_get_vec_def_for_operand_1 (gimple *, enum vect_def_type);
kono
parents: 67
diff changeset
1186 extern tree vect_get_vec_def_for_operand (tree, gimple *, tree = NULL);
kono
parents: 67
diff changeset
1187 extern void vect_get_vec_defs (tree, tree, gimple *, vec<tree> *,
kono
parents: 67
diff changeset
1188 vec<tree> *, slp_tree);
kono
parents: 67
diff changeset
1189 extern void vect_get_vec_defs_for_stmt_copy (enum vect_def_type *,
kono
parents: 67
diff changeset
1190 vec<tree> *, vec<tree> *);
kono
parents: 67
diff changeset
1191 extern tree vect_init_vector (gimple *, tree, tree,
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1192 gimple_stmt_iterator *);
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1193 extern tree vect_get_vec_def_for_stmt_copy (enum vect_def_type, tree);
111
kono
parents: 67
diff changeset
1194 extern bool vect_transform_stmt (gimple *, gimple_stmt_iterator *,
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1195 bool *, slp_tree, slp_instance);
111
kono
parents: 67
diff changeset
1196 extern void vect_remove_stores (gimple *);
kono
parents: 67
diff changeset
1197 extern bool vect_analyze_stmt (gimple *, bool *, slp_tree, slp_instance);
kono
parents: 67
diff changeset
1198 extern bool vectorizable_condition (gimple *, gimple_stmt_iterator *,
kono
parents: 67
diff changeset
1199 gimple **, tree, int, slp_tree);
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
1200 extern void vect_get_load_cost (struct data_reference *, int, bool,
111
kono
parents: 67
diff changeset
1201 unsigned int *, unsigned int *,
kono
parents: 67
diff changeset
1202 stmt_vector_for_cost *,
kono
parents: 67
diff changeset
1203 stmt_vector_for_cost *, bool);
kono
parents: 67
diff changeset
1204 extern void vect_get_store_cost (struct data_reference *, int,
kono
parents: 67
diff changeset
1205 unsigned int *, stmt_vector_for_cost *);
kono
parents: 67
diff changeset
1206 extern bool vect_supportable_shift (enum tree_code, tree);
kono
parents: 67
diff changeset
1207 extern tree vect_gen_perm_mask_any (tree, vec_perm_indices);
kono
parents: 67
diff changeset
1208 extern tree vect_gen_perm_mask_checked (tree, vec_perm_indices);
kono
parents: 67
diff changeset
1209 extern void optimize_mask_stores (struct loop*);
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1210
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1211 /* In tree-vect-data-refs.c. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1212 extern bool vect_can_force_dr_alignment_p (const_tree, unsigned int);
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1213 extern enum dr_alignment_support vect_supportable_dr_alignment
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
1214 (struct data_reference *, bool);
111
kono
parents: 67
diff changeset
1215 extern tree vect_get_smallest_scalar_type (gimple *, HOST_WIDE_INT *,
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1216 HOST_WIDE_INT *);
111
kono
parents: 67
diff changeset
1217 extern bool vect_analyze_data_ref_dependences (loop_vec_info, int *);
kono
parents: 67
diff changeset
1218 extern bool vect_slp_analyze_instance_dependence (slp_instance);
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1219 extern bool vect_enhance_data_refs_alignment (loop_vec_info);
111
kono
parents: 67
diff changeset
1220 extern bool vect_analyze_data_refs_alignment (loop_vec_info);
kono
parents: 67
diff changeset
1221 extern bool vect_verify_datarefs_alignment (loop_vec_info);
kono
parents: 67
diff changeset
1222 extern bool vect_slp_analyze_and_verify_instance_alignment (slp_instance);
kono
parents: 67
diff changeset
1223 extern bool vect_analyze_data_ref_accesses (vec_info *);
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1224 extern bool vect_prune_runtime_alias_test_list (loop_vec_info);
111
kono
parents: 67
diff changeset
1225 extern bool vect_check_gather_scatter (gimple *, loop_vec_info,
kono
parents: 67
diff changeset
1226 gather_scatter_info *);
kono
parents: 67
diff changeset
1227 extern bool vect_analyze_data_refs (vec_info *, int *);
kono
parents: 67
diff changeset
1228 extern void vect_record_base_alignments (vec_info *);
kono
parents: 67
diff changeset
1229 extern tree vect_create_data_ref_ptr (gimple *, tree, struct loop *, tree,
kono
parents: 67
diff changeset
1230 tree *, gimple_stmt_iterator *,
kono
parents: 67
diff changeset
1231 gimple **, bool, bool *,
kono
parents: 67
diff changeset
1232 tree = NULL_TREE);
kono
parents: 67
diff changeset
1233 extern tree bump_vector_ptr (tree, gimple *, gimple_stmt_iterator *, gimple *,
kono
parents: 67
diff changeset
1234 tree);
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1235 extern tree vect_create_destination_var (tree, tree);
111
kono
parents: 67
diff changeset
1236 extern bool vect_grouped_store_supported (tree, unsigned HOST_WIDE_INT);
kono
parents: 67
diff changeset
1237 extern bool vect_store_lanes_supported (tree, unsigned HOST_WIDE_INT);
kono
parents: 67
diff changeset
1238 extern bool vect_grouped_load_supported (tree, bool, unsigned HOST_WIDE_INT);
kono
parents: 67
diff changeset
1239 extern bool vect_load_lanes_supported (tree, unsigned HOST_WIDE_INT);
kono
parents: 67
diff changeset
1240 extern void vect_permute_store_chain (vec<tree> ,unsigned int, gimple *,
kono
parents: 67
diff changeset
1241 gimple_stmt_iterator *, vec<tree> *);
kono
parents: 67
diff changeset
1242 extern tree vect_setup_realignment (gimple *, gimple_stmt_iterator *, tree *,
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1243 enum dr_alignment_support, tree,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1244 struct loop **);
111
kono
parents: 67
diff changeset
1245 extern void vect_transform_grouped_load (gimple *, vec<tree> , int,
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1246 gimple_stmt_iterator *);
111
kono
parents: 67
diff changeset
1247 extern void vect_record_grouped_load_vectors (gimple *, vec<tree> );
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1248 extern tree vect_get_new_vect_var (tree, enum vect_var_kind, const char *);
111
kono
parents: 67
diff changeset
1249 extern tree vect_get_new_ssa_name (tree, enum vect_var_kind,
kono
parents: 67
diff changeset
1250 const char * = NULL);
kono
parents: 67
diff changeset
1251 extern tree vect_create_addr_base_for_vector_ref (gimple *, gimple_seq *,
kono
parents: 67
diff changeset
1252 tree, tree = NULL_TREE);
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1253
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1254 /* In tree-vect-loop.c. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1255 /* FORNOW: Used in tree-parloops.c. */
111
kono
parents: 67
diff changeset
1256 extern gimple *vect_force_simple_reduction (loop_vec_info, gimple *,
kono
parents: 67
diff changeset
1257 bool *, bool);
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1258 /* Drive for loop analysis stage. */
111
kono
parents: 67
diff changeset
1259 extern loop_vec_info vect_analyze_loop (struct loop *, loop_vec_info);
kono
parents: 67
diff changeset
1260 extern tree vect_build_loop_niters (loop_vec_info, bool * = NULL);
kono
parents: 67
diff changeset
1261 extern void vect_gen_vector_loop_niters (loop_vec_info, tree, tree *, bool);
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1262 /* Drive for loop transformation stage. */
111
kono
parents: 67
diff changeset
1263 extern struct loop *vect_transform_loop (loop_vec_info);
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1264 extern loop_vec_info vect_analyze_loop_form (struct loop *);
111
kono
parents: 67
diff changeset
1265 extern bool vectorizable_live_operation (gimple *, gimple_stmt_iterator *,
kono
parents: 67
diff changeset
1266 slp_tree, int, gimple **);
kono
parents: 67
diff changeset
1267 extern bool vectorizable_reduction (gimple *, gimple_stmt_iterator *,
kono
parents: 67
diff changeset
1268 gimple **, slp_tree, slp_instance);
kono
parents: 67
diff changeset
1269 extern bool vectorizable_induction (gimple *, gimple_stmt_iterator *,
kono
parents: 67
diff changeset
1270 gimple **, slp_tree);
kono
parents: 67
diff changeset
1271 extern tree get_initial_def_for_reduction (gimple *, tree, tree *);
kono
parents: 67
diff changeset
1272 extern bool vect_worthwhile_without_simd_p (vec_info *, tree_code);
kono
parents: 67
diff changeset
1273 extern int vect_get_known_peeling_cost (loop_vec_info, int, int *,
kono
parents: 67
diff changeset
1274 stmt_vector_for_cost *,
kono
parents: 67
diff changeset
1275 stmt_vector_for_cost *,
kono
parents: 67
diff changeset
1276 stmt_vector_for_cost *);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1277
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1278 /* In tree-vect-slp.c. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1279 extern void vect_free_slp_instance (slp_instance);
111
kono
parents: 67
diff changeset
1280 extern bool vect_transform_slp_perm_load (slp_tree, vec<tree> ,
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1281 gimple_stmt_iterator *, int,
111
kono
parents: 67
diff changeset
1282 slp_instance, bool, unsigned *);
kono
parents: 67
diff changeset
1283 extern bool vect_slp_analyze_operations (vec_info *);
kono
parents: 67
diff changeset
1284 extern bool vect_schedule_slp (vec_info *);
kono
parents: 67
diff changeset
1285 extern bool vect_analyze_slp (vec_info *, unsigned);
kono
parents: 67
diff changeset
1286 extern bool vect_make_slp_decision (loop_vec_info);
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1287 extern void vect_detect_hybrid_slp (loop_vec_info);
111
kono
parents: 67
diff changeset
1288 extern void vect_get_slp_defs (vec<tree> , slp_tree, vec<vec<tree> > *);
kono
parents: 67
diff changeset
1289 extern bool vect_slp_bb (basic_block);
kono
parents: 67
diff changeset
1290 extern gimple *vect_find_last_scalar_stmt_in_slp (slp_tree);
kono
parents: 67
diff changeset
1291 extern bool is_simple_and_all_uses_invariant (gimple *, loop_vec_info);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1292
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1293 /* In tree-vect-patterns.c. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1294 /* Pattern recognition functions.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1295 Additional pattern recognition functions can (and will) be added
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1296 in the future. */
111
kono
parents: 67
diff changeset
1297 typedef gimple *(* vect_recog_func_ptr) (vec<gimple *> *, tree *, tree *);
kono
parents: 67
diff changeset
1298 #define NUM_PATTERNS 14
kono
parents: 67
diff changeset
1299 void vect_pattern_recog (vec_info *);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1300
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1301 /* In tree-vectorizer.c. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1302 unsigned vectorize_loops (void);
111
kono
parents: 67
diff changeset
1303 bool vect_stmt_in_region_p (vec_info *, gimple *);
kono
parents: 67
diff changeset
1304 void vect_free_loop_info_assumptions (struct loop *);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1305
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1306 #endif /* GCC_TREE_VECTORIZER_H */