1 2013-11-07 Thomas Schwinge <thomas@codesourcery.com>
3 * gimple.def (GIMPLE_OACC_PARALLEL): New code.
4 * doc/gimple.texi: Document it.
5 * gimple.h (gimple_build_oacc_parallel): New declaration.
6 (gimple_oacc_parallel_clauses, gimple_oacc_parallel_clauses_ptr)
7 (gimple_oacc_parallel_set_clauses, gimple_oacc_parallel_child_fn)
8 (gimple_oacc_parallel_child_fn_ptr)
9 (gimple_oacc_parallel_set_child_fn, gimple_oacc_parallel_data_arg)
10 (gimple_oacc_parallel_data_arg_ptr)
11 (gimple_oacc_parallel_set_data_arg): New inline functions.
12 (CASE_GIMPLE_OMP): Add GIMPLE_OACC_PARALLEL.
13 * gimple.c (gimple_build_oacc_parallel): New function.
14 (walk_gimple_op, walk_gimple_stmt, gimple_copy): Handle
16 * gimplify.c (is_gimple_stmt): Handle GIMPLE_OACC_PARALLEL.
17 (gimplify_oacc_parallel): New function.
18 (gimplify_expr): Handle OACC_PARALLEL.
19 * cgraphbuild.c (build_cgraph_edges): Handle GIMPLE_OACC_PARALLEL.
20 * gimple-low.c (lower_stmt): Likewise.
21 * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
22 (dump_gimple_oacc_parallel): New function.
23 * oacc-builtins.def (BUILT_IN_GOACC_PARALLEL): New macro.
24 * omp-low.c (scan_oacc_parallel, expand_oacc_parallel)
25 (lower_oacc_parallel): New functions.
26 (use_pointer_for_field, build_outer_var_ref, scan_sharing_clauses)
27 (create_omp_child_function, check_omp_nesting_restrictions)
28 (scan_omp_1_stmt, lower_rec_simd_input_clauses)
29 (lower_lastprivate_clauses, lower_reduction_clauses)
30 (lower_copyprivate_clauses, lower_send_clauses)
31 (lower_send_shared_vars, expand_omp)
32 (maybe_add_implicit_barrier_cancel, create_task_copyfn)
33 (lower_omp_1, make_gimple_omp_edges): Handle GIMPLE_OACC_PARALLEL,
35 * tree-inline.c (remap_gimple_stmt): Likewise.
36 * tree-nested.c (convert_nonlocal_reference_stmt)
37 (convert_local_reference_stmt, convert_tramp_reference_stmt)
38 (convert_gimple_call): Likewise.
40 * tree.def (OACC_PARALLEL): New code.
41 * doc/generic.texi (OpenMP): Document it.
42 * tree.h (OMP_BODY, OMP_CLAUSES): Include it.
43 (OACC_PARALLEL_BODY, OACC_PARALLEL_CLAUSES): New macros.
44 * tree-pretty-print.c (dump_generic_node): Handle OACC_PARALLEL.
46 * doc/invoke.texi (-fopenacc): Update.
48 * gimplify.c (gimplify_body): Consider flag_openacc additionally
50 * omp-low.c (execute_expand_omp, execute_lower_omp)
51 (gate_diagnose_omp_blocks): Likewise.
53 * oacc-builtins.def: New file.
54 * Makefile.in (BUILTINS_DEF): Add oacc-builtins.def.
55 * builtins.def (DEF_GOACC_BUILTIN): New macro.
56 Include "oacc-builtins.def".
58 * gcc.c (LINK_COMMAND_SPEC, GOMP_SELF_SPECS): For -fopenacc, link
59 to libgomp and its dependencies.
60 * config/arc/arc.h (LINK_COMMAND_SPEC): Likewise.
61 * config/darwin.h (LINK_COMMAND_SPEC_A): Likewise.
62 * config/i386/mingw32.h (GOMP_SELF_SPECS): Likewise.
63 * config/ia64/hpux.h (LIB_SPEC): Likewise.
64 * config/pa/pa-hpux11.h (LIB_SPEC): Likewise.
65 * config/pa/pa64-hpux.h (LIB_SPEC): Likewise.
66 * doc/invoke.texi (-fopenacc): Update.
68 * doc/invoke.texi (-fopenacc): Document it.
69 * doc/sourcebuild.texi (fopenacc): Document it.
71 Backport from trunk, r204517:
73 * config/arc/arc.h (LINK_COMMAND_SPEC): For
74 -ftree-parallelize-loops=*, link to libgomp and its dependencies.
75 * config/ia64/hpux.h (LIB_SPEC): Likewise.
76 * config/pa/pa-hpux11.h (LIB_SPEC): Likewise.
77 * config/pa/pa64-hpux.h (LIB_SPEC): Likewise.
78 * gcc.c (GOMP_SELF_SPECS): Update comment about libgomp's
81 2013-11-07 Aldy Hernandez <aldyh@redhat.com>
83 * omp-low.c (ipa_simd_modify_function_body): Avoid
84 regimplification of GIMPLE_RETURNs.
86 2013-11-06 Aldy Hernandez <aldyh@redhat.com>
88 * ipa-prop.h (sra_ipa_get_adjustment_candidate): Protoize.
89 * omp-low.c (struct modify_stmt_info): New.
90 (ipa_simd_modify_function_body_ops_1): Remove.
91 (ipa_simd_modify_stmt_ops): New.
92 (ipa_simd_modify_function_body_ops): Remove.
93 (ipa_simd_modify_function_body): Set new callback info.
94 Remove special casing. Handle all operators with walk_gimple_op.
95 * tree-sra.c (get_ssa_base_param): Add new argument. Use it.
96 (disqualify_base_of_expr): Pass new argument to
98 (sra_ipa_modify_expr): Abstract candidate search into...
99 (sra_ipa_get_adjustment_candidate): ...here.
101 2013-11-06 Aldy Hernandez <aldyh@redhat.com>
103 * omp-low.c (simd_clone_mangle): Linear step of 1 is mangled as
106 2013-11-04 Aldy Hernandez <aldyh@redhat.com>
108 * omp-low.c (ipa_simd_modify_function_body): Adjust tree operands
109 on the LHS of an assign.
110 (ipa_simd_modify_function_body_ops_1): New.
111 (ipa_simd_modify_function_body_ops): New.
113 2013-11-02 Aldy Hernandez <aldyh@redhat.com>
115 * omp-low.c (ipa_simd_modify_function_body): Handle empty returns.
117 2013-11-01 Jakub Jelinek <jakub@redhat.com>
119 * cgraph.h (enum linear_stride_type): Remove.
120 (enum simd_clone_arg_type): New.
121 (struct simd_clone_arg): Remove linear_stride, linear_stride_num
122 and uniform fields. Add arg_type and linear_step.
123 * omp-low.c (simd_clone_struct_copy): Formatting.
124 (simd_clone_struct_alloc): Likewise. Use size_t.
125 (simd_clone_clauses_extract, simd_clone_compute_base_data_type,
126 simd_clone_adjust_argument_types): Adjust for struct simd_clone_arg
128 (simd_clone_mangle): Likewise. Handle negative linear step.
130 2013-11-01 Aldy Hernandez <aldyh@redhat.com>
132 * tree-vect-stmts.c: Include cgraph.h.
133 (vectorizable_call): Allow > 3 arguments when a SIMD clone may be
135 (vectorizable_function): Use SIMD clone if available.
136 * ipa-cp.c (determine_versionability): Nodes with SIMD clones are
138 * ggc.h (ggc_alloc_cleared_simd_clone_stat): New.
139 * cgraph.h (enum linear_stride_type): New.
140 (struct simd_clone_arg): New.
141 (struct simd_clone): New.
142 (struct cgraph_node): Add simdclone and simdclone_of fields.
143 (get_simd_clone): Protoize.
144 * cgraph.c (get_simd_clone): New.
145 Add `has_simd_clones' field.
146 * ipa-cp.c (determine_versionability): Disallow functions with
148 * ipa-prop.h (ipa_sra_modify_function_body): Protoize.
149 (sra_ipa_modify_expr): Same.
150 (struct ipa_parm_adjustment): Add new_arg_prefix and new_param
151 fields. Document their use.
152 * ipa-prop.c (ipa_modify_formal_parameters): Handle creating brand
153 new parameters and minor cleanups.
154 * omp-low.c: Add new pass_omp_simd_clone support code.
155 (make_pass_omp_simd_clone): New.
156 (pass_data_omp_simd_clone): Declare.
157 (class pass_omp_simd_clone): Declare.
158 (vecsize_mangle): New.
159 (ipa_omp_simd_clone): New.
160 (simd_clone_clauses_extract): New.
161 (simd_clone_compute_base_data_type): New.
162 (simd_clone_compute_vecsize_and_simdlen): New.
163 (simd_clone_create): New.
164 (simd_clone_adjust_return_type): New.
165 (simd_clone_adjust_return_types): New.
166 (simd_clone_adjust): New.
167 (simd_clone_init_simd_arrays): New.
168 (ipa_simd_modify_function_body): New.
169 (simd_clone_mangle): New.
170 (simd_clone_struct_alloc): New.
171 (simd_clone_struct_copy): New.
172 (class argno_map): New.
173 (argno_map::argno_map(tree)): New.
174 (argno_map::~argno_map): New.
175 (argno_map::operator []): New.
176 (argno_map::length): New.
177 (expand_simd_clones): New.
178 (create_tmp_simd_array): New.
179 * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): New.
180 * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document.
181 * tree-pass.h (make_pass_omp_simd_clone): New.
182 * passes.def (pass_omp_simd_clone): New.
183 * target.def: Define new hook prefix "TARGET_CILKPLUS_".
184 (default_vecsize_mangle): New.
185 (vecsize_for_mangle): New.
186 * doc/tm.texi.in: Add placeholder for
187 TARGET_CILKPLUS_DEFAULT_VECSIZE_MANGLE and
188 TARGET_CILKPLUS_VECSIZE_FOR_MANGLE.
189 * tree-sra.c (sra_ipa_modify_expr): Remove static modifier.
190 (ipa_sra_modify_function_body): Same.
191 * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define.
192 * doc/tm.texi: Regenerate.
193 * config/i386/i386.c (ix86_cilkplus_default_vecsize_mangle): New.
194 (ix86_cilkplus_vecsize_for_mangle): New.
195 (TARGET_CILKPLUS_DEFAULT_VECSIZE_MANGLE): New.
196 (TARGET_CILKPLUS_VECSIZE_FOR_MANGLE): New.
198 2013-10-10 Jakub Jelinek <jakub@redhat.com>
200 * tree.c (omp_remove_redundant_declare_simd_attrs): Adjust
201 for the clauses being stored into TREE_VALUE of an extra TREE_LIST
202 pointed out by TREE_VALUE of the attribute.
204 2013-10-04 Jakub Jelinek <jakub@redhat.com>
206 * omp-low.c (expand_omp_target): When handling IF clause on
207 #pragma omp target, split new_bb rather than entry_bb. If
208 not GF_OMP_TARGET_KIND_REGION, split new_bb right before
209 the GOMP_TARGET stmt, rather than after labels.
211 2013-09-26 Jakub Jelinek <jakub@redhat.com>
213 * omp-low.c (expand_task_call): If there are depend clauses,
214 pass bit 8 in 7th argument and pass pointer to depend array
216 (lower_depend_clauses): New function.
217 (lower_omp_taskreg): Handle depend clauses.
218 * omp-builtins.def (BUILT_IN_GOMP_TASK): Use
219 BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR
220 instead of BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT.
222 (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT): Remove.
223 (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR): New.
225 2013-09-25 Jakub Jelinek <jakub@redhat.com>
227 * omp-low.c (lower_omp_sections, lower_omp_for, lower_omp_taskreg):
228 Emit ctx->cancel_label before destructors.
230 * gimple-pretty-print.c (dump_gimple_omp_block,
231 pp_gimple_stmt_1): Handle GIMPLE_OMP_TASKGROUP.
232 * tree-nested.c (convert_nonlocal_reference_stmt,
233 convert_local_reference_stmt, convert_gimple_call): Likewise.
234 * tree-cfg.c (make_edges): Likewise.
235 * gimple.h (gimple_build_omp_taskgroup): New prototype.
236 (gimple_has_substatement): Handle GIMPLE_OMP_TASKGROUP.
237 (CASE_GIMPLE_OMP): Likewise.
238 * gimplify.c (is_gimple_stmt, gimplify_expr): Handle OMP_TASKGROUP.
239 * omp-low.c (check_omp_nesting_restrictions): Warn if #pragma omp
240 cancel is used in nowait loop or sections construct.
241 (scan_omp_1_stmt, expand_omp_synch, expand_omp, lower_omp_1): Handle
242 GIMPLE_OMP_TASKGROUP.
243 (diagnose_sb_1, diagnose_sb_2): Likewise. Handle GIMPLE_OMP_TARGET
244 and GIMPLE_OMP_TEAMS.
245 (lower_omp_taskgroup): New function.
246 * tree-inline.c (remap_gimple_stmt, estimate_num_insns): Handle
247 GIMPLE_OMP_TASKGROUP.
248 * gimple-low.c (lower_stmt): Likewise.
249 * tree.h (OMP_TASKGROUP_BODY): Define.
250 * tree.def (OMP_TASKGROUP): New tree.
251 * tree-pretty-print.c (dump_generic_node): Handle OMP_TASKGROUP.
252 * gimple.c (gimple_build_omp_taskgroup): New function.
253 (walk_gimple_stmt, gimple_copy): Handle GIMPLE_OMP_TASKGROUP.
254 * gimple.def (GIMPLE_OMP_TASKGROUP): New GIMPLE code.
256 2013-09-19 Jakub Jelinek <jakub@redhat.com>
258 * omp-builtins.def (BUILT_IN_GOMP_TARGET_DATA,
259 BUILT_IN_GOMP_TARGET_UPDATE): Use BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR
260 rather than BT_FN_VOID_INT_SIZE_PTR_PTR_PTR.
261 * builtin-types.def (BT_FN_VOID_INT_SIZE_PTR_PTR_PTR): Remove.
262 (BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR): New.
263 * omp-low.c (expand_omp_target): Remove fnname argument from
264 GOMP_target, add openmp_target argument to GOMP_target,
265 GOMP_target_data and GOMP_target_update calls.
267 2013-09-18 Jakub Jelinek <jakub@redhat.com>
269 * tree.h (OMP_CLAUSE_REDUCTION_OMP_ORIG_REF): Define.
270 * tree-core.h (OMP_CLAUSE_REDUCTION_OMP_ORIG_REF): Document.
271 * omp-low.c (lower_rec_simd_input_clauses): Don't set DECL_VALUE_EXPR
272 on new_var if it is not a DECL_P.
273 (lower_rec_input_clauses): Don't force max_vf = 1
274 if OMP_CLAUSE_REDUCTION_PLACEHOLDER. Add barrier also if any
275 OMP_CLAUSE_REDUCTION_OMP_ORIG_REF is seen. For OMP_CLAUSE_PRIVATE
276 in simd, fix last argument to omp_clause_default_ctor langhook.
277 Handle OMP_CLAUSE_REDUCTION_PLACEHOLDER in simd loops, if
278 OMP_CLAUSE_REDUCTION_GIMPLE_INIT is NULL, emit omp_clause_default_ctor
279 if any and emit omp_clause_dtor if any. Handle C++ references in
280 OMP_CLAUSE_REDUCTION clauses.
281 (lower_reduction_clauses): Adjust comment for UDRs. Handle
282 C++ references in OMP_CLAUSE_REDUCTION clauses.
283 (lower_omp_taskreg): Emit reduction merges before destructors.
284 * tree-pretty-print.c (dump_omp_clause): Don't emit any reduction
285 operator name if OMP_CLAUSE_REDUCTION_CODE is ERROR_MARK.
286 * gimplify.c (omp_add_variable): Ignore GOVD_LOCAL decls for which
287 privatize_by_reference returns true.
289 * tree-core.h (OMP_CLAUSE_DEPEND_KIND, OMP_CLAUSE_MAP_KIND,
290 OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION, OMP_CLAUSE_PROC_BIND_KIND):
292 * tree.h (OMP_CLAUSE_DEPEND_KIND, OMP_CLAUSE_MAP_KIND,
293 OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION, OMP_CLAUSE_PROC_BIND_KIND):
296 2013-09-16 Jakub Jelinek <jakub@redhat.com>
298 * omp-low.c (install_var_field): Use (mask & 4) to request double
300 (scan_sharing_clauses): For OMP_CLAUSE_MAP_POINTER arrays pass
301 7 instead of 3 to install_var_field.
302 (lower_omp_target): For OMP_CLAUSE_MAP_POINTER arrays add extra
305 2013-09-06 Jakub Jelinek <jakub@redhat.com>
307 * omp-low.c (scan_sharing_clauses): Handle VLAs in
308 OMP_CLAUSE_{MAP,TO,FROM}. Set DECL_ALIGN (field) before
309 calling insert_field_into_struct.
310 (scan_omp_target): Reverse TYPE_FIELDS, verify that
311 all field alignments are the same.
312 (lower_omp_target): Use maybe_lookup_field instead of
313 lookup_sfield to check if field is present. Handle VLAs.
314 * tree-pretty-print.c (dump_omp_clause): Only check
315 OMP_CLAUSE_MAP_KIND on OMP_CLAUSE_MAP clauses.
316 * gimplify.c (enum gimplify_omp_var_data): Add GOVD_MAP_TO_ONLY.
317 (omp_firstprivatize_variable, omp_add_variable,
318 gimplify_adjust_omp_clauses_1, gimplify_adjust_omp_clauses): Handle
319 VLAs in OMP_CLAUSE_{MAP,TO,FROM}.
321 2013-09-05 Jakub Jelinek <jakub@redhat.com>
323 * gimplify.c (gimplify_call_expr): Don't call fold_stmt
324 inside of #pragma omp target construct.
325 (gimplify_modify_expr): Likewise.
326 * omp-low.c (target_nesting_level): New variable.
327 (lower_omp_target): Increase/restore target_nesting_level
328 around lowering #pragma omp target body. Use TYPE_SIZE_UNIT
329 instead of TYPE_SIZE if OMP_CLAUSE_SIZE is missing.
330 Or log2 of needed alignment into high 5 bits of kind.
331 (lower_omp): Call fold_stmt on all stmts inside of
332 #pragma omp target construct.
334 * tree-cfg.c (make_edges): For GIMPLE_OMP_TARGET
335 with GF_OMP_TARGET_KIND_UPDATE, don't look for
336 GIMPLE_OMP_RETURN and immediately restore previous
338 * langhooks.c (lhd_omp_mappable_type): New function.
339 * omp-low.c (scan_sharing_clauses): Ignore OMP_CLAUSE_SHARED
340 in GIMPLE_OMP_TEAMS constructs. Handle OMP_CLAUSE_NUM_TEAMS,
341 OMP_CLAUSE_THREAD_LIMIT, OMP_CLAUSE_DEVICE, OMP_CLAUSE_MAP,
342 OMP_CLAUSE_TO and OMP_CLAUSE_FROM.
343 (create_omp_child_function): If current function has
344 "omp declare target" attribute or if current region
345 is OMP_TARGET or lexically nested in it, add that
346 attribute to the omp child function.
347 (scan_omp_target, scan_omp_teams): New functions.
348 (check_omp_nesting_restrictions): Fix a typo in TEAMS nesting
350 (scan_omp_1_stmt): Handle GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
351 (lower_rec_input_clauses): Ignore OMP_CLAUSE_SHARED
352 in GIMPLE_OMP_TEAMS constructs.
353 (expand_omp_synch): Handle GIMPLE_OMP_TEAMS.
354 (expand_omp_target): New function.
355 (expand_omp): Handle GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
356 (build_omp_regions_1): For GIMPLE_OMP_TARGET with
357 GF_OMP_TARGET_KIND_UPDATE, don't look for GIMPLE_OMP_RETURN and
358 immediately restore previous region.
359 (lower_omp_single): Emit a CLOBBER stmt after GIMPLE_OMP_RETURN.
360 (lower_omp_taskreg): Likewise.
361 (lower_omp_target, lower_omp_teams): New functions.
362 (lower_omp_1): Handle GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
363 * tree.h (enum omp_clause_map_kind): Improve description of
364 OMP_CLAUSE_MAP_POINTER.
365 (OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION): Define.
366 * gimple.def (GIMPLE_OMP_TARGET): Use GSS_OMP_PARALLEL instead
368 * langhooks.h (struct lang_hooks_for_types): Add
369 omp_mappable_type hook.
370 * langhooks-def.h (lhd_omp_mappable_type): New prototype.
371 (LANG_HOOKS_OMP_MAPPABLE_TYPE): Define.
372 (LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it.
373 * gimple.h (gimple_omp_target_clauses, gimple_omp_target_clauses_ptr,
374 gimple_omp_target_set_clauses): Use gimple_omp_parallel
375 instead of gimple_omp_single.
376 (gimple_omp_target_child_fn, gimple_omp_target_child_fn_ptr,
377 gimple_omp_target_set_child_fn, gimple_omp_target_data_arg,
378 gimple_omp_target_data_arg_ptr, gimple_omp_target_set_data_arg): New
380 * omp-builtins.def (BUILT_IN_GOMP_TARGET, BUILT_IN_GOMP_TARGET_DATA,
381 BUILT_IN_GOMP_TARGET_END_DATA, BUILT_IN_GOMP_TARGET_UPDATE,
382 BUILT_IN_GOMP_TEAMS): New builtins.
383 * gimple-pretty-print.c (dump_gimple_omp_target): Print child_fn
384 for #pragma omp target.
385 * gimplify.c (omp_notice_variable): Diagnose if implicitly mapped
386 decl doesn't have mappable type.
387 (gimplify_scan_omp_clauses): For OMP_CLAUSE_MAP don't clear
389 (gimplify_adjust_omp_clauses_1): Add OMP_CLAUSE_MAP even if the same
390 decl is already referenced in target data construct surrounding it.
391 (gimplify_adjust_omp_clauses): Likewise. Handle
392 OMP_CLAUSE_THREAD_LIMIT.
393 (gimplify_omp_workshare): Fix up gimplification of target or target
394 data construct body. For target data add GOMP_target_end_data
395 call in a try/finally cleanup.
396 * builtin-types.def (BT_FN_VOID_UINT_UINT,
397 BT_FN_VOID_INT_SIZE_PTR_PTR_PTR,
398 BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR): New.
400 2013-07-14 Jakub Jelinek <jakub@redhat.com>
402 * tree.h (omp_declare_simd_clauses_equal): Remove prototype.
403 (omp_remove_redundant_declare_simd_attrs): New prototype.
404 * tree.c (omp_declare_simd_clauses_equal): Make static.
405 (omp_remove_redundant_declare_simd_attrs): New function.
407 2013-07-09 Jakub Jelinek <jakub@redhat.com>
409 * gimple-pretty-print.c (dump_gimple_omp_return): Print
410 gimple_omp_return_lhs if non-NULL.
411 * tree-ssa-alias.c (ref_maybe_used_by_call_p_1,
412 call_may_clobber_ref_p_1): Handle BUILT_IN_GOMP_BARRIER_CANCEL,
413 BUILT_IN_GOMP_LOOP_END_CANCEL, BUILT_IN_GOMP_SECTIONS_END_CANCEL.
414 * gimple.h (gimple_omp_return_set_lhs, gimple_omp_return_lhs,
415 gimple_omp_return_lhs_ptr): New inlines.
416 * gimple.def (GIMPLE_OMP_RETURN): Use GSS_OMP_ATOMIC_STORE
418 * gimple.c (walk_gimple_op) <case GIMPLE_OMP_RETURN>: Walk lhs.
419 * builtin-types.def (BT_FN_BOOL_INT, BT_FN_BOOL_INT_BOOL): New.
420 * omp-builtins.def (BUILT_IN_GOMP_CANCELLATION_POINT): Use
421 ATTR_NOTHROW_LEAF_LIST instead of ATTR_NULL. Return type is now
423 (BUILT_IN_GOMP_CANCEL): Likewise. Add second argument with bool type.
424 (BUILT_IN_BARRIER_CANCEL, BUILT_IN_GOMP_LOOP_END_CANCEL,
425 BUILT_IN_GOMP_SECTIONS_END_CANCEL): New builtins.
426 * omp-low.c (struct omp_context): Add cancel_label and cancellable
428 (extract_omp_for_data): Set have_nowait even for simd implicitly.
429 (check_omp_nesting_restrictions): Verify nesting restrictions for
430 #pragma omp cancel and #pragma omp cancellation point.
431 Set ctx->cancellable for regions that can be cancelled or also
432 for any task region that contains #pragma omp cancellation point.
433 (scan_omp_1_stmt): Check nesting restrictions even if ctx == NULL.
434 (build_omp_barrier): Return gimple instead of tree, add lhs argument,
435 if non-NULL, build GOMP_barrier_cancel builtin instead and set its
437 (lower_rec_input_clauses): Adjust build_omp_barrier caller.
438 (expand_omp_for_static_nochunk, expand_omp_for_static_chunk,
439 expand_omp_single): Likewise. If OMP_RETURN has lhs, pass it to
441 (expand_omp_for_generic): If OMP_RETURN has lhs, use
442 GOMP_loop_end_cancel libcall instead of GOMP_loop_end and set its
443 lhs from OMP_RETURN's lhs.
444 (expand_omp_sections): If OMP_RETURN has lhs, use
445 GOMP_sections_end_cancel libcall instead of GOMP_sections_end and set
446 its lhs from OMP_RETURN's lhs.
447 (maybe_add_implicit_barrier_cancel): New function.
448 (lower_omp_sections): If ctx->cancellable, emit cancel_label before
449 OMP_RETURN. Call maybe_add_implicit_barrier_cancel.
450 (lower_omp_for): Likewise.
451 (lower_omp_single): Call maybe_add_implicit_barrier_cancel.
452 (lower_omp_taskreg): If ctx->cancellable, emit cancel_label before
454 (lower_omp_1): If ctx->cancellable, create ctx->cancel_label.
455 Adjust GOMP_barrier libcalls to GOMP_barrier_cancel plus conditional
456 branch in cancellable regions, adjust GOMP_cancel and
457 GOMP_cancellation_point in cancellable regions or remove
458 GOMP_cancellation_point in non-cancellable regions.
460 2013-07-03 Jakub Jelinek <jakub@redhat.com>
462 * omp-low.c (expand_omp_single): Don't force barrier for
465 2013-06-28 Jakub Jelinek <jakub@redhat.com>
466 Aldy Hernandez <aldyh@redhat.com>
468 * internal-fn.def (GOMP_SIMD_LANE, GOMP_SIMD_VF,
469 GOMP_SIMD_LAST_LANE): New internal functions.
470 * omp-low.c (omp_max_vf, lower_rec_simd_input_clauses): New
472 (lower_rec_input_clauses): Add fd argument. Enforce max_vf = 1
473 if any data sharing clauses mention VLAs or for array reductions.
474 Handle OMP_CLAUSE__LOOPTEMP_ clause. For
475 OMP_CLAUSE_{{FIRST,LAST,}PRIVATE,LINEAR,REDUCTION} on SIMD
476 constructs use "omp simd array" temporaries. For OMP_CLAUSE_LINEAR
477 adjust initial value in combined constructs. Don't emit any
478 barriers for #pragma omp distribute. If max_vf is lower than
479 current safelen, prepend an OMP_CLAUSE_SAFELEN clause.
480 (lower_lastprivate_clauses): Handle "omp simd array" temporaries.
481 (lower_reduction_clauses): Exit early for #pragma omp simd.
482 (expand_omp_simd): Set loop->simduid from OMP_CLAUSE__SIMDUID_
483 and cfun->has_simduid_loops if set.
484 If OMP_CLAUSE_SAFELEN (1) is present, don't set loop->safelen
485 nor loop->force_vect.
486 (lower_omp_sections, lower_omp_single, lower_omp_taskreg): Adjust
487 lower_rec_input_clauses callers.
488 (lower_omp_for_lastprivate): Unshare vinit.
489 (lower_omp_for): Add OMP_CLAUSE__LOOPTEMP_ clauses before calling
490 lower_rec_input_clauses. Adjust lower_rec_input_clauses caller.
491 Always call lower_omp_for_lastprivate at the same place, even for
493 * tree.h (enum clause_code): Add OMP_CLAUSE__SIMDUID_.
494 (OMP_CLAUSE__SIMDUID__DECL): Define.
495 * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h.
496 (simduid_to_vf, decl_to_simduid): New classes.
497 (simduid_to_vf::hash, simduid_to_vf::equal, decl_to_simduid::hash,
498 decl_to_simduid::equal): New methods.
499 (note_simd_array_uses_struct): New struct.
500 (adjust_simduid_builtins, note_simd_array_uses_cb,
501 note_simd_array_uses): New functions.
502 (vectorize_loops): Adjust "omp simd array" temporary array sizes
503 and fold GOMP_SIMD_{LANE,VF,LAST_LANE} builtins.
504 * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p
506 (STMT_VINFO_SIMD_LANE_ACCESS_P): Define.
507 * tree-data-ref.c (get_references_in_stmt): Allow GOMP_SIMD_LANE
508 builtins in their own loops.
509 * tree-inline.c (copy_cfg_body): Propagate has_force_vect_loops
510 and has_simduid_loops.
511 * function.h (struct function): Add has_simduid_loops field.
512 * tree-ssa-ccp.c (likely_value): For GOMP_SIMD_{LANE,LAST_LANE,VF}
513 builtins ignore the undefined magic argument.
514 * tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE__SIMDUID_
516 * cfgloop.h (struct loop): Add simduid field.
517 * Makefile.in (tree-vectorizer.o): Depend on $(HASH_TABLE_H)
518 and tree-ssa-propagate.h.
519 * tree-vect-data-refs.c (vect_analyze_data_refs): Check for SIMD
521 * gimplify.c (omp_add_variable): Handle combination of aligned
522 clause and some data sharing clause for the same decl.
523 (gimplify_omp_for): For collapse (2) and above simd loops
524 predetermine loop iteration vars as lastprivate instead of
526 * tree.c (omp_clause_num_ops, omp_clause_code_name): Add
527 entries for OMP_CLAUSE__SIMDUID_.
528 (walk_tree_1): Handle OMP_CLAUSE__SIMDUID_.
529 * tree-vect-loop.c (vectorizable_live_operation): Handle live
530 GOMP_SIMD_LANE result.
531 * tree-vect-stmts.c (vectorizable_call): Vectorize GOMP_SIMD_LANE
533 (vectorizable_store, vectorizable_load): Handle
534 STMT_VINFO_SIMD_LANE_ACCESS_P.
535 * internal-fn.c (expand_GOMP_SIMD_LANE, expand_GOMP_SIMD_VF,
536 expand_GOMP_SIMD_LAST_LANE): New functions.
538 2013-06-21 Jakub Jelinek <jakub@redhat.com>
540 * gimple.h (enum gf_mask): Adjust GF_OMP_FOR_COMBINED
541 value representation, add GF_OMP_FOR_COMBINED_INTO.
542 (gimple_omp_for_combined_into_p,
543 gimple_omp_for_set_combined_into_p): New inlines.
544 * gimplify.c (enum omp_region_type): Remove outdated
546 (struct gimplify_omp_ctx): Add combined_loop field.
547 (gimplify_omp_for): Call gimple_omp_for_set_combined_into_p
548 for inner for/simd constructs combined with an outer
549 loop construct (for or distribute).
550 * tree.c (omp_clause_num_ops): Add OMP_CLAUSE__LOOPTEMP_
552 (omp_clause_code_name): Likewise.
553 (walk_tree_1): Handle OMP_CLAUSE__LOOPTEMP_.
554 * tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE__LOOPTEMP_.
555 * tree.h (enum omp_clause_code): Add OMP_CLAUSE__LOOPTEMP_.
556 (OMP_CLAUSE_DECL): Allow also on OMP_CLAUSE__LOOPTEMP_.
557 * omp-low.c (extract_omp_for_data): Rename non_ws to simd. Don't set
558 fd->chunk_size for non-chunk OMP_CLAUSE_SCHEDULE_STATIC, unless
559 fd->have_ordered. For OMP_CLAUSE_SCHEDULE_STATIC non-ordered loops
560 compute fd->iter_type the same as for simd.
561 (get_ws_args_for): Add par_stmt argument, if
562 gimple_omp_for_combined_into_p, use first two _looptemp_ clauses
563 temporaries instead of fd->loop.n{1,2}.
564 (determine_parallel_type): Adjust caller.
565 (scan_sharing_clauses): Handle OMP_CLAUSE__LOOPTEMP_.
566 (find_combined_for): New function.
567 (scan_omp_parallel): If gimple_omp_parallel_combined_p and
568 it is combined with gimple_omp_for_combined_into_p OMP_FOR,
569 add OMP_CLAUSE__LOOPTEMP_ clauses to the parallel.
570 (check_omp_nesting_restrictions): Don't insist that the only construct
571 nested in OMP_DISTRIBUTE must be OMP_PARALLEL.
572 (lower_rec_input_clauses, lower_send_clauses): Handle
573 OMP_CLAUSE__LOOPTEMP_.
574 (expand_omp_for_init_counts, expand_omp_for_init_vars,
575 extract_omp_for_update_vars): New functions.
576 (expand_omp_for_generic): Add inner_stmt argument. Use
577 expand_omp_for_{init,update}* helper functions. Handle combined loop
579 (expand_omp_for_static_nochunk, expand_omp_for_static_chunk):
580 Likewise. Handle fd->collapse > 1 and broken_loop cases.
581 (expand_omp_simd): Use expand_omp_for_init* helper functions. Handle
582 combined loop constructs.
583 (expand_omp_for): Add inner_stmt argument. Pass it through to
584 expand_omp_for_{generic,static_{,no}chunk}. Use
585 expand_omp_for_static* even for fd->collapse > 1 and/or broken_loop
586 cases, just not when fd->have_ordered.
587 (expand_omp): Adjust expand_omp_for caller.
588 (lower_omp_for): If gimple_omp_parallel_combined_p, add
589 OMP_CLAUSE__LOOPTEMP_ clauses to the GIMPLE_FOR stmt.
591 2013-06-14 Jakub Jelinek <jakub@redhat.com>
593 * gimple-pretty-print.c (dump_gimple_omp_for): Don't handle
594 GF_OMP_FOR_KIND_FOR_SIMD.
595 * gimple.h (GF_OMP_FOR_KIND_FOR_SIMD): Remove.
596 (GF_OMP_FOR_COMBINED): New.
597 (gimple_omp_for_combined_p, gimple_omp_for_set_combined_p): New
599 * gimplify.c (is_gimple_stmt): Don't handle OMP_FOR_SIMD.
600 (find_combined_omp_for): New function.
601 (gimplify_omp_for): Handle combined OMP_DISTRIBUTE and OMP_FOR
603 * Makefile.in (c-family/c-omp.o): Depend on $(C_PRAGMA_H).
604 * omp-low.c (build_outer_var_ref): Fix up simd handling.
605 (check_omp_nesting_restrictions): Don't handle
606 GF_OMP_FOR_KIND_FOR_SIMD.
607 * tree.def (OMP_FOR_SIMD): Remove.
608 * tree-pretty-print.c (dump_generic_node): Don't handle OMP_FOR_SIMD.
609 Handle NULL OMP_FOR_INIT.
611 2013-06-12 Jakub Jelinek <jakub@redhat.com>
613 * gimplify.c (gimplify_scan_omp_clauses): Handle
614 OMP_CLAUSE_THREAD_LIMIT.
615 * tree-pretty-print.c (dump_omp_clause): Likewise.
616 * tree.c (omp_clause_num_ops, omp_clause_code_name): Add entries for
617 OMP_CLAUSE_THREAD_LIMIT.
618 * tree.h (enum omp_clause_code): Add OMP_CLAUSE_THREAD_LIMIT.
619 (OMP_CLAUSE_THREAD_LIMIT_EXPR): Define.
621 2013-06-04 Jakub Jelinek <jakub@redhat.com>
623 * gimplify.c (gimplify_scan_omp_clauses): Handle array
624 sections on OMP_CLAUSE_{MAP,TO,FROM} clauses, handle
625 OMP_CLAUSE_DEPEND clause.
626 (gimplify_adjust_omp_clauses): Handle array sections on
627 OMP_CLAUSE_MAP, handle OMP_CLAUSE_DEPEND clause.
628 * tree.c (omp_clause_num_ops): OMP_CLAUSE_{MAP,TO,FROM}
629 now have 2 arguments, move OMP_CLAUSE_UNIFORM before these
631 (omp_clause_code_name): Adjust for OMP_CLAUSE_UNIFORM movement.
632 (walk_tree_1): Adjust to handle 2 arguments of
633 OMP_CLAUSE_{MAP,TO,FROM}.
634 * tree-pretty-print.c (dump_omp_clause): For OMP_CLAUSE_{MAP,TO,FROM}
635 print OMP_CLAUSE_SIZE, and for OMP_CLAUSE_MAP handle
636 OMP_CLAUSE_MAP_POINTER.
637 * tree.h (enum omp_clause_code): Move OMP_CLAUSE_UNIFORM before
638 OMP_CLAUSE_{MAP,TO,FROM}.
639 (OMP_CLAUSE_SIZE): Define.
640 (enum omp_clause_map_kind): Add OMP_CLAUSE_MAP_POINTER.
641 * omp-low.c (scan_sharing_clauses): Handle OMP_CLAUSE_DEPEND.
643 2013-05-29 Jakub Jelinek <jakub@redhat.com>
645 * omp-builtins.def (BUILT_IN_OMP_GET_TEAM_NUM,
646 BUILT_IN_OMP_GET_NUM_TEAMS): New built-ins.
647 * omp-low.c (extract_omp_for_data, expand_omp_for_static_nochunk,
648 expand_omp_for_static_chunk): Handle #pragma omp distribute.
649 (expand_omp_for): Add assertion for non-finished distribute collapse
651 (check_omp_nesting_restrictions): Allow orphaned distribute construct.
653 * omp-low.c (check_omp_nesting_restrictions): Add some
654 accelerator related nesting restrictions.
655 (scan_omp_1_stmt): Call check_omp_nesting_restrictions
656 even for GOMP_taskgroup_{start,end}.
657 * gimplify.c (omp_notice_threadprivate_variable): Fix a typo.
658 (gimplify_body): For functions with "omp declare target" attribute
659 add ORT_TARGET region around the body.
661 2013-05-27 Jakub Jelinek <jakub@redhat.com>
663 * tree.def (OMP_TEAMS, OMP_TARGET_DATA, OMP_TARGET,
664 OMP_TARGET_UPDATE): New tree codes.
665 * tree-cfg.c (make_edges): Handle GIMPLE_OMP_TARGET
666 and GIMPLE_OMP_TEAMS.
667 * omp-low.c (scan_sharing_clauses): Handle OMP_CLAUSE_DIST_SCHEDULE.
668 * gimple-low.c (lower_stmt): Handle GIMPLE_OMP_TARGET
669 and GIMPLE_OMP_TEAMS.
670 * tree.h (OMP_TEAMS_BODY, OMP_TEAMS_CLAUSES, OMP_TARGET_DATA_BODY,
671 OMP_TARGET_DATA_CLAUSES, OMP_TARGET_BODY, OMP_TARGET_CLAUSES,
672 OMP_TARGET_UPDATE_CLAUSES): Define.
673 * tree-nested.c (convert_nonlocal_reference_stmt,
674 convert_local_reference_stmt, convert_gimple_call): Handle
675 GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
676 * tree-inline.c (estimate_num_insns): Likewise.
677 (remap_gimple_stmt): Likewise. Adjust gimple_build_omp_for
679 * gimple.def: Adjust comments describing OMP_CLAUSEs.
680 (GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS): New GIMPLE stmts.
681 * tree-parloops.c (create_parallel_loop): Adjust gimple_build_omp_for
683 * tree-pretty-print.c (dump_generic_node): Handle OMP_TEAMS,
684 OMP_TARGET, OMP_TARGET_DATA and OMP_TARGET_UPDATE.
685 * gimple.h (GF_OMP_TARGET_KIND_MASK, GF_OMP_TARGET_KIND_REGION,
686 GF_OMP_TARGET_KIND_DATA, GF_OMP_TARGET_KIND_UPDATE): New.
687 (gimple_build_omp_for): Add kind argument to prototype.
688 (gimple_build_omp_target, gimple_build_omp_teams): New prototypes.
689 (gimple_has_substatements): Handle GIMPLE_OMP_TARGET and
691 (gimple_omp_subcode): Change GIMPLE_OMP_SINGLE to GIMPLE_OMP_TEAMS.
692 (gimple_omp_target_clauses, gimple_omp_target_clauses_ptr,
693 gimple_omp_target_set_clauses, gimple_omp_target_kind,
694 gimple_omp_target_set_kind, gimple_omp_teams_clauses,
695 gimple_omp_teams_clauses_ptr, gimple_omp_teams_set_clauses): New
697 (gimple_return_set_retval): Handle GIMPLE_OMP_TARGET and
699 * gimple.c (gimple_build_omp_for): Add kind argument, call
700 gimple_omp_for_set_kind.
701 (gimple_build_omp_target, gimple_build_omp_teams): New functions.
702 (walk_gimple_op, walk_gimple_stmt, gimple_copy): Handle
703 GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
704 * gimple-pretty-print.c (dump_gimple_omp_target,
705 dump_gimple_omp_teams): New functions.
706 (pp_gimple_stmt_1): Handle GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
707 * gimplify.c (enum gimplify_omp_var_data): Add GOVD_MAP.
708 (enum omp_region_type): Add ORT_TEAMS, ORT_TARGET and ORT_TARGET_DATA.
709 (omp_add_variable): Add temporary assertions.
710 (omp_notice_threadprivate_variable): Complain if threadprivate vars
711 appear in target region.
712 (omp_notice_variable): ORT_TARGET, ORT_TARGET_DATA and ORT_TEAMS
714 (omp_check_private): Ignore ORT_TARGET and ORT_TARGET_DATA regions.
715 (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_MAP, OMP_CLAUSE_TO,
716 OMP_CLAUSE_FROM, OMP_CLAUSE_NUM_TEAMS, OMP_CLAUSE_DIST_SCHEDULE
717 and OMP_CLAUSE_DEVICE.
718 (gimplify_adjust_omp_clauses): Likewise.
719 (gimplify_adjust_omp_clauses_1): Handle GOVD_MAP. Fix up
720 check for privatization by also testing for GOVD_LINEAR.
721 (gimplify_omp_for): Adjust gimple_build_omp_for caller.
723 (gimplify_omp_workshare): Handle also OMP_TARGET, OMP_TARGET_DATA
724 and OMP_TEAMS. Clear *expr_p.
725 (gimplify_omp_target_update): New function.
726 (gimplify_expr): Handle OMP_TARGET, OMP_TARGET_DATA, OMP_TARGET_UPDATE
729 2013-05-20 Jakub Jelinek <jakub@redhat.com>
731 * omp-low.c (expand_omp_simd): For collapse > 1 loops,
732 if some loop condition might be not true initially, add runtime
733 test and skip the whole loop.
735 2013-05-14 Jakub Jelinek <jakub@redhat.com>
737 * cfgloop.h (struct loop): Add safelen and force_vect fields.
738 * function.h (struct function): Add has_force_vect_loops field.
739 * omp-low.c (expand_omp_simd): If !broken_loop, create loop for
740 the simd region and set safelen and force_vect fields in it.
741 * tree-vectorizer.c (vectorize_loops): If loop has force_vect set,
742 vectorize it even if flag_vectorize isn't set. Clear loop->force_vect
744 * tree-ssa-loop.c (gate_tree_vectorize): Return true even
745 cfun->has_force_vect_loops.
746 * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Don't
747 unroll loops with loop->force_vect.
748 * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): For
749 unknown or bad data dependency, if loop->safelen is non-zero, just
750 decrease *max_vf to loop->safelen if needed and return false.
751 * tree-if-conv.c (main_tree_if_conversion): If-convert also loops with
753 (gate_tree_if_conversion): Return true even if
754 cfun->has_force_vect_loops.
756 2013-05-09 Jakub Jelinek <jakub@redhat.com>
758 * tree.c (omp_declare_simd_clauses_equal): New function.
759 (attribute_value_equal): Call it for -fopenmp if
760 TREE_VALUE of the attributes are both OMP_CLAUSEs.
761 * tree.h (omp_declare_simd_clauses_equal): Declare.
763 2013-04-30 Jakub Jelinek <jakub@redhat.com>
765 * gimple-pretty-print.c (dump_gimple_omp_atomic_load,
766 dump_gimple_omp_atomic_store): Handle gimple_omp_atomic_seq_cst_p.
767 * gimple.h (enum gf_mask): Add GF_OMP_ATOMIC_SEQ_CST.
768 (gimple_omp_atomic_set_seq_cst, gimple_omp_atomic_seq_cst_p): New
770 * omp-low.c (expand_omp_atomic_load, expand_omp_atomic_store,
771 expand_omp_atomic_fetch_op): If gimple_omp_atomic_seq_cst_p,
772 pass MEMMODEL_SEQ_CST instead of MEMMODEL_RELAXED to the builtin.
773 * gimplify.c (gimplify_omp_atomic): Handle OMP_ATOMIC_SEQ_CST.
774 * tree-pretty-print.c (dump_generic_node): Handle OMP_ATOMIC_SEQ_CST.
775 * tree.def (OMP_ATOMIC): Add comment that OMP_ATOMIC* must stay
777 * tree.h (OMP_ATOMIC_SEQ_CST): Define.
779 * omp-low.c (check_omp_nesting_restrictions): Diagnose
780 OpenMP constructs nested inside simd region. Don't treat
781 #pragma omp simd as work-sharing region. Disallow work-sharing
782 constructs inside of critical region. Complain if ordered
783 region is nested inside of parallel region without loop
785 (scan_omp_1_stmt): Call check_omp_nesting_restrictions even
786 for GOMP_{cancel{,lation_point},taskyield,taskwait} calls.
788 2013-04-23 Jakub Jelinek <jakub@redhat.com>
790 * Makefile.in (omp-low.o): Depend on $(TARGET_H).
791 * gimplify.c (gimplify_adjust_omp_clauses): For linear clauses
792 if outer_context is non-NULL, but not ORT_COMBINED_PARALLEL,
793 call omp_notice_variable. Remove aligned clauses that can't
795 * omp-low.c: Include target.h.
796 (scan_sharing_clauses): For aligned clauses with global arrays
797 register local replacement.
798 (omp_clause_aligned_alignment): New function.
799 (lower_rec_input_clauses): For aligned clauses for global
800 arrays or automatic pointers emit __builtin_assume_aligned
801 before the loop if possible.
802 (expand_omp_regimplify_p, expand_omp_build_assign): New functions.
803 (expand_omp_simd): Use them. Handle pointer iterators and broken
805 (lower_omp_for): Call lower_omp on gimple_omp_body_ptr after
806 calling lower_rec_input_clauses, not before it.
808 2013-04-19 Jakub Jelinek <jakub@redhat.com>
810 * tree.h (OMP_CLAUSE_LINEAR_NO_COPYIN,
811 OMP_CLAUSE_LINEAR_NO_COPYOUT): Define.
812 * omp-low.c (extract_omp_for_data): Handle #pragma omp simd.
813 (build_outer_var_ref): For #pragma omp simd allow linear etc.
814 clauses to bind even to private vars.
815 (scan_sharing_clauses): Handle OMP_CLAUSE_LINEAR, OMP_CLAUSE_ALIGNED
816 and OMP_CLAUSE_SAFELEN.
817 (lower_rec_input_clauses): Handle OMP_CLAUSE_LINEAR. Don't emit
818 a GOMP_barrier call for firstprivate/lastprivate in #pragma omp simd.
819 (lower_lastprivate_clauses): Handle also OMP_CLAUSE_LINEAR.
820 (expand_omp_simd): New function.
821 (expand_omp_for): Handle #pragma omp simd.
822 * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR and
823 GOVD_ALIGNED, add GOVD_LINEAR into GOVD_DATA_SHARE_CLASS.
824 (enum omp_region_type): Add ORT_SIMD.
825 (gimple_add_tmp_var, gimplify_var_or_parm_decl, omp_check_private,
826 omp_firstprivatize_variable, omp_notice_variable): Handle ORT_SIMD
828 (omp_is_private): Likewise. Add SIMD argument, tweak diagnostics
829 and add extra errors in simd constructs.
830 (gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses): Handle
831 OMP_CLAUSE_LINEAR, OMP_CLAUSE_ALIGNED and OMP_CLAUSE_SAFELEN.
832 (gimplify_adjust_omp_clauses_1): Handle GOVD_LASTPRIVATE and
834 (gimplify_omp_for): Handle #pragma omp simd.
836 2013-04-10 Jakub Jelinek <jakub@redhat.com>
838 * builtin-types.def (DEF_FUNCTION_TYPE_8): Document.
839 (BT_FN_VOID_OMPFN_PTR_UINT, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG,
840 BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG): Remove.
841 (BT_FN_VOID_OMPFN_PTR_UINT_UINT_UINT,
842 BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_UINT,
843 BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG_UINT): New.
844 * gimplify.c (gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses):
845 Handle OMP_CLAUSE_PROC_BIND.
846 * omp-builtins.def (BUILT_IN_GOMP_TASKGROUP_START,
847 BUILT_IN_GOMP_TASKGROUP_END, BUILT_IN_GOMP_PARALLEL_LOOP_STATIC,
848 BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC,
849 BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED,
850 BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME, BUILT_IN_GOMP_PARALLEL,
851 BUILT_IN_GOMP_PARALLEL_SECTIONS): New built-ins.
852 (BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START,
853 BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START,
854 BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START,
855 BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START,
856 BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END,
857 BUILT_IN_GOMP_PARALLEL_SECTIONS_START): Remove.
858 * omp-low.c (scan_sharing_clauses): Handle OMP_CLAUSE_PROC_BIND.
859 (expand_parallel_call): Expand #pragma omp parallel* as
860 calls to the new GOMP_parallel_* APIs without _start at the end,
861 instead of GOMP_parallel_*_start followed by fn.omp_fn.N call,
862 followed by GOMP_parallel_end. Handle OMP_CLAUSE_PROC_BIND.
863 * tree-ssa-alias.c (ref_maybe_used_by_call_p_1,
864 call_may_clobber_ref_p_1): Handle BUILT_IN_GOMP_TASKGROUP_END
865 instead of BUILT_IN_GOMP_PARALLEL_END.
867 2013-03-27 Jakub Jelinek <jakub@redhat.com>
869 * gimple-pretty-print.c (dump_gimple_omp_for): Handle different
870 GIMPLE_OMP_FOR kinds.
871 * tree.def (OMP_SIMD, OMP_FOR_SIMD, OMP_DISTRIBUTE): New tree codes.
872 * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_MASK,
873 GF_OMP_FOR_KIND_FOR, GF_OMP_FOR_KIND_SIMD, GF_OMP_FOR_KIND_FOR_SIMD
874 and GF_OMP_FOR_KIND_DISTRIBUTE.
875 (gimple_omp_for_kind, gimple_omp_for_set_kind): New inline functions.
876 * gimplify.c (is_gimple_stmt, gimplify_omp_for, gimplify_expr): Handle
877 OMP_SIMD, OMP_FOR_SIMD and OMP_DISTRIBUTE.
878 * tree.c (omp_clause_num_ops, omp_clause_code_name, walk_tree_1):
879 Handle new OpenMP 4.0 clauses.
880 * tree-pretty-print.c (dump_omp_clause): Likewise.
881 (dump_generic_node): Handle OMP_SIMD, OMP_FOR_SIMD and OMP_DISTRIBUTE.
882 * tree.h (enum omp_clause_code): Add OMP_CLAUSE_LINEAR,
883 OMP_CLAUSE_ALIGNED, OMP_CLAUSE_DEPEND, OMP_CLAUSE_FROM, OMP_CLAUSE_TO,
884 OMP_CLAUSE_UNIFORM, OMP_CLAUSE_MAP, OMP_CLAUSE_DEVICE,
885 OMP_CLAUSE_DIST_SCHEDULE, OMP_CLAUSE_INBRANCH, OMP_CLAUSE_NOTINBRANCH,
886 OMP_CLAUSE_NUM_TEAMS, OMP_CLAUSE_PROC_BIND, OMP_CLAUSE_SAFELEN,
887 OMP_CLAUSE_SIMDLEN, OMP_CLAUSE_FOR, OMP_CLAUSE_PARALLEL,
888 OMP_CLAUSE_SECTIONS and OMP_CLAUSE_TASKGROUP.
889 (OMP_LOOP_CHECK): Define.
890 (OMP_FOR_BODY, OMP_FOR_CLAUSES, OMP_FOR_INIT, OMP_FOR_COND,
891 OMP_FOR_INCR, OMP_FOR_PRE_BODY): Use OMP_LOOP_CHECK instead of
893 (OMP_CLAUSE_DECL): Extend check range up to OMP_CLAUSE_MAP.
894 (OMP_CLAUSE_LINEAR_STEP, OMP_CLAUSE_ALIGNED_ALIGNMENT,
895 OMP_CLAUSE_NUM_TEAMS_EXPR, OMP_CLAUSE_DEVICE_ID,
896 OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR, OMP_CLAUSE_SAFELEN_EXPR,
897 OMP_CLAUSE_SIMDLEN_EXPR): Define.
898 (enum omp_clause_depend_kind, enum omp_clause_map_kind,
899 enum omp_clause_proc_bind_kind): New enums.
900 (OMP_CLAUSE_DEPEND_KIND, OMP_CLAUSE_MAP_KIND,
901 OMP_CLAUSE_PROC_BIND_KIND): Define.
902 (struct tree_omp_clause): Add subcode.depend_kind, subcode.map_kind
903 and subcode.proc_bind_kind.
904 (find_omp_clause): New prototype.
905 * omp-builtins.def (BUILT_IN_GOMP_CANCEL,
906 BUILT_IN_GOMP_CANCELLATION_POINT): New built-ins.
907 * tree-flow.h (find_omp_clause): Remove prototype.
909 Copyright (C) 2013 Free Software Foundation, Inc.
911 Copying and distribution of this file, with or without modification,
912 are permitted in any medium without royalty provided the copyright
913 notice and this notice are preserved.