diff options
Diffstat (limited to 'toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106820.patch')
-rw-r--r-- | toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106820.patch | 378 |
1 files changed, 0 insertions, 378 deletions
diff --git a/toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106820.patch b/toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106820.patch deleted file mode 100644 index 4a886ce56d..0000000000 --- a/toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106820.patch +++ /dev/null | |||
@@ -1,378 +0,0 @@ | |||
1 | 2011-10-06 Ira Rosen <ira.rosen@linaro.org> | ||
2 | |||
3 | Backport from mainline: | ||
4 | |||
5 | 2011-09-25 Ira Rosen <ira.rosen@linaro.org> | ||
6 | |||
7 | gcc/ | ||
8 | * tree-data-ref.c (dr_analyze_innermost): Add new argument. | ||
9 | Allow not simple iv if analyzing basic block. | ||
10 | (create_data_ref): Update call to dr_analyze_innermost. | ||
11 | (stmt_with_adjacent_zero_store_dr_p, ref_base_address): Likewise. | ||
12 | * tree-loop-distribution.c (generate_memset_zero): Likewise. | ||
13 | * tree-predcom.c (find_looparound_phi): Likewise. | ||
14 | * tree-data-ref.h (dr_analyze_innermost): Add new argument. | ||
15 | |||
16 | gcc/testsuite/ | ||
17 | * gcc.dg/vect/bb-slp-24.c: New. | ||
18 | |||
19 | |||
20 | 2011-09-15 Ira Rosen <ira.rosen@linaro.org> | ||
21 | |||
22 | gcc/ | ||
23 | * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Allow | ||
24 | read-after-read dependencies in basic block SLP. | ||
25 | |||
26 | gcc/testsuite/ | ||
27 | * gcc.dg/vect/bb-slp-25.c: New. | ||
28 | |||
29 | |||
30 | 2011-04-21 Richard Sandiford <richard.sandiford@linaro.org> | ||
31 | |||
32 | gcc/ | ||
33 | * tree-vect-data-refs.c (vect_drs_dependent_in_basic_block): Use | ||
34 | operand_equal_p to compare DR_BASE_ADDRESSes. | ||
35 | (vect_check_interleaving): Likewise. | ||
36 | |||
37 | gcc/testsuite/ | ||
38 | * gcc.dg/vect/vect-119.c: New test. | ||
39 | |||
40 | === added file 'gcc/testsuite/gcc.dg/vect/bb-slp-24.c' | ||
41 | --- old/gcc/testsuite/gcc.dg/vect/bb-slp-24.c 1970-01-01 00:00:00 +0000 | ||
42 | +++ new/gcc/testsuite/gcc.dg/vect/bb-slp-24.c 2011-10-02 08:43:10 +0000 | ||
43 | @@ -0,0 +1,59 @@ | ||
44 | +/* { dg-require-effective-target vect_int } */ | ||
45 | + | ||
46 | +#include <stdarg.h> | ||
47 | +#include "tree-vect.h" | ||
48 | + | ||
49 | +#define A 3 | ||
50 | +#define N 256 | ||
51 | + | ||
52 | +short src[N], dst[N]; | ||
53 | + | ||
54 | +void foo (short * __restrict__ dst, short * __restrict__ src, int h, | ||
55 | + int stride, int dummy) | ||
56 | +{ | ||
57 | + int i; | ||
58 | + h /= 8; | ||
59 | + for (i = 0; i < h; i++) | ||
60 | + { | ||
61 | + dst[0] += A*src[0]; | ||
62 | + dst[1] += A*src[1]; | ||
63 | + dst[2] += A*src[2]; | ||
64 | + dst[3] += A*src[3]; | ||
65 | + dst[4] += A*src[4]; | ||
66 | + dst[5] += A*src[5]; | ||
67 | + dst[6] += A*src[6]; | ||
68 | + dst[7] += A*src[7]; | ||
69 | + dst += stride; | ||
70 | + src += stride; | ||
71 | + if (dummy == 32) | ||
72 | + abort (); | ||
73 | + } | ||
74 | +} | ||
75 | + | ||
76 | + | ||
77 | +int main (void) | ||
78 | +{ | ||
79 | + int i; | ||
80 | + | ||
81 | + check_vect (); | ||
82 | + | ||
83 | + for (i = 0; i < N; i++) | ||
84 | + { | ||
85 | + dst[i] = 0; | ||
86 | + src[i] = i; | ||
87 | + } | ||
88 | + | ||
89 | + foo (dst, src, N, 8, 0); | ||
90 | + | ||
91 | + for (i = 0; i < N; i++) | ||
92 | + { | ||
93 | + if (dst[i] != A * i) | ||
94 | + abort (); | ||
95 | + } | ||
96 | + | ||
97 | + return 0; | ||
98 | +} | ||
99 | + | ||
100 | +/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target vect_element_align } } } */ | ||
101 | +/* { dg-final { cleanup-tree-dump "slp" } } */ | ||
102 | + | ||
103 | |||
104 | === added file 'gcc/testsuite/gcc.dg/vect/bb-slp-25.c' | ||
105 | --- old/gcc/testsuite/gcc.dg/vect/bb-slp-25.c 1970-01-01 00:00:00 +0000 | ||
106 | +++ new/gcc/testsuite/gcc.dg/vect/bb-slp-25.c 2011-10-02 08:43:10 +0000 | ||
107 | @@ -0,0 +1,59 @@ | ||
108 | +/* { dg-require-effective-target vect_int } */ | ||
109 | + | ||
110 | +#include <stdarg.h> | ||
111 | +#include "tree-vect.h" | ||
112 | + | ||
113 | +#define A 3 | ||
114 | +#define B 4 | ||
115 | +#define N 256 | ||
116 | + | ||
117 | +short src[N], dst[N]; | ||
118 | + | ||
119 | +void foo (short * __restrict__ dst, short * __restrict__ src, int h, int stride, int dummy) | ||
120 | +{ | ||
121 | + int i; | ||
122 | + h /= 16; | ||
123 | + for (i = 0; i < h; i++) | ||
124 | + { | ||
125 | + dst[0] += A*src[0] + src[stride]; | ||
126 | + dst[1] += A*src[1] + src[1+stride]; | ||
127 | + dst[2] += A*src[2] + src[2+stride]; | ||
128 | + dst[3] += A*src[3] + src[3+stride]; | ||
129 | + dst[4] += A*src[4] + src[4+stride]; | ||
130 | + dst[5] += A*src[5] + src[5+stride]; | ||
131 | + dst[6] += A*src[6] + src[6+stride]; | ||
132 | + dst[7] += A*src[7] + src[7+stride]; | ||
133 | + dst += 8; | ||
134 | + src += 8; | ||
135 | + if (dummy == 32) | ||
136 | + abort (); | ||
137 | + } | ||
138 | +} | ||
139 | + | ||
140 | + | ||
141 | +int main (void) | ||
142 | +{ | ||
143 | + int i; | ||
144 | + | ||
145 | + check_vect (); | ||
146 | + | ||
147 | + for (i = 0; i < N; i++) | ||
148 | + { | ||
149 | + dst[i] = 0; | ||
150 | + src[i] = i; | ||
151 | + } | ||
152 | + | ||
153 | + foo (dst, src, N, 8, 0); | ||
154 | + | ||
155 | + for (i = 0; i < N/2; i++) | ||
156 | + { | ||
157 | + if (dst[i] != A * i + i + 8) | ||
158 | + abort (); | ||
159 | + } | ||
160 | + | ||
161 | + return 0; | ||
162 | +} | ||
163 | + | ||
164 | +/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target vect_element_align } } } */ | ||
165 | +/* { dg-final { cleanup-tree-dump "slp" } } */ | ||
166 | + | ||
167 | |||
168 | === added file 'gcc/testsuite/gcc.dg/vect/vect-119.c' | ||
169 | --- old/gcc/testsuite/gcc.dg/vect/vect-119.c 1970-01-01 00:00:00 +0000 | ||
170 | +++ new/gcc/testsuite/gcc.dg/vect/vect-119.c 2011-10-02 08:43:10 +0000 | ||
171 | @@ -0,0 +1,28 @@ | ||
172 | +/* { dg-do compile } */ | ||
173 | + | ||
174 | +#define OUTER 32 | ||
175 | +#define INNER 40 | ||
176 | + | ||
177 | +static unsigned int | ||
178 | +bar (const unsigned int x[INNER][2], unsigned int sum) | ||
179 | +{ | ||
180 | + int i; | ||
181 | + | ||
182 | + for (i = 0; i < INNER; i++) | ||
183 | + sum += x[i][0] * x[i][0] + x[i][1] * x[i][1]; | ||
184 | + return sum; | ||
185 | +} | ||
186 | + | ||
187 | +unsigned int foo (const unsigned int x[OUTER][INNER][2]) | ||
188 | +{ | ||
189 | + int i; | ||
190 | + unsigned int sum; | ||
191 | + | ||
192 | + sum = 0.0f; | ||
193 | + for (i = 0; i < OUTER; i++) | ||
194 | + sum = bar (x[i], sum); | ||
195 | + return sum; | ||
196 | +} | ||
197 | + | ||
198 | +/* { dg-final { scan-tree-dump-times "Detected interleaving of size 2" 1 "vect" } } */ | ||
199 | +/* { dg-final { cleanup-tree-dump "vect" } } */ | ||
200 | |||
201 | === modified file 'gcc/tree-data-ref.c' | ||
202 | --- old/gcc/tree-data-ref.c 2011-05-26 14:27:33 +0000 | ||
203 | +++ new/gcc/tree-data-ref.c 2011-10-02 08:43:10 +0000 | ||
204 | @@ -721,11 +721,11 @@ | ||
205 | } | ||
206 | |||
207 | /* Analyzes the behavior of the memory reference DR in the innermost loop or | ||
208 | - basic block that contains it. Returns true if analysis succeed or false | ||
209 | + basic block that contains it. Returns true if analysis succeed or false | ||
210 | otherwise. */ | ||
211 | |||
212 | bool | ||
213 | -dr_analyze_innermost (struct data_reference *dr) | ||
214 | +dr_analyze_innermost (struct data_reference *dr, struct loop *nest) | ||
215 | { | ||
216 | gimple stmt = DR_STMT (dr); | ||
217 | struct loop *loop = loop_containing_stmt (stmt); | ||
218 | @@ -768,14 +768,25 @@ | ||
219 | } | ||
220 | else | ||
221 | base = build_fold_addr_expr (base); | ||
222 | + | ||
223 | if (in_loop) | ||
224 | { | ||
225 | if (!simple_iv (loop, loop_containing_stmt (stmt), base, &base_iv, | ||
226 | false)) | ||
227 | { | ||
228 | - if (dump_file && (dump_flags & TDF_DETAILS)) | ||
229 | - fprintf (dump_file, "failed: evolution of base is not affine.\n"); | ||
230 | - return false; | ||
231 | + if (nest) | ||
232 | + { | ||
233 | + if (dump_file && (dump_flags & TDF_DETAILS)) | ||
234 | + fprintf (dump_file, "failed: evolution of base is not" | ||
235 | + " affine.\n"); | ||
236 | + return false; | ||
237 | + } | ||
238 | + else | ||
239 | + { | ||
240 | + base_iv.base = base; | ||
241 | + base_iv.step = ssize_int (0); | ||
242 | + base_iv.no_overflow = true; | ||
243 | + } | ||
244 | } | ||
245 | } | ||
246 | else | ||
247 | @@ -800,10 +811,18 @@ | ||
248 | else if (!simple_iv (loop, loop_containing_stmt (stmt), | ||
249 | poffset, &offset_iv, false)) | ||
250 | { | ||
251 | - if (dump_file && (dump_flags & TDF_DETAILS)) | ||
252 | - fprintf (dump_file, "failed: evolution of offset is not" | ||
253 | - " affine.\n"); | ||
254 | - return false; | ||
255 | + if (nest) | ||
256 | + { | ||
257 | + if (dump_file && (dump_flags & TDF_DETAILS)) | ||
258 | + fprintf (dump_file, "failed: evolution of offset is not" | ||
259 | + " affine.\n"); | ||
260 | + return false; | ||
261 | + } | ||
262 | + else | ||
263 | + { | ||
264 | + offset_iv.base = poffset; | ||
265 | + offset_iv.step = ssize_int (0); | ||
266 | + } | ||
267 | } | ||
268 | } | ||
269 | |||
270 | @@ -967,7 +986,7 @@ | ||
271 | DR_REF (dr) = memref; | ||
272 | DR_IS_READ (dr) = is_read; | ||
273 | |||
274 | - dr_analyze_innermost (dr); | ||
275 | + dr_analyze_innermost (dr, nest); | ||
276 | dr_analyze_indices (dr, nest, loop); | ||
277 | dr_analyze_alias (dr); | ||
278 | |||
279 | @@ -5185,7 +5204,7 @@ | ||
280 | DR_STMT (dr) = stmt; | ||
281 | DR_REF (dr) = op0; | ||
282 | |||
283 | - res = dr_analyze_innermost (dr) | ||
284 | + res = dr_analyze_innermost (dr, loop_containing_stmt (stmt)) | ||
285 | && stride_of_unit_type_p (DR_STEP (dr), TREE_TYPE (op0)); | ||
286 | |||
287 | free_data_ref (dr); | ||
288 | @@ -5225,7 +5244,7 @@ | ||
289 | |||
290 | DR_STMT (dr) = stmt; | ||
291 | DR_REF (dr) = *ref->pos; | ||
292 | - dr_analyze_innermost (dr); | ||
293 | + dr_analyze_innermost (dr, loop_containing_stmt (stmt)); | ||
294 | base_address = DR_BASE_ADDRESS (dr); | ||
295 | |||
296 | if (!base_address) | ||
297 | |||
298 | === modified file 'gcc/tree-data-ref.h' | ||
299 | --- old/gcc/tree-data-ref.h 2011-03-27 09:38:18 +0000 | ||
300 | +++ new/gcc/tree-data-ref.h 2011-10-02 08:43:10 +0000 | ||
301 | @@ -386,7 +386,7 @@ | ||
302 | DEF_VEC_ALLOC_O (data_ref_loc, heap); | ||
303 | |||
304 | bool get_references_in_stmt (gimple, VEC (data_ref_loc, heap) **); | ||
305 | -bool dr_analyze_innermost (struct data_reference *); | ||
306 | +bool dr_analyze_innermost (struct data_reference *, struct loop *); | ||
307 | extern bool compute_data_dependences_for_loop (struct loop *, bool, | ||
308 | VEC (loop_p, heap) **, | ||
309 | VEC (data_reference_p, heap) **, | ||
310 | |||
311 | === modified file 'gcc/tree-loop-distribution.c' | ||
312 | --- old/gcc/tree-loop-distribution.c 2011-05-11 13:07:54 +0000 | ||
313 | +++ new/gcc/tree-loop-distribution.c 2011-10-02 08:43:10 +0000 | ||
314 | @@ -267,7 +267,7 @@ | ||
315 | |||
316 | DR_STMT (dr) = stmt; | ||
317 | DR_REF (dr) = op0; | ||
318 | - res = dr_analyze_innermost (dr); | ||
319 | + res = dr_analyze_innermost (dr, loop_containing_stmt (stmt)); | ||
320 | gcc_assert (res && stride_of_unit_type_p (DR_STEP (dr), TREE_TYPE (op0))); | ||
321 | |||
322 | nb_bytes = build_size_arg_loc (loc, nb_iter, op0, &stmt_list); | ||
323 | |||
324 | === modified file 'gcc/tree-predcom.c' | ||
325 | --- old/gcc/tree-predcom.c 2011-02-11 14:19:44 +0000 | ||
326 | +++ new/gcc/tree-predcom.c 2011-10-02 08:43:10 +0000 | ||
327 | @@ -1114,7 +1114,7 @@ | ||
328 | memset (&init_dr, 0, sizeof (struct data_reference)); | ||
329 | DR_REF (&init_dr) = init_ref; | ||
330 | DR_STMT (&init_dr) = phi; | ||
331 | - if (!dr_analyze_innermost (&init_dr)) | ||
332 | + if (!dr_analyze_innermost (&init_dr, loop)) | ||
333 | return NULL; | ||
334 | |||
335 | if (!valid_initializer_p (&init_dr, ref->distance + 1, root->ref)) | ||
336 | |||
337 | === modified file 'gcc/tree-vect-data-refs.c' | ||
338 | --- old/gcc/tree-vect-data-refs.c 2011-07-04 11:13:51 +0000 | ||
339 | +++ new/gcc/tree-vect-data-refs.c 2011-10-02 08:43:10 +0000 | ||
340 | @@ -353,11 +353,7 @@ | ||
341 | |||
342 | /* Check that the data-refs have same bases and offsets. If not, we can't | ||
343 | determine if they are dependent. */ | ||
344 | - if ((DR_BASE_ADDRESS (dra) != DR_BASE_ADDRESS (drb) | ||
345 | - && (TREE_CODE (DR_BASE_ADDRESS (dra)) != ADDR_EXPR | ||
346 | - || TREE_CODE (DR_BASE_ADDRESS (drb)) != ADDR_EXPR | ||
347 | - || TREE_OPERAND (DR_BASE_ADDRESS (dra), 0) | ||
348 | - != TREE_OPERAND (DR_BASE_ADDRESS (drb),0))) | ||
349 | + if (!operand_equal_p (DR_BASE_ADDRESS (dra), DR_BASE_ADDRESS (drb), 0) | ||
350 | || !dr_equal_offsets_p (dra, drb)) | ||
351 | return true; | ||
352 | |||
353 | @@ -403,11 +399,7 @@ | ||
354 | |||
355 | /* Check that the data-refs have same first location (except init) and they | ||
356 | are both either store or load (not load and store). */ | ||
357 | - if ((DR_BASE_ADDRESS (dra) != DR_BASE_ADDRESS (drb) | ||
358 | - && (TREE_CODE (DR_BASE_ADDRESS (dra)) != ADDR_EXPR | ||
359 | - || TREE_CODE (DR_BASE_ADDRESS (drb)) != ADDR_EXPR | ||
360 | - || TREE_OPERAND (DR_BASE_ADDRESS (dra), 0) | ||
361 | - != TREE_OPERAND (DR_BASE_ADDRESS (drb),0))) | ||
362 | + if (!operand_equal_p (DR_BASE_ADDRESS (dra), DR_BASE_ADDRESS (drb), 0) | ||
363 | || !dr_equal_offsets_p (dra, drb) | ||
364 | || !tree_int_cst_compare (DR_INIT (dra), DR_INIT (drb)) | ||
365 | || DR_IS_READ (dra) != DR_IS_READ (drb)) | ||
366 | @@ -615,6 +607,11 @@ | ||
367 | if (vect_check_interleaving (dra, drb)) | ||
368 | return false; | ||
369 | |||
370 | + /* Read-read is OK (we need this check here, after checking for | ||
371 | + interleaving). */ | ||
372 | + if (DR_IS_READ (dra) && DR_IS_READ (drb)) | ||
373 | + return false; | ||
374 | + | ||
375 | if (vect_print_dump_info (REPORT_DR_DETAILS)) | ||
376 | { | ||
377 | fprintf (vect_dump, "can't determine dependence between "); | ||
378 | |||