summaryrefslogtreecommitdiffstats
path: root/toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106842.patch
diff options
context:
space:
mode:
Diffstat (limited to 'toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106842.patch')
-rw-r--r--toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106842.patch375
1 files changed, 0 insertions, 375 deletions
diff --git a/toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106842.patch b/toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106842.patch
deleted file mode 100644
index 2cf2741ba6..0000000000
--- a/toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106842.patch
+++ /dev/null
@@ -1,375 +0,0 @@
12011-11-22 Ira Rosen <ira.rosen@linaro.org>
2
3 Backport from mainline:
4
5 2011-10-06 Jakub Jelinek <jakub@redhat.com>
6
7 gcc/
8 PR tree-optimization/50596
9 * tree-vectorizer.h (vect_is_simple_cond): New prototype.
10 (NUM_PATTERNS): Change to 6.
11 * tree-vect-patterns.c (vect_recog_mixed_size_cond_pattern): New
12 function.
13 (vect_vect_recog_func_ptrs): Add vect_recog_mixed_size_cond_pattern.
14 (vect_mark_pattern_stmts): Don't create stmt_vinfo for def_stmt
15 if it already has one, and don't set STMT_VINFO_VECTYPE in it
16 if it is already set.
17 * tree-vect-stmts.c (vect_mark_stmts_to_be_vectorized): Handle
18 COND_EXPR in pattern stmts.
19 (vect_is_simple_cond): No longer static.
20
21 gcc/testsuite:
22 PR tree-optimization/50596
23 * gcc.dg/vect/vect-cond-8.c: New test.
24
25 2011-10-07 Jakub Jelinek <jakub@redhat.com>
26
27 gcc/
28 PR tree-optimization/50650
29 * tree-vect-patterns.c (vect_recog_mixed_size_cond_pattern): Don't
30 call vect_is_simple_cond here, instead fail if cond_expr isn't
31 COMPARISON_CLASS_P or if get_vectype_for_scalar_type returns NULL
32 for cond_expr's first operand.
33 * tree-vect-stmts.c (vect_is_simple_cond): Static again.
34 * tree-vectorizer.h (vect_is_simple_cond): Remove prototype.
35
36
37 gcc/
38 * tree-vect-patterns.c (vect_recog_mixed_size_cond_pattern): Reduce
39 it to integral types only.
40
41 gcc/testsuite/
42 * gcc.dg/vect/pr30858.c: Expect the error message twice for targets
43 with multiple vector sizes.
44 * gcc.dg/vect/vect-cond-8.c: Rename to...
45 * gcc.dg/vect/vect-cond-8a.c: ... this and change the type from float
46 to int.
47 * lib/target-supports.exp (check_effective_target_vect_condition):
48 Return true for NEON.
49
50=== modified file 'gcc/testsuite/gcc.dg/vect/pr30858.c'
51Index: gcc-4_6-branch/gcc/testsuite/gcc.dg/vect/pr30858.c
52===================================================================
53--- gcc-4_6-branch.orig/gcc/testsuite/gcc.dg/vect/pr30858.c 2012-01-04 15:33:52.000000000 -0800
54+++ gcc-4_6-branch/gcc/testsuite/gcc.dg/vect/pr30858.c 2012-03-05 16:23:47.748983031 -0800
55@@ -11,5 +11,6 @@
56 }
57
58 /* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" } } */
59-/* { dg-final { scan-tree-dump-times "Unknown def-use cycle pattern." 1 "vect" } } */
60+/* { dg-final { scan-tree-dump-times "Unknown def-use cycle pattern." 1 "vect" { xfail vect_multiple_sizes } } } */
61+/* { dg-final { scan-tree-dump-times "Unknown def-use cycle pattern." 2 "vect" { target vect_multiple_sizes } } } */
62 /* { dg-final { cleanup-tree-dump "vect" } } */
63Index: gcc-4_6-branch/gcc/testsuite/gcc.dg/vect/vect-cond-8a.c
64===================================================================
65--- /dev/null 1970-01-01 00:00:00.000000000 +0000
66+++ gcc-4_6-branch/gcc/testsuite/gcc.dg/vect/vect-cond-8a.c 2012-03-05 16:23:47.748983031 -0800
67@@ -0,0 +1,75 @@
68+/* { dg-require-effective-target vect_condition } */
69+
70+#include "tree-vect.h"
71+
72+#define N 1024
73+int a[N], b[N], c[N];
74+char d[N], e[N], f[N];
75+unsigned char k[N];
76+
77+__attribute__((noinline, noclone)) void
78+f1 (void)
79+{
80+ int i;
81+ for (i = 0; i < N; ++i)
82+ k[i] = a[i] < b[i] ? 17 : 0;
83+}
84+
85+__attribute__((noinline, noclone)) void
86+f2 (void)
87+{
88+ int i;
89+ for (i = 0; i < N; ++i)
90+ k[i] = a[i] < b[i] ? 0 : 24;
91+}
92+
93+__attribute__((noinline, noclone)) void
94+f3 (void)
95+{
96+ int i;
97+ for (i = 0; i < N; ++i)
98+ k[i] = a[i] < b[i] ? 51 : 12;
99+}
100+
101+int
102+main ()
103+{
104+ int i;
105+
106+ check_vect ();
107+
108+ for (i = 0; i < N; i++)
109+ {
110+ switch (i % 9)
111+ {
112+ case 0: asm (""); a[i] = - i - 1; b[i] = i + 1; break;
113+ case 1: a[i] = 0; b[i] = 0; break;
114+ case 2: a[i] = i + 1; b[i] = - i - 1; break;
115+ case 3: a[i] = i; b[i] = i + 7; break;
116+ case 4: a[i] = i; b[i] = i; break;
117+ case 5: a[i] = i + 16; b[i] = i + 3; break;
118+ case 6: a[i] = - i - 5; b[i] = - i; break;
119+ case 7: a[i] = - i; b[i] = - i; break;
120+ case 8: a[i] = - i; b[i] = - i - 7; break;
121+ }
122+ d[i] = i;
123+ e[i] = 2 * i;
124+ }
125+ f1 ();
126+ for (i = 0; i < N; i++)
127+ if (k[i] != ((i % 3) == 0 ? 17 : 0))
128+ abort ();
129+ f2 ();
130+ for (i = 0; i < N; i++)
131+ if (k[i] != ((i % 3) == 0 ? 0 : 24))
132+ abort ();
133+ f3 ();
134+ for (i = 0; i < N; i++)
135+ if (k[i] != ((i % 3) == 0 ? 51 : 12))
136+ abort ();
137+
138+ return 0;
139+}
140+
141+/* { dg-final { scan-tree-dump-times "note: vectorized 1 loops" 3 "vect" } } */
142+/* { dg-final { cleanup-tree-dump "vect" } } */
143Index: gcc-4_6-branch/gcc/tree-vect-patterns.c
144===================================================================
145--- gcc-4_6-branch.orig/gcc/tree-vect-patterns.c 2012-03-05 16:23:10.000000000 -0800
146+++ gcc-4_6-branch/gcc/tree-vect-patterns.c 2012-03-05 16:23:47.748983031 -0800
147@@ -50,13 +50,16 @@
148 tree *);
149 static gimple vect_recog_widen_shift_pattern (VEC (gimple, heap) **,
150 tree *, tree *);
151+static gimple vect_recog_mixed_size_cond_pattern (VEC (gimple, heap) **,
152+ tree *, tree *);
153 static vect_recog_func_ptr vect_vect_recog_func_ptrs[NUM_PATTERNS] = {
154 vect_recog_widen_mult_pattern,
155 vect_recog_widen_sum_pattern,
156 vect_recog_dot_prod_pattern,
157 vect_recog_pow_pattern,
158 vect_recog_over_widening_pattern,
159- vect_recog_widen_shift_pattern};
160+ vect_recog_widen_shift_pattern,
161+ vect_recog_mixed_size_cond_pattern};
162
163
164 /* Function widened_name_p
165@@ -1441,6 +1444,118 @@
166 return pattern_stmt;
167 }
168
169+/* Function vect_recog_mixed_size_cond_pattern
170+
171+ Try to find the following pattern:
172+
173+ type x_t, y_t;
174+ TYPE a_T, b_T, c_T;
175+ loop:
176+ S1 a_T = x_t CMP y_t ? b_T : c_T;
177+
178+ where type 'TYPE' is an integral type which has different size
179+ from 'type'. b_T and c_T are constants and if 'TYPE' is wider
180+ than 'type', the constants need to fit into an integer type
181+ with the same width as 'type'.
182+
183+ Input:
184+
185+ * LAST_STMT: A stmt from which the pattern search begins.
186+
187+ Output:
188+
189+ * TYPE_IN: The type of the input arguments to the pattern.
190+
191+ * TYPE_OUT: The type of the output of this pattern.
192+
193+ * Return value: A new stmt that will be used to replace the pattern.
194+ Additionally a def_stmt is added.
195+
196+ a_it = x_t CMP y_t ? b_it : c_it;
197+ a_T = (TYPE) a_it; */
198+
199+static gimple
200+vect_recog_mixed_size_cond_pattern (VEC (gimple, heap) **stmts, tree *type_in,
201+ tree *type_out)
202+{
203+ gimple last_stmt = VEC_index (gimple, *stmts, 0);
204+ tree cond_expr, then_clause, else_clause;
205+ stmt_vec_info stmt_vinfo = vinfo_for_stmt (last_stmt), def_stmt_info;
206+ tree type, vectype, comp_vectype, comp_type, op, tmp;
207+ enum machine_mode cmpmode;
208+ gimple pattern_stmt, def_stmt;
209+ loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_vinfo);
210+
211+ if (!is_gimple_assign (last_stmt)
212+ || gimple_assign_rhs_code (last_stmt) != COND_EXPR
213+ || STMT_VINFO_DEF_TYPE (stmt_vinfo) != vect_internal_def)
214+ return NULL;
215+
216+ op = gimple_assign_rhs1 (last_stmt);
217+ cond_expr = TREE_OPERAND (op, 0);
218+ then_clause = TREE_OPERAND (op, 1);
219+ else_clause = TREE_OPERAND (op, 2);
220+
221+ if (TREE_CODE (then_clause) != INTEGER_CST
222+ || TREE_CODE (else_clause) != INTEGER_CST)
223+ return NULL;
224+
225+ if (!COMPARISON_CLASS_P (cond_expr))
226+ return NULL;
227+
228+ type = gimple_expr_type (last_stmt);
229+ comp_type = TREE_TYPE (TREE_OPERAND (cond_expr, 0));
230+ if (!INTEGRAL_TYPE_P (comp_type)
231+ || !INTEGRAL_TYPE_P (type))
232+ return NULL;
233+
234+ comp_vectype = get_vectype_for_scalar_type (comp_type);
235+ if (comp_vectype == NULL_TREE)
236+ return NULL;
237+
238+ cmpmode = GET_MODE_INNER (TYPE_MODE (comp_vectype));
239+
240+ if (GET_MODE_BITSIZE (TYPE_MODE (type)) == GET_MODE_BITSIZE (cmpmode))
241+ return NULL;
242+
243+ vectype = get_vectype_for_scalar_type (type);
244+ if (vectype == NULL_TREE)
245+ return NULL;
246+
247+ if (types_compatible_p (vectype, comp_vectype))
248+ return NULL;
249+
250+ if (!expand_vec_cond_expr_p (comp_vectype, TYPE_MODE (comp_vectype)))
251+ return NULL;
252+
253+ if (GET_MODE_BITSIZE (TYPE_MODE (type)) > GET_MODE_BITSIZE (cmpmode))
254+ {
255+ if (!int_fits_type_p (then_clause, comp_type)
256+ || !int_fits_type_p (else_clause, comp_type))
257+ return NULL;
258+ }
259+
260+ tmp = build3 (COND_EXPR, comp_type, unshare_expr (cond_expr),
261+ fold_convert (comp_type, then_clause),
262+ fold_convert (comp_type, else_clause));
263+ def_stmt = gimple_build_assign (vect_recog_temp_ssa_var (comp_type, NULL), tmp);
264+
265+ pattern_stmt
266+ = gimple_build_assign_with_ops (NOP_EXPR,
267+ vect_recog_temp_ssa_var (type, NULL),
268+ gimple_assign_lhs (def_stmt), NULL_TREE);
269+
270+ STMT_VINFO_PATTERN_DEF_STMT (stmt_vinfo) = def_stmt;
271+ def_stmt_info = new_stmt_vec_info (def_stmt, loop_vinfo, NULL);
272+ set_vinfo_for_stmt (def_stmt, def_stmt_info);
273+ STMT_VINFO_VECTYPE (def_stmt_info) = comp_vectype;
274+ *type_in = vectype;
275+ *type_out = vectype;
276+
277+ return pattern_stmt;
278+}
279+
280+
281 /* Mark statements that are involved in a pattern. */
282
283 static inline void
284@@ -1468,14 +1583,18 @@
285 if (STMT_VINFO_PATTERN_DEF_STMT (pattern_stmt_info))
286 {
287 def_stmt = STMT_VINFO_PATTERN_DEF_STMT (pattern_stmt_info);
288- set_vinfo_for_stmt (def_stmt,
289- new_stmt_vec_info (def_stmt, loop_vinfo, NULL));
290- gimple_set_bb (def_stmt, gimple_bb (orig_stmt));
291 def_stmt_info = vinfo_for_stmt (def_stmt);
292+ if (def_stmt_info == NULL)
293+ {
294+ def_stmt_info = new_stmt_vec_info (def_stmt, loop_vinfo, NULL);
295+ set_vinfo_for_stmt (def_stmt, def_stmt_info);
296+ }
297+ gimple_set_bb (def_stmt, gimple_bb (orig_stmt));
298 STMT_VINFO_RELATED_STMT (def_stmt_info) = orig_stmt;
299 STMT_VINFO_DEF_TYPE (def_stmt_info)
300 = STMT_VINFO_DEF_TYPE (orig_stmt_info);
301- STMT_VINFO_VECTYPE (def_stmt_info) = pattern_vectype;
302+ if (STMT_VINFO_VECTYPE (def_stmt_info) == NULL_TREE)
303+ STMT_VINFO_VECTYPE (def_stmt_info) = pattern_vectype;
304 }
305 }
306
307Index: gcc-4_6-branch/gcc/tree-vect-stmts.c
308===================================================================
309--- gcc-4_6-branch.orig/gcc/tree-vect-stmts.c 2012-03-05 16:23:11.000000000 -0800
310+++ gcc-4_6-branch/gcc/tree-vect-stmts.c 2012-03-05 16:23:47.748983031 -0800
311@@ -655,20 +655,40 @@
312 tree rhs = gimple_assign_rhs1 (stmt);
313 unsigned int op_num;
314 tree op;
315+ enum tree_code rhs_code;
316 switch (get_gimple_rhs_class (gimple_assign_rhs_code (stmt)))
317 {
318 case GIMPLE_SINGLE_RHS:
319- op_num = TREE_OPERAND_LENGTH (gimple_assign_rhs1 (stmt));
320- for (i = 0; i < op_num; i++)
321- {
322- op = TREE_OPERAND (rhs, i);
323- if (!process_use (stmt, op, loop_vinfo, live_p, relevant,
324- &worklist))
325- {
326- VEC_free (gimple, heap, worklist);
327- return false;
328- }
329- }
330+ op = gimple_assign_rhs1 (stmt);
331+ rhs_code = gimple_assign_rhs_code (stmt);
332+ i = 0;
333+ if (rhs_code == COND_EXPR
334+ && COMPARISON_CLASS_P (TREE_OPERAND (op, 0)))
335+ {
336+ op = TREE_OPERAND (op, 0);
337+ if (!process_use (stmt, TREE_OPERAND (op, 0),
338+ loop_vinfo,
339+ live_p, relevant, &worklist)
340+ || !process_use (stmt, TREE_OPERAND (op, 1),
341+ loop_vinfo,
342+ live_p, relevant, &worklist))
343+ {
344+ VEC_free (gimple, heap, worklist);
345+ return false;
346+ }
347+ i = 1;
348+ }
349+ op_num = TREE_OPERAND_LENGTH (gimple_assign_rhs1 (stmt));
350+ for (i; i < op_num; i++)
351+ {
352+ op = TREE_OPERAND (rhs, i);
353+ if (!process_use (stmt, op, loop_vinfo, live_p, relevant,
354+ &worklist))
355+ {
356+ VEC_free (gimple, heap, worklist);
357+ return false;
358+ }
359+ }
360 break;
361
362 case GIMPLE_BINARY_RHS:
363Index: gcc-4_6-branch/gcc/tree-vectorizer.h
364===================================================================
365--- gcc-4_6-branch.orig/gcc/tree-vectorizer.h 2012-03-05 16:23:11.000000000 -0800
366+++ gcc-4_6-branch/gcc/tree-vectorizer.h 2012-03-05 16:23:47.748983031 -0800
367@@ -917,7 +917,7 @@
368 Additional pattern recognition functions can (and will) be added
369 in the future. */
370 typedef gimple (* vect_recog_func_ptr) (VEC (gimple, heap) **, tree *, tree *);
371-#define NUM_PATTERNS 6
372+#define NUM_PATTERNS 7
373 void vect_pattern_recog (loop_vec_info);
374
375 /* In tree-vectorizer.c. */