summaryrefslogtreecommitdiffstats
path: root/toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106826.patch
diff options
context:
space:
mode:
Diffstat (limited to 'toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106826.patch')
-rw-r--r--toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106826.patch362
1 files changed, 0 insertions, 362 deletions
diff --git a/toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106826.patch b/toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106826.patch
deleted file mode 100644
index 6642f8a667..0000000000
--- a/toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106826.patch
+++ /dev/null
@@ -1,362 +0,0 @@
12011-10-16 Ira Rosen <ira.rosen@linaro.org>
2
3 Backport from mainline:
4
5 2011-09-27 Ira Rosen <ira.rosen@linaro.org>
6
7 gcc/
8 * tree-vect-stmts.c (vectorizable_type_demotion): Handle basic block
9 vectorization.
10 (vectorizable_type_promotion): Likewise.
11 (vect_analyze_stmt): Call vectorizable_type_demotion and
12 vectorizable_type_promotion for basic blocks.
13 (supportable_widening_operation): Don't assume loop vectorization.
14 * tree-vect-slp.c (vect_build_slp_tree): Allow multiple types for
15 basic blocks. Update vectorization factor for basic block
16 vectorization.
17 (vect_analyze_slp_instance): Allow multiple types for basic block
18 vectorization. Recheck unrolling factor after construction of SLP
19 instance.
20
21 gcc/testsuite/
22 * gcc.dg/vect/bb-slp-11.c: Expect to get vectorized with 64-bit
23 vectors.
24 * gcc.dg/vect/bb-slp-27.c: New.
25 * gcc.dg/vect/bb-slp-28.c: New.
26
27
28 2011-10-04 Ira Rosen <ira.rosen@linaro.org>
29
30 gcc/testsuite/
31 * lib/target-supports.exp (check_effective_target_vect_multiple_sizes):
32 Make et_vect_multiple_sizes_saved global.
33 (check_effective_target_vect64): Make et_vect64_saved global.
34
35=== modified file 'gcc/testsuite/gcc.dg/vect/bb-slp-11.c'
36--- old/gcc/testsuite/gcc.dg/vect/bb-slp-11.c 2011-10-02 10:40:34 +0000
37+++ new/gcc/testsuite/gcc.dg/vect/bb-slp-11.c 2011-10-06 11:08:08 +0000
38@@ -48,8 +48,6 @@
39 return 0;
40 }
41
42-/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 0 "slp" } } */
43-/* { dg-final { scan-tree-dump-times "SLP with multiple types" 1 "slp" { xfail vect_multiple_sizes } } } */
44-/* { dg-final { scan-tree-dump-times "SLP with multiple types" 2 "slp" { target vect_multiple_sizes } } } */
45+/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target vect64 } } } */
46 /* { dg-final { cleanup-tree-dump "slp" } } */
47
48
49=== added file 'gcc/testsuite/gcc.dg/vect/bb-slp-27.c'
50--- old/gcc/testsuite/gcc.dg/vect/bb-slp-27.c 1970-01-01 00:00:00 +0000
51+++ new/gcc/testsuite/gcc.dg/vect/bb-slp-27.c 2011-10-06 11:08:08 +0000
52@@ -0,0 +1,49 @@
53+/* { dg-require-effective-target vect_int } */
54+
55+#include <stdarg.h>
56+#include "tree-vect.h"
57+
58+#define A 3
59+#define N 16
60+
61+short src[N], dst[N];
62+
63+void foo (int a)
64+{
65+ dst[0] += a*src[0];
66+ dst[1] += a*src[1];
67+ dst[2] += a*src[2];
68+ dst[3] += a*src[3];
69+ dst[4] += a*src[4];
70+ dst[5] += a*src[5];
71+ dst[6] += a*src[6];
72+ dst[7] += a*src[7];
73+}
74+
75+
76+int main (void)
77+{
78+ int i;
79+
80+ check_vect ();
81+
82+ for (i = 0; i < N; i++)
83+ {
84+ dst[i] = 0;
85+ src[i] = i;
86+ }
87+
88+ foo (A);
89+
90+ for (i = 0; i < 8; i++)
91+ {
92+ if (dst[i] != A * i)
93+ abort ();
94+ }
95+
96+ return 0;
97+}
98+
99+/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target { vect_int_mult && { vect_unpack && vect_pack_trunc } } } } } */
100+/* { dg-final { cleanup-tree-dump "slp" } } */
101+
102
103=== added file 'gcc/testsuite/gcc.dg/vect/bb-slp-28.c'
104--- old/gcc/testsuite/gcc.dg/vect/bb-slp-28.c 1970-01-01 00:00:00 +0000
105+++ new/gcc/testsuite/gcc.dg/vect/bb-slp-28.c 2011-10-06 11:08:08 +0000
106@@ -0,0 +1,71 @@
107+/* { dg-require-effective-target vect_int } */
108+
109+#include <stdarg.h>
110+#include "tree-vect.h"
111+
112+#define A 300
113+#define N 16
114+
115+char src[N];
116+short dst[N];
117+short src1[N], dst1[N];
118+
119+void foo (int a)
120+{
121+ dst[0] = (short) (a * (int) src[0]);
122+ dst[1] = (short) (a * (int) src[1]);
123+ dst[2] = (short) (a * (int) src[2]);
124+ dst[3] = (short) (a * (int) src[3]);
125+ dst[4] = (short) (a * (int) src[4]);
126+ dst[5] = (short) (a * (int) src[5]);
127+ dst[6] = (short) (a * (int) src[6]);
128+ dst[7] = (short) (a * (int) src[7]);
129+ dst[8] = (short) (a * (int) src[8]);
130+ dst[9] = (short) (a * (int) src[9]);
131+ dst[10] = (short) (a * (int) src[10]);
132+ dst[11] = (short) (a * (int) src[11]);
133+ dst[12] = (short) (a * (int) src[12]);
134+ dst[13] = (short) (a * (int) src[13]);
135+ dst[14] = (short) (a * (int) src[14]);
136+ dst[15] = (short) (a * (int) src[15]);
137+
138+ dst1[0] += src1[0];
139+ dst1[1] += src1[1];
140+ dst1[2] += src1[2];
141+ dst1[3] += src1[3];
142+ dst1[4] += src1[4];
143+ dst1[5] += src1[5];
144+ dst1[6] += src1[6];
145+ dst1[7] += src1[7];
146+}
147+
148+
149+int main (void)
150+{
151+ int i;
152+
153+ check_vect ();
154+
155+ for (i = 0; i < N; i++)
156+ {
157+ dst[i] = 2;
158+ dst1[i] = 0;
159+ src[i] = i;
160+ src1[i] = i+2;
161+ }
162+
163+ foo (A);
164+
165+ for (i = 0; i < N; i++)
166+ {
167+ if (dst[i] != A * i
168+ || (i < N/2 && dst1[i] != i + 2))
169+ abort ();
170+ }
171+
172+ return 0;
173+}
174+
175+/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target { vect_int_mult && { vect_pack_trunc && vect_unpack } } } } } */
176+/* { dg-final { cleanup-tree-dump "slp" } } */
177+
178
179=== modified file 'gcc/testsuite/lib/target-supports.exp'
180--- old/gcc/testsuite/lib/target-supports.exp 2011-10-02 10:40:34 +0000
181+++ new/gcc/testsuite/lib/target-supports.exp 2011-10-06 11:08:08 +0000
182@@ -3268,7 +3268,7 @@
183 # Return 1 if the target supports multiple vector sizes
184
185 proc check_effective_target_vect_multiple_sizes { } {
186- global et_vect_multiple_sizes
187+ global et_vect_multiple_sizes_saved
188
189 if [info exists et_vect_multiple_sizes_saved] {
190 verbose "check_effective_target_vect_multiple_sizes: using cached result" 2
191@@ -3286,7 +3286,7 @@
192 # Return 1 if the target supports vectors of 64 bits.
193
194 proc check_effective_target_vect64 { } {
195- global et_vect64
196+ global et_vect64_saved
197
198 if [info exists et_vect64_saved] {
199 verbose "check_effective_target_vect64: using cached result" 2
200
201=== modified file 'gcc/tree-vect-slp.c'
202--- old/gcc/tree-vect-slp.c 2011-10-02 10:40:34 +0000
203+++ new/gcc/tree-vect-slp.c 2011-10-06 11:08:08 +0000
204@@ -386,20 +386,15 @@
205 return false;
206 }
207
208- ncopies = vectorization_factor / TYPE_VECTOR_SUBPARTS (vectype);
209- if (ncopies != 1)
210- {
211- if (vect_print_dump_info (REPORT_SLP))
212- fprintf (vect_dump, "SLP with multiple types ");
213-
214- /* FORNOW: multiple types are unsupported in BB SLP. */
215- if (bb_vinfo)
216- return false;
217- }
218-
219 /* In case of multiple types we need to detect the smallest type. */
220 if (*max_nunits < TYPE_VECTOR_SUBPARTS (vectype))
221- *max_nunits = TYPE_VECTOR_SUBPARTS (vectype);
222+ {
223+ *max_nunits = TYPE_VECTOR_SUBPARTS (vectype);
224+ if (bb_vinfo)
225+ vectorization_factor = *max_nunits;
226+ }
227+
228+ ncopies = vectorization_factor / TYPE_VECTOR_SUBPARTS (vectype);
229
230 if (is_gimple_call (stmt))
231 rhs_code = CALL_EXPR;
232@@ -1183,7 +1178,6 @@
233 if (loop_vinfo)
234 vectorization_factor = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
235 else
236- /* No multitypes in BB SLP. */
237 vectorization_factor = nunits;
238
239 /* Calculate the unrolling factor. */
240@@ -1246,16 +1240,23 @@
241 &max_nunits, &load_permutation, &loads,
242 vectorization_factor))
243 {
244+ /* Calculate the unrolling factor based on the smallest type. */
245+ if (max_nunits > nunits)
246+ unrolling_factor = least_common_multiple (max_nunits, group_size)
247+ / group_size;
248+
249+ if (unrolling_factor != 1 && !loop_vinfo)
250+ {
251+ if (vect_print_dump_info (REPORT_SLP))
252+ fprintf (vect_dump, "Build SLP failed: unrolling required in basic"
253+ " block SLP");
254+ return false;
255+ }
256+
257 /* Create a new SLP instance. */
258 new_instance = XNEW (struct _slp_instance);
259 SLP_INSTANCE_TREE (new_instance) = node;
260 SLP_INSTANCE_GROUP_SIZE (new_instance) = group_size;
261- /* Calculate the unrolling factor based on the smallest type in the
262- loop. */
263- if (max_nunits > nunits)
264- unrolling_factor = least_common_multiple (max_nunits, group_size)
265- / group_size;
266-
267 SLP_INSTANCE_UNROLLING_FACTOR (new_instance) = unrolling_factor;
268 SLP_INSTANCE_OUTSIDE_OF_LOOP_COST (new_instance) = outside_cost;
269 SLP_INSTANCE_INSIDE_OF_LOOP_COST (new_instance) = inside_cost;
270
271=== modified file 'gcc/tree-vect-stmts.c'
272--- old/gcc/tree-vect-stmts.c 2011-10-04 08:57:25 +0000
273+++ new/gcc/tree-vect-stmts.c 2011-10-16 12:16:07 +0000
274@@ -3081,11 +3081,9 @@
275 VEC (tree, heap) *vec_oprnds0 = NULL;
276 VEC (tree, heap) *vec_dsts = NULL, *interm_types = NULL, *tmp_vec_dsts = NULL;
277 tree last_oprnd, intermediate_type;
278-
279- /* FORNOW: not supported by basic block SLP vectorization. */
280- gcc_assert (loop_vinfo);
281-
282- if (!STMT_VINFO_RELEVANT_P (stmt_info))
283+ bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
284+
285+ if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
286 return false;
287
288 if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def)
289@@ -3113,7 +3111,7 @@
290 && SCALAR_FLOAT_TYPE_P (TREE_TYPE (op0))
291 && CONVERT_EXPR_CODE_P (code))))
292 return false;
293- if (!vect_is_simple_use_1 (op0, loop_vinfo, NULL,
294+ if (!vect_is_simple_use_1 (op0, loop_vinfo, bb_vinfo,
295 &def_stmt, &def, &dt[0], &vectype_in))
296 {
297 if (vect_print_dump_info (REPORT_DETAILS))
298@@ -3360,11 +3358,9 @@
299 int multi_step_cvt = 0;
300 VEC (tree, heap) *vec_oprnds0 = NULL, *vec_oprnds1 = NULL;
301 VEC (tree, heap) *vec_dsts = NULL, *interm_types = NULL, *tmp_vec_dsts = NULL;
302-
303- /* FORNOW: not supported by basic block SLP vectorization. */
304- gcc_assert (loop_vinfo);
305-
306- if (!STMT_VINFO_RELEVANT_P (stmt_info))
307+ bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
308+
309+ if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
310 return false;
311
312 if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def)
313@@ -3393,7 +3389,7 @@
314 && SCALAR_FLOAT_TYPE_P (TREE_TYPE (op0))
315 && CONVERT_EXPR_CODE_P (code))))
316 return false;
317- if (!vect_is_simple_use_1 (op0, loop_vinfo, NULL,
318+ if (!vect_is_simple_use_1 (op0, loop_vinfo, bb_vinfo,
319 &def_stmt, &def, &dt[0], &vectype_in))
320 {
321 if (vect_print_dump_info (REPORT_DETAILS))
322@@ -5153,7 +5149,9 @@
323 else
324 {
325 if (bb_vinfo)
326- ok = (vectorizable_shift (stmt, NULL, NULL, node)
327+ ok = (vectorizable_type_promotion (stmt, NULL, NULL, node)
328+ || vectorizable_type_demotion (stmt, NULL, NULL, node)
329+ || vectorizable_shift (stmt, NULL, NULL, node)
330 || vectorizable_operation (stmt, NULL, NULL, node)
331 || vectorizable_assignment (stmt, NULL, NULL, node)
332 || vectorizable_load (stmt, NULL, NULL, node, NULL)
333@@ -5780,7 +5778,7 @@
334 {
335 stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
336 loop_vec_info loop_info = STMT_VINFO_LOOP_VINFO (stmt_info);
337- struct loop *vect_loop = LOOP_VINFO_LOOP (loop_info);
338+ struct loop *vect_loop = NULL;
339 bool ordered_p;
340 enum machine_mode vec_mode;
341 enum insn_code icode1, icode2;
342@@ -5789,6 +5787,9 @@
343 tree wide_vectype = vectype_out;
344 enum tree_code c1, c2;
345
346+ if (loop_info)
347+ vect_loop = LOOP_VINFO_LOOP (loop_info);
348+
349 /* The result of a vectorized widening operation usually requires two vectors
350 (because the widened results do not fit int one vector). The generated
351 vector results would normally be expected to be generated in the same
352@@ -5809,7 +5810,8 @@
353 iterations in parallel). We therefore don't allow to change the order
354 of the computation in the inner-loop during outer-loop vectorization. */
355
356- if (STMT_VINFO_RELEVANT (stmt_info) == vect_used_by_reduction
357+ if (vect_loop
358+ && STMT_VINFO_RELEVANT (stmt_info) == vect_used_by_reduction
359 && !nested_in_vect_loop_p (vect_loop, stmt))
360 ordered_p = false;
361 else
362