summaryrefslogtreecommitdiffstats
path: root/toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106753.patch
diff options
context:
space:
mode:
Diffstat (limited to 'toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106753.patch')
-rw-r--r--toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106753.patch5027
1 files changed, 0 insertions, 5027 deletions
diff --git a/toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106753.patch b/toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106753.patch
deleted file mode 100644
index bda39e8fa..000000000
--- a/toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106753.patch
+++ /dev/null
@@ -1,5027 +0,0 @@
12001-06-02 Richard Sandiford <richard.sandiford@linaro.org>
2
3 gcc/
4 * gimple.c (gimple_build_call_internal_1): Add missing call to
5 gimple_call_reset_alias_info.
6
72001-06-02 Richard Sandiford <richard.sandiford@linaro.org>
8
9 gcc/testsuite/
10 Backport from mainline:
11
12 2011-05-03 Richard Sandiford <richard.sandiford@linaro.org>
13
14 * gcc.dg/vect/vect-strided-u16-i3.c: New test.
15
162001-06-02 Richard Sandiford <richard.sandiford@linaro.org>
17
18 gcc/testsuite/
19 Backport from mainline:
20
21 2011-05-03 Richard Sandiford <richard.sandiford@linaro.org>
22
23 * lib/target-supports.exp (check_effective_target_vect_strided):
24 Replace with...
25 (check_effective_target_vect_strided2)
26 (check_effective_target_vect_strided3)
27 (check_effective_target_vect_strided4)
28 (check_effective_target_vect_strided8): ...these new functions.
29
30 * gcc.dg/vect/O3-pr39675-2.c: Update accordingly.
31 * gcc.dg/vect/costmodel/ppc/costmodel-slp-12.c: Likewise.
32 * gcc.dg/vect/fast-math-slp-27.c: Likewise.
33 * gcc.dg/vect/if-cvt-stores-vect-ifcvt-18.c: Likewise.
34 * gcc.dg/vect/pr37539.c: Likewise.
35 * gcc.dg/vect/slp-11a.c: Likewise.
36 * gcc.dg/vect/slp-11b.c: Likewise.
37 * gcc.dg/vect/slp-11c.c: Likewise.
38 * gcc.dg/vect/slp-12a.c: Likewise.
39 * gcc.dg/vect/slp-12b.c: Likewise.
40 * gcc.dg/vect/slp-18.c: Likewise.
41 * gcc.dg/vect/slp-19a.c: Likewise.
42 * gcc.dg/vect/slp-19b.c: Likewise.
43 * gcc.dg/vect/slp-21.c: Likewise.
44 * gcc.dg/vect/slp-23.c: Likewise.
45 * gcc.dg/vect/vect-cselim-1.c: Likewise.
46
47 * gcc.dg/vect/fast-math-vect-complex-3.c: Use vect_stridedN
48 instead of vect_interleave && vect_extract_even_odd.
49 * gcc.dg/vect/no-scevccp-outer-10a.c: Likewise.
50 * gcc.dg/vect/no-scevccp-outer-10b.c: Likewise.
51 * gcc.dg/vect/no-scevccp-outer-20.c: Likewise.
52 * gcc.dg/vect/vect-1.c: Likewise.
53 * gcc.dg/vect/vect-10.c: Likewise.
54 * gcc.dg/vect/vect-98.c: Likewise.
55 * gcc.dg/vect/vect-107.c: Likewise.
56 * gcc.dg/vect/vect-strided-a-mult.c: Likewise.
57 * gcc.dg/vect/vect-strided-a-u16-i2.c: Likewise.
58 * gcc.dg/vect/vect-strided-a-u16-i4.c: Likewise.
59 * gcc.dg/vect/vect-strided-a-u16-mult.c: Likewise.
60 * gcc.dg/vect/vect-strided-a-u32-mult.c: Likewise.
61 * gcc.dg/vect/vect-strided-a-u8-i2-gap.c: Likewise.
62 * gcc.dg/vect/vect-strided-a-u8-i8-gap2.c: Likewise.
63 * gcc.dg/vect/vect-strided-a-u8-i8-gap7.c: Likewise.
64 * gcc.dg/vect/vect-strided-float.c: Likewise.
65 * gcc.dg/vect/vect-strided-mult-char-ls.c: Likewise.
66 * gcc.dg/vect/vect-strided-mult.c: Likewise.
67 * gcc.dg/vect/vect-strided-same-dr.c: Likewise.
68 * gcc.dg/vect/vect-strided-u16-i2.c: Likewise.
69 * gcc.dg/vect/vect-strided-u16-i4.c: Likewise.
70 * gcc.dg/vect/vect-strided-u32-i4.c: Likewise.
71 * gcc.dg/vect/vect-strided-u32-i8.c: Likewise.
72 * gcc.dg/vect/vect-strided-u32-mult.c: Likewise.
73 * gcc.dg/vect/vect-strided-u8-i2-gap.c: Likewise.
74 * gcc.dg/vect/vect-strided-u8-i2.c: Likewise.
75 * gcc.dg/vect/vect-strided-u8-i8-gap2.c: Likewise.
76 * gcc.dg/vect/vect-strided-u8-i8-gap4.c: Likewise.
77 * gcc.dg/vect/vect-strided-u8-i8-gap7.c: Likewise.
78 * gcc.dg/vect/vect-strided-u8-i8.c: Likewise.
79 * gcc.dg/vect/vect-vfa-03.c: Likewise.
80
81 * gcc.dg/vect/no-scevccp-outer-18.c: Add vect_stridedN to the
82 target condition.
83 * gcc.dg/vect/pr30843.c: Likewise.
84 * gcc.dg/vect/pr33866.c: Likewise.
85 * gcc.dg/vect/slp-reduc-6.c: Likewise.
86 * gcc.dg/vect/vect-strided-store-a-u8-i2.c: Likewise.
87 * gcc.dg/vect/vect-strided-store-u16-i4.c: Likewise.
88 * gcc.dg/vect/vect-strided-store-u32-i2.c: Likewise.
89
902001-06-02 Richard Sandiford <richard.sandiford@linaro.org>
91
92 gcc/testsuite/
93 Backport from mainline:
94
95 2011-05-03 Richard Sandiford <richard.sandiford@linaro.org>
96
97 * gcc.dg/vect/slp-11.c: Split into...
98 * gcc.dg/vect/slp-11a.c, gcc.dg/vect/slp-11b.c,
99 gcc.dg/vect/slp-11c.c: ...these tests.
100 * gcc.dg/vect/slp-12a.c: Split 4-stride loop into...
101 * gcc.dg/vect/slp-12c.c: ...this new test.
102 * gcc.dg/vect/slp-19.c: Split into...
103 * gcc.dg/vect/slp-19a.c, gcc.dg/vect/slp-19b.c,
104 gcc.dg/vect/slp-19c.c: ...these new tests.
105
1062001-06-02 Richard Sandiford <richard.sandiford@linaro.org>
107
108 gcc/testsuite/
109 Backport from mainline:
110
111 2011-05-03 Richard Sandiford <richard.sandiford@linaro.org>
112
113 * lib/target-supports.exp
114 (check_effective_target_vect_extract_even_odd_wide): Delete.
115 (check_effective_target_vect_strided_wide): Likewise.
116 * gcc.dg/vect/O3-pr39675-2.c: Use the non-wide versions instead.
117 * gcc.dg/vect/fast-math-pr35982.c: Likewise.
118 * gcc.dg/vect/fast-math-vect-complex-3.c: Likewise.
119 * gcc.dg/vect/pr37539.c: Likewise.
120 * gcc.dg/vect/slp-11.c: Likewise.
121 * gcc.dg/vect/slp-12a.c: Likewise.
122 * gcc.dg/vect/slp-12b.c: Likewise.
123 * gcc.dg/vect/slp-19.c: Likewise.
124 * gcc.dg/vect/slp-23.c: Likewise.
125 * gcc.dg/vect/vect-1.c: Likewise.
126 * gcc.dg/vect/vect-98.c: Likewise.
127 * gcc.dg/vect/vect-107.c: Likewise.
128 * gcc.dg/vect/vect-strided-float.c: Likewise.
129
1302001-06-02 Richard Sandiford <richard.sandiford@linaro.org>
131
132 gcc/testsuite/
133 Backport from mainline:
134
135 2011-04-21 Richard Sandiford <richard.sandiford@linaro.org>
136
137 * gcc.dg/vect/vect.exp: Run the main tests twice, one with -flto
138 and once without.
139
1402001-06-02 Richard Sandiford <richard.sandiford@linaro.org>
141
142 gcc/
143 Backport from mainlie:
144
145 2011-05-03 Richard Sandiford <richard.sandiford@linaro.org>
146
147 * config/arm/neon.md (vec_load_lanes<mode><mode>): New expanders,
148 (vec_store_lanes<mode><mode>): Likewise.
149
1502001-06-02 Richard Sandiford <richard.sandiford@linaro.org>
151
152 gcc/
153 Backport from mainline:
154
155 2011-05-03 Richard Sandiford <richard.sandiford@linaro.org>
156
157 * doc/md.texi (vec_load_lanes, vec_store_lanes): Document.
158 * optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New
159 convert_optab_index values.
160 (vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs.
161 * genopinit.c (optabs): Initialize the new optabs.
162 * internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions.
163 * internal-fn.c (get_multi_vector_move, expand_LOAD_LANES)
164 (expand_STORE_LANES): New functions.
165 * tree.h (build_array_type_nelts): Declare.
166 * tree.c (build_array_type_nelts): New function.
167 * tree-vectorizer.h (vect_model_store_cost): Add a bool argument.
168 (vect_model_load_cost): Likewise.
169 (vect_store_lanes_supported, vect_load_lanes_supported)
170 (vect_record_strided_load_vectors): Declare.
171 * tree-vect-data-refs.c (vect_lanes_optab_supported_p)
172 (vect_store_lanes_supported, vect_load_lanes_supported): New functions.
173 (vect_transform_strided_load): Split out statement recording into...
174 (vect_record_strided_load_vectors): ...this new function.
175 * tree-vect-stmts.c (create_vector_array, read_vector_array)
176 (write_vector_array, create_array_ref): New functions.
177 (vect_model_store_cost): Add store_lanes_p argument.
178 (vect_model_load_cost): Add load_lanes_p argument.
179 (vectorizable_store): Try to use store-lanes functions for
180 interleaved stores.
181 (vectorizable_load): Likewise load-lanes and loads.
182 * tree-vect-slp.c (vect_get_and_check_slp_defs): Update call
183 to vect_model_store_cost.
184 (vect_build_slp_tree): Likewise vect_model_load_cost.
185
1862001-06-02 Richard Sandiford <richard.sandiford@linaro.org>
187
188 gcc/
189 Backport from mainline:
190
191 2011-04-20 Richard Sandiford <richard.sandiford@linaro.org>
192
193 * tree-vect-stmts.c (vectorizable_store): Only chain one related
194 statement per copy.
195
1962001-06-02 Richard Sandiford <richard.sandiford@linaro.org>
197
198 gcc/
199 * tree-inline.c (estimate_num_insns): Likewise.
200
201 Backport from mainline:
202
203 2011-04-20 Richard Sandiford <richard.sandiford@linaro.org>
204
205 * Makefile.in (INTERNAL_FN_DEF, INTERNAL_FN_H): Define.
206 (GIMPLE_H): Include $(INTERNAL_FN_H).
207 (OBJS-common): Add internal-fn.o.
208 (internal-fn.o): New rule.
209 * internal-fn.def: New file.
210 * internal-fn.h: Likewise.
211 * internal-fn.c: Likewise.
212 * gimple.h: Include internal-fn.h.
213 (GF_CALL_INTERNAL): New gf_mask.
214 (gimple_statement_call): Put fntype into a union with a new
215 internal_fn field.
216 (gimple_build_call_internal): Declare.
217 (gimple_build_call_internal_vec): Likewise.
218 (gimple_call_same_target_p): Likewise.
219 (gimple_call_internal_p): New function.
220 (gimple_call_internal_fn): Likewise.
221 (gimple_call_set_fn): Assert that the function is not internal.
222 (gimple_call_set_fndecl): Likewise.
223 (gimple_call_set_internal_fn): New function.
224 (gimple_call_addr_fndecl): Handle null functions.
225 (gimple_call_return_type): Likewise.
226 [---- Plus backport adjustments:
227 (GF_CALL_INTERNAL_FN_SHIFT): New macro.
228 (GF_CALL_INTERNAL_FN): New gf_mask.
229 ----]
230 * gimple.c (gimple_build_call_internal_1): New function.
231 (gimple_build_call_internal): Likewise.
232 (gimple_build_call_internal_vec): Likewise.
233 (gimple_call_same_target_p): Likewise.
234 (gimple_call_flags): Handle calls to internal functions.
235 (gimple_call_fnspec): New function.
236 (gimple_call_arg_flags, gimple_call_return_flags): Use it.
237 (gimple_has_side_effects): Handle null functions.
238 (gimple_rhs_has_side_effects): Likewise.
239 (gimple_call_copy_skip_args): Handle calls to internal functions.
240 * cfgexpand.c (expand_call_stmt): Likewise.
241 * expr.c (expand_expr_real_1): Assert that the call isn't internal.
242 * gimple-low.c (gimple_check_call_args): Handle calls to internal
243 functions.
244 * gimple-pretty-print.c (dump_gimple_call): Likewise.
245 * ipa-prop.c (ipa_analyze_call_uses): Handle null functions.
246 * tree-cfg.c (verify_gimple_call): Handle calls to internal functions.
247 (do_warn_unused_result): Likewise.
248 [---- Plus backport adjustments:
249 (verify_stmt): Likewise.
250 ----]
251 * tree-eh.c (same_handler_p): Use gimple_call_same_target_p.
252 * tree-ssa-ccp.c (ccp_fold_stmt): Handle calls to internal functions.
253 [---- Plus backport adjustments:
254 (fold_gimple_call): Likewise.
255 ----]
256 * tree-ssa-dom.c (hashable_expr): Use the gimple statement to record
257 the target of a call.
258 (initialize_hash_element): Update accordingly.
259 (hashable_expr_equal_p): Use gimple_call_same_target_p.
260 (iterative_hash_hashable_expr): Handle calls to internal functions.
261 (print_expr_hash_elt): Likewise.
262 * tree-ssa-pre.c (can_value_number_call): Likewise.
263 (eliminate): Handle null functions.
264 * tree-ssa-sccvn.c (visit_use): Handle calls to internal functions.
265 * tree-ssa-structalias.c (find_func_aliases): Likewise.
266 * value-prof.c (gimple_ic_transform): Likewise.
267 (gimple_indirect_call_to_profile): Likewise.
268
2692001-06-02 Richard Sandiford <richard.sandiford@linaro.org>
270
271 gcc/
272 Backport from mainline:
273
274 2011-04-14 Richard Sandiford <richard.sandiford@linaro.org>
275
276 * tree-vectorizer.h (vect_strided_store_supported): Add a
277 HOST_WIDE_INT argument.
278 (vect_strided_load_supported): Likewise.
279 (vect_permute_store_chain): Return void.
280 (vect_transform_strided_load): Likewise.
281 (vect_permute_load_chain): Delete.
282 * tree-vect-data-refs.c (vect_strided_store_supported): Take a
283 count argument. Check that the count is a power of two.
284 (vect_strided_load_supported): Likewise.
285 (vect_permute_store_chain): Return void. Update after above changes.
286 Assert that the access is supported.
287 (vect_permute_load_chain): Likewise.
288 (vect_transform_strided_load): Return void.
289 * tree-vect-stmts.c (vectorizable_store): Update calls after
290 above interface changes.
291 (vectorizable_load): Likewise.
292 (vect_analyze_stmt): Don't check for strided powers of two here.
293
2942001-06-02 Richard Sandiford <richard.sandiford@linaro.org>
295
296 gcc/
297 Backport from mainline:
298
299 2011-04-14 Richard Sandiford <richard.sandiford@linaro.org>
300
301 * tree-vectorizer.h (vect_create_data_ref_ptr): Add an extra
302 type parameter.
303 * tree-vect-data-refs.c (vect_create_data_ref_ptr): Add an aggr_type
304 parameter. Generalise code to handle arrays as well as vectors.
305 (vect_setup_realignment): Update accordingly.
306 * tree-vect-stmts.c (vectorizable_store): Likewise.
307 (vectorizable_load): Likewise.
308
3092001-06-02 Richard Sandiford <richard.sandiford@linaro.org>
310
311 gcc/
312 Backport from mainline:
313
314 2011-04-14 Richard Sandiford <richard.sandiford@linaro.org>
315
316 * tree-vect-stmts.c (vectorizable_load): Allocate and free dr_chain
317 within the per-copy loop.
318
3192001-06-02 Richard Sandiford <richard.sandiford@linaro.org>
320
321 gcc/
322 Backport from mainline:
323
324 2011-04-14 Richard Sandiford <richard.sandiford@linaro.org>
325
326 * tree-vect-stmts.c (vectorizable_load): Print the number of copies
327 in the dump file.
328
3292001-06-02 Richard Sandiford <richard.sandiford@linaro.org>
330
331 gcc/
332 Backport from mainline:
333
334 2011-03-25 Richard Sandiford <richard.sandiford@linaro.org>
335
336 * config/arm/arm.h (CANNOT_CHANGE_MODE_CLASS): Restrict FPA_REGS
337 case to VFPv1.
338
339=== modified file 'gcc/Makefile.in'
340--- old/gcc/Makefile.in 2011-05-26 14:27:33 +0000
341+++ new/gcc/Makefile.in 2011-06-02 12:12:00 +0000
342@@ -888,6 +888,8 @@
343 READ_MD_H = $(OBSTACK_H) $(HASHTAB_H) read-md.h
344 PARAMS_H = params.h params.def
345 BUILTINS_DEF = builtins.def sync-builtins.def omp-builtins.def
346+INTERNAL_FN_DEF = internal-fn.def
347+INTERNAL_FN_H = internal-fn.h $(INTERNAL_FN_DEF)
348 TREE_H = tree.h all-tree.def tree.def c-family/c-common.def \
349 $(lang_tree_files) $(MACHMODE_H) tree-check.h $(BUILTINS_DEF) \
350 $(INPUT_H) statistics.h $(VEC_H) treestruct.def $(HASHTAB_H) \
351@@ -897,7 +899,7 @@
352 BASIC_BLOCK_H = basic-block.h $(PREDICT_H) $(VEC_H) $(FUNCTION_H) cfghooks.h
353 GIMPLE_H = gimple.h gimple.def gsstruct.def pointer-set.h $(VEC_H) \
354 $(GGC_H) $(BASIC_BLOCK_H) $(TARGET_H) tree-ssa-operands.h \
355- tree-ssa-alias.h vecir.h
356+ tree-ssa-alias.h vecir.h $(INTERNAL_FN_H)
357 GCOV_IO_H = gcov-io.h gcov-iov.h auto-host.h
358 COVERAGE_H = coverage.h $(GCOV_IO_H)
359 DEMANGLE_H = $(srcdir)/../include/demangle.h
360@@ -1269,6 +1271,7 @@
361 init-regs.o \
362 input.o \
363 integrate.o \
364+ internal-fn.o \
365 intl.o \
366 ira.o \
367 ira-build.o \
368@@ -2751,6 +2754,8 @@
369 $(TM_H) $(TREE_H) $(DIAGNOSTIC_CORE_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) \
370 $(TREE_PASS_H) tree-ssa-propagate.h tree-pretty-print.h \
371 gimple-pretty-print.h
372+internal-fn.o : internal-fn.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
373+ $(GIMPLE_H) $(TREE_H) $(EXPR_H) $(OPTABS_H) $(RECOG_H)
374 gimple.o : gimple.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \
375 $(GGC_H) $(GIMPLE_H) $(DIAGNOSTIC_CORE_H) $(DIAGNOSTIC_H) gt-gimple.h \
376 $(TREE_FLOW_H) value-prof.h $(FLAGS_H) $(DEMANGLE_H) \
377
378=== modified file 'gcc/cfgexpand.c'
379--- old/gcc/cfgexpand.c 2011-04-20 11:18:50 +0000
380+++ new/gcc/cfgexpand.c 2011-06-02 12:12:00 +0000
381@@ -1839,12 +1839,17 @@
382 static void
383 expand_call_stmt (gimple stmt)
384 {
385- tree exp;
386- tree lhs = gimple_call_lhs (stmt);
387+ tree exp, lhs;
388 size_t i;
389 bool builtin_p;
390 tree decl;
391
392+ if (gimple_call_internal_p (stmt))
393+ {
394+ expand_internal_call (stmt);
395+ return;
396+ }
397+
398 exp = build_vl_exp (CALL_EXPR, gimple_call_num_args (stmt) + 3);
399
400 CALL_EXPR_FN (exp) = gimple_call_fn (stmt);
401@@ -1882,6 +1887,7 @@
402 SET_EXPR_LOCATION (exp, gimple_location (stmt));
403 TREE_BLOCK (exp) = gimple_block (stmt);
404
405+ lhs = gimple_call_lhs (stmt);
406 if (lhs)
407 expand_assignment (lhs, exp, false);
408 else
409
410=== modified file 'gcc/config/arm/arm.h'
411--- old/gcc/config/arm/arm.h 2011-04-26 14:42:21 +0000
412+++ new/gcc/config/arm/arm.h 2011-06-02 12:12:00 +0000
413@@ -1169,12 +1169,12 @@
414 }
415
416 /* FPA registers can't do subreg as all values are reformatted to internal
417- precision. VFP registers may only be accessed in the mode they
418- were set. */
419-#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
420- (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \
421- ? reg_classes_intersect_p (FPA_REGS, (CLASS)) \
422- || reg_classes_intersect_p (VFP_REGS, (CLASS)) \
423+ precision. In VFPv1, VFP registers could only be accessed in the mode
424+ they were set, so subregs would be invalid there too. However, we don't
425+ support VFPv1 at the moment, and the restriction was lifted in VFPv2. */
426+#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
427+ (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \
428+ ? reg_classes_intersect_p (FPA_REGS, (CLASS)) \
429 : 0)
430
431 /* The class value for index registers, and the one for base regs. */
432
433=== modified file 'gcc/config/arm/neon.md'
434--- old/gcc/config/arm/neon.md 2011-05-06 11:28:27 +0000
435+++ new/gcc/config/arm/neon.md 2011-06-02 12:12:00 +0000
436@@ -4248,6 +4248,12 @@
437 DONE;
438 })
439
440+(define_expand "vec_load_lanes<mode><mode>"
441+ [(set (match_operand:VDQX 0 "s_register_operand")
442+ (unspec:VDQX [(match_operand:VDQX 1 "neon_struct_operand")]
443+ UNSPEC_VLD1))]
444+ "TARGET_NEON")
445+
446 (define_insn "neon_vld1<mode>"
447 [(set (match_operand:VDQX 0 "s_register_operand" "=w")
448 (unspec:VDQX [(match_operand:VDQX 1 "neon_struct_operand" "Um")]
449@@ -4345,6 +4351,12 @@
450 (const_string "neon_vld1_1_2_regs")))]
451 )
452
453+(define_expand "vec_store_lanes<mode><mode>"
454+ [(set (match_operand:VDQX 0 "neon_struct_operand")
455+ (unspec:VDQX [(match_operand:VDQX 1 "s_register_operand")]
456+ UNSPEC_VST1))]
457+ "TARGET_NEON")
458+
459 (define_insn "neon_vst1<mode>"
460 [(set (match_operand:VDQX 0 "neon_struct_operand" "=Um")
461 (unspec:VDQX [(match_operand:VDQX 1 "s_register_operand" "w")]
462@@ -4401,6 +4413,13 @@
463 [(set_attr "neon_type" "neon_vst1_vst2_lane")]
464 )
465
466+(define_expand "vec_load_lanesti<mode>"
467+ [(set (match_operand:TI 0 "s_register_operand")
468+ (unspec:TI [(match_operand:TI 1 "neon_struct_operand")
469+ (unspec:VDX [(const_int 0)] UNSPEC_VSTRUCTDUMMY)]
470+ UNSPEC_VLD2))]
471+ "TARGET_NEON")
472+
473 (define_insn "neon_vld2<mode>"
474 [(set (match_operand:TI 0 "s_register_operand" "=w")
475 (unspec:TI [(match_operand:TI 1 "neon_struct_operand" "Um")
476@@ -4419,6 +4438,13 @@
477 (const_string "neon_vld2_2_regs_vld1_vld2_all_lanes")))]
478 )
479
480+(define_expand "vec_load_lanesoi<mode>"
481+ [(set (match_operand:OI 0 "s_register_operand")
482+ (unspec:OI [(match_operand:OI 1 "neon_struct_operand")
483+ (unspec:VQ [(const_int 0)] UNSPEC_VSTRUCTDUMMY)]
484+ UNSPEC_VLD2))]
485+ "TARGET_NEON")
486+
487 (define_insn "neon_vld2<mode>"
488 [(set (match_operand:OI 0 "s_register_operand" "=w")
489 (unspec:OI [(match_operand:OI 1 "neon_struct_operand" "Um")
490@@ -4501,6 +4527,13 @@
491 (const_string "neon_vld1_1_2_regs")))]
492 )
493
494+(define_expand "vec_store_lanesti<mode>"
495+ [(set (match_operand:TI 0 "neon_struct_operand")
496+ (unspec:TI [(match_operand:TI 1 "s_register_operand")
497+ (unspec:VDX [(const_int 0)] UNSPEC_VSTRUCTDUMMY)]
498+ UNSPEC_VST2))]
499+ "TARGET_NEON")
500+
501 (define_insn "neon_vst2<mode>"
502 [(set (match_operand:TI 0 "neon_struct_operand" "=Um")
503 (unspec:TI [(match_operand:TI 1 "s_register_operand" "w")
504@@ -4519,6 +4552,13 @@
505 (const_string "neon_vst1_1_2_regs_vst2_2_regs")))]
506 )
507
508+(define_expand "vec_store_lanesoi<mode>"
509+ [(set (match_operand:OI 0 "neon_struct_operand")
510+ (unspec:OI [(match_operand:OI 1 "s_register_operand")
511+ (unspec:VQ [(const_int 0)] UNSPEC_VSTRUCTDUMMY)]
512+ UNSPEC_VST2))]
513+ "TARGET_NEON")
514+
515 (define_insn "neon_vst2<mode>"
516 [(set (match_operand:OI 0 "neon_struct_operand" "=Um")
517 (unspec:OI [(match_operand:OI 1 "s_register_operand" "w")
518@@ -4584,6 +4624,13 @@
519 [(set_attr "neon_type" "neon_vst1_vst2_lane")]
520 )
521
522+(define_expand "vec_load_lanesei<mode>"
523+ [(set (match_operand:EI 0 "s_register_operand")
524+ (unspec:EI [(match_operand:EI 1 "neon_struct_operand")
525+ (unspec:VDX [(const_int 0)] UNSPEC_VSTRUCTDUMMY)]
526+ UNSPEC_VLD3))]
527+ "TARGET_NEON")
528+
529 (define_insn "neon_vld3<mode>"
530 [(set (match_operand:EI 0 "s_register_operand" "=w")
531 (unspec:EI [(match_operand:EI 1 "neon_struct_operand" "Um")
532@@ -4602,6 +4649,16 @@
533 (const_string "neon_vld3_vld4")))]
534 )
535
536+(define_expand "vec_load_lanesci<mode>"
537+ [(match_operand:CI 0 "s_register_operand")
538+ (match_operand:CI 1 "neon_struct_operand")
539+ (unspec:VQ [(const_int 0)] UNSPEC_VSTRUCTDUMMY)]
540+ "TARGET_NEON"
541+{
542+ emit_insn (gen_neon_vld3<mode> (operands[0], operands[1]));
543+ DONE;
544+})
545+
546 (define_expand "neon_vld3<mode>"
547 [(match_operand:CI 0 "s_register_operand")
548 (match_operand:CI 1 "neon_struct_operand")
549@@ -4741,6 +4798,13 @@
550 (const_string "neon_vld3_vld4_all_lanes")
551 (const_string "neon_vld1_1_2_regs")))])
552
553+(define_expand "vec_store_lanesei<mode>"
554+ [(set (match_operand:EI 0 "neon_struct_operand")
555+ (unspec:EI [(match_operand:EI 1 "s_register_operand")
556+ (unspec:VDX [(const_int 0)] UNSPEC_VSTRUCTDUMMY)]
557+ UNSPEC_VST3))]
558+ "TARGET_NEON")
559+
560 (define_insn "neon_vst3<mode>"
561 [(set (match_operand:EI 0 "neon_struct_operand" "=Um")
562 (unspec:EI [(match_operand:EI 1 "s_register_operand" "w")
563@@ -4758,6 +4822,16 @@
564 (const_string "neon_vst1_1_2_regs_vst2_2_regs")
565 (const_string "neon_vst2_4_regs_vst3_vst4")))])
566
567+(define_expand "vec_store_lanesci<mode>"
568+ [(match_operand:CI 0 "neon_struct_operand")
569+ (match_operand:CI 1 "s_register_operand")
570+ (unspec:VQ [(const_int 0)] UNSPEC_VSTRUCTDUMMY)]
571+ "TARGET_NEON"
572+{
573+ emit_insn (gen_neon_vst3<mode> (operands[0], operands[1]));
574+ DONE;
575+})
576+
577 (define_expand "neon_vst3<mode>"
578 [(match_operand:CI 0 "neon_struct_operand")
579 (match_operand:CI 1 "s_register_operand")
580@@ -4869,6 +4943,13 @@
581 }
582 [(set_attr "neon_type" "neon_vst3_vst4_lane")])
583
584+(define_expand "vec_load_lanesoi<mode>"
585+ [(set (match_operand:OI 0 "s_register_operand")
586+ (unspec:OI [(match_operand:OI 1 "neon_struct_operand")
587+ (unspec:VDX [(const_int 0)] UNSPEC_VSTRUCTDUMMY)]
588+ UNSPEC_VLD4))]
589+ "TARGET_NEON")
590+
591 (define_insn "neon_vld4<mode>"
592 [(set (match_operand:OI 0 "s_register_operand" "=w")
593 (unspec:OI [(match_operand:OI 1 "neon_struct_operand" "Um")
594@@ -4887,6 +4968,16 @@
595 (const_string "neon_vld3_vld4")))]
596 )
597
598+(define_expand "vec_load_lanesxi<mode>"
599+ [(match_operand:XI 0 "s_register_operand")
600+ (match_operand:XI 1 "neon_struct_operand")
601+ (unspec:VQ [(const_int 0)] UNSPEC_VSTRUCTDUMMY)]
602+ "TARGET_NEON"
603+{
604+ emit_insn (gen_neon_vld4<mode> (operands[0], operands[1]));
605+ DONE;
606+})
607+
608 (define_expand "neon_vld4<mode>"
609 [(match_operand:XI 0 "s_register_operand")
610 (match_operand:XI 1 "neon_struct_operand")
611@@ -5033,6 +5124,13 @@
612 (const_string "neon_vld1_1_2_regs")))]
613 )
614
615+(define_expand "vec_store_lanesoi<mode>"
616+ [(set (match_operand:OI 0 "neon_struct_operand")
617+ (unspec:OI [(match_operand:OI 1 "s_register_operand")
618+ (unspec:VDX [(const_int 0)] UNSPEC_VSTRUCTDUMMY)]
619+ UNSPEC_VST4))]
620+ "TARGET_NEON")
621+
622 (define_insn "neon_vst4<mode>"
623 [(set (match_operand:OI 0 "neon_struct_operand" "=Um")
624 (unspec:OI [(match_operand:OI 1 "s_register_operand" "w")
625@@ -5051,6 +5149,16 @@
626 (const_string "neon_vst2_4_regs_vst3_vst4")))]
627 )
628
629+(define_expand "vec_store_lanesxi<mode>"
630+ [(match_operand:XI 0 "neon_struct_operand")
631+ (match_operand:XI 1 "s_register_operand")
632+ (unspec:VQ [(const_int 0)] UNSPEC_VSTRUCTDUMMY)]
633+ "TARGET_NEON"
634+{
635+ emit_insn (gen_neon_vst4<mode> (operands[0], operands[1]));
636+ DONE;
637+})
638+
639 (define_expand "neon_vst4<mode>"
640 [(match_operand:XI 0 "neon_struct_operand")
641 (match_operand:XI 1 "s_register_operand")
642
643=== modified file 'gcc/doc/md.texi'
644--- old/gcc/doc/md.texi 2011-01-03 20:52:22 +0000
645+++ new/gcc/doc/md.texi 2011-05-05 15:43:06 +0000
646@@ -3935,6 +3935,48 @@
647 consecutive memory locations, operand 1 is the first register, and
648 operand 2 is a constant: the number of consecutive registers.
649
650+@cindex @code{vec_load_lanes@var{m}@var{n}} instruction pattern
651+@item @samp{vec_load_lanes@var{m}@var{n}}
652+Perform an interleaved load of several vectors from memory operand 1
653+into register operand 0. Both operands have mode @var{m}. The register
654+operand is viewed as holding consecutive vectors of mode @var{n},
655+while the memory operand is a flat array that contains the same number
656+of elements. The operation is equivalent to:
657+
658+@smallexample
659+int c = GET_MODE_SIZE (@var{m}) / GET_MODE_SIZE (@var{n});
660+for (j = 0; j < GET_MODE_NUNITS (@var{n}); j++)
661+ for (i = 0; i < c; i++)
662+ operand0[i][j] = operand1[j * c + i];
663+@end smallexample
664+
665+For example, @samp{vec_load_lanestiv4hi} loads 8 16-bit values
666+from memory into a register of mode @samp{TI}@. The register
667+contains two consecutive vectors of mode @samp{V4HI}@.
668+
669+This pattern can only be used if:
670+@smallexample
671+TARGET_ARRAY_MODE_SUPPORTED_P (@var{n}, @var{c})
672+@end smallexample
673+is true. GCC assumes that, if a target supports this kind of
674+instruction for some mode @var{n}, it also supports unaligned
675+loads for vectors of mode @var{n}.
676+
677+@cindex @code{vec_store_lanes@var{m}@var{n}} instruction pattern
678+@item @samp{vec_store_lanes@var{m}@var{n}}
679+Equivalent to @samp{vec_load_lanes@var{m}@var{n}}, with the memory
680+and register operands reversed. That is, the instruction is
681+equivalent to:
682+
683+@smallexample
684+int c = GET_MODE_SIZE (@var{m}) / GET_MODE_SIZE (@var{n});
685+for (j = 0; j < GET_MODE_NUNITS (@var{n}); j++)
686+ for (i = 0; i < c; i++)
687+ operand0[j * c + i] = operand1[i][j];
688+@end smallexample
689+
690+for a memory operand 0 and register operand 1.
691+
692 @cindex @code{vec_set@var{m}} instruction pattern
693 @item @samp{vec_set@var{m}}
694 Set given field in the vector value. Operand 0 is the vector to modify,
695
696=== modified file 'gcc/expr.c'
697--- old/gcc/expr.c 2011-05-26 14:27:33 +0000
698+++ new/gcc/expr.c 2011-06-02 12:12:00 +0000
699@@ -8537,10 +8537,13 @@
700 if (code == SSA_NAME
701 && (g = SSA_NAME_DEF_STMT (ssa_name))
702 && gimple_code (g) == GIMPLE_CALL)
703- pmode = promote_function_mode (type, mode, &unsignedp,
704- TREE_TYPE
705- (TREE_TYPE (gimple_call_fn (g))),
706- 2);
707+ {
708+ gcc_assert (!gimple_call_internal_p (g));
709+ pmode = promote_function_mode (type, mode, &unsignedp,
710+ TREE_TYPE
711+ (TREE_TYPE (gimple_call_fn (g))),
712+ 2);
713+ }
714 else
715 pmode = promote_decl_mode (exp, &unsignedp);
716 gcc_assert (GET_MODE (decl_rtl) == pmode);
717
718=== modified file 'gcc/genopinit.c'
719--- old/gcc/genopinit.c 2011-01-03 20:52:22 +0000
720+++ new/gcc/genopinit.c 2011-05-05 15:43:06 +0000
721@@ -74,6 +74,8 @@
722 "set_convert_optab_handler (fractuns_optab, $B, $A, CODE_FOR_$(fractuns$Q$a$I$b2$))",
723 "set_convert_optab_handler (satfract_optab, $B, $A, CODE_FOR_$(satfract$a$Q$b2$))",
724 "set_convert_optab_handler (satfractuns_optab, $B, $A, CODE_FOR_$(satfractuns$I$a$Q$b2$))",
725+ "set_convert_optab_handler (vec_load_lanes_optab, $A, $B, CODE_FOR_$(vec_load_lanes$a$b$))",
726+ "set_convert_optab_handler (vec_store_lanes_optab, $A, $B, CODE_FOR_$(vec_store_lanes$a$b$))",
727 "set_optab_handler (add_optab, $A, CODE_FOR_$(add$P$a3$))",
728 "set_optab_handler (addv_optab, $A, CODE_FOR_$(add$F$a3$)),\n\
729 set_optab_handler (add_optab, $A, CODE_FOR_$(add$F$a3$))",
730
731=== modified file 'gcc/gimple-low.c'
732--- old/gcc/gimple-low.c 2011-02-08 11:15:53 +0000
733+++ new/gcc/gimple-low.c 2011-05-05 15:42:22 +0000
734@@ -218,6 +218,10 @@
735 tree fndecl, parms, p;
736 unsigned int i, nargs;
737
738+ /* Calls to internal functions always match their signature. */
739+ if (gimple_call_internal_p (stmt))
740+ return true;
741+
742 nargs = gimple_call_num_args (stmt);
743
744 /* Get argument types for verification. */
745
746=== modified file 'gcc/gimple-pretty-print.c'
747--- old/gcc/gimple-pretty-print.c 2011-02-15 18:36:16 +0000
748+++ new/gcc/gimple-pretty-print.c 2011-05-05 15:42:22 +0000
749@@ -596,8 +596,12 @@
750
751 if (flags & TDF_RAW)
752 {
753- dump_gimple_fmt (buffer, spc, flags, "%G <%T, %T",
754- gs, gimple_call_fn (gs), lhs);
755+ if (gimple_call_internal_p (gs))
756+ dump_gimple_fmt (buffer, spc, flags, "%G <%s, %T", gs,
757+ internal_fn_name (gimple_call_internal_fn (gs)), lhs);
758+ else
759+ dump_gimple_fmt (buffer, spc, flags, "%G <%T, %T",
760+ gs, gimple_call_fn (gs), lhs);
761 if (gimple_call_num_args (gs) > 0)
762 {
763 pp_string (buffer, ", ");
764@@ -617,7 +621,10 @@
765
766 pp_space (buffer);
767 }
768- print_call_name (buffer, gimple_call_fn (gs), flags);
769+ if (gimple_call_internal_p (gs))
770+ pp_string (buffer, internal_fn_name (gimple_call_internal_fn (gs)));
771+ else
772+ print_call_name (buffer, gimple_call_fn (gs), flags);
773 pp_string (buffer, " (");
774 dump_gimple_call_args (buffer, gs, flags);
775 pp_character (buffer, ')');
776
777=== modified file 'gcc/gimple.c'
778--- old/gcc/gimple.c 2011-05-18 13:33:53 +0000
779+++ new/gcc/gimple.c 2011-06-02 12:12:00 +0000
780@@ -276,6 +276,59 @@
781 }
782
783
784+/* Helper for gimple_build_call_internal and gimple_build_call_internal_vec.
785+ Build the basic components of a GIMPLE_CALL statement to internal
786+ function FN with NARGS arguments. */
787+
788+static inline gimple
789+gimple_build_call_internal_1 (enum internal_fn fn, unsigned nargs)
790+{
791+ gimple s = gimple_build_with_ops (GIMPLE_CALL, ERROR_MARK, nargs + 3);
792+ s->gsbase.subcode |= GF_CALL_INTERNAL;
793+ gimple_call_set_internal_fn (s, fn);
794+ gimple_call_reset_alias_info (s);
795+ return s;
796+}
797+
798+
799+/* Build a GIMPLE_CALL statement to internal function FN. NARGS is
800+ the number of arguments. The ... are the arguments. */
801+
802+gimple
803+gimple_build_call_internal (enum internal_fn fn, unsigned nargs, ...)
804+{
805+ va_list ap;
806+ gimple call;
807+ unsigned i;
808+
809+ call = gimple_build_call_internal_1 (fn, nargs);
810+ va_start (ap, nargs);
811+ for (i = 0; i < nargs; i++)
812+ gimple_call_set_arg (call, i, va_arg (ap, tree));
813+ va_end (ap);
814+
815+ return call;
816+}
817+
818+
819+/* Build a GIMPLE_CALL statement to internal function FN with the arguments
820+ specified in vector ARGS. */
821+
822+gimple
823+gimple_build_call_internal_vec (enum internal_fn fn, VEC(tree, heap) *args)
824+{
825+ unsigned i, nargs;
826+ gimple call;
827+
828+ nargs = VEC_length (tree, args);
829+ call = gimple_build_call_internal_1 (fn, nargs);
830+ for (i = 0; i < nargs; i++)
831+ gimple_call_set_arg (call, i, VEC_index (tree, args, i));
832+
833+ return call;
834+}
835+
836+
837 /* Build a GIMPLE_CALL statement from CALL_EXPR T. Note that T is
838 assumed to be in GIMPLE form already. Minimal checking is done of
839 this fact. */
840@@ -1774,6 +1827,20 @@
841 return (gimple_body (fndecl) || (fn && fn->cfg));
842 }
843
844+/* Return true if calls C1 and C2 are known to go to the same function. */
845+
846+bool
847+gimple_call_same_target_p (const_gimple c1, const_gimple c2)
848+{
849+ if (gimple_call_internal_p (c1))
850+ return (gimple_call_internal_p (c2)
851+ && gimple_call_internal_fn (c1) == gimple_call_internal_fn (c2));
852+ else
853+ return (gimple_call_fn (c1) == gimple_call_fn (c2)
854+ || (gimple_call_fndecl (c1)
855+ && gimple_call_fndecl (c1) == gimple_call_fndecl (c2)));
856+}
857+
858 /* Detect flags from a GIMPLE_CALL. This is just like
859 call_expr_flags, but for gimple tuples. */
860
861@@ -1786,6 +1853,8 @@
862
863 if (decl)
864 flags = flags_from_decl_or_type (decl);
865+ else if (gimple_call_internal_p (stmt))
866+ flags = internal_fn_flags (gimple_call_internal_fn (stmt));
867 else
868 {
869 t = TREE_TYPE (gimple_call_fn (stmt));
870@@ -1801,18 +1870,35 @@
871 return flags;
872 }
873
874+/* Return the "fn spec" string for call STMT. */
875+
876+static tree
877+gimple_call_fnspec (const_gimple stmt)
878+{
879+ tree fn, type, attr;
880+
881+ fn = gimple_call_fn (stmt);
882+ if (!fn)
883+ return NULL_TREE;
884+
885+ type = TREE_TYPE (TREE_TYPE (fn));
886+ if (!type)
887+ return NULL_TREE;
888+
889+ attr = lookup_attribute ("fn spec", TYPE_ATTRIBUTES (type));
890+ if (!attr)
891+ return NULL_TREE;
892+
893+ return TREE_VALUE (TREE_VALUE (attr));
894+}
895+
896 /* Detects argument flags for argument number ARG on call STMT. */
897
898 int
899 gimple_call_arg_flags (const_gimple stmt, unsigned arg)
900 {
901- tree type = TREE_TYPE (TREE_TYPE (gimple_call_fn (stmt)));
902- tree attr = lookup_attribute ("fn spec", TYPE_ATTRIBUTES (type));
903- if (!attr)
904- return 0;
905-
906- attr = TREE_VALUE (TREE_VALUE (attr));
907- if (1 + arg >= (unsigned) TREE_STRING_LENGTH (attr))
908+ tree attr = gimple_call_fnspec (stmt);
909+ if (!attr || 1 + arg >= (unsigned) TREE_STRING_LENGTH (attr))
910 return 0;
911
912 switch (TREE_STRING_POINTER (attr)[1 + arg])
913@@ -1850,13 +1936,8 @@
914 if (gimple_call_flags (stmt) & ECF_MALLOC)
915 return ERF_NOALIAS;
916
917- type = TREE_TYPE (TREE_TYPE (gimple_call_fn (stmt)));
918- attr = lookup_attribute ("fn spec", TYPE_ATTRIBUTES (type));
919- if (!attr)
920- return 0;
921-
922- attr = TREE_VALUE (TREE_VALUE (attr));
923- if (TREE_STRING_LENGTH (attr) < 1)
924+ attr = gimple_call_fnspec (stmt);
925+ if (!attr || TREE_STRING_LENGTH (attr) < 1)
926 return 0;
927
928 switch (TREE_STRING_POINTER (attr)[0])
929@@ -2293,6 +2374,7 @@
930 if (is_gimple_call (s))
931 {
932 unsigned nargs = gimple_call_num_args (s);
933+ tree fn;
934
935 if (!(gimple_call_flags (s) & (ECF_CONST | ECF_PURE)))
936 return true;
937@@ -2307,7 +2389,8 @@
938 return true;
939 }
940
941- if (TREE_SIDE_EFFECTS (gimple_call_fn (s)))
942+ fn = gimple_call_fn (s);
943+ if (fn && TREE_SIDE_EFFECTS (fn))
944 return true;
945
946 for (i = 0; i < nargs; i++)
947@@ -2349,14 +2432,15 @@
948 if (is_gimple_call (s))
949 {
950 unsigned nargs = gimple_call_num_args (s);
951+ tree fn;
952
953 if (!(gimple_call_flags (s) & (ECF_CONST | ECF_PURE)))
954 return true;
955
956 /* We cannot use gimple_has_volatile_ops here,
957 because we must ignore a volatile LHS. */
958- if (TREE_SIDE_EFFECTS (gimple_call_fn (s))
959- || TREE_THIS_VOLATILE (gimple_call_fn (s)))
960+ fn = gimple_call_fn (s);
961+ if (fn && (TREE_SIDE_EFFECTS (fn) || TREE_THIS_VOLATILE (fn)))
962 {
963 gcc_assert (gimple_has_volatile_ops (s));
964 return true;
965@@ -3113,7 +3197,6 @@
966 gimple_call_copy_skip_args (gimple stmt, bitmap args_to_skip)
967 {
968 int i;
969- tree fn = gimple_call_fn (stmt);
970 int nargs = gimple_call_num_args (stmt);
971 VEC(tree, heap) *vargs = VEC_alloc (tree, heap, nargs);
972 gimple new_stmt;
973@@ -3122,7 +3205,11 @@
974 if (!bitmap_bit_p (args_to_skip, i))
975 VEC_quick_push (tree, vargs, gimple_call_arg (stmt, i));
976
977- new_stmt = gimple_build_call_vec (fn, vargs);
978+ if (gimple_call_internal_p (stmt))
979+ new_stmt = gimple_build_call_internal_vec (gimple_call_internal_fn (stmt),
980+ vargs);
981+ else
982+ new_stmt = gimple_build_call_vec (gimple_call_fn (stmt), vargs);
983 VEC_free (tree, heap, vargs);
984 if (gimple_call_lhs (stmt))
985 gimple_call_set_lhs (new_stmt, gimple_call_lhs (stmt));
986
987=== modified file 'gcc/gimple.h'
988--- old/gcc/gimple.h 2011-04-18 21:58:03 +0000
989+++ new/gcc/gimple.h 2011-06-02 12:12:00 +0000
990@@ -30,6 +30,7 @@
991 #include "basic-block.h"
992 #include "tree-ssa-operands.h"
993 #include "tree-ssa-alias.h"
994+#include "internal-fn.h"
995
996 struct gimple_seq_node_d;
997 typedef struct gimple_seq_node_d *gimple_seq_node;
998@@ -82,6 +83,8 @@
999 name, a _DECL, a _REF, etc. */
1000 };
1001
1002+#define GF_CALL_INTERNAL_FN_SHIFT 8
1003+
1004 /* Specific flags for individual GIMPLE statements. These flags are
1005 always stored in gimple_statement_base.subcode and they may only be
1006 defined for statement codes that do not use sub-codes.
1007@@ -102,6 +105,8 @@
1008 GF_CALL_TAILCALL = 1 << 3,
1009 GF_CALL_VA_ARG_PACK = 1 << 4,
1010 GF_CALL_NOTHROW = 1 << 5,
1011+ GF_CALL_INTERNAL = 1 << 6,
1012+ GF_CALL_INTERNAL_FN = 0xff << GF_CALL_INTERNAL_FN_SHIFT,
1013 GF_OMP_PARALLEL_COMBINED = 1 << 0,
1014
1015 /* True on an GIMPLE_OMP_RETURN statement if the return does not require
1016@@ -817,6 +822,8 @@
1017
1018 gimple gimple_build_call_vec (tree, VEC(tree, heap) *);
1019 gimple gimple_build_call (tree, unsigned, ...);
1020+gimple gimple_build_call_internal (enum internal_fn, unsigned, ...);
1021+gimple gimple_build_call_internal_vec (enum internal_fn, VEC(tree, heap) *);
1022 gimple gimple_build_call_from_tree (tree);
1023 gimple gimplify_assign (tree, tree, gimple_seq *);
1024 gimple gimple_build_cond (enum tree_code, tree, tree, tree, tree);
1025@@ -861,6 +868,7 @@
1026 void gimple_seq_free (gimple_seq);
1027 void gimple_seq_add_seq (gimple_seq *, gimple_seq);
1028 gimple_seq gimple_seq_copy (gimple_seq);
1029+bool gimple_call_same_target_p (const_gimple, const_gimple);
1030 int gimple_call_flags (const_gimple);
1031 int gimple_call_return_flags (const_gimple);
1032 int gimple_call_arg_flags (const_gimple, unsigned);
1033@@ -2012,6 +2020,27 @@
1034 }
1035
1036
1037+/* Return true if call GS calls an internal-only function, as enumerated
1038+ by internal_fn. */
1039+
1040+static inline bool
1041+gimple_call_internal_p (const_gimple gs)
1042+{
1043+ GIMPLE_CHECK (gs, GIMPLE_CALL);
1044+ return (gs->gsbase.subcode & GF_CALL_INTERNAL) != 0;
1045+}
1046+
1047+
1048+/* Return the target of internal call GS. */
1049+
1050+static inline enum internal_fn
1051+gimple_call_internal_fn (const_gimple gs)
1052+{
1053+ gcc_assert (gimple_call_internal_p (gs));
1054+ return (enum internal_fn) (gs->gsbase.subcode >> GF_CALL_INTERNAL_FN_SHIFT);
1055+}
1056+
1057+
1058 /* Return a pointer to the tree node representing the function called by call
1059 statement GS. */
1060
1061@@ -2029,6 +2058,7 @@
1062 gimple_call_set_fn (gimple gs, tree fn)
1063 {
1064 GIMPLE_CHECK (gs, GIMPLE_CALL);
1065+ gcc_assert (!gimple_call_internal_p (gs));
1066 gimple_set_op (gs, 1, fn);
1067 }
1068
1069@@ -2039,10 +2069,23 @@
1070 gimple_call_set_fndecl (gimple gs, tree decl)
1071 {
1072 GIMPLE_CHECK (gs, GIMPLE_CALL);
1073+ gcc_assert (!gimple_call_internal_p (gs));
1074 gimple_set_op (gs, 1, build_fold_addr_expr_loc (gimple_location (gs), decl));
1075 }
1076
1077
1078+/* Set internal function FN to be the function called by call statement GS. */
1079+
1080+static inline void
1081+gimple_call_set_internal_fn (gimple gs, enum internal_fn fn)
1082+{
1083+ GIMPLE_CHECK (gs, GIMPLE_CALL);
1084+ gcc_assert (gimple_call_internal_p (gs));
1085+ gs->gsbase.subcode &= ~GF_CALL_INTERNAL_FN;
1086+ gs->gsbase.subcode |= (int) fn << GF_CALL_INTERNAL_FN_SHIFT;
1087+}
1088+
1089+
1090 /* If a given GIMPLE_CALL's callee is a FUNCTION_DECL, return it.
1091 Otherwise return NULL. This function is analogous to
1092 get_callee_fndecl in tree land. */
1093@@ -2051,7 +2094,7 @@
1094 gimple_call_fndecl (const_gimple gs)
1095 {
1096 tree addr = gimple_call_fn (gs);
1097- if (TREE_CODE (addr) == ADDR_EXPR)
1098+ if (addr && TREE_CODE (addr) == ADDR_EXPR)
1099 {
1100 tree fndecl = TREE_OPERAND (addr, 0);
1101 if (TREE_CODE (fndecl) == MEM_REF)
1102@@ -2073,8 +2116,13 @@
1103 static inline tree
1104 gimple_call_return_type (const_gimple gs)
1105 {
1106- tree fn = gimple_call_fn (gs);
1107- tree type = TREE_TYPE (fn);
1108+ tree fn, type;
1109+
1110+ fn = gimple_call_fn (gs);
1111+ if (fn == NULL_TREE)
1112+ return TREE_TYPE (gimple_call_lhs (gs));
1113+
1114+ type = TREE_TYPE (fn);
1115
1116 /* See through the pointer. */
1117 type = TREE_TYPE (type);
1118
1119=== added file 'gcc/internal-fn.c'
1120--- old/gcc/internal-fn.c 1970-01-01 00:00:00 +0000
1121+++ new/gcc/internal-fn.c 2011-05-05 15:43:06 +0000
1122@@ -0,0 +1,147 @@
1123+/* Internal functions.
1124+ Copyright (C) 2011 Free Software Foundation, Inc.
1125+
1126+This file is part of GCC.
1127+
1128+GCC is free software; you can redistribute it and/or modify it under
1129+the terms of the GNU General Public License as published by the Free
1130+Software Foundation; either version 3, or (at your option) any later
1131+version.
1132+
1133+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
1134+WARRANTY; without even the implied warranty of MERCHANTABILITY or
1135+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1136+for more details.
1137+
1138+You should have received a copy of the GNU General Public License
1139+along with GCC; see the file COPYING3. If not see
1140+<http://www.gnu.org/licenses/>. */
1141+
1142+#include "config.h"
1143+#include "system.h"
1144+#include "coretypes.h"
1145+#include "gimple.h"
1146+#include "tree.h"
1147+#include "expr.h"
1148+#include "optabs.h"
1149+#include "recog.h"
1150+
1151+/* The names of each internal function, indexed by function number. */
1152+const char *const internal_fn_name_array[] = {
1153+#define DEF_INTERNAL_FN(CODE, FLAGS) #CODE,
1154+#include "internal-fn.def"
1155+#undef DEF_INTERNAL_FN
1156+ "<invalid-fn>"
1157+};
1158+
1159+/* The ECF_* flags of each internal function, indexed by function number. */
1160+const int internal_fn_flags_array[] = {
1161+#define DEF_INTERNAL_FN(CODE, FLAGS) FLAGS,
1162+#include "internal-fn.def"
1163+#undef DEF_INTERNAL_FN
1164+ 0
1165+};
1166+
1167+/* ARRAY_TYPE is an array of vector modes. Return the associated insn
1168+ for load-lanes-style optab OPTAB. The insn must exist. */
1169+
1170+static enum insn_code
1171+get_multi_vector_move (tree array_type, convert_optab optab)
1172+{
1173+ enum insn_code icode;
1174+ enum machine_mode imode;
1175+ enum machine_mode vmode;
1176+
1177+ gcc_assert (TREE_CODE (array_type) == ARRAY_TYPE);
1178+ imode = TYPE_MODE (array_type);
1179+ vmode = TYPE_MODE (TREE_TYPE (array_type));
1180+
1181+ icode = convert_optab_handler (optab, imode, vmode);
1182+ gcc_assert (icode != CODE_FOR_nothing);
1183+ return icode;
1184+}
1185+
1186+/* Expand LOAD_LANES call STMT. */
1187+
1188+static void
1189+expand_LOAD_LANES (gimple stmt)
1190+{
1191+ tree type, lhs, rhs;
1192+ rtx target, mem;
1193+ enum insn_code icode;
1194+ const struct insn_operand_data *operand;
1195+
1196+ lhs = gimple_call_lhs (stmt);
1197+ rhs = gimple_call_arg (stmt, 0);
1198+ type = TREE_TYPE (lhs);
1199+
1200+ target = expand_expr (lhs, NULL_RTX, VOIDmode, EXPAND_WRITE);
1201+ mem = expand_normal (rhs);
1202+
1203+ gcc_assert (REG_P (target));
1204+ gcc_assert (MEM_P (mem));
1205+ PUT_MODE (mem, TYPE_MODE (type));
1206+
1207+ icode = get_multi_vector_move (type, vec_load_lanes_optab);
1208+
1209+ operand = &insn_data[(int) icode].operand[1];
1210+ if (operand->predicate && !operand->predicate (mem, operand->mode))
1211+ mem = replace_equiv_address (mem, force_reg (Pmode, XEXP (mem, 0)));
1212+
1213+ emit_insn (GEN_FCN (icode) (target, mem));
1214+}
1215+
1216+/* Expand STORE_LANES call STMT. */
1217+
1218+static void
1219+expand_STORE_LANES (gimple stmt)
1220+{
1221+ tree type, lhs, rhs;
1222+ rtx target, reg;
1223+ enum insn_code icode;
1224+ const struct insn_operand_data *operand;
1225+
1226+ lhs = gimple_call_lhs (stmt);
1227+ rhs = gimple_call_arg (stmt, 0);
1228+ type = TREE_TYPE (rhs);
1229+
1230+ target = expand_expr (lhs, NULL_RTX, VOIDmode, EXPAND_WRITE);
1231+ reg = expand_normal (rhs);
1232+
1233+ gcc_assert (MEM_P (target));
1234+ PUT_MODE (target, TYPE_MODE (type));
1235+
1236+ icode = get_multi_vector_move (type, vec_store_lanes_optab);
1237+
1238+ operand = &insn_data[(int) icode].operand[0];
1239+ if (operand->predicate && !operand->predicate (target, operand->mode))
1240+ target = replace_equiv_address (target,
1241+ force_reg (Pmode, XEXP (target, 0)));
1242+
1243+ operand = &insn_data[(int) icode].operand[1];
1244+ if (operand->predicate && !operand->predicate (reg, operand->mode))
1245+ reg = force_reg (TYPE_MODE (type), reg);
1246+
1247+ emit_insn (GEN_FCN (icode) (target, reg));
1248+}
1249+
1250+/* Routines to expand each internal function, indexed by function number.
1251+ Each routine has the prototype:
1252+
1253+ expand_<NAME> (gimple stmt)
1254+
1255+ where STMT is the statement that performs the call. */
1256+static void (*const internal_fn_expanders[]) (gimple) = {
1257+#define DEF_INTERNAL_FN(CODE, FLAGS) expand_##CODE,
1258+#include "internal-fn.def"
1259+#undef DEF_INTERNAL_FN
1260+ 0
1261+};
1262+
1263+/* Expand STMT, which is a call to internal function FN. */
1264+
1265+void
1266+expand_internal_call (gimple stmt)
1267+{
1268+ internal_fn_expanders[(int) gimple_call_internal_fn (stmt)] (stmt);
1269+}
1270
1271=== added file 'gcc/internal-fn.def'
1272--- old/gcc/internal-fn.def 1970-01-01 00:00:00 +0000
1273+++ new/gcc/internal-fn.def 2011-05-05 15:43:06 +0000
1274@@ -0,0 +1,42 @@
1275+/* Internal functions.
1276+ Copyright (C) 2011 Free Software Foundation, Inc.
1277+
1278+This file is part of GCC.
1279+
1280+GCC is free software; you can redistribute it and/or modify it under
1281+the terms of the GNU General Public License as published by the Free
1282+Software Foundation; either version 3, or (at your option) any later
1283+version.
1284+
1285+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
1286+WARRANTY; without even the implied warranty of MERCHANTABILITY or
1287+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1288+for more details.
1289+
1290+You should have received a copy of the GNU General Public License
1291+along with GCC; see the file COPYING3. If not see
1292+<http://www.gnu.org/licenses/>. */
1293+
1294+/* This file specifies a list of internal "functions". These functions
1295+ differ from built-in functions in that they have no linkage and cannot
1296+ be called directly by the user. They represent operations that are only
1297+ synthesised by GCC itself.
1298+
1299+ Internal functions are used instead of tree codes if the operation
1300+ and its operands are more naturally represented as a GIMPLE_CALL
1301+ than a GIMPLE_ASSIGN.
1302+
1303+ Each entry in this file has the form:
1304+
1305+ DEF_INTERNAL_FN (NAME, FLAGS)
1306+
1307+ where NAME is the name of the function and FLAGS is a set of
1308+ ECF_* flags. Each entry must have a corresponding expander
1309+ of the form:
1310+
1311+ void expand_NAME (gimple stmt)
1312+
1313+ where STMT is the statement that performs the call. */
1314+
1315+DEF_INTERNAL_FN (LOAD_LANES, ECF_CONST | ECF_LEAF)
1316+DEF_INTERNAL_FN (STORE_LANES, ECF_CONST | ECF_LEAF)
1317
1318=== added file 'gcc/internal-fn.h'
1319--- old/gcc/internal-fn.h 1970-01-01 00:00:00 +0000
1320+++ new/gcc/internal-fn.h 2011-05-05 15:42:22 +0000
1321@@ -0,0 +1,52 @@
1322+/* Internal functions.
1323+ Copyright (C) 2011 Free Software Foundation, Inc.
1324+
1325+This file is part of GCC.
1326+
1327+GCC is free software; you can redistribute it and/or modify it under
1328+the terms of the GNU General Public License as published by the Free
1329+Software Foundation; either version 3, or (at your option) any later
1330+version.
1331+
1332+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
1333+WARRANTY; without even the implied warranty of MERCHANTABILITY or
1334+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1335+for more details.
1336+
1337+You should have received a copy of the GNU General Public License
1338+along with GCC; see the file COPYING3. If not see
1339+<http://www.gnu.org/licenses/>. */
1340+
1341+#ifndef GCC_INTERNAL_FN_H
1342+#define GCC_INTERNAL_FN_H
1343+
1344+enum internal_fn {
1345+#define DEF_INTERNAL_FN(CODE, FLAGS) IFN_##CODE,
1346+#include "internal-fn.def"
1347+#undef DEF_INTERNAL_FN
1348+ IFN_LAST
1349+};
1350+
1351+extern const char *const internal_fn_name_array[];
1352+extern const int internal_fn_flags_array[];
1353+
1354+/* Return the name of internal function FN. The name is only meaningful
1355+ for dumps; it has no linkage. */
1356+
1357+static inline const char *
1358+internal_fn_name (enum internal_fn fn)
1359+{
1360+ return internal_fn_name_array[(int) fn];
1361+}
1362+
1363+/* Return the ECF_* flags for function FN. */
1364+
1365+static inline int
1366+internal_fn_flags (enum internal_fn fn)
1367+{
1368+ return internal_fn_flags_array[(int) fn];
1369+}
1370+
1371+extern void expand_internal_call (gimple);
1372+
1373+#endif
1374
1375=== modified file 'gcc/ipa-prop.c'
1376--- old/gcc/ipa-prop.c 2011-04-18 21:58:03 +0000
1377+++ new/gcc/ipa-prop.c 2011-06-02 12:12:00 +0000
1378@@ -1418,6 +1418,8 @@
1379 {
1380 tree target = gimple_call_fn (call);
1381
1382+ if (!target)
1383+ return;
1384 if (TREE_CODE (target) == SSA_NAME)
1385 ipa_analyze_indirect_call_uses (node, info, parms_info, call, target);
1386 else if (TREE_CODE (target) == OBJ_TYPE_REF)
1387
1388=== modified file 'gcc/optabs.h'
1389--- old/gcc/optabs.h 2011-01-03 20:52:22 +0000
1390+++ new/gcc/optabs.h 2011-05-05 15:43:06 +0000
1391@@ -578,6 +578,9 @@
1392 COI_satfract,
1393 COI_satfractuns,
1394
1395+ COI_vec_load_lanes,
1396+ COI_vec_store_lanes,
1397+
1398 COI_MAX
1399 };
1400
1401@@ -598,6 +601,8 @@
1402 #define fractuns_optab (&convert_optab_table[COI_fractuns])
1403 #define satfract_optab (&convert_optab_table[COI_satfract])
1404 #define satfractuns_optab (&convert_optab_table[COI_satfractuns])
1405+#define vec_load_lanes_optab (&convert_optab_table[COI_vec_load_lanes])
1406+#define vec_store_lanes_optab (&convert_optab_table[COI_vec_store_lanes])
1407
1408 /* Contains the optab used for each rtx code. */
1409 extern optab code_to_optab[NUM_RTX_CODE + 1];
1410
1411=== modified file 'gcc/testsuite/gcc.dg/vect/O3-pr39675-2.c'
1412--- old/gcc/testsuite/gcc.dg/vect/O3-pr39675-2.c 2009-04-20 10:26:18 +0000
1413+++ new/gcc/testsuite/gcc.dg/vect/O3-pr39675-2.c 2011-05-05 15:46:10 +0000
1414@@ -26,7 +26,7 @@
1415 }
1416 }
1417
1418-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided_wide } } } */
1419-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_strided_wide } } } */
1420+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided4 } } } */
1421+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_strided4 } } } */
1422 /* { dg-final { cleanup-tree-dump "vect" } } */
1423
1424
1425=== modified file 'gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-12.c'
1426--- old/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-12.c 2010-11-22 12:16:52 +0000
1427+++ new/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-12.c 2011-05-05 15:46:10 +0000
1428@@ -113,7 +113,7 @@
1429 return 0;
1430 }
1431
1432-/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" {target { vect_strided && vect_int_mult } } } } */
1433-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" {target { vect_strided && vect_int_mult } } } } */
1434+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" {target { vect_strided8 && vect_int_mult } } } } */
1435+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" {target { vect_strided8 && vect_int_mult } } } } */
1436 /* { dg-final { cleanup-tree-dump "vect" } } */
1437
1438
1439=== modified file 'gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c'
1440--- old/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c 2008-08-26 08:14:37 +0000
1441+++ new/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c 2011-05-05 15:44:00 +0000
1442@@ -20,7 +20,7 @@
1443 return avg;
1444 }
1445
1446-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_extract_even_odd_wide } } } */
1447-/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail vect_extract_even_odd_wide } } } */
1448+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_extract_even_odd } } } */
1449+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail vect_extract_even_odd } } } */
1450 /* { dg-final { cleanup-tree-dump "vect" } } */
1451
1452
1453=== modified file 'gcc/testsuite/gcc.dg/vect/fast-math-slp-27.c'
1454--- old/gcc/testsuite/gcc.dg/vect/fast-math-slp-27.c 2010-08-26 11:13:58 +0000
1455+++ new/gcc/testsuite/gcc.dg/vect/fast-math-slp-27.c 2011-05-05 15:46:10 +0000
1456@@ -13,5 +13,5 @@
1457 }
1458 }
1459
1460-/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { target vect_strided } } } */
1461+/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { target vect_strided2 } } } */
1462 /* { dg-final { cleanup-tree-dump "vect" } } */
1463
1464=== modified file 'gcc/testsuite/gcc.dg/vect/fast-math-vect-complex-3.c'
1465--- old/gcc/testsuite/gcc.dg/vect/fast-math-vect-complex-3.c 2010-11-22 12:16:52 +0000
1466+++ new/gcc/testsuite/gcc.dg/vect/fast-math-vect-complex-3.c 2011-05-05 15:46:10 +0000
1467@@ -56,5 +56,5 @@
1468 return 0;
1469 }
1470
1471-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd_wide } } } } */
1472+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
1473 /* { dg-final { cleanup-tree-dump "vect" } } */
1474
1475=== modified file 'gcc/testsuite/gcc.dg/vect/if-cvt-stores-vect-ifcvt-18.c'
1476--- old/gcc/testsuite/gcc.dg/vect/if-cvt-stores-vect-ifcvt-18.c 2011-04-24 07:45:49 +0000
1477+++ new/gcc/testsuite/gcc.dg/vect/if-cvt-stores-vect-ifcvt-18.c 2011-05-05 15:46:10 +0000
1478@@ -65,5 +65,5 @@
1479 return 0;
1480 }
1481
1482-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align || {! vect_strided } } } } } */
1483+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align || { ! vect_strided2 } } } } } */
1484 /* { dg-final { cleanup-tree-dump "vect" } } */
1485
1486=== modified file 'gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10a.c'
1487--- old/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10a.c 2007-09-04 12:05:19 +0000
1488+++ new/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10a.c 2011-05-05 15:46:10 +0000
1489@@ -54,5 +54,5 @@
1490 return 0;
1491 }
1492
1493-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
1494+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target vect_strided2 } } } */
1495 /* { dg-final { cleanup-tree-dump "vect" } } */
1496
1497=== modified file 'gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10b.c'
1498--- old/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10b.c 2007-09-04 12:05:19 +0000
1499+++ new/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10b.c 2011-05-05 15:46:10 +0000
1500@@ -53,5 +53,5 @@
1501 return 0;
1502 }
1503
1504-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
1505+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target vect_strided2 } } } */
1506 /* { dg-final { cleanup-tree-dump "vect" } } */
1507
1508=== modified file 'gcc/testsuite/gcc.dg/vect/no-scevccp-outer-18.c'
1509--- old/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-18.c 2007-10-21 09:01:16 +0000
1510+++ new/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-18.c 2011-05-05 15:46:10 +0000
1511@@ -47,5 +47,5 @@
1512 return 0;
1513 }
1514
1515-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target vect_interleave } } } */
1516+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target { vect_interleave || vect_strided2 } } } } */
1517 /* { dg-final { cleanup-tree-dump "vect" } } */
1518
1519=== modified file 'gcc/testsuite/gcc.dg/vect/no-scevccp-outer-20.c'
1520--- old/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-20.c 2007-09-04 12:05:19 +0000
1521+++ new/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-20.c 2011-05-05 15:46:10 +0000
1522@@ -50,5 +50,5 @@
1523 return 0;
1524 }
1525
1526-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
1527+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target vect_strided2 } } } */
1528 /* { dg-final { cleanup-tree-dump "vect" } } */
1529
1530=== modified file 'gcc/testsuite/gcc.dg/vect/pr30843.c'
1531--- old/gcc/testsuite/gcc.dg/vect/pr30843.c 2007-02-22 12:30:12 +0000
1532+++ new/gcc/testsuite/gcc.dg/vect/pr30843.c 2011-05-05 15:46:10 +0000
1533@@ -20,6 +20,6 @@
1534 }
1535 }
1536
1537-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave } } } } */
1538+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave || vect_strided4 } } } } */
1539 /* { dg-final { cleanup-tree-dump "vect" } } */
1540
1541
1542=== modified file 'gcc/testsuite/gcc.dg/vect/pr33866.c'
1543--- old/gcc/testsuite/gcc.dg/vect/pr33866.c 2007-10-30 08:26:14 +0000
1544+++ new/gcc/testsuite/gcc.dg/vect/pr33866.c 2011-05-05 15:46:10 +0000
1545@@ -27,6 +27,6 @@
1546 }
1547
1548 /* Needs interleaving support. */
1549-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave } } } } */
1550+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave || vect_strided2 } } } } */
1551 /* { dg-final { cleanup-tree-dump "vect" } } */
1552
1553
1554=== modified file 'gcc/testsuite/gcc.dg/vect/pr37539.c'
1555--- old/gcc/testsuite/gcc.dg/vect/pr37539.c 2009-11-26 02:03:50 +0000
1556+++ new/gcc/testsuite/gcc.dg/vect/pr37539.c 2011-05-05 15:46:10 +0000
1557@@ -40,7 +40,7 @@
1558 return 0;
1559 }
1560
1561-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_strided_wide } } } */
1562+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target { vect_strided4 && vect_strided2 } } } } */
1563 /* { dg-final { cleanup-tree-dump "vect" } } */
1564
1565
1566
1567=== removed file 'gcc/testsuite/gcc.dg/vect/slp-11.c'
1568--- old/gcc/testsuite/gcc.dg/vect/slp-11.c 2010-11-22 12:16:52 +0000
1569+++ new/gcc/testsuite/gcc.dg/vect/slp-11.c 1970-01-01 00:00:00 +0000
1570@@ -1,113 +0,0 @@
1571-/* { dg-require-effective-target vect_int } */
1572-
1573-#include <stdarg.h>
1574-#include "tree-vect.h"
1575-
1576-#define N 8
1577-
1578-int
1579-main1 ()
1580-{
1581- int i;
1582- unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7;
1583- unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
1584- float out2[N*8];
1585-
1586- /* Different operations - not SLPable. */
1587- for (i = 0; i < N; i++)
1588- {
1589- a0 = in[i*8] + 5;
1590- a1 = in[i*8 + 1] * 6;
1591- a2 = in[i*8 + 2] + 7;
1592- a3 = in[i*8 + 3] + 8;
1593- a4 = in[i*8 + 4] + 9;
1594- a5 = in[i*8 + 5] + 10;
1595- a6 = in[i*8 + 6] + 11;
1596- a7 = in[i*8 + 7] + 12;
1597-
1598- b0 = a0 * 3;
1599- b1 = a1 * 2;
1600- b2 = a2 * 12;
1601- b3 = a3 * 5;
1602- b4 = a4 * 8;
1603- b5 = a5 * 4;
1604- b6 = a6 * 3;
1605- b7 = a7 * 2;
1606-
1607- out[i*8] = b0 - 2;
1608- out[i*8 + 1] = b1 - 3;
1609- out[i*8 + 2] = b2 - 2;
1610- out[i*8 + 3] = b3 - 1;
1611- out[i*8 + 4] = b4 - 8;
1612- out[i*8 + 5] = b5 - 7;
1613- out[i*8 + 6] = b6 - 3;
1614- out[i*8 + 7] = b7 - 7;
1615- }
1616-
1617- /* check results: */
1618- for (i = 0; i < N; i++)
1619- {
1620- if (out[i*8] != (in[i*8] + 5) * 3 - 2
1621- || out[i*8 + 1] != (in[i*8 + 1] * 6) * 2 - 3
1622- || out[i*8 + 2] != (in[i*8 + 2] + 7) * 12 - 2
1623- || out[i*8 + 3] != (in[i*8 + 3] + 8) * 5 - 1
1624- || out[i*8 + 4] != (in[i*8 + 4] + 9) * 8 - 8
1625- || out[i*8 + 5] != (in[i*8 + 5] + 10) * 4 - 7
1626- || out[i*8 + 6] != (in[i*8 + 6] + 11) * 3 - 3
1627- || out[i*8 + 7] != (in[i*8 + 7] + 12) * 2 - 7)
1628- abort ();
1629- }
1630-
1631- /* Requires permutation - not SLPable. */
1632- for (i = 0; i < N*2; i++)
1633- {
1634- out[i*4] = (in[i*4] + 2) * 3;
1635- out[i*4 + 1] = (in[i*4 + 2] + 2) * 7;
1636- out[i*4 + 2] = (in[i*4 + 1] + 7) * 3;
1637- out[i*4 + 3] = (in[i*4 + 3] + 3) * 4;
1638- }
1639-
1640- /* check results: */
1641- for (i = 0; i < N*2; i++)
1642- {
1643- if (out[i*4] != (in[i*4] + 2) * 3
1644- || out[i*4 + 1] != (in[i*4 + 2] + 2) * 7
1645- || out[i*4 + 2] != (in[i*4 + 1] + 7) * 3
1646- || out[i*4 + 3] != (in[i*4 + 3] + 3) * 4)
1647- abort ();
1648- }
1649-
1650- /* Different operations - not SLPable. */
1651- for (i = 0; i < N*4; i++)
1652- {
1653- out2[i*2] = ((float) in[i*2] * 2 + 6) ;
1654- out2[i*2 + 1] = (float) (in[i*2 + 1] * 3 + 7);
1655- }
1656-
1657- /* check results: */
1658- for (i = 0; i < N*4; i++)
1659- {
1660- if (out2[i*2] != ((float) in[i*2] * 2 + 6)
1661- || out2[i*2 + 1] != (float) (in[i*2 + 1] * 3 + 7))
1662- abort ();
1663- }
1664-
1665-
1666- return 0;
1667-}
1668-
1669-int main (void)
1670-{
1671- check_vect ();
1672-
1673- main1 ();
1674-
1675- return 0;
1676-}
1677-
1678-/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target { { vect_uintfloat_cvt && vect_strided_wide } && vect_int_mult } } } } */
1679-/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { { { ! vect_uintfloat_cvt } && vect_strided_wide } && vect_int_mult } } } } */
1680-/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" {target { ! { vect_int_mult && vect_strided_wide } } } } } */
1681-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */
1682-/* { dg-final { cleanup-tree-dump "vect" } } */
1683-
1684
1685=== added file 'gcc/testsuite/gcc.dg/vect/slp-11a.c'
1686--- old/gcc/testsuite/gcc.dg/vect/slp-11a.c 1970-01-01 00:00:00 +0000
1687+++ new/gcc/testsuite/gcc.dg/vect/slp-11a.c 2011-05-05 15:46:10 +0000
1688@@ -0,0 +1,75 @@
1689+/* { dg-require-effective-target vect_int } */
1690+
1691+#include <stdarg.h>
1692+#include "tree-vect.h"
1693+
1694+#define N 8
1695+
1696+int
1697+main1 ()
1698+{
1699+ int i;
1700+ unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7;
1701+ unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
1702+
1703+ /* Different operations - not SLPable. */
1704+ for (i = 0; i < N; i++)
1705+ {
1706+ a0 = in[i*8] + 5;
1707+ a1 = in[i*8 + 1] * 6;
1708+ a2 = in[i*8 + 2] + 7;
1709+ a3 = in[i*8 + 3] + 8;
1710+ a4 = in[i*8 + 4] + 9;
1711+ a5 = in[i*8 + 5] + 10;
1712+ a6 = in[i*8 + 6] + 11;
1713+ a7 = in[i*8 + 7] + 12;
1714+
1715+ b0 = a0 * 3;
1716+ b1 = a1 * 2;
1717+ b2 = a2 * 12;
1718+ b3 = a3 * 5;
1719+ b4 = a4 * 8;
1720+ b5 = a5 * 4;
1721+ b6 = a6 * 3;
1722+ b7 = a7 * 2;
1723+
1724+ out[i*8] = b0 - 2;
1725+ out[i*8 + 1] = b1 - 3;
1726+ out[i*8 + 2] = b2 - 2;
1727+ out[i*8 + 3] = b3 - 1;
1728+ out[i*8 + 4] = b4 - 8;
1729+ out[i*8 + 5] = b5 - 7;
1730+ out[i*8 + 6] = b6 - 3;
1731+ out[i*8 + 7] = b7 - 7;
1732+ }
1733+
1734+ /* check results: */
1735+ for (i = 0; i < N; i++)
1736+ {
1737+ if (out[i*8] != (in[i*8] + 5) * 3 - 2
1738+ || out[i*8 + 1] != (in[i*8 + 1] * 6) * 2 - 3
1739+ || out[i*8 + 2] != (in[i*8 + 2] + 7) * 12 - 2
1740+ || out[i*8 + 3] != (in[i*8 + 3] + 8) * 5 - 1
1741+ || out[i*8 + 4] != (in[i*8 + 4] + 9) * 8 - 8
1742+ || out[i*8 + 5] != (in[i*8 + 5] + 10) * 4 - 7
1743+ || out[i*8 + 6] != (in[i*8 + 6] + 11) * 3 - 3
1744+ || out[i*8 + 7] != (in[i*8 + 7] + 12) * 2 - 7)
1745+ abort ();
1746+ }
1747+
1748+ return 0;
1749+}
1750+
1751+int main (void)
1752+{
1753+ check_vect ();
1754+
1755+ main1 ();
1756+
1757+ return 0;
1758+}
1759+
1760+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_strided8 && vect_int_mult } } } } */
1761+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! { vect_strided8 && vect_int_mult } } } } } */
1762+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */
1763+/* { dg-final { cleanup-tree-dump "vect" } } */
1764
1765=== added file 'gcc/testsuite/gcc.dg/vect/slp-11b.c'
1766--- old/gcc/testsuite/gcc.dg/vect/slp-11b.c 1970-01-01 00:00:00 +0000
1767+++ new/gcc/testsuite/gcc.dg/vect/slp-11b.c 2011-05-05 15:46:10 +0000
1768@@ -0,0 +1,49 @@
1769+/* { dg-require-effective-target vect_int } */
1770+
1771+#include <stdarg.h>
1772+#include "tree-vect.h"
1773+
1774+#define N 8
1775+
1776+int
1777+main1 ()
1778+{
1779+ int i;
1780+ unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7;
1781+ unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
1782+
1783+ /* Requires permutation - not SLPable. */
1784+ for (i = 0; i < N*2; i++)
1785+ {
1786+ out[i*4] = (in[i*4] + 2) * 3;
1787+ out[i*4 + 1] = (in[i*4 + 2] + 2) * 7;
1788+ out[i*4 + 2] = (in[i*4 + 1] + 7) * 3;
1789+ out[i*4 + 3] = (in[i*4 + 3] + 3) * 4;
1790+ }
1791+
1792+ /* check results: */
1793+ for (i = 0; i < N*2; i++)
1794+ {
1795+ if (out[i*4] != (in[i*4] + 2) * 3
1796+ || out[i*4 + 1] != (in[i*4 + 2] + 2) * 7
1797+ || out[i*4 + 2] != (in[i*4 + 1] + 7) * 3
1798+ || out[i*4 + 3] != (in[i*4 + 3] + 3) * 4)
1799+ abort ();
1800+ }
1801+
1802+ return 0;
1803+}
1804+
1805+int main (void)
1806+{
1807+ check_vect ();
1808+
1809+ main1 ();
1810+
1811+ return 0;
1812+}
1813+
1814+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_strided4 && vect_int_mult } } } } */
1815+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! { vect_strided4 && vect_int_mult } } } } } */
1816+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */
1817+/* { dg-final { cleanup-tree-dump "vect" } } */
1818
1819=== added file 'gcc/testsuite/gcc.dg/vect/slp-11c.c'
1820--- old/gcc/testsuite/gcc.dg/vect/slp-11c.c 1970-01-01 00:00:00 +0000
1821+++ new/gcc/testsuite/gcc.dg/vect/slp-11c.c 2011-05-05 15:46:10 +0000
1822@@ -0,0 +1,46 @@
1823+/* { dg-require-effective-target vect_int } */
1824+
1825+#include <stdarg.h>
1826+#include "tree-vect.h"
1827+
1828+#define N 8
1829+
1830+int
1831+main1 ()
1832+{
1833+ int i;
1834+ unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
1835+ float out[N*8];
1836+
1837+ /* Different operations - not SLPable. */
1838+ for (i = 0; i < N*4; i++)
1839+ {
1840+ out[i*2] = ((float) in[i*2] * 2 + 6) ;
1841+ out[i*2 + 1] = (float) (in[i*2 + 1] * 3 + 7);
1842+ }
1843+
1844+ /* check results: */
1845+ for (i = 0; i < N*4; i++)
1846+ {
1847+ if (out[i*2] != ((float) in[i*2] * 2 + 6)
1848+ || out[i*2 + 1] != (float) (in[i*2 + 1] * 3 + 7))
1849+ abort ();
1850+ }
1851+
1852+
1853+ return 0;
1854+}
1855+
1856+int main (void)
1857+{
1858+ check_vect ();
1859+
1860+ main1 ();
1861+
1862+ return 0;
1863+}
1864+
1865+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { { vect_uintfloat_cvt && vect_strided2 } && vect_int_mult } } } } */
1866+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! { { vect_uintfloat_cvt && vect_strided2 } && vect_int_mult } } } } } */
1867+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */
1868+/* { dg-final { cleanup-tree-dump "vect" } } */
1869
1870=== modified file 'gcc/testsuite/gcc.dg/vect/slp-12a.c'
1871--- old/gcc/testsuite/gcc.dg/vect/slp-12a.c 2010-11-22 12:16:52 +0000
1872+++ new/gcc/testsuite/gcc.dg/vect/slp-12a.c 2011-05-05 15:46:10 +0000
1873@@ -11,7 +11,7 @@
1874 int i;
1875 unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7;
1876 unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
1877- unsigned int ia[N], ib[N*2];
1878+ unsigned int ia[N];
1879
1880 for (i = 0; i < N; i++)
1881 {
1882@@ -61,27 +61,6 @@
1883 abort ();
1884 }
1885
1886- for (i = 0; i < N*2; i++)
1887- {
1888- out[i*4] = (in[i*4] + 2) * 3;
1889- out[i*4 + 1] = (in[i*4 + 1] + 2) * 7;
1890- out[i*4 + 2] = (in[i*4 + 2] + 7) * 3;
1891- out[i*4 + 3] = (in[i*4 + 3] + 7) * 7;
1892-
1893- ib[i] = 7;
1894- }
1895-
1896- /* check results: */
1897- for (i = 0; i < N*2; i++)
1898- {
1899- if (out[i*4] != (in[i*4] + 2) * 3
1900- || out[i*4 + 1] != (in[i*4 + 1] + 2) * 7
1901- || out[i*4 + 2] != (in[i*4 + 2] + 7) * 3
1902- || out[i*4 + 3] != (in[i*4 + 3] + 7) * 7
1903- || ib[i] != 7)
1904- abort ();
1905- }
1906-
1907 return 0;
1908 }
1909
1910@@ -94,11 +73,8 @@
1911 return 0;
1912 }
1913
1914-/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" {target { vect_strided_wide && vect_int_mult} } } } */
1915-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {target { {! {vect_strided_wide}} && vect_int_mult } } } } */
1916-/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" {target { ! vect_int_mult } } } } */
1917-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" {target { vect_strided_wide && vect_int_mult } } } } */
1918-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" {target { {! {vect_strided_wide}} && vect_int_mult } } } } */
1919-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" {target { ! vect_int_mult } } } } */
1920+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_strided8 && vect_int_mult } } } } */
1921+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! { vect_strided8 && vect_int_mult } } } } } */
1922+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_strided8 && vect_int_mult } } } } */
1923+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { ! { vect_strided8 && vect_int_mult } } } } } */
1924 /* { dg-final { cleanup-tree-dump "vect" } } */
1925-
1926
1927=== modified file 'gcc/testsuite/gcc.dg/vect/slp-12b.c'
1928--- old/gcc/testsuite/gcc.dg/vect/slp-12b.c 2010-11-22 12:16:52 +0000
1929+++ new/gcc/testsuite/gcc.dg/vect/slp-12b.c 2011-05-05 15:46:10 +0000
1930@@ -43,9 +43,9 @@
1931 return 0;
1932 }
1933
1934-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {target { vect_strided_wide && vect_int_mult } } } } */
1935-/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" {target { { ! { vect_int_mult }} || { ! {vect_strided_wide}}} } } } */
1936-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" {target { vect_strided_wide && vect_int_mult } } } } */
1937-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" {target { { ! { vect_int_mult }} || { ! {vect_strided_wide}}} } } } */
1938+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_strided2 && vect_int_mult } } } } */
1939+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! { vect_strided2 && vect_int_mult } } } } } */
1940+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_strided2 && vect_int_mult } } } } */
1941+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { ! { vect_strided2 && vect_int_mult } } } } } */
1942 /* { dg-final { cleanup-tree-dump "vect" } } */
1943
1944
1945=== added file 'gcc/testsuite/gcc.dg/vect/slp-12c.c'
1946--- old/gcc/testsuite/gcc.dg/vect/slp-12c.c 1970-01-01 00:00:00 +0000
1947+++ new/gcc/testsuite/gcc.dg/vect/slp-12c.c 2011-05-05 15:44:41 +0000
1948@@ -0,0 +1,53 @@
1949+/* { dg-require-effective-target vect_int } */
1950+
1951+#include <stdarg.h>
1952+#include "tree-vect.h"
1953+
1954+#define N 8
1955+
1956+int
1957+main1 ()
1958+{
1959+ int i;
1960+ unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7;
1961+ unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
1962+ unsigned int ia[N*2];
1963+
1964+ for (i = 0; i < N*2; i++)
1965+ {
1966+ out[i*4] = (in[i*4] + 2) * 3;
1967+ out[i*4 + 1] = (in[i*4 + 1] + 2) * 7;
1968+ out[i*4 + 2] = (in[i*4 + 2] + 7) * 3;
1969+ out[i*4 + 3] = (in[i*4 + 3] + 7) * 7;
1970+
1971+ ia[i] = 7;
1972+ }
1973+
1974+ /* check results: */
1975+ for (i = 0; i < N*2; i++)
1976+ {
1977+ if (out[i*4] != (in[i*4] + 2) * 3
1978+ || out[i*4 + 1] != (in[i*4 + 1] + 2) * 7
1979+ || out[i*4 + 2] != (in[i*4 + 2] + 7) * 3
1980+ || out[i*4 + 3] != (in[i*4 + 3] + 7) * 7
1981+ || ia[i] != 7)
1982+ abort ();
1983+ }
1984+
1985+ return 0;
1986+}
1987+
1988+int main (void)
1989+{
1990+ check_vect ();
1991+
1992+ main1 ();
1993+
1994+ return 0;
1995+}
1996+
1997+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_int_mult } } } } */
1998+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! vect_int_mult } } } } */
1999+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_int_mult } } } */
2000+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { ! vect_int_mult } } } } */
2001+/* { dg-final { cleanup-tree-dump "vect" } } */
2002
2003=== modified file 'gcc/testsuite/gcc.dg/vect/slp-18.c'
2004--- old/gcc/testsuite/gcc.dg/vect/slp-18.c 2010-11-22 12:16:52 +0000
2005+++ new/gcc/testsuite/gcc.dg/vect/slp-18.c 2011-05-05 15:46:10 +0000
2006@@ -91,7 +91,7 @@
2007 return 0;
2008 }
2009
2010-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_strided } } } } */
2011-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target { vect_strided } } } } */
2012+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
2013+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_strided8 } } } */
2014 /* { dg-final { cleanup-tree-dump "vect" } } */
2015
2016
2017=== removed file 'gcc/testsuite/gcc.dg/vect/slp-19.c'
2018--- old/gcc/testsuite/gcc.dg/vect/slp-19.c 2010-11-22 12:16:52 +0000
2019+++ new/gcc/testsuite/gcc.dg/vect/slp-19.c 1970-01-01 00:00:00 +0000
2020@@ -1,154 +0,0 @@
2021-/* { dg-require-effective-target vect_int } */
2022-
2023-#include <stdarg.h>
2024-#include "tree-vect.h"
2025-
2026-#define N 16
2027-
2028-int
2029-main1 ()
2030-{
2031- unsigned int i;
2032- unsigned int out[N*8];
2033- unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
2034- unsigned int ia[N*2], a0, a1, a2, a3;
2035-
2036- for (i = 0; i < N; i++)
2037- {
2038- out[i*8] = in[i*8];
2039- out[i*8 + 1] = in[i*8 + 1];
2040- out[i*8 + 2] = in[i*8 + 2];
2041- out[i*8 + 3] = in[i*8 + 3];
2042- out[i*8 + 4] = in[i*8 + 4];
2043- out[i*8 + 5] = in[i*8 + 5];
2044- out[i*8 + 6] = in[i*8 + 6];
2045- out[i*8 + 7] = in[i*8 + 7];
2046-
2047- ia[i] = in[i*8 + 2];
2048- }
2049-
2050- /* check results: */
2051- for (i = 0; i < N; i++)
2052- {
2053- if (out[i*8] != in[i*8]
2054- || out[i*8 + 1] != in[i*8 + 1]
2055- || out[i*8 + 2] != in[i*8 + 2]
2056- || out[i*8 + 3] != in[i*8 + 3]
2057- || out[i*8 + 4] != in[i*8 + 4]
2058- || out[i*8 + 5] != in[i*8 + 5]
2059- || out[i*8 + 6] != in[i*8 + 6]
2060- || out[i*8 + 7] != in[i*8 + 7]
2061- || ia[i] != in[i*8 + 2])
2062- abort ();
2063- }
2064-
2065- for (i = 0; i < N*2; i++)
2066- {
2067- a0 = in[i*4] + 1;
2068- a1 = in[i*4 + 1] + 2;
2069- a2 = in[i*4 + 2] + 3;
2070- a3 = in[i*4 + 3] + 4;
2071-
2072- out[i*4] = a0;
2073- out[i*4 + 1] = a1;
2074- out[i*4 + 2] = a2;
2075- out[i*4 + 3] = a3;
2076-
2077- ia[i] = a2;
2078- }
2079-
2080- /* check results: */
2081- for (i = 0; i < N*2; i++)
2082- {
2083- if (out[i*4] != in[i*4] + 1
2084- || out[i*4 + 1] != in[i*4 + 1] + 2
2085- || out[i*4 + 2] != in[i*4 + 2] + 3
2086- || out[i*4 + 3] != in[i*4 + 3] + 4
2087- || ia[i] != in[i*4 + 2] + 3)
2088- abort ();
2089- }
2090-
2091- /* The last stmt requires interleaving of not power of 2 size - not
2092- vectorizable. */
2093- for (i = 0; i < N/2; i++)
2094- {
2095- out[i*12] = in[i*12];
2096- out[i*12 + 1] = in[i*12 + 1];
2097- out[i*12 + 2] = in[i*12 + 2];
2098- out[i*12 + 3] = in[i*12 + 3];
2099- out[i*12 + 4] = in[i*12 + 4];
2100- out[i*12 + 5] = in[i*12 + 5];
2101- out[i*12 + 6] = in[i*12 + 6];
2102- out[i*12 + 7] = in[i*12 + 7];
2103- out[i*12 + 8] = in[i*12 + 8];
2104- out[i*12 + 9] = in[i*12 + 9];
2105- out[i*12 + 10] = in[i*12 + 10];
2106- out[i*12 + 11] = in[i*12 + 11];
2107-
2108- ia[i] = in[i*12 + 7];
2109- }
2110-
2111- /* check results: */
2112- for (i = 0; i < N/2; i++)
2113- {
2114- if (out[i*12] != in[i*12]
2115- || out[i*12 + 1] != in[i*12 + 1]
2116- || out[i*12 + 2] != in[i*12 + 2]
2117- || out[i*12 + 3] != in[i*12 + 3]
2118- || out[i*12 + 4] != in[i*12 + 4]
2119- || out[i*12 + 5] != in[i*12 + 5]
2120- || out[i*12 + 6] != in[i*12 + 6]
2121- || out[i*12 + 7] != in[i*12 + 7]
2122- || out[i*12 + 8] != in[i*12 + 8]
2123- || out[i*12 + 9] != in[i*12 + 9]
2124- || out[i*12 + 10] != in[i*12 + 10]
2125- || out[i*12 + 11] != in[i*12 + 11]
2126- || ia[i] != in[i*12 + 7])
2127- abort ();
2128- }
2129-
2130- /* Hybrid SLP with unrolling by 2. */
2131- for (i = 0; i < N; i++)
2132- {
2133- out[i*6] = in[i*6];
2134- out[i*6 + 1] = in[i*6 + 1];
2135- out[i*6 + 2] = in[i*6 + 2];
2136- out[i*6 + 3] = in[i*6 + 3];
2137- out[i*6 + 4] = in[i*6 + 4];
2138- out[i*6 + 5] = in[i*6 + 5];
2139-
2140- ia[i] = i;
2141- }
2142-
2143- /* check results: */
2144- for (i = 0; i < N/2; i++)
2145- {
2146- if (out[i*6] != in[i*6]
2147- || out[i*6 + 1] != in[i*6 + 1]
2148- || out[i*6 + 2] != in[i*6 + 2]
2149- || out[i*6 + 3] != in[i*6 + 3]
2150- || out[i*6 + 4] != in[i*6 + 4]
2151- || out[i*6 + 5] != in[i*6 + 5]
2152- || ia[i] != i)
2153- abort ();
2154- }
2155-
2156-
2157- return 0;
2158-}
2159-
2160-int main (void)
2161-{
2162- check_vect ();
2163-
2164- main1 ();
2165-
2166- return 0;
2167-}
2168-
2169-/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target vect_strided_wide } } } */
2170-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! { vect_strided_wide } } } } } */
2171-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" { target vect_strided_wide } } } */
2172-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { ! { vect_strided_wide } } } } } */
2173-/* { dg-final { cleanup-tree-dump "vect" } } */
2174-
2175
2176=== added file 'gcc/testsuite/gcc.dg/vect/slp-19a.c'
2177--- old/gcc/testsuite/gcc.dg/vect/slp-19a.c 1970-01-01 00:00:00 +0000
2178+++ new/gcc/testsuite/gcc.dg/vect/slp-19a.c 2011-05-05 15:46:10 +0000
2179@@ -0,0 +1,61 @@
2180+/* { dg-require-effective-target vect_int } */
2181+
2182+#include <stdarg.h>
2183+#include "tree-vect.h"
2184+
2185+#define N 16
2186+
2187+int
2188+main1 ()
2189+{
2190+ unsigned int i;
2191+ unsigned int out[N*8];
2192+ unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
2193+ unsigned int ia[N*2];
2194+
2195+ for (i = 0; i < N; i++)
2196+ {
2197+ out[i*8] = in[i*8];
2198+ out[i*8 + 1] = in[i*8 + 1];
2199+ out[i*8 + 2] = in[i*8 + 2];
2200+ out[i*8 + 3] = in[i*8 + 3];
2201+ out[i*8 + 4] = in[i*8 + 4];
2202+ out[i*8 + 5] = in[i*8 + 5];
2203+ out[i*8 + 6] = in[i*8 + 6];
2204+ out[i*8 + 7] = in[i*8 + 7];
2205+
2206+ ia[i] = in[i*8 + 2];
2207+ }
2208+
2209+ /* check results: */
2210+ for (i = 0; i < N; i++)
2211+ {
2212+ if (out[i*8] != in[i*8]
2213+ || out[i*8 + 1] != in[i*8 + 1]
2214+ || out[i*8 + 2] != in[i*8 + 2]
2215+ || out[i*8 + 3] != in[i*8 + 3]
2216+ || out[i*8 + 4] != in[i*8 + 4]
2217+ || out[i*8 + 5] != in[i*8 + 5]
2218+ || out[i*8 + 6] != in[i*8 + 6]
2219+ || out[i*8 + 7] != in[i*8 + 7]
2220+ || ia[i] != in[i*8 + 2])
2221+ abort ();
2222+ }
2223+
2224+ return 0;
2225+}
2226+
2227+int main (void)
2228+{
2229+ check_vect ();
2230+
2231+ main1 ();
2232+
2233+ return 0;
2234+}
2235+
2236+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
2237+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! vect_strided8 } } } } */
2238+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_strided8 } } } */
2239+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { ! vect_strided8} } } } */
2240+/* { dg-final { cleanup-tree-dump "vect" } } */
2241
2242=== added file 'gcc/testsuite/gcc.dg/vect/slp-19b.c'
2243--- old/gcc/testsuite/gcc.dg/vect/slp-19b.c 1970-01-01 00:00:00 +0000
2244+++ new/gcc/testsuite/gcc.dg/vect/slp-19b.c 2011-05-05 15:46:10 +0000
2245@@ -0,0 +1,58 @@
2246+/* { dg-require-effective-target vect_int } */
2247+
2248+#include <stdarg.h>
2249+#include "tree-vect.h"
2250+
2251+#define N 16
2252+
2253+int
2254+main1 ()
2255+{
2256+ unsigned int i;
2257+ unsigned int out[N*8];
2258+ unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
2259+ unsigned int ia[N*2], a0, a1, a2, a3;
2260+
2261+ for (i = 0; i < N*2; i++)
2262+ {
2263+ a0 = in[i*4] + 1;
2264+ a1 = in[i*4 + 1] + 2;
2265+ a2 = in[i*4 + 2] + 3;
2266+ a3 = in[i*4 + 3] + 4;
2267+
2268+ out[i*4] = a0;
2269+ out[i*4 + 1] = a1;
2270+ out[i*4 + 2] = a2;
2271+ out[i*4 + 3] = a3;
2272+
2273+ ia[i] = a2;
2274+ }
2275+
2276+ /* check results: */
2277+ for (i = 0; i < N*2; i++)
2278+ {
2279+ if (out[i*4] != in[i*4] + 1
2280+ || out[i*4 + 1] != in[i*4 + 1] + 2
2281+ || out[i*4 + 2] != in[i*4 + 2] + 3
2282+ || out[i*4 + 3] != in[i*4 + 3] + 4
2283+ || ia[i] != in[i*4 + 2] + 3)
2284+ abort ();
2285+ }
2286+
2287+ return 0;
2288+}
2289+
2290+int main (void)
2291+{
2292+ check_vect ();
2293+
2294+ main1 ();
2295+
2296+ return 0;
2297+}
2298+
2299+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided4 } } } */
2300+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! vect_strided4 } } } } */
2301+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_strided4 } } } */
2302+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { ! vect_strided4 } } } } */
2303+/* { dg-final { cleanup-tree-dump "vect" } } */
2304
2305=== added file 'gcc/testsuite/gcc.dg/vect/slp-19c.c'
2306--- old/gcc/testsuite/gcc.dg/vect/slp-19c.c 1970-01-01 00:00:00 +0000
2307+++ new/gcc/testsuite/gcc.dg/vect/slp-19c.c 2011-05-05 15:44:41 +0000
2308@@ -0,0 +1,95 @@
2309+/* { dg-require-effective-target vect_int } */
2310+
2311+#include <stdarg.h>
2312+#include "tree-vect.h"
2313+
2314+#define N 16
2315+
2316+int
2317+main1 ()
2318+{
2319+ unsigned int i;
2320+ unsigned int out[N*8];
2321+ unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
2322+ unsigned int ia[N*2], a0, a1, a2, a3;
2323+
2324+ /* The last stmt requires interleaving of not power of 2 size - not
2325+ vectorizable. */
2326+ for (i = 0; i < N/2; i++)
2327+ {
2328+ out[i*12] = in[i*12];
2329+ out[i*12 + 1] = in[i*12 + 1];
2330+ out[i*12 + 2] = in[i*12 + 2];
2331+ out[i*12 + 3] = in[i*12 + 3];
2332+ out[i*12 + 4] = in[i*12 + 4];
2333+ out[i*12 + 5] = in[i*12 + 5];
2334+ out[i*12 + 6] = in[i*12 + 6];
2335+ out[i*12 + 7] = in[i*12 + 7];
2336+ out[i*12 + 8] = in[i*12 + 8];
2337+ out[i*12 + 9] = in[i*12 + 9];
2338+ out[i*12 + 10] = in[i*12 + 10];
2339+ out[i*12 + 11] = in[i*12 + 11];
2340+
2341+ ia[i] = in[i*12 + 7];
2342+ }
2343+
2344+ /* check results: */
2345+ for (i = 0; i < N/2; i++)
2346+ {
2347+ if (out[i*12] != in[i*12]
2348+ || out[i*12 + 1] != in[i*12 + 1]
2349+ || out[i*12 + 2] != in[i*12 + 2]
2350+ || out[i*12 + 3] != in[i*12 + 3]
2351+ || out[i*12 + 4] != in[i*12 + 4]
2352+ || out[i*12 + 5] != in[i*12 + 5]
2353+ || out[i*12 + 6] != in[i*12 + 6]
2354+ || out[i*12 + 7] != in[i*12 + 7]
2355+ || out[i*12 + 8] != in[i*12 + 8]
2356+ || out[i*12 + 9] != in[i*12 + 9]
2357+ || out[i*12 + 10] != in[i*12 + 10]
2358+ || out[i*12 + 11] != in[i*12 + 11]
2359+ || ia[i] != in[i*12 + 7])
2360+ abort ();
2361+ }
2362+
2363+ /* Hybrid SLP with unrolling by 2. */
2364+ for (i = 0; i < N; i++)
2365+ {
2366+ out[i*6] = in[i*6];
2367+ out[i*6 + 1] = in[i*6 + 1];
2368+ out[i*6 + 2] = in[i*6 + 2];
2369+ out[i*6 + 3] = in[i*6 + 3];
2370+ out[i*6 + 4] = in[i*6 + 4];
2371+ out[i*6 + 5] = in[i*6 + 5];
2372+
2373+ ia[i] = i;
2374+ }
2375+
2376+ /* check results: */
2377+ for (i = 0; i < N/2; i++)
2378+ {
2379+ if (out[i*6] != in[i*6]
2380+ || out[i*6 + 1] != in[i*6 + 1]
2381+ || out[i*6 + 2] != in[i*6 + 2]
2382+ || out[i*6 + 3] != in[i*6 + 3]
2383+ || out[i*6 + 4] != in[i*6 + 4]
2384+ || out[i*6 + 5] != in[i*6 + 5]
2385+ || ia[i] != i)
2386+ abort ();
2387+ }
2388+
2389+ return 0;
2390+}
2391+
2392+int main (void)
2393+{
2394+ check_vect ();
2395+
2396+ main1 ();
2397+
2398+ return 0;
2399+}
2400+
2401+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
2402+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
2403+/* { dg-final { cleanup-tree-dump "vect" } } */
2404
2405=== modified file 'gcc/testsuite/gcc.dg/vect/slp-21.c'
2406--- old/gcc/testsuite/gcc.dg/vect/slp-21.c 2010-11-22 12:16:52 +0000
2407+++ new/gcc/testsuite/gcc.dg/vect/slp-21.c 2011-05-05 15:46:10 +0000
2408@@ -199,9 +199,9 @@
2409 return 0;
2410 }
2411
2412-/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" { target { vect_strided || vect_extract_even_odd } } } } */
2413-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! { vect_strided || vect_extract_even_odd } } } } } */
2414-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_strided } } } */
2415-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { ! { vect_strided } } } } } */
2416+/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" { target { vect_strided4 || vect_extract_even_odd } } } } */
2417+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! { vect_strided4 || vect_extract_even_odd } } } } } */
2418+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_strided4 } } } */
2419+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { ! { vect_strided4 } } } } } */
2420 /* { dg-final { cleanup-tree-dump "vect" } } */
2421
2422
2423=== modified file 'gcc/testsuite/gcc.dg/vect/slp-23.c'
2424--- old/gcc/testsuite/gcc.dg/vect/slp-23.c 2011-01-10 12:51:00 +0000
2425+++ new/gcc/testsuite/gcc.dg/vect/slp-23.c 2011-05-05 15:46:10 +0000
2426@@ -106,8 +106,8 @@
2427 return 0;
2428 }
2429
2430-/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { vect_strided_wide } && {! { vect_no_align} } } } } */
2431-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! { vect_strided_wide || vect_no_align} } } } } */
2432+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { vect_strided8 && { ! { vect_no_align} } } } } } */
2433+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! { vect_strided8 || vect_no_align } } } } } */
2434 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
2435 /* { dg-final { cleanup-tree-dump "vect" } } */
2436
2437
2438=== modified file 'gcc/testsuite/gcc.dg/vect/slp-reduc-6.c'
2439--- old/gcc/testsuite/gcc.dg/vect/slp-reduc-6.c 2010-11-22 12:16:52 +0000
2440+++ new/gcc/testsuite/gcc.dg/vect/slp-reduc-6.c 2011-05-05 15:46:10 +0000
2441@@ -42,7 +42,7 @@
2442 return 0;
2443 }
2444
2445-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail { vect_no_int_add || { ! vect_unpack } } } } } */
2446+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail { vect_no_int_add || { ! { vect_unpack || vect_strided2 } } } } } } */
2447 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */
2448 /* { dg-final { scan-tree-dump-times "different interleaving chains in one node" 1 "vect" { target { ! vect_no_int_add } } } } */
2449 /* { dg-final { cleanup-tree-dump "vect" } } */
2450
2451=== modified file 'gcc/testsuite/gcc.dg/vect/vect-1.c'
2452--- old/gcc/testsuite/gcc.dg/vect/vect-1.c 2010-08-19 10:23:50 +0000
2453+++ new/gcc/testsuite/gcc.dg/vect/vect-1.c 2011-05-05 15:46:10 +0000
2454@@ -85,6 +85,6 @@
2455 fbar (a);
2456 }
2457
2458-/* { dg-final { scan-tree-dump-times "vectorized 6 loops" 1 "vect" { target vect_extract_even_odd_wide } } } */
2459-/* { dg-final { scan-tree-dump-times "vectorized 5 loops" 1 "vect" { xfail vect_extract_even_odd_wide } } } */
2460+/* { dg-final { scan-tree-dump-times "vectorized 6 loops" 1 "vect" { target vect_strided2 } } } */
2461+/* { dg-final { scan-tree-dump-times "vectorized 5 loops" 1 "vect" { xfail vect_strided2 } } } */
2462 /* { dg-final { cleanup-tree-dump "vect" } } */
2463
2464=== modified file 'gcc/testsuite/gcc.dg/vect/vect-10.c'
2465--- old/gcc/testsuite/gcc.dg/vect/vect-10.c 2010-05-27 12:23:45 +0000
2466+++ new/gcc/testsuite/gcc.dg/vect/vect-10.c 2011-05-05 15:46:10 +0000
2467@@ -22,5 +22,5 @@
2468 return 0;
2469 }
2470
2471-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { ! vect_extract_even_odd } } } } */
2472+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { ! vect_strided2 } } } } */
2473 /* { dg-final { cleanup-tree-dump "vect" } } */
2474
2475=== modified file 'gcc/testsuite/gcc.dg/vect/vect-107.c'
2476--- old/gcc/testsuite/gcc.dg/vect/vect-107.c 2008-08-19 08:06:54 +0000
2477+++ new/gcc/testsuite/gcc.dg/vect/vect-107.c 2011-05-05 15:46:10 +0000
2478@@ -40,6 +40,6 @@
2479 return main1 ();
2480 }
2481
2482-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_extract_even_odd_wide } } } */
2483-/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail vect_extract_even_odd_wide } } } */
2484+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
2485+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail vect_strided2 } } } */
2486 /* { dg-final { cleanup-tree-dump "vect" } } */
2487
2488=== modified file 'gcc/testsuite/gcc.dg/vect/vect-98.c'
2489--- old/gcc/testsuite/gcc.dg/vect/vect-98.c 2008-08-02 11:05:47 +0000
2490+++ new/gcc/testsuite/gcc.dg/vect/vect-98.c 2011-05-05 15:46:10 +0000
2491@@ -38,6 +38,6 @@
2492 }
2493
2494 /* Needs interleaving support. */
2495-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd_wide } } } } */
2496-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { xfail { vect_interleave && vect_extract_even_odd_wide } } } } */
2497+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided4 } } } */
2498+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { xfail vect_strided4 } } } */
2499 /* { dg-final { cleanup-tree-dump "vect" } } */
2500
2501=== modified file 'gcc/testsuite/gcc.dg/vect/vect-cselim-1.c'
2502--- old/gcc/testsuite/gcc.dg/vect/vect-cselim-1.c 2011-03-27 09:38:18 +0000
2503+++ new/gcc/testsuite/gcc.dg/vect/vect-cselim-1.c 2011-05-05 15:46:10 +0000
2504@@ -82,5 +82,5 @@
2505 return 0;
2506 }
2507
2508-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align || {! vect_strided } } } } } */
2509+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align || { ! vect_strided2 } } } } } */
2510 /* { dg-final { cleanup-tree-dump "vect" } } */
2511
2512=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-a-mult.c'
2513--- old/gcc/testsuite/gcc.dg/vect/vect-strided-a-mult.c 2007-09-04 12:05:19 +0000
2514+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-a-mult.c 2011-05-05 15:46:10 +0000
2515@@ -71,6 +71,6 @@
2516 return 0;
2517 }
2518
2519-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
2520+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
2521 /* { dg-final { cleanup-tree-dump "vect" } } */
2522
2523
2524=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-i2.c'
2525--- old/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-i2.c 2007-09-04 12:05:19 +0000
2526+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-i2.c 2011-05-05 15:46:10 +0000
2527@@ -55,6 +55,6 @@
2528 return 0;
2529 }
2530
2531-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
2532+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
2533 /* { dg-final { cleanup-tree-dump "vect" } } */
2534
2535
2536=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-i4.c'
2537--- old/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-i4.c 2007-09-04 12:05:19 +0000
2538+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-i4.c 2011-05-05 15:46:10 +0000
2539@@ -68,6 +68,6 @@
2540 return 0;
2541 }
2542
2543-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
2544+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided4 } } } */
2545 /* { dg-final { cleanup-tree-dump "vect" } } */
2546
2547
2548=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-mult.c'
2549--- old/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-mult.c 2007-09-04 12:05:19 +0000
2550+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-mult.c 2011-05-05 15:46:10 +0000
2551@@ -62,6 +62,6 @@
2552 return 0;
2553 }
2554
2555-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
2556+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
2557 /* { dg-final { cleanup-tree-dump "vect" } } */
2558
2559
2560=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-a-u32-mult.c'
2561--- old/gcc/testsuite/gcc.dg/vect/vect-strided-a-u32-mult.c 2010-05-27 12:23:45 +0000
2562+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-a-u32-mult.c 2011-05-05 15:46:10 +0000
2563@@ -61,6 +61,6 @@
2564 return 0;
2565 }
2566
2567-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
2568+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
2569 /* { dg-final { cleanup-tree-dump "vect" } } */
2570
2571
2572=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i2-gap.c'
2573--- old/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i2-gap.c 2007-09-04 12:05:19 +0000
2574+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i2-gap.c 2011-05-05 15:46:10 +0000
2575@@ -69,6 +69,6 @@
2576 return 0;
2577 }
2578
2579-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
2580+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
2581 /* { dg-final { cleanup-tree-dump "vect" } } */
2582
2583
2584=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap2.c'
2585--- old/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap2.c 2010-11-22 12:16:52 +0000
2586+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap2.c 2011-05-05 15:46:10 +0000
2587@@ -76,6 +76,6 @@
2588 return 0;
2589 }
2590
2591-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
2592+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
2593 /* { dg-final { cleanup-tree-dump "vect" } } */
2594
2595
2596=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap7.c'
2597--- old/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap7.c 2007-09-04 12:05:19 +0000
2598+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap7.c 2011-05-05 15:46:10 +0000
2599@@ -81,6 +81,6 @@
2600 return 0;
2601 }
2602
2603-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
2604+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
2605 /* { dg-final { cleanup-tree-dump "vect" } } */
2606
2607
2608=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-float.c'
2609--- old/gcc/testsuite/gcc.dg/vect/vect-strided-float.c 2008-08-19 08:06:54 +0000
2610+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-float.c 2011-05-05 15:46:10 +0000
2611@@ -39,7 +39,7 @@
2612 }
2613
2614 /* Needs interleaving support. */
2615-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd_wide } } } } */
2616-/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail { vect_interleave && vect_extract_even_odd_wide } } } } */
2617+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
2618+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail vect_strided2 } } } */
2619 /* { dg-final { cleanup-tree-dump "vect" } } */
2620
2621
2622=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-mult-char-ls.c'
2623--- old/gcc/testsuite/gcc.dg/vect/vect-strided-mult-char-ls.c 2007-09-04 12:05:19 +0000
2624+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-mult-char-ls.c 2011-05-05 15:46:10 +0000
2625@@ -71,6 +71,6 @@
2626 return 0;
2627 }
2628
2629-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
2630+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
2631 /* { dg-final { cleanup-tree-dump "vect" } } */
2632
2633
2634=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-mult.c'
2635--- old/gcc/testsuite/gcc.dg/vect/vect-strided-mult.c 2007-09-04 12:05:19 +0000
2636+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-mult.c 2011-05-05 15:46:10 +0000
2637@@ -71,6 +71,6 @@
2638 return 0;
2639 }
2640
2641-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
2642+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
2643 /* { dg-final { cleanup-tree-dump "vect" } } */
2644
2645
2646=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-same-dr.c'
2647--- old/gcc/testsuite/gcc.dg/vect/vect-strided-same-dr.c 2007-09-04 12:05:19 +0000
2648+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-same-dr.c 2011-05-05 15:46:10 +0000
2649@@ -72,5 +72,5 @@
2650 return 0;
2651 }
2652
2653-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
2654+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
2655 /* { dg-final { cleanup-tree-dump "vect" } } */
2656
2657=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-store-a-u8-i2.c'
2658--- old/gcc/testsuite/gcc.dg/vect/vect-strided-store-a-u8-i2.c 2008-08-12 05:31:57 +0000
2659+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-store-a-u8-i2.c 2011-05-05 15:46:10 +0000
2660@@ -55,6 +55,6 @@
2661 return 0;
2662 }
2663
2664-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave } } } } */
2665+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave || vect_strided2 } } } } */
2666 /* { dg-final { cleanup-tree-dump "vect" } } */
2667
2668
2669=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-store-u16-i4.c'
2670--- old/gcc/testsuite/gcc.dg/vect/vect-strided-store-u16-i4.c 2007-10-21 09:01:16 +0000
2671+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-store-u16-i4.c 2011-05-05 15:46:10 +0000
2672@@ -65,8 +65,8 @@
2673 return 0;
2674 }
2675
2676-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target { vect_interleave && vect_pack_trunc } } } } */
2677-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { { ! { vect_interleave } } && { vect_pack_trunc } } } } } */
2678+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target { { vect_interleave || vect_strided4 } && vect_pack_trunc } } } } */
2679+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { { ! { vect_interleave || vect_strided4 } } && { vect_pack_trunc } } } } } */
2680 /* { dg-final { cleanup-tree-dump "vect" } } */
2681
2682
2683
2684=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-store-u32-i2.c'
2685--- old/gcc/testsuite/gcc.dg/vect/vect-strided-store-u32-i2.c 2010-11-22 12:16:52 +0000
2686+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-store-u32-i2.c 2011-05-05 15:46:10 +0000
2687@@ -39,7 +39,7 @@
2688 }
2689
2690 /* Needs interleaving support. */
2691-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave } } } } */
2692-/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail { vect_interleave } } } } */
2693+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave || vect_strided2 } } } } */
2694+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail { vect_interleave || vect_strided2 } } } } */
2695 /* { dg-final { cleanup-tree-dump "vect" } } */
2696
2697
2698=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-u16-i2.c'
2699--- old/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i2.c 2007-09-04 12:05:19 +0000
2700+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i2.c 2011-05-05 15:46:10 +0000
2701@@ -55,6 +55,6 @@
2702 return 0;
2703 }
2704
2705-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
2706+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
2707 /* { dg-final { cleanup-tree-dump "vect" } } */
2708
2709
2710=== added file 'gcc/testsuite/gcc.dg/vect/vect-strided-u16-i3.c'
2711--- old/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i3.c 1970-01-01 00:00:00 +0000
2712+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i3.c 2011-05-05 15:46:25 +0000
2713@@ -0,0 +1,112 @@
2714+#include <stdarg.h>
2715+#include "tree-vect.h"
2716+
2717+#define N 128
2718+
2719+typedef struct {
2720+ unsigned short a;
2721+ unsigned short b;
2722+ unsigned short c;
2723+} s;
2724+
2725+#define A(I) (I)
2726+#define B(I) ((I) * 2)
2727+#define C(I) ((unsigned short) ~((I) ^ 0x18))
2728+
2729+void __attribute__ ((noinline))
2730+check1 (s *res)
2731+{
2732+ int i;
2733+
2734+ for (i = 0; i < N; i++)
2735+ if (res[i].a != C (i)
2736+ || res[i].b != A (i)
2737+ || res[i].c != B (i))
2738+ abort ();
2739+}
2740+
2741+void __attribute__ ((noinline))
2742+check2 (unsigned short *res)
2743+{
2744+ int i;
2745+
2746+ for (i = 0; i < N; i++)
2747+ if (res[i] != (unsigned short) (A (i) + B (i) + C (i)))
2748+ abort ();
2749+}
2750+
2751+void __attribute__ ((noinline))
2752+check3 (s *res)
2753+{
2754+ int i;
2755+
2756+ for (i = 0; i < N; i++)
2757+ if (res[i].a != i
2758+ || res[i].b != i
2759+ || res[i].c != i)
2760+ abort ();
2761+}
2762+
2763+void __attribute__ ((noinline))
2764+check4 (unsigned short *res)
2765+{
2766+ int i;
2767+
2768+ for (i = 0; i < N; i++)
2769+ if (res[i] != (unsigned short) (A (i) + B (i)))
2770+ abort ();
2771+}
2772+
2773+void __attribute__ ((noinline))
2774+main1 (s *arr)
2775+{
2776+ int i;
2777+ s *ptr = arr;
2778+ s res1[N];
2779+ unsigned short res2[N];
2780+
2781+ for (i = 0; i < N; i++)
2782+ {
2783+ res1[i].a = arr[i].c;
2784+ res1[i].b = arr[i].a;
2785+ res1[i].c = arr[i].b;
2786+ }
2787+ check1 (res1);
2788+
2789+ for (i = 0; i < N; i++)
2790+ res2[i] = arr[i].a + arr[i].b + arr[i].c;
2791+ check2 (res2);
2792+
2793+ for (i = 0; i < N; i++)
2794+ {
2795+ res1[i].a = i;
2796+ res1[i].b = i;
2797+ res1[i].c = i;
2798+ }
2799+ check3 (res1);
2800+
2801+ for (i = 0; i < N; i++)
2802+ res2[i] = arr[i].a + arr[i].b;
2803+ check4 (res2);
2804+}
2805+
2806+int main (void)
2807+{
2808+ int i;
2809+ s arr[N];
2810+
2811+ check_vect ();
2812+
2813+ for (i = 0; i < N; i++)
2814+ {
2815+ arr[i].a = A (i);
2816+ arr[i].b = B (i);
2817+ arr[i].c = C (i);
2818+ }
2819+ main1 (arr);
2820+
2821+ return 0;
2822+}
2823+
2824+/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" { target vect_strided3 } } } */
2825+/* { dg-final { cleanup-tree-dump "vect" } } */
2826
2827=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-u16-i4.c'
2828--- old/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i4.c 2007-09-04 12:05:19 +0000
2829+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i4.c 2011-05-05 15:46:10 +0000
2830@@ -68,6 +68,6 @@
2831 return 0;
2832 }
2833
2834-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
2835+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided4 } } } */
2836 /* { dg-final { cleanup-tree-dump "vect" } } */
2837
2838
2839=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-u32-i4.c'
2840--- old/gcc/testsuite/gcc.dg/vect/vect-strided-u32-i4.c 2007-09-04 12:05:19 +0000
2841+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-u32-i4.c 2011-05-05 15:46:10 +0000
2842@@ -63,6 +63,6 @@
2843 return 0;
2844 }
2845
2846-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
2847+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided4 } } } */
2848 /* { dg-final { cleanup-tree-dump "vect" } } */
2849
2850
2851=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-u32-i8.c'
2852--- old/gcc/testsuite/gcc.dg/vect/vect-strided-u32-i8.c 2007-09-04 12:05:19 +0000
2853+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-u32-i8.c 2011-05-05 15:46:10 +0000
2854@@ -77,6 +77,6 @@
2855 return 0;
2856 }
2857
2858-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
2859+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
2860 /* { dg-final { cleanup-tree-dump "vect" } } */
2861
2862
2863=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-u32-mult.c'
2864--- old/gcc/testsuite/gcc.dg/vect/vect-strided-u32-mult.c 2010-05-27 12:23:45 +0000
2865+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-u32-mult.c 2011-05-05 15:46:10 +0000
2866@@ -60,6 +60,6 @@
2867 return 0;
2868 }
2869
2870-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
2871+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
2872 /* { dg-final { cleanup-tree-dump "vect" } } */
2873
2874
2875=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2-gap.c'
2876--- old/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2-gap.c 2007-09-04 12:05:19 +0000
2877+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2-gap.c 2011-05-05 15:46:10 +0000
2878@@ -71,6 +71,6 @@
2879 return 0;
2880 }
2881
2882-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
2883+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
2884 /* { dg-final { cleanup-tree-dump "vect" } } */
2885
2886
2887=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2.c'
2888--- old/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2.c 2007-09-04 12:05:19 +0000
2889+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2.c 2011-05-05 15:46:10 +0000
2890@@ -54,6 +54,6 @@
2891 return 0;
2892 }
2893
2894-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
2895+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
2896 /* { dg-final { cleanup-tree-dump "vect" } } */
2897
2898
2899=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap2.c'
2900--- old/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap2.c 2010-11-22 12:16:52 +0000
2901+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap2.c 2011-05-05 15:46:10 +0000
2902@@ -78,6 +78,6 @@
2903 return 0;
2904 }
2905
2906-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
2907+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
2908 /* { dg-final { cleanup-tree-dump "vect" } } */
2909
2910
2911=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap4.c'
2912--- old/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap4.c 2007-09-04 12:05:19 +0000
2913+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap4.c 2011-05-05 15:46:10 +0000
2914@@ -98,6 +98,6 @@
2915 return 0;
2916 }
2917
2918-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
2919+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
2920 /* { dg-final { cleanup-tree-dump "vect" } } */
2921
2922
2923=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap7.c'
2924--- old/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap7.c 2007-09-04 12:05:19 +0000
2925+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap7.c 2011-05-05 15:46:10 +0000
2926@@ -83,6 +83,6 @@
2927 return 0;
2928 }
2929
2930-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
2931+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
2932 /* { dg-final { cleanup-tree-dump "vect" } } */
2933
2934
2935=== modified file 'gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8.c'
2936--- old/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8.c 2010-11-22 12:16:52 +0000
2937+++ new/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8.c 2011-05-05 15:46:10 +0000
2938@@ -85,6 +85,6 @@
2939 return 0;
2940 }
2941
2942-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
2943+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
2944 /* { dg-final { cleanup-tree-dump "vect" } } */
2945
2946
2947=== modified file 'gcc/testsuite/gcc.dg/vect/vect-vfa-03.c'
2948--- old/gcc/testsuite/gcc.dg/vect/vect-vfa-03.c 2007-09-09 07:46:12 +0000
2949+++ new/gcc/testsuite/gcc.dg/vect/vect-vfa-03.c 2011-05-05 15:46:10 +0000
2950@@ -53,6 +53,6 @@
2951 }
2952
2953 /* Needs interleaving support. */
2954-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
2955-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { xfail { vect_interleave && vect_extract_even_odd } } } } */
2956+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
2957+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { xfail vect_strided2 } } } */
2958 /* { dg-final { cleanup-tree-dump "vect" } } */
2959
2960=== modified file 'gcc/testsuite/gcc.dg/vect/vect.exp'
2961--- old/gcc/testsuite/gcc.dg/vect/vect.exp 2011-04-24 07:45:49 +0000
2962+++ new/gcc/testsuite/gcc.dg/vect/vect.exp 2011-05-05 15:43:31 +0000
2963@@ -75,15 +75,20 @@
2964 lappend VECT_SLP_CFLAGS "-fdump-tree-slp-details"
2965
2966 # Main loop.
2967-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/pr*.\[cS\]]] \
2968- "" $DEFAULT_VECTCFLAGS
2969-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/vect-*.\[cS\]]] \
2970- "" $DEFAULT_VECTCFLAGS
2971-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/slp-*.\[cS\]]] \
2972- "" $DEFAULT_VECTCFLAGS
2973-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/bb-slp*.\[cS\]]] \
2974- "" $VECT_SLP_CFLAGS
2975-
2976+set VECT_ADDITIONAL_FLAGS [list ""]
2977+if { [check_effective_target_lto] } {
2978+ lappend VECT_ADDITIONAL_FLAGS "-flto"
2979+}
2980+foreach flags $VECT_ADDITIONAL_FLAGS {
2981+ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/pr*.\[cS\]]] \
2982+ $flags $DEFAULT_VECTCFLAGS
2983+ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/vect-*.\[cS\]]] \
2984+ $flags $DEFAULT_VECTCFLAGS
2985+ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/slp-*.\[cS\]]] \
2986+ $flags $DEFAULT_VECTCFLAGS
2987+ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/bb-slp*.\[cS\]]] \
2988+ $flags $VECT_SLP_CFLAGS
2989+}
2990
2991 #### Tests with special options
2992 global SAVED_DEFAULT_VECTCFLAGS
2993
2994=== modified file 'gcc/testsuite/lib/target-supports.exp'
2995--- old/gcc/testsuite/lib/target-supports.exp 2011-05-06 11:28:27 +0000
2996+++ new/gcc/testsuite/lib/target-supports.exp 2011-06-02 12:12:00 +0000
2997@@ -3139,29 +3139,6 @@
2998 return $et_vect_extract_even_odd_saved
2999 }
3000
3001-# Return 1 if the target supports vector even/odd elements extraction of
3002-# vectors with SImode elements or larger, 0 otherwise.
3003-
3004-proc check_effective_target_vect_extract_even_odd_wide { } {
3005- global et_vect_extract_even_odd_wide_saved
3006-
3007- if [info exists et_vect_extract_even_odd_wide_saved] {
3008- verbose "check_effective_target_vect_extract_even_odd_wide: using cached result" 2
3009- } else {
3010- set et_vect_extract_even_odd_wide_saved 0
3011- if { [istarget powerpc*-*-*]
3012- || [istarget i?86-*-*]
3013- || [istarget x86_64-*-*]
3014- || [istarget ia64-*-*]
3015- || [istarget spu-*-*] } {
3016- set et_vect_extract_even_odd_wide_saved 1
3017- }
3018- }
3019-
3020- verbose "check_effective_target_vect_extract_even_wide_odd: returning $et_vect_extract_even_odd_wide_saved" 2
3021- return $et_vect_extract_even_odd_wide_saved
3022-}
3023-
3024 # Return 1 if the target supports vector interleaving, 0 otherwise.
3025
3026 proc check_effective_target_vect_interleave { } {
3027@@ -3184,41 +3161,30 @@
3028 return $et_vect_interleave_saved
3029 }
3030
3031-# Return 1 if the target supports vector interleaving and extract even/odd, 0 otherwise.
3032-proc check_effective_target_vect_strided { } {
3033- global et_vect_strided_saved
3034-
3035- if [info exists et_vect_strided_saved] {
3036- verbose "check_effective_target_vect_strided: using cached result" 2
3037- } else {
3038- set et_vect_strided_saved 0
3039- if { [check_effective_target_vect_interleave]
3040- && [check_effective_target_vect_extract_even_odd] } {
3041- set et_vect_strided_saved 1
3042- }
3043- }
3044-
3045- verbose "check_effective_target_vect_strided: returning $et_vect_strided_saved" 2
3046- return $et_vect_strided_saved
3047-}
3048-
3049-# Return 1 if the target supports vector interleaving and extract even/odd
3050-# for wide element types, 0 otherwise.
3051-proc check_effective_target_vect_strided_wide { } {
3052- global et_vect_strided_wide_saved
3053-
3054- if [info exists et_vect_strided_wide_saved] {
3055- verbose "check_effective_target_vect_strided_wide: using cached result" 2
3056- } else {
3057- set et_vect_strided_wide_saved 0
3058- if { [check_effective_target_vect_interleave]
3059- && [check_effective_target_vect_extract_even_odd_wide] } {
3060- set et_vect_strided_wide_saved 1
3061- }
3062- }
3063-
3064- verbose "check_effective_target_vect_strided_wide: returning $et_vect_strided_wide_saved" 2
3065- return $et_vect_strided_wide_saved
3066+foreach N {2 3 4 8} {
3067+ eval [string map [list N $N] {
3068+ # Return 1 if the target supports 2-vector interleaving
3069+ proc check_effective_target_vect_stridedN { } {
3070+ global et_vect_stridedN_saved
3071+
3072+ if [info exists et_vect_stridedN_saved] {
3073+ verbose "check_effective_target_vect_stridedN: using cached result" 2
3074+ } else {
3075+ set et_vect_stridedN_saved 0
3076+ if { (N & -N) == N
3077+ && [check_effective_target_vect_interleave]
3078+ && [check_effective_target_vect_extract_even_odd] } {
3079+ set et_vect_stridedN_saved 1
3080+ }
3081+ if { [istarget arm*-*-*] && N >= 2 && N <= 4 } {
3082+ set et_vect_stridedN_saved 1
3083+ }
3084+ }
3085+
3086+ verbose "check_effective_target_vect_stridedN: returning $et_vect_stridedN_saved" 2
3087+ return $et_vect_stridedN_saved
3088+ }
3089+ }]
3090 }
3091
3092 # Return 1 if the target supports section-anchors
3093
3094=== modified file 'gcc/tree-cfg.c'
3095--- old/gcc/tree-cfg.c 2011-02-12 21:11:33 +0000
3096+++ new/gcc/tree-cfg.c 2011-05-05 15:42:22 +0000
3097@@ -3046,7 +3046,26 @@
3098 tree fntype;
3099 unsigned i;
3100
3101- if (TREE_CODE (fn) != OBJ_TYPE_REF
3102+ if (gimple_call_internal_p (stmt))
3103+ {
3104+ if (fn)
3105+ {
3106+ error ("gimple call has two targets");
3107+ debug_generic_stmt (fn);
3108+ return true;
3109+ }
3110+ }
3111+ else
3112+ {
3113+ if (!fn)
3114+ {
3115+ error ("gimple call has no target");
3116+ return true;
3117+ }
3118+ }
3119+
3120+ if (fn
3121+ && TREE_CODE (fn) != OBJ_TYPE_REF
3122 && !is_gimple_val (fn))
3123 {
3124 error ("invalid function in gimple call");
3125@@ -3054,9 +3073,10 @@
3126 return true;
3127 }
3128
3129- if (!POINTER_TYPE_P (TREE_TYPE (fn))
3130- || (TREE_CODE (TREE_TYPE (TREE_TYPE (fn))) != FUNCTION_TYPE
3131- && TREE_CODE (TREE_TYPE (TREE_TYPE (fn))) != METHOD_TYPE))
3132+ if (fn
3133+ && (!POINTER_TYPE_P (TREE_TYPE (fn))
3134+ || (TREE_CODE (TREE_TYPE (TREE_TYPE (fn))) != FUNCTION_TYPE
3135+ && TREE_CODE (TREE_TYPE (TREE_TYPE (fn))) != METHOD_TYPE)))
3136 {
3137 error ("non-function in gimple call");
3138 return true;
3139@@ -3076,8 +3096,12 @@
3140 return true;
3141 }
3142
3143- fntype = TREE_TYPE (TREE_TYPE (fn));
3144- if (gimple_call_lhs (stmt)
3145+ if (fn)
3146+ fntype = TREE_TYPE (TREE_TYPE (fn));
3147+ else
3148+ fntype = NULL_TREE;
3149+ if (fntype
3150+ && gimple_call_lhs (stmt)
3151 && !useless_type_conversion_p (TREE_TYPE (gimple_call_lhs (stmt)),
3152 TREE_TYPE (fntype))
3153 /* ??? At least C++ misses conversions at assignments from
3154@@ -4130,9 +4154,10 @@
3155 didn't see a function declaration before the call. */
3156 if (is_gimple_call (stmt))
3157 {
3158- tree decl;
3159+ tree fn, decl;
3160
3161- if (!is_gimple_call_addr (gimple_call_fn (stmt)))
3162+ fn = gimple_call_fn (stmt);
3163+ if (fn && !is_gimple_call_addr (fn))
3164 {
3165 error ("invalid function in call statement");
3166 return true;
3167@@ -7484,6 +7509,8 @@
3168 case GIMPLE_CALL:
3169 if (gimple_call_lhs (g))
3170 break;
3171+ if (gimple_call_internal_p (g))
3172+ break;
3173
3174 /* This is a naked call, as opposed to a GIMPLE_CALL with an
3175 LHS. All calls whose value is ignored should be
3176
3177=== modified file 'gcc/tree-eh.c'
3178--- old/gcc/tree-eh.c 2011-05-10 06:31:59 +0000
3179+++ new/gcc/tree-eh.c 2011-06-02 12:12:00 +0000
3180@@ -2745,7 +2745,7 @@
3181 || gimple_call_lhs (twos)
3182 || gimple_call_chain (ones)
3183 || gimple_call_chain (twos)
3184- || !operand_equal_p (gimple_call_fn (ones), gimple_call_fn (twos), 0)
3185+ || !gimple_call_same_target_p (ones, twos)
3186 || gimple_call_num_args (ones) != gimple_call_num_args (twos))
3187 return false;
3188
3189
3190=== modified file 'gcc/tree-inline.c'
3191--- old/gcc/tree-inline.c 2011-05-05 21:02:06 +0000
3192+++ new/gcc/tree-inline.c 2011-06-02 12:12:00 +0000
3193@@ -3471,10 +3471,13 @@
3194 {
3195 tree decl = gimple_call_fndecl (stmt);
3196 tree addr = gimple_call_fn (stmt);
3197- tree funtype = TREE_TYPE (addr);
3198+ tree funtype = NULL_TREE;
3199 bool stdarg = false;
3200
3201- if (POINTER_TYPE_P (funtype))
3202+ if (addr)
3203+ funtype = TREE_TYPE (addr);
3204+
3205+ if (funtype && POINTER_TYPE_P (funtype))
3206 funtype = TREE_TYPE (funtype);
3207
3208 /* Do not special case builtins where we see the body.
3209@@ -3514,7 +3517,7 @@
3210 if (decl)
3211 funtype = TREE_TYPE (decl);
3212
3213- if (!VOID_TYPE_P (TREE_TYPE (funtype)))
3214+ if (funtype && !VOID_TYPE_P (TREE_TYPE (funtype)))
3215 cost += estimate_move_cost (TREE_TYPE (funtype));
3216
3217 if (funtype)
3218
3219=== modified file 'gcc/tree-ssa-ccp.c'
3220--- old/gcc/tree-ssa-ccp.c 2011-01-31 16:52:22 +0000
3221+++ new/gcc/tree-ssa-ccp.c 2011-05-05 15:42:22 +0000
3222@@ -1279,7 +1279,10 @@
3223
3224 case GIMPLE_CALL:
3225 {
3226- tree fn = valueize_op (gimple_call_fn (stmt));
3227+ tree fn = gimple_call_fn (stmt);
3228+ if (!fn)
3229+ return NULL_TREE;
3230+ fn = valueize_op (fn);
3231 if (TREE_CODE (fn) == ADDR_EXPR
3232 && TREE_CODE (TREE_OPERAND (fn, 0)) == FUNCTION_DECL
3233 && DECL_BUILT_IN (TREE_OPERAND (fn, 0)))
3234@@ -2310,6 +2313,11 @@
3235 return true;
3236 }
3237
3238+ /* Internal calls provide no argument types, so the extra laxity
3239+ for normal calls does not apply. */
3240+ if (gimple_call_internal_p (stmt))
3241+ return false;
3242+
3243 /* Propagate into the call arguments. Compared to replace_uses_in
3244 this can use the argument slot types for type verification
3245 instead of the current argument type. We also can safely
3246
3247=== modified file 'gcc/tree-ssa-dom.c'
3248--- old/gcc/tree-ssa-dom.c 2011-02-14 17:59:10 +0000
3249+++ new/gcc/tree-ssa-dom.c 2011-05-05 15:42:22 +0000
3250@@ -64,7 +64,7 @@
3251 struct { enum tree_code op; tree opnd; } unary;
3252 struct { enum tree_code op; tree opnd0, opnd1; } binary;
3253 struct { enum tree_code op; tree opnd0, opnd1, opnd2; } ternary;
3254- struct { tree fn; bool pure; size_t nargs; tree *args; } call;
3255+ struct { gimple fn_from; bool pure; size_t nargs; tree *args; } call;
3256 } ops;
3257 };
3258
3259@@ -258,7 +258,7 @@
3260
3261 expr->type = TREE_TYPE (gimple_call_lhs (stmt));
3262 expr->kind = EXPR_CALL;
3263- expr->ops.call.fn = gimple_call_fn (stmt);
3264+ expr->ops.call.fn_from = stmt;
3265
3266 if (gimple_call_flags (stmt) & (ECF_CONST | ECF_PURE))
3267 expr->ops.call.pure = true;
3268@@ -422,8 +422,8 @@
3269
3270 /* If the calls are to different functions, then they
3271 clearly cannot be equal. */
3272- if (! operand_equal_p (expr0->ops.call.fn,
3273- expr1->ops.call.fn, 0))
3274+ if (!gimple_call_same_target_p (expr0->ops.call.fn_from,
3275+ expr1->ops.call.fn_from))
3276 return false;
3277
3278 if (! expr0->ops.call.pure)
3279@@ -503,9 +503,15 @@
3280 {
3281 size_t i;
3282 enum tree_code code = CALL_EXPR;
3283+ gimple fn_from;
3284
3285 val = iterative_hash_object (code, val);
3286- val = iterative_hash_expr (expr->ops.call.fn, val);
3287+ fn_from = expr->ops.call.fn_from;
3288+ if (gimple_call_internal_p (fn_from))
3289+ val = iterative_hash_hashval_t
3290+ ((hashval_t) gimple_call_internal_fn (fn_from), val);
3291+ else
3292+ val = iterative_hash_expr (gimple_call_fn (fn_from), val);
3293 for (i = 0; i < expr->ops.call.nargs; i++)
3294 val = iterative_hash_expr (expr->ops.call.args[i], val);
3295 }
3296@@ -565,8 +571,14 @@
3297 {
3298 size_t i;
3299 size_t nargs = element->expr.ops.call.nargs;
3300+ gimple fn_from;
3301
3302- print_generic_expr (stream, element->expr.ops.call.fn, 0);
3303+ fn_from = element->expr.ops.call.fn_from;
3304+ if (gimple_call_internal_p (fn_from))
3305+ fputs (internal_fn_name (gimple_call_internal_fn (fn_from)),
3306+ stream);
3307+ else
3308+ print_generic_expr (stream, gimple_call_fn (fn_from), 0);
3309 fprintf (stream, " (");
3310 for (i = 0; i < nargs; i++)
3311 {
3312
3313=== modified file 'gcc/tree-ssa-pre.c'
3314--- old/gcc/tree-ssa-pre.c 2011-02-15 13:04:47 +0000
3315+++ new/gcc/tree-ssa-pre.c 2011-05-05 15:42:22 +0000
3316@@ -2657,11 +2657,13 @@
3317 }
3318
3319 /* Return true if we can value number the call in STMT. This is true
3320- if we have a pure or constant call. */
3321+ if we have a pure or constant call to a real function. */
3322
3323 static bool
3324 can_value_number_call (gimple stmt)
3325 {
3326+ if (gimple_call_internal_p (stmt))
3327+ return false;
3328 if (gimple_call_flags (stmt) & (ECF_PURE | ECF_CONST))
3329 return true;
3330 return false;
3331@@ -4187,6 +4189,7 @@
3332 gimple_stmt_iterator gsi;
3333 gimple stmt;
3334 unsigned i;
3335+ tree fn;
3336
3337 FOR_EACH_BB (b)
3338 {
3339@@ -4378,9 +4381,10 @@
3340 /* Visit indirect calls and turn them into direct calls if
3341 possible. */
3342 if (is_gimple_call (stmt)
3343- && TREE_CODE (gimple_call_fn (stmt)) == SSA_NAME)
3344+ && (fn = gimple_call_fn (stmt))
3345+ && TREE_CODE (fn) == SSA_NAME)
3346 {
3347- tree fn = VN_INFO (gimple_call_fn (stmt))->valnum;
3348+ fn = VN_INFO (fn)->valnum;
3349 if (TREE_CODE (fn) == ADDR_EXPR
3350 && TREE_CODE (TREE_OPERAND (fn, 0)) == FUNCTION_DECL)
3351 {
3352
3353=== modified file 'gcc/tree-ssa-sccvn.c'
3354--- old/gcc/tree-ssa-sccvn.c 2011-05-12 14:08:00 +0000
3355+++ new/gcc/tree-ssa-sccvn.c 2011-06-02 12:12:00 +0000
3356@@ -2982,7 +2982,8 @@
3357 /* ??? We should handle stores from calls. */
3358 else if (TREE_CODE (lhs) == SSA_NAME)
3359 {
3360- if (gimple_call_flags (stmt) & (ECF_PURE | ECF_CONST))
3361+ if (!gimple_call_internal_p (stmt)
3362+ && gimple_call_flags (stmt) & (ECF_PURE | ECF_CONST))
3363 changed = visit_reference_op_call (lhs, stmt);
3364 else
3365 changed = defs_to_varying (stmt);
3366
3367=== modified file 'gcc/tree-ssa-structalias.c'
3368--- old/gcc/tree-ssa-structalias.c 2011-02-10 15:29:52 +0000
3369+++ new/gcc/tree-ssa-structalias.c 2011-05-05 15:42:22 +0000
3370@@ -4319,6 +4319,7 @@
3371 /* Fallthru to general call handling. */;
3372 }
3373 if (!in_ipa_mode
3374+ || gimple_call_internal_p (t)
3375 || (fndecl
3376 && (!(fi = lookup_vi_for_tree (fndecl))
3377 || !fi->is_fn_info)))
3378
3379=== modified file 'gcc/tree-vect-data-refs.c'
3380--- old/gcc/tree-vect-data-refs.c 2011-05-06 11:28:27 +0000
3381+++ new/gcc/tree-vect-data-refs.c 2011-06-02 12:12:00 +0000
3382@@ -43,6 +43,45 @@
3383 #include "expr.h"
3384 #include "optabs.h"
3385
3386+/* Return true if load- or store-lanes optab OPTAB is implemented for
3387+ COUNT vectors of type VECTYPE. NAME is the name of OPTAB. */
3388+
3389+static bool
3390+vect_lanes_optab_supported_p (const char *name, convert_optab optab,
3391+ tree vectype, unsigned HOST_WIDE_INT count)
3392+{
3393+ enum machine_mode mode, array_mode;
3394+ bool limit_p;
3395+
3396+ mode = TYPE_MODE (vectype);
3397+ limit_p = !targetm.array_mode_supported_p (mode, count);
3398+ array_mode = mode_for_size (count * GET_MODE_BITSIZE (mode),
3399+ MODE_INT, limit_p);
3400+
3401+ if (array_mode == BLKmode)
3402+ {
3403+ if (vect_print_dump_info (REPORT_DETAILS))
3404+ fprintf (vect_dump, "no array mode for %s[" HOST_WIDE_INT_PRINT_DEC "]",
3405+ GET_MODE_NAME (mode), count);
3406+ return false;
3407+ }
3408+
3409+ if (convert_optab_handler (optab, array_mode, mode) == CODE_FOR_nothing)
3410+ {
3411+ if (vect_print_dump_info (REPORT_DETAILS))
3412+ fprintf (vect_dump, "cannot use %s<%s><%s>",
3413+ name, GET_MODE_NAME (array_mode), GET_MODE_NAME (mode));
3414+ return false;
3415+ }
3416+
3417+ if (vect_print_dump_info (REPORT_DETAILS))
3418+ fprintf (vect_dump, "can use %s<%s><%s>",
3419+ name, GET_MODE_NAME (array_mode), GET_MODE_NAME (mode));
3420+
3421+ return true;
3422+}
3423+
3424+
3425 /* Return the smallest scalar part of STMT.
3426 This is used to determine the vectype of the stmt. We generally set the
3427 vectype according to the type of the result (lhs). For stmts whose
3428@@ -2196,19 +2235,6 @@
3429 return false;
3430 }
3431
3432- /* FORNOW: we handle only interleaving that is a power of 2.
3433- We don't fail here if it may be still possible to vectorize the
3434- group using SLP. If not, the size of the group will be checked in
3435- vect_analyze_operations, and the vectorization will fail. */
3436- if (exact_log2 (stride) == -1)
3437- {
3438- if (vect_print_dump_info (REPORT_DETAILS))
3439- fprintf (vect_dump, "interleaving is not a power of 2");
3440-
3441- if (slp_impossible)
3442- return false;
3443- }
3444-
3445 if (stride == 0)
3446 stride = count;
3447
3448@@ -2911,31 +2937,33 @@
3449
3450 /* Function vect_create_data_ref_ptr.
3451
3452- Create a new pointer to vector type (vp), that points to the first location
3453- accessed in the loop by STMT, along with the def-use update chain to
3454- appropriately advance the pointer through the loop iterations. Also set
3455- aliasing information for the pointer. This vector pointer is used by the
3456- callers to this function to create a memory reference expression for vector
3457- load/store access.
3458+ Create a new pointer-to-AGGR_TYPE variable (ap), that points to the first
3459+ location accessed in the loop by STMT, along with the def-use update
3460+ chain to appropriately advance the pointer through the loop iterations.
3461+ Also set aliasing information for the pointer. This pointer is used by
3462+ the callers to this function to create a memory reference expression for
3463+ vector load/store access.
3464
3465 Input:
3466 1. STMT: a stmt that references memory. Expected to be of the form
3467 GIMPLE_ASSIGN <name, data-ref> or
3468 GIMPLE_ASSIGN <data-ref, name>.
3469- 2. AT_LOOP: the loop where the vector memref is to be created.
3470- 3. OFFSET (optional): an offset to be added to the initial address accessed
3471+ 2. AGGR_TYPE: the type of the reference, which should be either a vector
3472+ or an array.
3473+ 3. AT_LOOP: the loop where the vector memref is to be created.
3474+ 4. OFFSET (optional): an offset to be added to the initial address accessed
3475 by the data-ref in STMT.
3476- 4. ONLY_INIT: indicate if vp is to be updated in the loop, or remain
3477+ 5. ONLY_INIT: indicate if vp is to be updated in the loop, or remain
3478 pointing to the initial address.
3479- 5. TYPE: if not NULL indicates the required type of the data-ref.
3480+ 6. TYPE: if not NULL indicates the required type of the data-ref.
3481
3482 Output:
3483 1. Declare a new ptr to vector_type, and have it point to the base of the
3484 data reference (initial addressed accessed by the data reference).
3485 For example, for vector of type V8HI, the following code is generated:
3486
3487- v8hi *vp;
3488- vp = (v8hi *)initial_address;
3489+ v8hi *ap;
3490+ ap = (v8hi *)initial_address;
3491
3492 if OFFSET is not supplied:
3493 initial_address = &a[init];
3494@@ -2955,7 +2983,7 @@
3495 4. Return the pointer. */
3496
3497 tree
3498-vect_create_data_ref_ptr (gimple stmt, struct loop *at_loop,
3499+vect_create_data_ref_ptr (gimple stmt, tree aggr_type, struct loop *at_loop,
3500 tree offset, tree *initial_address, gimple *ptr_incr,
3501 bool only_init, bool *inv_p)
3502 {
3503@@ -2965,17 +2993,16 @@
3504 struct loop *loop = NULL;
3505 bool nested_in_vect_loop = false;
3506 struct loop *containing_loop = NULL;
3507- tree vectype = STMT_VINFO_VECTYPE (stmt_info);
3508- tree vect_ptr_type;
3509- tree vect_ptr;
3510+ tree aggr_ptr_type;
3511+ tree aggr_ptr;
3512 tree new_temp;
3513 gimple vec_stmt;
3514 gimple_seq new_stmt_list = NULL;
3515 edge pe = NULL;
3516 basic_block new_bb;
3517- tree vect_ptr_init;
3518+ tree aggr_ptr_init;
3519 struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info);
3520- tree vptr;
3521+ tree aptr;
3522 gimple_stmt_iterator incr_gsi;
3523 bool insert_after;
3524 bool negative;
3525@@ -2986,6 +3013,9 @@
3526 gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
3527 tree base;
3528
3529+ gcc_assert (TREE_CODE (aggr_type) == ARRAY_TYPE
3530+ || TREE_CODE (aggr_type) == VECTOR_TYPE);
3531+
3532 if (loop_vinfo)
3533 {
3534 loop = LOOP_VINFO_LOOP (loop_vinfo);
3535@@ -3020,8 +3050,9 @@
3536 if (vect_print_dump_info (REPORT_DETAILS))
3537 {
3538 tree data_ref_base = base_name;
3539- fprintf (vect_dump, "create vector-pointer variable to type: ");
3540- print_generic_expr (vect_dump, vectype, TDF_SLIM);
3541+ fprintf (vect_dump, "create %s-pointer variable to type: ",
3542+ tree_code_name[(int) TREE_CODE (aggr_type)]);
3543+ print_generic_expr (vect_dump, aggr_type, TDF_SLIM);
3544 if (TREE_CODE (data_ref_base) == VAR_DECL
3545 || TREE_CODE (data_ref_base) == ARRAY_REF)
3546 fprintf (vect_dump, " vectorizing an array ref: ");
3547@@ -3032,27 +3063,28 @@
3548 print_generic_expr (vect_dump, base_name, TDF_SLIM);
3549 }
3550
3551- /* (1) Create the new vector-pointer variable. */
3552- vect_ptr_type = build_pointer_type (vectype);
3553+ /* (1) Create the new aggregate-pointer variable. */
3554+ aggr_ptr_type = build_pointer_type (aggr_type);
3555 base = get_base_address (DR_REF (dr));
3556 if (base
3557 && TREE_CODE (base) == MEM_REF)
3558- vect_ptr_type
3559- = build_qualified_type (vect_ptr_type,
3560+ aggr_ptr_type
3561+ = build_qualified_type (aggr_ptr_type,
3562 TYPE_QUALS (TREE_TYPE (TREE_OPERAND (base, 0))));
3563- vect_ptr = vect_get_new_vect_var (vect_ptr_type, vect_pointer_var,
3564+ aggr_ptr = vect_get_new_vect_var (aggr_ptr_type, vect_pointer_var,
3565 get_name (base_name));
3566
3567- /* Vector types inherit the alias set of their component type by default so
3568- we need to use a ref-all pointer if the data reference does not conflict
3569- with the created vector data reference because it is not addressable. */
3570- if (!alias_sets_conflict_p (get_deref_alias_set (vect_ptr),
3571+ /* Vector and array types inherit the alias set of their component
3572+ type by default so we need to use a ref-all pointer if the data
3573+ reference does not conflict with the created aggregated data
3574+ reference because it is not addressable. */
3575+ if (!alias_sets_conflict_p (get_deref_alias_set (aggr_ptr),
3576 get_alias_set (DR_REF (dr))))
3577 {
3578- vect_ptr_type
3579- = build_pointer_type_for_mode (vectype,
3580- TYPE_MODE (vect_ptr_type), true);
3581- vect_ptr = vect_get_new_vect_var (vect_ptr_type, vect_pointer_var,
3582+ aggr_ptr_type
3583+ = build_pointer_type_for_mode (aggr_type,
3584+ TYPE_MODE (aggr_ptr_type), true);
3585+ aggr_ptr = vect_get_new_vect_var (aggr_ptr_type, vect_pointer_var,
3586 get_name (base_name));
3587 }
3588
3589@@ -3063,14 +3095,14 @@
3590 do
3591 {
3592 tree lhs = gimple_assign_lhs (orig_stmt);
3593- if (!alias_sets_conflict_p (get_deref_alias_set (vect_ptr),
3594+ if (!alias_sets_conflict_p (get_deref_alias_set (aggr_ptr),
3595 get_alias_set (lhs)))
3596 {
3597- vect_ptr_type
3598- = build_pointer_type_for_mode (vectype,
3599- TYPE_MODE (vect_ptr_type), true);
3600- vect_ptr
3601- = vect_get_new_vect_var (vect_ptr_type, vect_pointer_var,
3602+ aggr_ptr_type
3603+ = build_pointer_type_for_mode (aggr_type,
3604+ TYPE_MODE (aggr_ptr_type), true);
3605+ aggr_ptr
3606+ = vect_get_new_vect_var (aggr_ptr_type, vect_pointer_var,
3607 get_name (base_name));
3608 break;
3609 }
3610@@ -3080,7 +3112,7 @@
3611 while (orig_stmt);
3612 }
3613
3614- add_referenced_var (vect_ptr);
3615+ add_referenced_var (aggr_ptr);
3616
3617 /* Note: If the dataref is in an inner-loop nested in LOOP, and we are
3618 vectorizing LOOP (i.e., outer-loop vectorization), we need to create two
3619@@ -3113,8 +3145,8 @@
3620 vp2 = vp1 + step
3621 if () goto LOOP */
3622
3623- /* (2) Calculate the initial address the vector-pointer, and set
3624- the vector-pointer to point to it before the loop. */
3625+ /* (2) Calculate the initial address of the aggregate-pointer, and set
3626+ the aggregate-pointer to point to it before the loop. */
3627
3628 /* Create: (&(base[init_val+offset]) in the loop preheader. */
3629
3630@@ -3133,17 +3165,17 @@
3631
3632 *initial_address = new_temp;
3633
3634- /* Create: p = (vectype *) initial_base */
3635+ /* Create: p = (aggr_type *) initial_base */
3636 if (TREE_CODE (new_temp) != SSA_NAME
3637- || !useless_type_conversion_p (vect_ptr_type, TREE_TYPE (new_temp)))
3638+ || !useless_type_conversion_p (aggr_ptr_type, TREE_TYPE (new_temp)))
3639 {
3640- vec_stmt = gimple_build_assign (vect_ptr,
3641- fold_convert (vect_ptr_type, new_temp));
3642- vect_ptr_init = make_ssa_name (vect_ptr, vec_stmt);
3643+ vec_stmt = gimple_build_assign (aggr_ptr,
3644+ fold_convert (aggr_ptr_type, new_temp));
3645+ aggr_ptr_init = make_ssa_name (aggr_ptr, vec_stmt);
3646 /* Copy the points-to information if it exists. */
3647 if (DR_PTR_INFO (dr))
3648- duplicate_ssa_name_ptr_info (vect_ptr_init, DR_PTR_INFO (dr));
3649- gimple_assign_set_lhs (vec_stmt, vect_ptr_init);
3650+ duplicate_ssa_name_ptr_info (aggr_ptr_init, DR_PTR_INFO (dr));
3651+ gimple_assign_set_lhs (vec_stmt, aggr_ptr_init);
3652 if (pe)
3653 {
3654 new_bb = gsi_insert_on_edge_immediate (pe, vec_stmt);
3655@@ -3153,19 +3185,19 @@
3656 gsi_insert_before (&gsi, vec_stmt, GSI_SAME_STMT);
3657 }
3658 else
3659- vect_ptr_init = new_temp;
3660+ aggr_ptr_init = new_temp;
3661
3662- /* (3) Handle the updating of the vector-pointer inside the loop.
3663+ /* (3) Handle the updating of the aggregate-pointer inside the loop.
3664 This is needed when ONLY_INIT is false, and also when AT_LOOP is the
3665 inner-loop nested in LOOP (during outer-loop vectorization). */
3666
3667 /* No update in loop is required. */
3668 if (only_init && (!loop_vinfo || at_loop == loop))
3669- vptr = vect_ptr_init;
3670+ aptr = aggr_ptr_init;
3671 else
3672 {
3673- /* The step of the vector pointer is the Vector Size. */
3674- tree step = TYPE_SIZE_UNIT (vectype);
3675+ /* The step of the aggregate pointer is the type size. */
3676+ tree step = TYPE_SIZE_UNIT (aggr_type);
3677 /* One exception to the above is when the scalar step of the load in
3678 LOOP is zero. In this case the step here is also zero. */
3679 if (*inv_p)
3680@@ -3175,9 +3207,9 @@
3681
3682 standard_iv_increment_position (loop, &incr_gsi, &insert_after);
3683
3684- create_iv (vect_ptr_init,
3685- fold_convert (vect_ptr_type, step),
3686- vect_ptr, loop, &incr_gsi, insert_after,
3687+ create_iv (aggr_ptr_init,
3688+ fold_convert (aggr_ptr_type, step),
3689+ aggr_ptr, loop, &incr_gsi, insert_after,
3690 &indx_before_incr, &indx_after_incr);
3691 incr = gsi_stmt (incr_gsi);
3692 set_vinfo_for_stmt (incr, new_stmt_vec_info (incr, loop_vinfo, NULL));
3693@@ -3191,14 +3223,14 @@
3694 if (ptr_incr)
3695 *ptr_incr = incr;
3696
3697- vptr = indx_before_incr;
3698+ aptr = indx_before_incr;
3699 }
3700
3701 if (!nested_in_vect_loop || only_init)
3702- return vptr;
3703-
3704-
3705- /* (4) Handle the updating of the vector-pointer inside the inner-loop
3706+ return aptr;
3707+
3708+
3709+ /* (4) Handle the updating of the aggregate-pointer inside the inner-loop
3710 nested in LOOP, if exists. */
3711
3712 gcc_assert (nested_in_vect_loop);
3713@@ -3206,7 +3238,7 @@
3714 {
3715 standard_iv_increment_position (containing_loop, &incr_gsi,
3716 &insert_after);
3717- create_iv (vptr, fold_convert (vect_ptr_type, DR_STEP (dr)), vect_ptr,
3718+ create_iv (aptr, fold_convert (aggr_ptr_type, DR_STEP (dr)), aggr_ptr,
3719 containing_loop, &incr_gsi, insert_after, &indx_before_incr,
3720 &indx_after_incr);
3721 incr = gsi_stmt (incr_gsi);
3722@@ -3343,13 +3375,22 @@
3723 and FALSE otherwise. */
3724
3725 bool
3726-vect_strided_store_supported (tree vectype)
3727+vect_strided_store_supported (tree vectype, unsigned HOST_WIDE_INT count)
3728 {
3729 optab interleave_high_optab, interleave_low_optab;
3730 enum machine_mode mode;
3731
3732 mode = TYPE_MODE (vectype);
3733
3734+ /* vect_permute_store_chain requires the group size to be a power of two. */
3735+ if (exact_log2 (count) == -1)
3736+ {
3737+ if (vect_print_dump_info (REPORT_DETAILS))
3738+ fprintf (vect_dump, "the size of the group of strided accesses"
3739+ " is not a power of 2");
3740+ return false;
3741+ }
3742+
3743 /* Check that the operation is supported. */
3744 interleave_high_optab = optab_for_tree_code (VEC_INTERLEAVE_HIGH_EXPR,
3745 vectype, optab_default);
3746@@ -3374,6 +3415,18 @@
3747 }
3748
3749
3750+/* Return TRUE if vec_store_lanes is available for COUNT vectors of
3751+ type VECTYPE. */
3752+
3753+bool
3754+vect_store_lanes_supported (tree vectype, unsigned HOST_WIDE_INT count)
3755+{
3756+ return vect_lanes_optab_supported_p ("vec_store_lanes",
3757+ vec_store_lanes_optab,
3758+ vectype, count);
3759+}
3760+
3761+
3762 /* Function vect_permute_store_chain.
3763
3764 Given a chain of interleaved stores in DR_CHAIN of LENGTH that must be
3765@@ -3435,7 +3488,7 @@
3766 I3: 4 12 20 28 5 13 21 30
3767 I4: 6 14 22 30 7 15 23 31. */
3768
3769-bool
3770+void
3771 vect_permute_store_chain (VEC(tree,heap) *dr_chain,
3772 unsigned int length,
3773 gimple stmt,
3774@@ -3449,9 +3502,7 @@
3775 unsigned int j;
3776 enum tree_code high_code, low_code;
3777
3778- /* Check that the operation is supported. */
3779- if (!vect_strided_store_supported (vectype))
3780- return false;
3781+ gcc_assert (vect_strided_store_supported (vectype, length));
3782
3783 *result_chain = VEC_copy (tree, heap, dr_chain);
3784
3785@@ -3504,7 +3555,6 @@
3786 }
3787 dr_chain = VEC_copy (tree, heap, *result_chain);
3788 }
3789- return true;
3790 }
3791
3792 /* Function vect_setup_realignment
3793@@ -3674,8 +3724,9 @@
3794
3795 gcc_assert (!compute_in_loop);
3796 vec_dest = vect_create_destination_var (scalar_dest, vectype);
3797- ptr = vect_create_data_ref_ptr (stmt, loop_for_initial_load, NULL_TREE,
3798- &init_addr, &inc, true, &inv_p);
3799+ ptr = vect_create_data_ref_ptr (stmt, vectype, loop_for_initial_load,
3800+ NULL_TREE, &init_addr, &inc,
3801+ true, &inv_p);
3802 new_stmt = gimple_build_assign_with_ops
3803 (BIT_AND_EXPR, NULL_TREE, ptr,
3804 build_int_cst (TREE_TYPE (ptr),
3805@@ -3780,13 +3831,22 @@
3806 and FALSE otherwise. */
3807
3808 bool
3809-vect_strided_load_supported (tree vectype)
3810+vect_strided_load_supported (tree vectype, unsigned HOST_WIDE_INT count)
3811 {
3812 optab perm_even_optab, perm_odd_optab;
3813 enum machine_mode mode;
3814
3815 mode = TYPE_MODE (vectype);
3816
3817+ /* vect_permute_load_chain requires the group size to be a power of two. */
3818+ if (exact_log2 (count) == -1)
3819+ {
3820+ if (vect_print_dump_info (REPORT_DETAILS))
3821+ fprintf (vect_dump, "the size of the group of strided accesses"
3822+ " is not a power of 2");
3823+ return false;
3824+ }
3825+
3826 perm_even_optab = optab_for_tree_code (VEC_EXTRACT_EVEN_EXPR, vectype,
3827 optab_default);
3828 if (!perm_even_optab)
3829@@ -3821,6 +3881,16 @@
3830 return true;
3831 }
3832
3833+/* Return TRUE if vec_load_lanes is available for COUNT vectors of
3834+ type VECTYPE. */
3835+
3836+bool
3837+vect_load_lanes_supported (tree vectype, unsigned HOST_WIDE_INT count)
3838+{
3839+ return vect_lanes_optab_supported_p ("vec_load_lanes",
3840+ vec_load_lanes_optab,
3841+ vectype, count);
3842+}
3843
3844 /* Function vect_permute_load_chain.
3845
3846@@ -3898,7 +3968,7 @@
3847 3rd vec (E2): 2 6 10 14 18 22 26 30
3848 4th vec (E4): 3 7 11 15 19 23 27 31. */
3849
3850-bool
3851+static void
3852 vect_permute_load_chain (VEC(tree,heap) *dr_chain,
3853 unsigned int length,
3854 gimple stmt,
3855@@ -3911,9 +3981,7 @@
3856 int i;
3857 unsigned int j;
3858
3859- /* Check that the operation is supported. */
3860- if (!vect_strided_load_supported (vectype))
3861- return false;
3862+ gcc_assert (vect_strided_load_supported (vectype, length));
3863
3864 *result_chain = VEC_copy (tree, heap, dr_chain);
3865 for (i = 0; i < exact_log2 (length); i++)
3866@@ -3956,7 +4024,6 @@
3867 }
3868 dr_chain = VEC_copy (tree, heap, *result_chain);
3869 }
3870- return true;
3871 }
3872
3873
3874@@ -3967,24 +4034,32 @@
3875 the scalar statements.
3876 */
3877
3878-bool
3879+void
3880 vect_transform_strided_load (gimple stmt, VEC(tree,heap) *dr_chain, int size,
3881 gimple_stmt_iterator *gsi)
3882 {
3883- stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
3884- gimple first_stmt = DR_GROUP_FIRST_DR (stmt_info);
3885- gimple next_stmt, new_stmt;
3886 VEC(tree,heap) *result_chain = NULL;
3887- unsigned int i, gap_count;
3888- tree tmp_data_ref;
3889
3890 /* DR_CHAIN contains input data-refs that are a part of the interleaving.
3891 RESULT_CHAIN is the output of vect_permute_load_chain, it contains permuted
3892 vectors, that are ready for vector computation. */
3893 result_chain = VEC_alloc (tree, heap, size);
3894- /* Permute. */
3895- if (!vect_permute_load_chain (dr_chain, size, stmt, gsi, &result_chain))
3896- return false;
3897+ vect_permute_load_chain (dr_chain, size, stmt, gsi, &result_chain);
3898+ vect_record_strided_load_vectors (stmt, result_chain);
3899+ VEC_free (tree, heap, result_chain);
3900+}
3901+
3902+/* RESULT_CHAIN contains the output of a group of strided loads that were
3903+ generated as part of the vectorization of STMT. Assign the statement
3904+ for each vector to the associated scalar statement. */
3905+
3906+void
3907+vect_record_strided_load_vectors (gimple stmt, VEC(tree,heap) *result_chain)
3908+{
3909+ gimple first_stmt = DR_GROUP_FIRST_DR (vinfo_for_stmt (stmt));
3910+ gimple next_stmt, new_stmt;
3911+ unsigned int i, gap_count;
3912+ tree tmp_data_ref;
3913
3914 /* Put a permuted data-ref in the VECTORIZED_STMT field.
3915 Since we scan the chain starting from it's first node, their order
3916@@ -4046,9 +4121,6 @@
3917 break;
3918 }
3919 }
3920-
3921- VEC_free (tree, heap, result_chain);
3922- return true;
3923 }
3924
3925 /* Function vect_force_dr_alignment_p.
3926
3927=== modified file 'gcc/tree-vect-slp.c'
3928--- old/gcc/tree-vect-slp.c 2010-12-23 16:25:52 +0000
3929+++ new/gcc/tree-vect-slp.c 2011-05-05 15:43:06 +0000
3930@@ -215,7 +215,8 @@
3931 vect_model_simple_cost (stmt_info, ncopies_for_cost, dt, slp_node);
3932 else
3933 /* Store. */
3934- vect_model_store_cost (stmt_info, ncopies_for_cost, dt[0], slp_node);
3935+ vect_model_store_cost (stmt_info, ncopies_for_cost, false,
3936+ dt[0], slp_node);
3937 }
3938
3939 else
3940@@ -579,7 +580,7 @@
3941
3942 /* Analyze costs (for the first stmt in the group). */
3943 vect_model_load_cost (vinfo_for_stmt (stmt),
3944- ncopies_for_cost, *node);
3945+ ncopies_for_cost, false, *node);
3946 }
3947
3948 /* Store the place of this load in the interleaving chain. In
3949
3950=== modified file 'gcc/tree-vect-stmts.c'
3951--- old/gcc/tree-vect-stmts.c 2011-04-18 07:38:11 +0000
3952+++ new/gcc/tree-vect-stmts.c 2011-06-02 12:12:00 +0000
3953@@ -42,6 +42,82 @@
3954 #include "langhooks.h"
3955
3956
3957+/* Return a variable of type ELEM_TYPE[NELEMS]. */
3958+
3959+static tree
3960+create_vector_array (tree elem_type, unsigned HOST_WIDE_INT nelems)
3961+{
3962+ return create_tmp_var (build_array_type_nelts (elem_type, nelems),
3963+ "vect_array");
3964+}
3965+
3966+/* ARRAY is an array of vectors created by create_vector_array.
3967+ Return an SSA_NAME for the vector in index N. The reference
3968+ is part of the vectorization of STMT and the vector is associated
3969+ with scalar destination SCALAR_DEST. */
3970+
3971+static tree
3972+read_vector_array (gimple stmt, gimple_stmt_iterator *gsi, tree scalar_dest,
3973+ tree array, unsigned HOST_WIDE_INT n)
3974+{
3975+ tree vect_type, vect, vect_name, array_ref;
3976+ gimple new_stmt;
3977+
3978+ gcc_assert (TREE_CODE (TREE_TYPE (array)) == ARRAY_TYPE);
3979+ vect_type = TREE_TYPE (TREE_TYPE (array));
3980+ vect = vect_create_destination_var (scalar_dest, vect_type);
3981+ array_ref = build4 (ARRAY_REF, vect_type, array,
3982+ build_int_cst (size_type_node, n),
3983+ NULL_TREE, NULL_TREE);
3984+
3985+ new_stmt = gimple_build_assign (vect, array_ref);
3986+ vect_name = make_ssa_name (vect, new_stmt);
3987+ gimple_assign_set_lhs (new_stmt, vect_name);
3988+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
3989+ mark_symbols_for_renaming (new_stmt);
3990+
3991+ return vect_name;
3992+}
3993+
3994+/* ARRAY is an array of vectors created by create_vector_array.
3995+ Emit code to store SSA_NAME VECT in index N of the array.
3996+ The store is part of the vectorization of STMT. */
3997+
3998+static void
3999+write_vector_array (gimple stmt, gimple_stmt_iterator *gsi, tree vect,
4000+ tree array, unsigned HOST_WIDE_INT n)
4001+{
4002+ tree array_ref;
4003+ gimple new_stmt;
4004+
4005+ array_ref = build4 (ARRAY_REF, TREE_TYPE (vect), array,
4006+ build_int_cst (size_type_node, n),
4007+ NULL_TREE, NULL_TREE);
4008+
4009+ new_stmt = gimple_build_assign (array_ref, vect);
4010+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
4011+ mark_symbols_for_renaming (new_stmt);
4012+}
4013+
4014+/* PTR is a pointer to an array of type TYPE. Return a representation
4015+ of *PTR. The memory reference replaces those in FIRST_DR
4016+ (and its group). */
4017+
4018+static tree
4019+create_array_ref (tree type, tree ptr, struct data_reference *first_dr)
4020+{
4021+ struct ptr_info_def *pi;
4022+ tree mem_ref, alias_ptr_type;
4023+
4024+ alias_ptr_type = reference_alias_ptr_type (DR_REF (first_dr));
4025+ mem_ref = build2 (MEM_REF, type, ptr, build_int_cst (alias_ptr_type, 0));
4026+ /* Arrays have the same alignment as their type. */
4027+ pi = get_ptr_info (ptr);
4028+ pi->align = TYPE_ALIGN_UNIT (type);
4029+ pi->misalign = 0;
4030+ return mem_ref;
4031+}
4032+
4033 /* Utility functions used by vect_mark_stmts_to_be_vectorized. */
4034
4035 /* Function vect_mark_relevant.
4036@@ -648,7 +724,8 @@
4037
4038 void
4039 vect_model_store_cost (stmt_vec_info stmt_info, int ncopies,
4040- enum vect_def_type dt, slp_tree slp_node)
4041+ bool store_lanes_p, enum vect_def_type dt,
4042+ slp_tree slp_node)
4043 {
4044 int group_size;
4045 unsigned int inside_cost = 0, outside_cost = 0;
4046@@ -685,9 +762,11 @@
4047 first_dr = STMT_VINFO_DATA_REF (stmt_info);
4048 }
4049
4050- /* Is this an access in a group of stores, which provide strided access?
4051- If so, add in the cost of the permutes. */
4052- if (group_size > 1)
4053+ /* We assume that the cost of a single store-lanes instruction is
4054+ equivalent to the cost of GROUP_SIZE separate stores. If a strided
4055+ access is instead being provided by a permute-and-store operation,
4056+ include the cost of the permutes. */
4057+ if (!store_lanes_p && group_size > 1)
4058 {
4059 /* Uses a high and low interleave operation for each needed permute. */
4060 inside_cost = ncopies * exact_log2(group_size) * group_size
4061@@ -763,8 +842,8 @@
4062 access scheme chosen. */
4063
4064 void
4065-vect_model_load_cost (stmt_vec_info stmt_info, int ncopies, slp_tree slp_node)
4066-
4067+vect_model_load_cost (stmt_vec_info stmt_info, int ncopies, bool load_lanes_p,
4068+ slp_tree slp_node)
4069 {
4070 int group_size;
4071 gimple first_stmt;
4072@@ -789,9 +868,11 @@
4073 first_dr = dr;
4074 }
4075
4076- /* Is this an access in a group of loads providing strided access?
4077- If so, add in the cost of the permutes. */
4078- if (group_size > 1)
4079+ /* We assume that the cost of a single load-lanes instruction is
4080+ equivalent to the cost of GROUP_SIZE separate loads. If a strided
4081+ access is instead being provided by a load-and-permute operation,
4082+ include the cost of the permutes. */
4083+ if (!load_lanes_p && group_size > 1)
4084 {
4085 /* Uses an even and odd extract operations for each needed permute. */
4086 inside_cost = ncopies * exact_log2(group_size) * group_size
4087@@ -3329,6 +3410,7 @@
4088 stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
4089 struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info), *first_dr = NULL;
4090 tree vectype = STMT_VINFO_VECTYPE (stmt_info);
4091+ tree elem_type;
4092 loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
4093 struct loop *loop = NULL;
4094 enum machine_mode vec_mode;
4095@@ -3344,6 +3426,7 @@
4096 int j;
4097 gimple next_stmt, first_stmt = NULL;
4098 bool strided_store = false;
4099+ bool store_lanes_p = false;
4100 unsigned int group_size, i;
4101 VEC(tree,heap) *dr_chain = NULL, *oprnds = NULL, *result_chain = NULL;
4102 bool inv_p;
4103@@ -3351,6 +3434,7 @@
4104 bool slp = (slp_node != NULL);
4105 unsigned int vec_num;
4106 bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
4107+ tree aggr_type;
4108
4109 if (loop_vinfo)
4110 loop = LOOP_VINFO_LOOP (loop_vinfo);
4111@@ -3404,7 +3488,8 @@
4112
4113 /* The scalar rhs type needs to be trivially convertible to the vector
4114 component type. This should always be the case. */
4115- if (!useless_type_conversion_p (TREE_TYPE (vectype), TREE_TYPE (op)))
4116+ elem_type = TREE_TYPE (vectype);
4117+ if (!useless_type_conversion_p (elem_type, TREE_TYPE (op)))
4118 {
4119 if (vect_print_dump_info (REPORT_DETAILS))
4120 fprintf (vect_dump, "??? operands of different types");
4121@@ -3431,9 +3516,14 @@
4122 {
4123 strided_store = true;
4124 first_stmt = DR_GROUP_FIRST_DR (stmt_info);
4125- if (!vect_strided_store_supported (vectype)
4126- && !PURE_SLP_STMT (stmt_info) && !slp)
4127- return false;
4128+ if (!slp && !PURE_SLP_STMT (stmt_info))
4129+ {
4130+ group_size = DR_GROUP_SIZE (vinfo_for_stmt (first_stmt));
4131+ if (vect_store_lanes_supported (vectype, group_size))
4132+ store_lanes_p = true;
4133+ else if (!vect_strided_store_supported (vectype, group_size))
4134+ return false;
4135+ }
4136
4137 if (first_stmt == stmt)
4138 {
4139@@ -3459,7 +3549,7 @@
4140 if (!vec_stmt) /* transformation not required. */
4141 {
4142 STMT_VINFO_TYPE (stmt_info) = store_vec_info_type;
4143- vect_model_store_cost (stmt_info, ncopies, dt, NULL);
4144+ vect_model_store_cost (stmt_info, ncopies, store_lanes_p, dt, NULL);
4145 return true;
4146 }
4147
4148@@ -3514,6 +3604,16 @@
4149
4150 alignment_support_scheme = vect_supportable_dr_alignment (first_dr, false);
4151 gcc_assert (alignment_support_scheme);
4152+ /* Targets with store-lane instructions must not require explicit
4153+ realignment. */
4154+ gcc_assert (!store_lanes_p
4155+ || alignment_support_scheme == dr_aligned
4156+ || alignment_support_scheme == dr_unaligned_supported);
4157+
4158+ if (store_lanes_p)
4159+ aggr_type = build_array_type_nelts (elem_type, vec_num * nunits);
4160+ else
4161+ aggr_type = vectype;
4162
4163 /* In case the vectorization factor (VF) is bigger than the number
4164 of elements that we can fit in a vectype (nunits), we have to generate
4165@@ -3602,9 +3702,9 @@
4166 /* We should have catched mismatched types earlier. */
4167 gcc_assert (useless_type_conversion_p (vectype,
4168 TREE_TYPE (vec_oprnd)));
4169- dataref_ptr = vect_create_data_ref_ptr (first_stmt, NULL, NULL_TREE,
4170- &dummy, &ptr_incr, false,
4171- &inv_p);
4172+ dataref_ptr = vect_create_data_ref_ptr (first_stmt, aggr_type, NULL,
4173+ NULL_TREE, &dummy,
4174+ &ptr_incr, false, &inv_p);
4175 gcc_assert (bb_vinfo || !inv_p);
4176 }
4177 else
4178@@ -3625,76 +3725,101 @@
4179 VEC_replace(tree, dr_chain, i, vec_oprnd);
4180 VEC_replace(tree, oprnds, i, vec_oprnd);
4181 }
4182- dataref_ptr =
4183- bump_vector_ptr (dataref_ptr, ptr_incr, gsi, stmt, NULL_TREE);
4184- }
4185-
4186- if (strided_store)
4187- {
4188- result_chain = VEC_alloc (tree, heap, group_size);
4189- /* Permute. */
4190- if (!vect_permute_store_chain (dr_chain, group_size, stmt, gsi,
4191- &result_chain))
4192- return false;
4193- }
4194-
4195- next_stmt = first_stmt;
4196- for (i = 0; i < vec_num; i++)
4197- {
4198- struct ptr_info_def *pi;
4199-
4200- if (i > 0)
4201- /* Bump the vector pointer. */
4202- dataref_ptr = bump_vector_ptr (dataref_ptr, ptr_incr, gsi, stmt,
4203- NULL_TREE);
4204-
4205- if (slp)
4206- vec_oprnd = VEC_index (tree, vec_oprnds, i);
4207- else if (strided_store)
4208- /* For strided stores vectorized defs are interleaved in
4209- vect_permute_store_chain(). */
4210- vec_oprnd = VEC_index (tree, result_chain, i);
4211-
4212- data_ref = build2 (MEM_REF, TREE_TYPE (vec_oprnd), dataref_ptr,
4213- build_int_cst (reference_alias_ptr_type
4214- (DR_REF (first_dr)), 0));
4215- pi = get_ptr_info (dataref_ptr);
4216- pi->align = TYPE_ALIGN_UNIT (vectype);
4217- if (aligned_access_p (first_dr))
4218- pi->misalign = 0;
4219- else if (DR_MISALIGNMENT (first_dr) == -1)
4220- {
4221- TREE_TYPE (data_ref)
4222- = build_aligned_type (TREE_TYPE (data_ref),
4223- TYPE_ALIGN (TREE_TYPE (vectype)));
4224- pi->align = TYPE_ALIGN_UNIT (TREE_TYPE (vectype));
4225- pi->misalign = 0;
4226- }
4227- else
4228- {
4229- TREE_TYPE (data_ref)
4230- = build_aligned_type (TREE_TYPE (data_ref),
4231- TYPE_ALIGN (TREE_TYPE (vectype)));
4232- pi->misalign = DR_MISALIGNMENT (first_dr);
4233- }
4234-
4235- /* Arguments are ready. Create the new vector stmt. */
4236- new_stmt = gimple_build_assign (data_ref, vec_oprnd);
4237+ dataref_ptr = bump_vector_ptr (dataref_ptr, ptr_incr, gsi, stmt,
4238+ TYPE_SIZE_UNIT (aggr_type));
4239+ }
4240+
4241+ if (store_lanes_p)
4242+ {
4243+ tree vec_array;
4244+
4245+ /* Combine all the vectors into an array. */
4246+ vec_array = create_vector_array (vectype, vec_num);
4247+ for (i = 0; i < vec_num; i++)
4248+ {
4249+ vec_oprnd = VEC_index (tree, dr_chain, i);
4250+ write_vector_array (stmt, gsi, vec_oprnd, vec_array, i);
4251+ }
4252+
4253+ /* Emit:
4254+ MEM_REF[...all elements...] = STORE_LANES (VEC_ARRAY). */
4255+ data_ref = create_array_ref (aggr_type, dataref_ptr, first_dr);
4256+ new_stmt = gimple_build_call_internal (IFN_STORE_LANES, 1, vec_array);
4257+ gimple_call_set_lhs (new_stmt, data_ref);
4258 vect_finish_stmt_generation (stmt, new_stmt, gsi);
4259 mark_symbols_for_renaming (new_stmt);
4260-
4261- if (slp)
4262- continue;
4263-
4264- if (j == 0)
4265- STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
4266+ }
4267+ else
4268+ {
4269+ new_stmt = NULL;
4270+ if (strided_store)
4271+ {
4272+ result_chain = VEC_alloc (tree, heap, group_size);
4273+ /* Permute. */
4274+ vect_permute_store_chain (dr_chain, group_size, stmt, gsi,
4275+ &result_chain);
4276+ }
4277+
4278+ next_stmt = first_stmt;
4279+ for (i = 0; i < vec_num; i++)
4280+ {
4281+ struct ptr_info_def *pi;
4282+
4283+ if (i > 0)
4284+ /* Bump the vector pointer. */
4285+ dataref_ptr = bump_vector_ptr (dataref_ptr, ptr_incr, gsi,
4286+ stmt, NULL_TREE);
4287+
4288+ if (slp)
4289+ vec_oprnd = VEC_index (tree, vec_oprnds, i);
4290+ else if (strided_store)
4291+ /* For strided stores vectorized defs are interleaved in
4292+ vect_permute_store_chain(). */
4293+ vec_oprnd = VEC_index (tree, result_chain, i);
4294+
4295+ data_ref = build2 (MEM_REF, TREE_TYPE (vec_oprnd), dataref_ptr,
4296+ build_int_cst (reference_alias_ptr_type
4297+ (DR_REF (first_dr)), 0));
4298+ pi = get_ptr_info (dataref_ptr);
4299+ pi->align = TYPE_ALIGN_UNIT (vectype);
4300+ if (aligned_access_p (first_dr))
4301+ pi->misalign = 0;
4302+ else if (DR_MISALIGNMENT (first_dr) == -1)
4303+ {
4304+ TREE_TYPE (data_ref)
4305+ = build_aligned_type (TREE_TYPE (data_ref),
4306+ TYPE_ALIGN (elem_type));
4307+ pi->align = TYPE_ALIGN_UNIT (elem_type);
4308+ pi->misalign = 0;
4309+ }
4310+ else
4311+ {
4312+ TREE_TYPE (data_ref)
4313+ = build_aligned_type (TREE_TYPE (data_ref),
4314+ TYPE_ALIGN (elem_type));
4315+ pi->misalign = DR_MISALIGNMENT (first_dr);
4316+ }
4317+
4318+ /* Arguments are ready. Create the new vector stmt. */
4319+ new_stmt = gimple_build_assign (data_ref, vec_oprnd);
4320+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
4321+ mark_symbols_for_renaming (new_stmt);
4322+
4323+ if (slp)
4324+ continue;
4325+
4326+ next_stmt = DR_GROUP_NEXT_DR (vinfo_for_stmt (next_stmt));
4327+ if (!next_stmt)
4328+ break;
4329+ }
4330+ }
4331+ if (!slp)
4332+ {
4333+ if (j == 0)
4334+ STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
4335 else
4336 STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
4337-
4338 prev_stmt_info = vinfo_for_stmt (new_stmt);
4339- next_stmt = DR_GROUP_NEXT_DR (vinfo_for_stmt (next_stmt));
4340- if (!next_stmt)
4341- break;
4342 }
4343 }
4344
4345@@ -3805,6 +3930,7 @@
4346 bool nested_in_vect_loop = false;
4347 struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info), *first_dr;
4348 tree vectype = STMT_VINFO_VECTYPE (stmt_info);
4349+ tree elem_type;
4350 tree new_temp;
4351 enum machine_mode mode;
4352 gimple new_stmt = NULL;
4353@@ -3821,6 +3947,7 @@
4354 gimple phi = NULL;
4355 VEC(tree,heap) *dr_chain = NULL;
4356 bool strided_load = false;
4357+ bool load_lanes_p = false;
4358 gimple first_stmt;
4359 tree scalar_type;
4360 bool inv_p;
4361@@ -3833,6 +3960,7 @@
4362 enum tree_code code;
4363 bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
4364 int vf;
4365+ tree aggr_type;
4366
4367 if (loop_vinfo)
4368 {
4369@@ -3909,7 +4037,8 @@
4370
4371 /* The vector component type needs to be trivially convertible to the
4372 scalar lhs. This should always be the case. */
4373- if (!useless_type_conversion_p (TREE_TYPE (scalar_dest), TREE_TYPE (vectype)))
4374+ elem_type = TREE_TYPE (vectype);
4375+ if (!useless_type_conversion_p (TREE_TYPE (scalar_dest), elem_type))
4376 {
4377 if (vect_print_dump_info (REPORT_DETAILS))
4378 fprintf (vect_dump, "??? operands of different types");
4379@@ -3923,10 +4052,15 @@
4380 /* FORNOW */
4381 gcc_assert (! nested_in_vect_loop);
4382
4383- /* Check if interleaving is supported. */
4384- if (!vect_strided_load_supported (vectype)
4385- && !PURE_SLP_STMT (stmt_info) && !slp)
4386- return false;
4387+ first_stmt = DR_GROUP_FIRST_DR (stmt_info);
4388+ if (!slp && !PURE_SLP_STMT (stmt_info))
4389+ {
4390+ group_size = DR_GROUP_SIZE (vinfo_for_stmt (first_stmt));
4391+ if (vect_load_lanes_supported (vectype, group_size))
4392+ load_lanes_p = true;
4393+ else if (!vect_strided_load_supported (vectype, group_size))
4394+ return false;
4395+ }
4396 }
4397
4398 if (negative)
4399@@ -3951,12 +4085,12 @@
4400 if (!vec_stmt) /* transformation not required. */
4401 {
4402 STMT_VINFO_TYPE (stmt_info) = load_vec_info_type;
4403- vect_model_load_cost (stmt_info, ncopies, NULL);
4404+ vect_model_load_cost (stmt_info, ncopies, load_lanes_p, NULL);
4405 return true;
4406 }
4407
4408 if (vect_print_dump_info (REPORT_DETAILS))
4409- fprintf (vect_dump, "transform load.");
4410+ fprintf (vect_dump, "transform load. ncopies = %d", ncopies);
4411
4412 /** Transform. **/
4413
4414@@ -3982,8 +4116,6 @@
4415 }
4416 else
4417 vec_num = group_size;
4418-
4419- dr_chain = VEC_alloc (tree, heap, vec_num);
4420 }
4421 else
4422 {
4423@@ -3994,6 +4126,11 @@
4424
4425 alignment_support_scheme = vect_supportable_dr_alignment (first_dr, false);
4426 gcc_assert (alignment_support_scheme);
4427+ /* Targets with load-lane instructions must not require explicit
4428+ realignment. */
4429+ gcc_assert (!load_lanes_p
4430+ || alignment_support_scheme == dr_aligned
4431+ || alignment_support_scheme == dr_unaligned_supported);
4432
4433 /* In case the vectorization factor (VF) is bigger than the number
4434 of elements that we can fit in a vectype (nunits), we have to generate
4435@@ -4125,208 +4262,252 @@
4436 if (negative)
4437 offset = size_int (-TYPE_VECTOR_SUBPARTS (vectype) + 1);
4438
4439+ if (load_lanes_p)
4440+ aggr_type = build_array_type_nelts (elem_type, vec_num * nunits);
4441+ else
4442+ aggr_type = vectype;
4443+
4444 prev_stmt_info = NULL;
4445 for (j = 0; j < ncopies; j++)
4446 {
4447 /* 1. Create the vector pointer update chain. */
4448 if (j == 0)
4449- dataref_ptr = vect_create_data_ref_ptr (first_stmt,
4450+ dataref_ptr = vect_create_data_ref_ptr (first_stmt, aggr_type,
4451 at_loop, offset,
4452 &dummy, &ptr_incr, false,
4453 &inv_p);
4454 else
4455- dataref_ptr =
4456- bump_vector_ptr (dataref_ptr, ptr_incr, gsi, stmt, NULL_TREE);
4457-
4458- for (i = 0; i < vec_num; i++)
4459+ dataref_ptr = bump_vector_ptr (dataref_ptr, ptr_incr, gsi, stmt,
4460+ TYPE_SIZE_UNIT (aggr_type));
4461+
4462+ if (strided_load || slp_perm)
4463+ dr_chain = VEC_alloc (tree, heap, vec_num);
4464+
4465+ if (load_lanes_p)
4466 {
4467- if (i > 0)
4468- dataref_ptr = bump_vector_ptr (dataref_ptr, ptr_incr, gsi, stmt,
4469- NULL_TREE);
4470-
4471- /* 2. Create the vector-load in the loop. */
4472- switch (alignment_support_scheme)
4473- {
4474- case dr_aligned:
4475- case dr_unaligned_supported:
4476- {
4477- struct ptr_info_def *pi;
4478- data_ref
4479- = build2 (MEM_REF, vectype, dataref_ptr,
4480- build_int_cst (reference_alias_ptr_type
4481- (DR_REF (first_dr)), 0));
4482- pi = get_ptr_info (dataref_ptr);
4483- pi->align = TYPE_ALIGN_UNIT (vectype);
4484- if (alignment_support_scheme == dr_aligned)
4485- {
4486- gcc_assert (aligned_access_p (first_dr));
4487- pi->misalign = 0;
4488- }
4489- else if (DR_MISALIGNMENT (first_dr) == -1)
4490- {
4491- TREE_TYPE (data_ref)
4492- = build_aligned_type (TREE_TYPE (data_ref),
4493- TYPE_ALIGN (TREE_TYPE (vectype)));
4494- pi->align = TYPE_ALIGN_UNIT (TREE_TYPE (vectype));
4495- pi->misalign = 0;
4496- }
4497- else
4498- {
4499- TREE_TYPE (data_ref)
4500- = build_aligned_type (TREE_TYPE (data_ref),
4501- TYPE_ALIGN (TREE_TYPE (vectype)));
4502- pi->misalign = DR_MISALIGNMENT (first_dr);
4503- }
4504- break;
4505- }
4506- case dr_explicit_realign:
4507- {
4508- tree ptr, bump;
4509- tree vs_minus_1 = size_int (TYPE_VECTOR_SUBPARTS (vectype) - 1);
4510-
4511- if (compute_in_loop)
4512- msq = vect_setup_realignment (first_stmt, gsi,
4513- &realignment_token,
4514- dr_explicit_realign,
4515- dataref_ptr, NULL);
4516-
4517- new_stmt = gimple_build_assign_with_ops
4518- (BIT_AND_EXPR, NULL_TREE, dataref_ptr,
4519- build_int_cst
4520- (TREE_TYPE (dataref_ptr),
4521- -(HOST_WIDE_INT)TYPE_ALIGN_UNIT (vectype)));
4522- ptr = make_ssa_name (SSA_NAME_VAR (dataref_ptr), new_stmt);
4523- gimple_assign_set_lhs (new_stmt, ptr);
4524- vect_finish_stmt_generation (stmt, new_stmt, gsi);
4525- data_ref
4526- = build2 (MEM_REF, vectype, ptr,
4527- build_int_cst (reference_alias_ptr_type
4528- (DR_REF (first_dr)), 0));
4529- vec_dest = vect_create_destination_var (scalar_dest, vectype);
4530- new_stmt = gimple_build_assign (vec_dest, data_ref);
4531- new_temp = make_ssa_name (vec_dest, new_stmt);
4532- gimple_assign_set_lhs (new_stmt, new_temp);
4533- gimple_set_vdef (new_stmt, gimple_vdef (stmt));
4534- gimple_set_vuse (new_stmt, gimple_vuse (stmt));
4535- vect_finish_stmt_generation (stmt, new_stmt, gsi);
4536- msq = new_temp;
4537-
4538- bump = size_binop (MULT_EXPR, vs_minus_1,
4539- TYPE_SIZE_UNIT (scalar_type));
4540- ptr = bump_vector_ptr (dataref_ptr, NULL, gsi, stmt, bump);
4541- new_stmt = gimple_build_assign_with_ops
4542- (BIT_AND_EXPR, NULL_TREE, ptr,
4543- build_int_cst
4544- (TREE_TYPE (ptr),
4545- -(HOST_WIDE_INT)TYPE_ALIGN_UNIT (vectype)));
4546- ptr = make_ssa_name (SSA_NAME_VAR (dataref_ptr), new_stmt);
4547- gimple_assign_set_lhs (new_stmt, ptr);
4548- vect_finish_stmt_generation (stmt, new_stmt, gsi);
4549- data_ref
4550- = build2 (MEM_REF, vectype, ptr,
4551- build_int_cst (reference_alias_ptr_type
4552- (DR_REF (first_dr)), 0));
4553- break;
4554- }
4555- case dr_explicit_realign_optimized:
4556- new_stmt = gimple_build_assign_with_ops
4557- (BIT_AND_EXPR, NULL_TREE, dataref_ptr,
4558- build_int_cst
4559- (TREE_TYPE (dataref_ptr),
4560- -(HOST_WIDE_INT)TYPE_ALIGN_UNIT (vectype)));
4561- new_temp = make_ssa_name (SSA_NAME_VAR (dataref_ptr), new_stmt);
4562- gimple_assign_set_lhs (new_stmt, new_temp);
4563- vect_finish_stmt_generation (stmt, new_stmt, gsi);
4564- data_ref
4565- = build2 (MEM_REF, vectype, new_temp,
4566- build_int_cst (reference_alias_ptr_type
4567- (DR_REF (first_dr)), 0));
4568- break;
4569- default:
4570- gcc_unreachable ();
4571- }
4572- vec_dest = vect_create_destination_var (scalar_dest, vectype);
4573- new_stmt = gimple_build_assign (vec_dest, data_ref);
4574- new_temp = make_ssa_name (vec_dest, new_stmt);
4575- gimple_assign_set_lhs (new_stmt, new_temp);
4576+ tree vec_array;
4577+
4578+ vec_array = create_vector_array (vectype, vec_num);
4579+
4580+ /* Emit:
4581+ VEC_ARRAY = LOAD_LANES (MEM_REF[...all elements...]). */
4582+ data_ref = create_array_ref (aggr_type, dataref_ptr, first_dr);
4583+ new_stmt = gimple_build_call_internal (IFN_LOAD_LANES, 1, data_ref);
4584+ gimple_call_set_lhs (new_stmt, vec_array);
4585 vect_finish_stmt_generation (stmt, new_stmt, gsi);
4586 mark_symbols_for_renaming (new_stmt);
4587
4588- /* 3. Handle explicit realignment if necessary/supported. Create in
4589- loop: vec_dest = realign_load (msq, lsq, realignment_token) */
4590- if (alignment_support_scheme == dr_explicit_realign_optimized
4591- || alignment_support_scheme == dr_explicit_realign)
4592- {
4593- tree tmp;
4594-
4595- lsq = gimple_assign_lhs (new_stmt);
4596- if (!realignment_token)
4597- realignment_token = dataref_ptr;
4598+ /* Extract each vector into an SSA_NAME. */
4599+ for (i = 0; i < vec_num; i++)
4600+ {
4601+ new_temp = read_vector_array (stmt, gsi, scalar_dest,
4602+ vec_array, i);
4603+ VEC_quick_push (tree, dr_chain, new_temp);
4604+ }
4605+
4606+ /* Record the mapping between SSA_NAMEs and statements. */
4607+ vect_record_strided_load_vectors (stmt, dr_chain);
4608+ }
4609+ else
4610+ {
4611+ for (i = 0; i < vec_num; i++)
4612+ {
4613+ if (i > 0)
4614+ dataref_ptr = bump_vector_ptr (dataref_ptr, ptr_incr, gsi,
4615+ stmt, NULL_TREE);
4616+
4617+ /* 2. Create the vector-load in the loop. */
4618+ switch (alignment_support_scheme)
4619+ {
4620+ case dr_aligned:
4621+ case dr_unaligned_supported:
4622+ {
4623+ struct ptr_info_def *pi;
4624+ data_ref
4625+ = build2 (MEM_REF, vectype, dataref_ptr,
4626+ build_int_cst (reference_alias_ptr_type
4627+ (DR_REF (first_dr)), 0));
4628+ pi = get_ptr_info (dataref_ptr);
4629+ pi->align = TYPE_ALIGN_UNIT (vectype);
4630+ if (alignment_support_scheme == dr_aligned)
4631+ {
4632+ gcc_assert (aligned_access_p (first_dr));
4633+ pi->misalign = 0;
4634+ }
4635+ else if (DR_MISALIGNMENT (first_dr) == -1)
4636+ {
4637+ TREE_TYPE (data_ref)
4638+ = build_aligned_type (TREE_TYPE (data_ref),
4639+ TYPE_ALIGN (elem_type));
4640+ pi->align = TYPE_ALIGN_UNIT (elem_type);
4641+ pi->misalign = 0;
4642+ }
4643+ else
4644+ {
4645+ TREE_TYPE (data_ref)
4646+ = build_aligned_type (TREE_TYPE (data_ref),
4647+ TYPE_ALIGN (elem_type));
4648+ pi->misalign = DR_MISALIGNMENT (first_dr);
4649+ }
4650+ break;
4651+ }
4652+ case dr_explicit_realign:
4653+ {
4654+ tree ptr, bump;
4655+ tree vs_minus_1
4656+ = size_int (TYPE_VECTOR_SUBPARTS (vectype) - 1);
4657+
4658+ if (compute_in_loop)
4659+ msq = vect_setup_realignment (first_stmt, gsi,
4660+ &realignment_token,
4661+ dr_explicit_realign,
4662+ dataref_ptr, NULL);
4663+
4664+ new_stmt = gimple_build_assign_with_ops
4665+ (BIT_AND_EXPR, NULL_TREE, dataref_ptr,
4666+ build_int_cst
4667+ (TREE_TYPE (dataref_ptr),
4668+ -(HOST_WIDE_INT)
4669+ TYPE_ALIGN_UNIT (vectype)));
4670+ ptr = make_ssa_name (SSA_NAME_VAR (dataref_ptr), new_stmt);
4671+ gimple_assign_set_lhs (new_stmt, ptr);
4672+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
4673+ data_ref
4674+ = build2 (MEM_REF, vectype, ptr,
4675+ build_int_cst (reference_alias_ptr_type
4676+ (DR_REF (first_dr)), 0));
4677+ vec_dest = vect_create_destination_var (scalar_dest,
4678+ vectype);
4679+ new_stmt = gimple_build_assign (vec_dest, data_ref);
4680+ new_temp = make_ssa_name (vec_dest, new_stmt);
4681+ gimple_assign_set_lhs (new_stmt, new_temp);
4682+ gimple_set_vdef (new_stmt, gimple_vdef (stmt));
4683+ gimple_set_vuse (new_stmt, gimple_vuse (stmt));
4684+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
4685+ msq = new_temp;
4686+
4687+ bump = size_binop (MULT_EXPR, vs_minus_1,
4688+ TYPE_SIZE_UNIT (scalar_type));
4689+ ptr = bump_vector_ptr (dataref_ptr, NULL, gsi, stmt, bump);
4690+ new_stmt = gimple_build_assign_with_ops
4691+ (BIT_AND_EXPR, NULL_TREE, ptr,
4692+ build_int_cst
4693+ (TREE_TYPE (ptr),
4694+ -(HOST_WIDE_INT)
4695+ TYPE_ALIGN_UNIT (vectype)));
4696+ ptr = make_ssa_name (SSA_NAME_VAR (dataref_ptr), new_stmt);
4697+ gimple_assign_set_lhs (new_stmt, ptr);
4698+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
4699+ data_ref
4700+ = build2 (MEM_REF, vectype, ptr,
4701+ build_int_cst (reference_alias_ptr_type
4702+ (DR_REF (first_dr)), 0));
4703+ break;
4704+ }
4705+ case dr_explicit_realign_optimized:
4706+ new_stmt = gimple_build_assign_with_ops
4707+ (BIT_AND_EXPR, NULL_TREE, dataref_ptr,
4708+ build_int_cst
4709+ (TREE_TYPE (dataref_ptr),
4710+ -(HOST_WIDE_INT)TYPE_ALIGN_UNIT (vectype)));
4711+ new_temp = make_ssa_name (SSA_NAME_VAR (dataref_ptr),
4712+ new_stmt);
4713+ gimple_assign_set_lhs (new_stmt, new_temp);
4714+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
4715+ data_ref
4716+ = build2 (MEM_REF, vectype, new_temp,
4717+ build_int_cst (reference_alias_ptr_type
4718+ (DR_REF (first_dr)), 0));
4719+ break;
4720+ default:
4721+ gcc_unreachable ();
4722+ }
4723 vec_dest = vect_create_destination_var (scalar_dest, vectype);
4724- tmp = build3 (REALIGN_LOAD_EXPR, vectype, msq, lsq,
4725- realignment_token);
4726- new_stmt = gimple_build_assign (vec_dest, tmp);
4727+ new_stmt = gimple_build_assign (vec_dest, data_ref);
4728 new_temp = make_ssa_name (vec_dest, new_stmt);
4729 gimple_assign_set_lhs (new_stmt, new_temp);
4730 vect_finish_stmt_generation (stmt, new_stmt, gsi);
4731-
4732- if (alignment_support_scheme == dr_explicit_realign_optimized)
4733- {
4734- gcc_assert (phi);
4735- if (i == vec_num - 1 && j == ncopies - 1)
4736- add_phi_arg (phi, lsq, loop_latch_edge (containing_loop),
4737- UNKNOWN_LOCATION);
4738- msq = lsq;
4739- }
4740- }
4741-
4742- /* 4. Handle invariant-load. */
4743- if (inv_p && !bb_vinfo)
4744- {
4745- gcc_assert (!strided_load);
4746- gcc_assert (nested_in_vect_loop_p (loop, stmt));
4747- if (j == 0)
4748- {
4749- int k;
4750- tree t = NULL_TREE;
4751- tree vec_inv, bitpos, bitsize = TYPE_SIZE (scalar_type);
4752-
4753- /* CHECKME: bitpos depends on endianess? */
4754- bitpos = bitsize_zero_node;
4755- vec_inv = build3 (BIT_FIELD_REF, scalar_type, new_temp,
4756- bitsize, bitpos);
4757- vec_dest =
4758- vect_create_destination_var (scalar_dest, NULL_TREE);
4759- new_stmt = gimple_build_assign (vec_dest, vec_inv);
4760- new_temp = make_ssa_name (vec_dest, new_stmt);
4761+ mark_symbols_for_renaming (new_stmt);
4762+
4763+ /* 3. Handle explicit realignment if necessary/supported.
4764+ Create in loop:
4765+ vec_dest = realign_load (msq, lsq, realignment_token) */
4766+ if (alignment_support_scheme == dr_explicit_realign_optimized
4767+ || alignment_support_scheme == dr_explicit_realign)
4768+ {
4769+ tree tmp;
4770+
4771+ lsq = gimple_assign_lhs (new_stmt);
4772+ if (!realignment_token)
4773+ realignment_token = dataref_ptr;
4774+ vec_dest = vect_create_destination_var (scalar_dest, vectype);
4775+ tmp = build3 (REALIGN_LOAD_EXPR, vectype, msq, lsq,
4776+ realignment_token);
4777+ new_stmt = gimple_build_assign (vec_dest, tmp);
4778+ new_temp = make_ssa_name (vec_dest, new_stmt);
4779 gimple_assign_set_lhs (new_stmt, new_temp);
4780 vect_finish_stmt_generation (stmt, new_stmt, gsi);
4781
4782- for (k = nunits - 1; k >= 0; --k)
4783- t = tree_cons (NULL_TREE, new_temp, t);
4784- /* FIXME: use build_constructor directly. */
4785- vec_inv = build_constructor_from_list (vectype, t);
4786- new_temp = vect_init_vector (stmt, vec_inv, vectype, gsi);
4787+ if (alignment_support_scheme == dr_explicit_realign_optimized)
4788+ {
4789+ gcc_assert (phi);
4790+ if (i == vec_num - 1 && j == ncopies - 1)
4791+ add_phi_arg (phi, lsq,
4792+ loop_latch_edge (containing_loop),
4793+ UNKNOWN_LOCATION);
4794+ msq = lsq;
4795+ }
4796+ }
4797+
4798+ /* 4. Handle invariant-load. */
4799+ if (inv_p && !bb_vinfo)
4800+ {
4801+ gcc_assert (!strided_load);
4802+ gcc_assert (nested_in_vect_loop_p (loop, stmt));
4803+ if (j == 0)
4804+ {
4805+ int k;
4806+ tree t = NULL_TREE;
4807+ tree vec_inv, bitpos, bitsize = TYPE_SIZE (scalar_type);
4808+
4809+ /* CHECKME: bitpos depends on endianess? */
4810+ bitpos = bitsize_zero_node;
4811+ vec_inv = build3 (BIT_FIELD_REF, scalar_type, new_temp,
4812+ bitsize, bitpos);
4813+ vec_dest = vect_create_destination_var (scalar_dest,
4814+ NULL_TREE);
4815+ new_stmt = gimple_build_assign (vec_dest, vec_inv);
4816+ new_temp = make_ssa_name (vec_dest, new_stmt);
4817+ gimple_assign_set_lhs (new_stmt, new_temp);
4818+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
4819+
4820+ for (k = nunits - 1; k >= 0; --k)
4821+ t = tree_cons (NULL_TREE, new_temp, t);
4822+ /* FIXME: use build_constructor directly. */
4823+ vec_inv = build_constructor_from_list (vectype, t);
4824+ new_temp = vect_init_vector (stmt, vec_inv, vectype, gsi);
4825+ new_stmt = SSA_NAME_DEF_STMT (new_temp);
4826+ }
4827+ else
4828+ gcc_unreachable (); /* FORNOW. */
4829+ }
4830+
4831+ if (negative)
4832+ {
4833+ new_temp = reverse_vec_elements (new_temp, stmt, gsi);
4834 new_stmt = SSA_NAME_DEF_STMT (new_temp);
4835 }
4836- else
4837- gcc_unreachable (); /* FORNOW. */
4838- }
4839-
4840- if (negative)
4841- {
4842- new_temp = reverse_vec_elements (new_temp, stmt, gsi);
4843- new_stmt = SSA_NAME_DEF_STMT (new_temp);
4844- }
4845-
4846- /* Collect vector loads and later create their permutation in
4847- vect_transform_strided_load (). */
4848- if (strided_load || slp_perm)
4849- VEC_quick_push (tree, dr_chain, new_temp);
4850-
4851- /* Store vector loads in the corresponding SLP_NODE. */
4852- if (slp && !slp_perm)
4853- VEC_quick_push (gimple, SLP_TREE_VEC_STMTS (slp_node), new_stmt);
4854+
4855+ /* Collect vector loads and later create their permutation in
4856+ vect_transform_strided_load (). */
4857+ if (strided_load || slp_perm)
4858+ VEC_quick_push (tree, dr_chain, new_temp);
4859+
4860+ /* Store vector loads in the corresponding SLP_NODE. */
4861+ if (slp && !slp_perm)
4862+ VEC_quick_push (gimple, SLP_TREE_VEC_STMTS (slp_node),
4863+ new_stmt);
4864+ }
4865 }
4866
4867 if (slp && !slp_perm)
4868@@ -4345,12 +4526,9 @@
4869 {
4870 if (strided_load)
4871 {
4872- if (!vect_transform_strided_load (stmt, dr_chain, group_size, gsi))
4873- return false;
4874-
4875+ if (!load_lanes_p)
4876+ vect_transform_strided_load (stmt, dr_chain, group_size, gsi);
4877 *vec_stmt = STMT_VINFO_VEC_STMT (stmt_info);
4878- VEC_free (tree, heap, dr_chain);
4879- dr_chain = VEC_alloc (tree, heap, group_size);
4880 }
4881 else
4882 {
4883@@ -4361,11 +4539,10 @@
4884 prev_stmt_info = vinfo_for_stmt (new_stmt);
4885 }
4886 }
4887+ if (dr_chain)
4888+ VEC_free (tree, heap, dr_chain);
4889 }
4890
4891- if (dr_chain)
4892- VEC_free (tree, heap, dr_chain);
4893-
4894 return true;
4895 }
4896
4897@@ -4769,27 +4946,6 @@
4898 return false;
4899 }
4900
4901- if (!PURE_SLP_STMT (stmt_info))
4902- {
4903- /* Groups of strided accesses whose size is not a power of 2 are not
4904- vectorizable yet using loop-vectorization. Therefore, if this stmt
4905- feeds non-SLP-able stmts (i.e., this stmt has to be both SLPed and
4906- loop-based vectorized), the loop cannot be vectorized. */
4907- if (STMT_VINFO_STRIDED_ACCESS (stmt_info)
4908- && exact_log2 (DR_GROUP_SIZE (vinfo_for_stmt (
4909- DR_GROUP_FIRST_DR (stmt_info)))) == -1)
4910- {
4911- if (vect_print_dump_info (REPORT_DETAILS))
4912- {
4913- fprintf (vect_dump, "not vectorized: the size of group "
4914- "of strided accesses is not a power of 2");
4915- print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
4916- }
4917-
4918- return false;
4919- }
4920- }
4921-
4922 return true;
4923 }
4924
4925
4926=== modified file 'gcc/tree-vectorizer.h'
4927--- old/gcc/tree-vectorizer.h 2010-12-23 16:25:52 +0000
4928+++ new/gcc/tree-vectorizer.h 2011-05-05 15:43:06 +0000
4929@@ -788,9 +788,9 @@
4930 extern tree vectorizable_function (gimple, tree, tree);
4931 extern void vect_model_simple_cost (stmt_vec_info, int, enum vect_def_type *,
4932 slp_tree);
4933-extern void vect_model_store_cost (stmt_vec_info, int, enum vect_def_type,
4934- slp_tree);
4935-extern void vect_model_load_cost (stmt_vec_info, int, slp_tree);
4936+extern void vect_model_store_cost (stmt_vec_info, int, bool,
4937+ enum vect_def_type, slp_tree);
4938+extern void vect_model_load_cost (stmt_vec_info, int, bool, slp_tree);
4939 extern void vect_finish_stmt_generation (gimple, gimple,
4940 gimple_stmt_iterator *);
4941 extern bool vect_mark_stmts_to_be_vectorized (loop_vec_info);
4942@@ -823,21 +823,22 @@
4943 extern bool vect_analyze_data_ref_accesses (loop_vec_info, bb_vec_info);
4944 extern bool vect_prune_runtime_alias_test_list (loop_vec_info);
4945 extern bool vect_analyze_data_refs (loop_vec_info, bb_vec_info, int *);
4946-extern tree vect_create_data_ref_ptr (gimple, struct loop *, tree, tree *,
4947- gimple *, bool, bool *);
4948+extern tree vect_create_data_ref_ptr (gimple, tree, struct loop *, tree,
4949+ tree *, gimple *, bool, bool *);
4950 extern tree bump_vector_ptr (tree, gimple, gimple_stmt_iterator *, gimple, tree);
4951 extern tree vect_create_destination_var (tree, tree);
4952-extern bool vect_strided_store_supported (tree);
4953-extern bool vect_strided_load_supported (tree);
4954-extern bool vect_permute_store_chain (VEC(tree,heap) *,unsigned int, gimple,
4955+extern bool vect_strided_store_supported (tree, unsigned HOST_WIDE_INT);
4956+extern bool vect_store_lanes_supported (tree, unsigned HOST_WIDE_INT);
4957+extern bool vect_strided_load_supported (tree, unsigned HOST_WIDE_INT);
4958+extern bool vect_load_lanes_supported (tree, unsigned HOST_WIDE_INT);
4959+extern void vect_permute_store_chain (VEC(tree,heap) *,unsigned int, gimple,
4960 gimple_stmt_iterator *, VEC(tree,heap) **);
4961 extern tree vect_setup_realignment (gimple, gimple_stmt_iterator *, tree *,
4962 enum dr_alignment_support, tree,
4963 struct loop **);
4964-extern bool vect_permute_load_chain (VEC(tree,heap) *,unsigned int, gimple,
4965- gimple_stmt_iterator *, VEC(tree,heap) **);
4966-extern bool vect_transform_strided_load (gimple, VEC(tree,heap) *, int,
4967+extern void vect_transform_strided_load (gimple, VEC(tree,heap) *, int,
4968 gimple_stmt_iterator *);
4969+extern void vect_record_strided_load_vectors (gimple, VEC(tree,heap) *);
4970 extern int vect_get_place_in_interleaving_chain (gimple, gimple);
4971 extern tree vect_get_new_vect_var (tree, enum vect_var_kind, const char *);
4972 extern tree vect_create_addr_base_for_vector_ref (gimple, gimple_seq *,
4973
4974=== modified file 'gcc/tree.c'
4975--- old/gcc/tree.c 2011-05-18 13:29:24 +0000
4976+++ new/gcc/tree.c 2011-06-02 12:12:00 +0000
4977@@ -7321,6 +7321,15 @@
4978 return build_array_type_1 (elt_type, index_type, false);
4979 }
4980
4981+/* Return a representation of ELT_TYPE[NELTS], using indices of type
4982+ sizetype. */
4983+
4984+tree
4985+build_array_type_nelts (tree elt_type, unsigned HOST_WIDE_INT nelts)
4986+{
4987+ return build_array_type (elt_type, build_index_type (size_int (nelts - 1)));
4988+}
4989+
4990 /* Recursively examines the array elements of TYPE, until a non-array
4991 element type is found. */
4992
4993
4994=== modified file 'gcc/tree.h'
4995--- old/gcc/tree.h 2011-03-11 22:38:58 +0000
4996+++ new/gcc/tree.h 2011-05-05 15:43:06 +0000
4997@@ -4192,6 +4192,7 @@
4998 extern tree build_index_type (tree);
4999 extern tree build_array_type (tree, tree);
5000 extern tree build_nonshared_array_type (tree, tree);
5001+extern tree build_array_type_nelts (tree, unsigned HOST_WIDE_INT);
5002 extern tree build_function_type (tree, tree);
5003 extern tree build_function_type_list (tree, ...);
5004 extern tree build_function_type_skip_args (tree, bitmap);
5005
5006=== modified file 'gcc/value-prof.c'
5007--- old/gcc/value-prof.c 2011-01-29 03:54:56 +0000
5008+++ new/gcc/value-prof.c 2011-05-05 15:42:22 +0000
5009@@ -1242,6 +1242,9 @@
5010 if (TREE_CODE (callee) == FUNCTION_DECL)
5011 return false;
5012
5013+ if (gimple_call_internal_p (stmt))
5014+ return false;
5015+
5016 histogram = gimple_histogram_value_of_type (cfun, stmt, HIST_TYPE_INDIR_CALL);
5017 if (!histogram)
5018 return false;
5019@@ -1630,6 +1633,7 @@
5020 tree callee;
5021
5022 if (gimple_code (stmt) != GIMPLE_CALL
5023+ || gimple_call_internal_p (stmt)
5024 || gimple_call_fndecl (stmt) != NULL_TREE)
5025 return;
5026
5027