1 2014-11-05 Thomas Schwinge <thomas@codesourcery.com>
3 * invoke.texi: Update for OpenACC.
4 * sourcebuild.texi: Likewise.
6 * tree.def (OACC_WAIT): Remove. Update all users.
8 * omp-builtins.def (BUILT_IN_OMP_SET_NUM_THREADS): Remove.
10 2014-11-03 Cesar Philippidis <cesar@codesourcery.com>
12 * builtins.def (DEF_GOACC_BUILTIN): Revert erroneous checkin.
14 2014-11-03 Cesar Philippidis <cesar@codesourcery.com>
16 * oacc-builtins.def (BUILT_IN_GOACC_GET_NUM_THREADS): New built-in
18 (BUILT_IN_ACC_GET_DEVICE_TYPE): Likewise.
19 * omp-low.c (oacc_max_threads): New function.
20 (lower_reduction_clauses): Use the GOACC thread builtin functions to
21 determine the thread count. Handle multiple reduction variables.
22 (expand_omp_for_static_nochunk): Likewise.
23 (expand_omp_for_static_chunk): Likewise.
24 (finalize_reduction_data): General cleanups.
25 (process_reduction_data): Use acc_get_device_type to determine nthreads
28 2014-11-03 Cesar Philippidis <cesar@codesourcery.com>
30 * gimple.h (enum gf_mask): Add GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA.
31 * gimple-pretty-print.c (dump_gimple_omp_target): Handle it.
32 * gimplify.c (gimplify_scan_omp_clauses): Remove switch stmt which
33 declared OMP_CLAUSE_MAP_FORCE_DEALLOC as unimplemented.
34 (gimplify_omp_target_update): Handle OACC_ENTER_DATA and
36 (gimplify_expr): Shuffle around OACC_ENTER_DATA, OACC_EXIT_DATA and
38 * oacc-builtins.def (BUILD_INT_GOACC_ENTER_EXIT_DATA): New built-in
40 * omp-low.c (expand_omp_target): Handle
41 GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA. Don't use quick_push when
42 there is an unknown number of wait args.
43 (lower_omp_target): Handle GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA.
45 2014-10-24 James Norris <jnorris@codesourcery.com>
47 * builtin-types.def (BT_FN_VOID_INT_INT_VAR,
48 BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR_INT_INT_INT_INT_INT_VAR,
49 BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR_INT_INT_VAR): Add.
50 (BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR_INT_INT_INT): Remove.
51 * c-family/c-common.c (enum c_builtin_type, c_define_builtins): Remove
52 unused FUNCTION_TYPE_10. Add new FUNCTION_TYPE_VAR_8 and
54 * c-family/c-pragma.c (oacc_pragmas): Add entry for wait directive.
55 * c/c-parser.c (c_parser_omp_clause_name): Add handling of wait and
57 (c_parser_oacc_wait_list, c_parser_oacc_clause_async,
58 c_parser_oacc_clause_wait): New.
59 (c_parser_oacc_all_clauses): Handle async and wait clauses.
60 (OACC_KERNELS_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK,
61 OACC_UPDATE_CLAUSE_MASK): Add async and wait clauses.
62 (OACC_WAIT_CLAUSE_MASK): New.
63 (c_parser_oacc_wait): New.
64 (c_parser_omp_construct): Handle wait directive.
65 * c/c-typeck.c (c_finish_omp_clauses): Handle async and wait clauses.
66 * fortran/f95-lang.c (gfc_init_builtin_functions): Remove unused
67 FUNCTION_TYPE_10. Add new FUNCTION_TYPE_VAR_2, FUNCTION_TYPE_VAR_8,
68 and FUNCTION_TYPE_VAR_12.
69 * fortran/types.def (BT_FN_VOID_INT_INT_VAR,
70 BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR_INT_INT_INT_INT_INT_VAR,
71 BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR_INT_INT_VAR): Add.
72 (BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR_INT_INT_INT): Remove.
73 * lto/lto-lang.c (enum lto_builtin_type, lto_define_builtins): Remove
74 unsigned FUNCTION_TYPE_10. Add new FUNCTION_TYPE_VAR_8 and
76 * oacc-builtins.def (BUILT_IN_GOACC_KERNELS BUILT_IN_GOACC_PARALLEL,
77 BUILT_IN_GOACC_UPDATE, BUILT_IN_GOACC_WAIT): Change type.
78 * omp-low.c (scan_sharing_clauses): Handle async and wait clauses.
79 (expand_oacc_offload): Lower kernel directive and async and wait
82 2014-10-23 Thomas Schwinge <thomas@codesourcery.com>
84 * omp-low.c (finalize_reduction_data): Don't skip the reduction
85 variable's original value.
87 2014-10-20 Cesar Philippidis <cesar@codesourcery.com>
89 * gimplify.c (gimplify_scan_omp_clauses): Remove switch stmt which
90 declared OMP_CLAUSE_MAP_FORCE_DEALLOC as unimplemented.
91 (gimplify_expr): Remove OACC_WAIT, since it handled directly by the
94 2014-10-15 James Norris <jnorris@codesourcery.com>
96 * builtin-types.def (BT_FN_VOID_INT_PTR_INT): New type.
97 * oacc-builtins.def (BUILT_IN_GOACC_WAIT): New builtin.
99 2014-10-09 Thomas Schwinge <thomas@codesourcery.com>
101 * omp-low.c (process_reduction_data): Initialize variable inner.
103 2014-10-08 Cesar Philippidis <cesar@codesourcery.com>
105 * omp-low.c (lower_reduction_clauses): Clarify comment.
106 (process_reduction_data): Scan for nonempty bind statements at
107 the beginning of parallel blocks.
109 2014-09-23 Thomas Schwinge <thomas@codesourcery.com>
111 * builtins.def (DEF_GOACC_BUILTIN_COMPILER): New macro.
112 * oacc-builtins.def (BUILT_IN_GOACC_UPDATE): New builtin.
113 * builtins.c (expand_builtin_acc_on_device): New function.
114 (expand_builtin): Use it to handle BUILT_IN_ACC_ON_DEVICE.
115 (is_inexpensive_builtin): Handle BUILT_IN_ACC_ON_DEVICE.
117 2014-09-08 Thomas Schwinge <thomas@codesourcery.com>
119 * configure.ac (offload_targets): Remove.
120 * configure: Regenerate.
122 2014-09-05 Bernd Schmidt <bernds@codesourcery.com>
124 * configure.ac (enable-accelerator): Remove option.
125 (enable_accelerator): Don't subst.
126 * configure: Regenerate.
128 2014-09-03 Thomas Schwinge <thomas@codesourcery.com>
130 * omp-low.c (expand_oacc_offload): Add child_fn to offload_funcs.
132 2014-08-19 Ilya Verbin <ilya.verbin@intel.com>
134 * Makefile.in (GTFILES): Add omp-low.h.
135 * cgraphunit.c: Include omp-low.h.
136 (init_offload_var_table): New function.
137 (ipa_passes): Run ipa_write_summaries for target only when
138 offload_funcs or offload_vars is not empty.
139 * gengtype.c (ifiles): Add omp-low.h.
140 * lto/lto.c (read_cgraph_and_symbols): Call input_offload_tables.
141 * lto-cgraph.c: Include omp-low.h.
142 (output_offload_tables): New function.
143 (input_offload_tables): Likewise.
144 * lto-section-in.c (lto_section_name): Add offload_table.
145 * lto-streamer-out.c (lto_output): Call output_offload_tables.
146 * lto-streamer.h: Declare output_offload_tables
147 and input_offload_tables.
148 (lto_section_type): Add LTO_section_offload_table.
149 * omp-low.c: Define offload_funcs and offload_vars.
150 (expand_omp_target): Add child_fn to offload_funcs.
151 (omp_finish_file): Remove obsolete code.
152 * omp-low.h: Declare offload_funcs and offload_vars.
154 2014-08-04 Bernd Schmidt <bernds@codesourcery.com>
156 * Makefile.in (tool_prefix): Remove.
157 (unlibsubdir): Change depending on enable_as_accelerator.
158 (GCC_TARGET_INSTALL_NAME): Revert previous change.
159 (install_driver): Rework offloading changes.
160 * configure.ac (tool_prefix): Remove.
161 (enable-as-accelerator-for): Don't require --enable-as-accelerator.
162 Update the program_transform_name.
163 (offload_targets): Add 'g' modifier to sed script.
164 * configure: Regenerate.
166 2014-07-28 Cesar Philippidis <cesar@codesourcery.com>
168 * omp-low.c (get_base_type): New function.
169 (scan_sharing_clauses): Replace TREE_TYPE with get_base_type.
170 (lower_reduction_clauses): Use it.
171 (initialize_reduction_data): Likewise.
172 (finalize_reduction_data): Likewise. Remove new_var.
174 2014-07-28 Tom de Vries <tom@codesourcery.com>
176 * omp-low.c (process_reduction_data): Remove unused variables.
178 2014-07-24 Thomas Schwinge <thomas@codesourcery.com>
180 * omp-low.c (extract_omp_for_data): Force OpenACC loop to use a
183 * omp-low.c (expand_omp_for_static_chunk): Merge changes
184 previously applied to expand_omp_for_static_nochunk.
186 2014-07-14 Cesar Philippidis <cesar@codesourcery.com>
188 * omp-low.c (extract_omp_for_data): Likewise.
189 (expand_omp_for_static_nochunk): Likewise.
191 2014-07-14 Cesar Philippidis <cesar@codesourcery.com>
193 * omp-low.c (process_reduction_data): Check for new
194 binding level and skip for-loops which don't have a
197 2014-07-08 Cesar Philippidis <cesar@codesourcery.com>
198 Thomas Schwinge <thomas@codesourcery.com>
200 * omp-low.c (omp_get_id): New function.
201 (lookup_reduction): New function.
202 (maybe_lookup_reduction): New function.
203 (build_outer_var_ref): Remove openacc assert.
204 (new_omp_context): Preserve ctx->reduction_map.
205 (scan_sharing_clauses): Handle OMP_CLAUSE_REDUCTION.
206 (scan_oacc_offload): Initialize ctx->reduction_map.
207 (lower_reduction_clauses): Handle OpenACC reductions.
208 (omp_gimple_assign_with_ops): New function.
209 (initialize_reduction_data): New function.
210 (finalize_reduction_data): New function.
211 (process_reduction_data): New function.
212 (lower_oacc_offload): Handle reductions.
213 * gcc/omp-builtins.def (BUILT_IN_OMP_SET_NUM_THREADS): New.
215 2014-06-13 Thomas Schwinge <thomas@codesourcery.com>
216 Ilmir Usmanov <i.usmanov@samsung.com>
218 * tree-pretty-print.c (dump_omp_clause): Instead of
219 OMP_CLAUSE_DECL, use more specific accessors for some clauses.
221 2014-06-13 Thomas Schwinge <thomas@codesourcery.com>
222 Cesar Philippidis <cesar@codesourcery.com>
224 * omp-low.c (extract_omp_for_data, scan_sharing_clauses): For
225 OpenACC directives, the collapse(1) clause is supported.
227 2014-06-13 Cesar Philippidis <cesar@codesourcery.com>
229 * omp-low.c (scan_sharing_clauses): Preliminary support for
230 OMP_CLAUSE_PRIVATE for OpenACC.
232 * omp-low.c (scan_sharing_clauses): For clauses currently not
233 supported with OpenACC directives, emit a sorry message instead of
236 2014-06-12 Thomas Schwinge <thomas@codesourcery.com>
237 James Norris <jnorris@codesourcery.com>
239 * omp-low.c (scan_sharing_clauses): Allow OMP_CLAUSE_IF.
240 (expand_oacc_offload, expand_omp_target): Handle it.
242 2014-06-06 Thomas Schwinge <thomas@codesourcery.com>
243 James Norris <jnorris@codesourcery.com>
245 * gimple.h (enum gf_mask): Add GF_OMP_TARGET_KIND_OACC_UPDATE, and
246 extend mask size, GF_OMP_TARGET_KIND_MASK.
247 (is_gimple_omp_oacc_specifically): Handle
248 GF_OMP_TARGET_KIND_OACC_UPDATE.
249 * gimplify.c (gimplify_omp_target_update, gimplify_expr):
251 * gimple-pretty-print.c (dump_gimple_omp_target): Likewise.
252 * omp-low.c (scan_omp_target, expand_omp_target)
253 (build_omp_regions_1, lower_omp_target, lower_omp_1)
254 (make_gimple_omp_edges): Likewise.
255 * oacc-builtins.def (BUILT_IN_GOACC_UPDATE): New builtin.
257 2014-06-05 Thomas Schwinge <thomas@codesourcery.com>
259 * gimplify.c (gimplify_scan_omp_clauses)
260 (gimplify_adjust_omp_clauses): Handle
261 OMP_CLAUSE_MAP_FORCE_DEVICEPTR.
262 * omp-low.c (scan_sharing_clauses, lower_oacc_offload)
263 (lower_omp_target): Likewise.
264 * tree-core.h (enum omp_clause_map_kind)
265 <OMP_CLAUSE_MAP_FORCE_DEVICEPTR>: Update comment.
267 * gimplify.c (gimplify_scan_omp_clauses) <case OMP_CLAUSE_MAP>:
268 Don't block OMP_CLAUSE_MAP_FORCE_PRESENT.
270 2014-06-04 Thomas Schwinge <thomas@codesourcery.com>
272 * cgraphunit.c (ipa_passes, compile): Handle flag_openacc next to
274 * ipa-inline-analysis.c (inline_generate_summary): Likewise.
275 * lto-streamer.c (lto_streamer_init, gate_lto_out): Likewise.
276 * passes.c (ipa_write_summaries): Likewise.
278 2014-05-12 Bernd Schmidt <bernds@codesourcery.com>
280 * lto-wrapper.c (ompbegin): New static variable.
281 (find_ompbeginend): Renamed from find_ompend. Also look for
283 (run_gcc): Also use ompbegin.
285 2014-05-08 Thomas Schwinge <thomas@codesourcery.com>
287 * omp-low.c (get_offload_symbol_decl): Mark __OPENMP_TARGET__ as
290 2014-04-04 Bernd Schmidt <bernds@codesourcery.com>
292 * lto-wrapper.c (replace_special_characters): Remove functions and
295 * lto-section-names.h (OFFLOAD_VAR_TABLE_SECTION_NAME,
296 OFFLOAD_FUNC_TABLE_SECTION_NAME): Define.
297 * lto-wrapper.c (OFFLOAD_FUNC_TABLE_SECTION_NAME): Don't define.
298 (ompend): New static variable.
299 (copy_file, find_ompend): New static functions.
300 (run_gcc): Call find_ompend if we have offload images. Add its
301 return value to the output.
302 * omp-low.c: Include "lto-section-names.h".
303 (omp_finish_file): Initialize section names from macros defined there.
305 * omp-low.c (offload_symbol_decl): New static variable.
306 (get_offload_symbol_decl): New static function.
307 (expand_oacc_offload, expand_omp_target): Use it.
309 2014-04-02 Thomas Schwinge <thomas@codesourcery.com>
311 * omp-low.c (omp_finish_file): Use num_vars instead of num_funcs
312 when recording offload symbols v_vars.
314 * omp-low.c (expand_oacc_offload): Handle __OPENMP_TARGET__
317 2014-03-20 Bernd Schmidt <bernds@codesourcery.com>
319 Mostly by Michael Zolotukhin:
320 * lto-wrapper.c (OFFLOAD_FUNC_TABLE_SECTION_NAME,
321 OFFLOAD_TARGET_NAMES_ENV): New defines.
322 (offload_names): New static variable.
323 (free_array_of_ptrs, parse_env_var, access_check,
324 prepare_target_image, replace_special_characters,
325 compile_images_for_openmp_targets): New static functions.
326 (run_gcc): Determine whether offload sections are present. If so,
327 run compile_images_for_openmp_targets and print the image names.
329 * Makefile.in (COLLECT2_OBJS): Add collect-utils.o.
330 (LTO_WRAPPER_OBJS): New variable.
331 (lto-wrapper$(exeext)): Use it.
332 * collect2.c: Include "collect-utils.h".
333 (vflag, debug): Remove variables. Rename all uses of vflag to
335 (at_file_supplied): No longer static.
336 (tool_name): New variable.
337 (do_wait, fork_execute, maybe_unlink): Don't declare.
338 (tool_cleanup): Renamed from collect_atexit. New arg from_signal.
339 (collect_atexit): New static function.
340 (notice): Remove function.
341 (handler): Just call tool_cleanup.
342 (maybe_run_lto_and_relink, main, do_dsymutil): Add new arg to
344 (collect_wait, do_wait, collect_execute): Remove functions.
345 (maybe_unlink): No longer static.
346 * collect2.h (vflag, debug): Don't declare.
347 (at_file_supplied): Declare.
348 * collect-utils.c (utils_cleanup): New arg from_signal. All callers
350 (collect_execute): Replace with implementation from collect2, plus a
351 new arg use_atfile. All callers changed.
352 (collect_wait): Replace with implementation from collect2.
353 (maybe_unlink_file): Remove function.
354 (fork_execute): Replace with implementation from collect2, plus a
355 new arg use_atfile. All callers changed.
356 (do_wait): Add call to utils_cleanup to the error path.
357 * collect-utils.h (collect_execute, fork_execute, utils_cleanup,
358 tool_cleanup): Adjust declarations.
359 * lto-wrapper.c (tool_cleanup): Add unused bool argument.
360 * tlink.c: Include "collect-utils.h".
361 (tlink_execute): New arg use_atfile. All callers changed.
362 (tlink_init, tlink_execute): Remove declarations.
364 * Makefile.in (ALL_HOST_BACKEND_OBJS): Add collect-utils.o.
365 (lto-wrapper$(exeext)): Link with collect-utils.o.
366 * collect-utils.c: New file.
367 * collect-utils.h: New file.
368 * lto-wrapper.c: Include "collect-utils.h".
369 (args_name): Delete variable.
370 (tool_name): New variable.
371 (tool_cleanup): New function.
372 (maybe_unlink): Renamed from maybe_unlink_file. All callers changed.
373 (lto_wrapper_cleanup, fatal_signal, fatal, fatal_perror,
374 collect_execute, collect_wait, fork_execute): Remove functions.
376 Mostly by Michael Zolotukhin:
377 * omp-low.c: Include "common/common-target.h".
378 (expand_omp_target): Pass in address of __OPENMP_TARGET__.
379 (add_decls_addresses_to_decl_constructor, omp_finish_file): New
381 * omp-low.h (omp_finish_file): Declare.
382 * toplev.c: Include "omp-low.h".
383 (compile_file): Call omp_finish_file.
384 * target.def (record_offload_symbol): New hook.
385 * doc/tm.texi.in (TARGET_RECORD_OFFLOAD_SYMBOL): Add.
386 * doc/tm.texi: Regenerate.
387 * configure.ac (ENABLE_OFFLOADING): Define if we have offload_targets.
388 * configure: Regenerate.
389 * config.in: Regenerate.
391 * config/darwin.c: Include "lto-section-names.h".
392 (LTO_SEGMENT_NAME): Don't define.
393 * config/i386/winnt.c: Include "lto-section-names.h".
394 * lto-streamer.c: Include "lto-section-names.h".
395 * lto-streamer.h (LTO_SECTION_NAME_PREFIX, OMP_SECTION_NAME_PREFIX):
397 (section_name_prefix): Don't declare.
398 * lto-wrapper.c: Include "lto-section-names.h".
399 (LTO_SECTION_NAME_PREFIX): Don't define.
400 * lto-section-names.h: New file.
401 * cgraphunit.c: Include "lto-section-names.h".
403 * configure.ac (real_target_noncanonical, tool_prefix,
404 accel_dir_suffix, offload_targets): Compute new variables.
405 (--enable-as-accelerator-for, --enable-as-accelerator,
406 --enable-offload-targets): New options.
407 * configure: Regenerate.
408 * config.in: Regenerate.
409 * Makefile.in (real_target_noncanonical, tool_prefix,
410 accel_dir_suffix, enable_as_accelerator): New variables substituted
412 (libsubdir, libexecsubdir, GCC_TARGET_INSTALL_NAME): Tweak for the
413 possibility of being configured as an offload compiler.
414 (install_driver): Likewise.
415 (DRIVER_DEFINES): Pass new defines DEFAULT_REAL_TARGET_MACHINE and
417 * gcc.c (spec_host_machine, accel_dir_suffix): New variables.
418 (process_command): Tweak path construction for the possibility
419 of being configured as an offload compiler.
420 (main): Likewise. Look up specs in just_machine_suffix only if not
421 ACCEL_COMPILER. Construct OFFLOAD_TARGET_NAMES environment variable
422 if we have OFFLOAD_TARGETS.
424 2014-03-20 Thomas Schwinge <thomas@codesourcery.com>
426 * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_OACC_LOOP.
427 (is_gimple_omp_oacc_specifically): Handle it.
428 * gimple-pretty-print.c (dump_gimple_omp_for): Likewise.
429 * gimple.def (GIMPLE_OMP_FOR): Update for OpenACC loop.
430 * gimple.c (gimple_build_omp_for): Don't explicitly mention some
432 (gimple_copy) <GIMPLE_OMP_FOR>: Handle GF_OMP_FOR_KIND_OACC_LOOP.
433 * omp-low.c (extract_omp_for_data, scan_sharing_clauses)
434 (check_omp_nesting_restrictions, lower_rec_input_clauses)
435 (lower_lastprivate_clauses, lower_reduction_clauses)
436 (expand_omp_for_generic, expand_omp_for_static_nochunk)
437 (expand_omp_for_static_chunk, maybe_add_implicit_barrier_cancel)
438 (lower_omp_for): Likewise.
439 * tree-inline.c (remap_gimple_stmt): Likewise.
440 * tree-nested.c (walk_gimple_omp_for)
441 (convert_nonlocal_reference_stmt, convert_local_reference_stmt)
442 (convert_gimple_call): Likewise.
443 * doc/gimple.texi (GIMPLE_OMP_FOR): Don't explicitly mention some
445 * gimplify.c (gimplify_omp_for, gimplify_expr): Handle OACC_LOOP.
447 * tree.def (OACC_LOOP): Sort after OMP_DISTRIBUTE.
448 * tree.h (OMP_LOOP_CHECK): Update accordingly.
449 * gimplify.c (is_gimple_stmt): Sort OACC_LOOP after
451 * tree-pretty-print.c (dump_generic_node): Likewise.
452 * doc/generic.texi (OACC_LOOP): Sort after OACC_HOST_DATA.
453 (OMP_FOR): Fix and extend for OACC_LOOP.
455 * gimple.h (enum gf_mask): Add and use GF_OMP_FOR_SIMD.
456 * omp-low.c: Update accordingly.
458 * gimple.h (enum gf_mask): Rewrite "<< 0" shift expressions used
459 for GF_OMP_FOR_KIND_MASK, GF_OMP_FOR_KIND_FOR,
460 GF_OMP_FOR_KIND_DISTRIBUTE, GF_OMP_FOR_KIND_SIMD,
461 GF_OMP_FOR_KIND_CILKSIMD, GF_OMP_TARGET_KIND_MASK,
462 GF_OMP_TARGET_KIND_REGION, GF_OMP_TARGET_KIND_DATA,
463 GF_OMP_TARGET_KIND_UPDATE, GF_OMP_TARGET_KIND_OACC_DATA.
465 * omp-low.c (check_omp_nesting_restrictions): Allow nesting of
466 OpenACC constructs inside of OpenACC data constructs.
468 2014-03-18 Ilmir Usmanov <i.usmanov@samsung.com>
470 * tree.def (OACC_LOOP): New tree code.
471 * tree-pretty-print.c (dump_generic_node): Show it.
472 * tree.h (OACC_KERNELS_COMBINED, OACC_PARALLEL_COMBINED): New macros.
473 * doc/generic.texi: Document loop directive.
474 * gimplify.c (is_gimple_stmt, gimplify_expr): Stub gimplification of
475 loop directive and combined directives.
477 2014-03-18 Thomas Schwinge <thomas@codesourcery.com>
480 (BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR_INT_INT_INT): New type.
481 * oacc-builtins.def (BUILT_IN_GOACC_KERNELS)
482 (BUILT_IN_GOACC_PARALLEL): Switch to that one.
483 * gimplify.c (gimplify_scan_omp_clauses)
484 (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_NUM_GANGS,
485 OMP_CLAUSE_NUM_WORKERS, OMP_CLAUSE_VECTOR_LENGTH.
486 * omp-low.c (scan_sharing_clauses, expand_oacc_offload): Likewise.
488 2014-03-13 Thomas Schwinge <thomas@codesourcery.com>
490 * tree.h (OMP_CLAUSE_VECTOR_EXPR): Check for OMP_CLAUSE_VECTOR
491 instead of OMP_CLAUSE_VECTOR_LENGTH.
492 (OMP_WAIT_EXPR): Rename to OMP_CLAUSE_WAIT_EXPR. Change
495 2014-03-13 Thomas Schwinge <thomas@codesourcery.com>
497 * omp-low.c (create_omp_child_function): Use
498 is_gimple_omp_offloaded when looking for offloaded regions.
500 2014-03-12 Thomas Schwinge <thomas@codesourcery.com>
502 * omp-low.c (scan_sharing_clauses): Move offloaded logic into...
503 * gimple.h (is_gimple_omp_offloaded): ... this new static inline
506 2014-02-28 Thomas Schwinge <thomas@codesourcery.com>
508 * gimple.def (GIMPLE_OACC_KERNELS): New code.
509 * doc/gimple.texi: Document it.
510 * gimple.h (gimple_has_substatements, CASE_GIMPLE_OMP)
511 (is_gimple_omp_oacc_specifically): Handle it.
512 (gimple_statement_oacc_kernels): New struct.
513 (gimple_build_oacc_kernels): New prototype.
514 (gimple_oacc_kernels_clauses, gimple_oacc_kernels_clauses_ptr)
515 (gimple_oacc_kernels_set_clauses, gimple_oacc_kernels_child_fn)
516 (gimple_oacc_kernels_child_fn_ptr)
517 (gimple_oacc_kernels_set_child_fn, gimple_oacc_kernels_data_arg)
518 (gimple_oacc_kernels_data_arg_ptr)
519 (gimple_oacc_kernels_set_data_arg): New inline functions.
520 * gimple.c (gimple_build_oacc_kernels): New function.
521 (gimple_copy): Handle GIMPLE_OACC_KERNELS.
522 * gimple-low.c (lower_stmt): Likewise.
523 * gimple-walk.c (walk_gimple_op, walk_gimple_stmt): Likewise.
524 * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
525 (dump_gimple_oacc_parallel): Rename to dump_gimple_oacc_offload.
526 Also handle GIMPLE_OACC_KERNELS. Update all callers.
527 * gimplify.c (gimplify_omp_workshare, gimplify_expr): Handle
529 * oacc-builtins.def (BUILT_IN_GOACC_KERNELS): New builtin.
530 * omp-low.c (scan_oacc_parallel, expand_oacc_parallel)
531 (lower_oacc_parallel): Rename to scan_oacc_offload,
532 expand_oacc_offload, and lower_oacc_offload. Also handle
533 GIMPLE_OACC_KERNELS. Update all callers.
534 (scan_sharing_clauses, scan_omp_1_stmt, expand_omp, lower_omp_1)
535 (diagnose_sb_0, diagnose_sb_1, diagnose_sb_2)
536 (make_gimple_omp_edges): Handle GIMPLE_OACC_KERNELS.
537 * tree-inline.c (remap_gimple_stmt, estimate_num_insns): Likewise.
538 * tree-nested.c (convert_nonlocal_reference_stmt)
539 (convert_local_reference_stmt, convert_tramp_reference_stmt)
540 (convert_gimple_call): Likewise.
542 2014-02-27 Thomas Schwinge <thomas@codesourcery.com>
544 * gimplify.c (gimplify_oacc_parallel): Merge into
545 gimplify_omp_workshare. Update all callers.
547 2014-02-27 Ilmir Usmanov <i.usmanov@samsung.com>
549 Fix OpenACC ASYNC clause: it cannot contain integer-expression-list.
552 * tree.h (OMP_CLAUSE_ASYNC_EXPR): Reorder.
553 * tree.c (omp_clause_num_ops, omp_clause_code_name): Reorder clauses.
554 * tree-core.h (enum omp_clause_code): Likewise.
555 * omp-low.c (scan_sharing_clauses): Likewise.
556 * gimplify.c (gimplify_scan_omp_clauses): Likewise.
558 2014-02-21 Thomas Schwinge <thomas@codesourcery.com>
560 * gimple.h (enum gf_mask): Add GF_OMP_TARGET_KIND_OACC_DATA.
561 (is_gimple_omp_oacc_specifically): Handle it.
562 * gimple-pretty-print.c (dump_gimple_omp_target): Likewise.
563 * gimplify.c (gimplify_omp_workshare, gimplify_expr): Likewise.
564 * omp-low.c (scan_sharing_clauses, scan_omp_target)
565 (expand_omp_target, lower_omp_target, lower_omp_1): Likewise.
566 * gimple.def (GIMPLE_OMP_TARGET): Update comment.
567 * gimple.c (gimple_build_omp_target): Likewise.
568 (gimple_copy): Catch unimplemented case.
569 * tree-inline.c (remap_gimple_stmt): Likewise.
570 * tree-nested.c (convert_nonlocal_reference_stmt)
571 (convert_local_reference_stmt, convert_gimple_call): Likewise.
572 * oacc-builtins.def (BUILT_IN_GOACC_DATA_START)
573 (BUILT_IN_GOACC_DATA_END): New builtins.
575 * omp-low.c (scan_sharing_clauses): Catch unexpected occurrences
576 of OMP_CLAUSE_TO, OMP_CLAUSE_FROM, OMP_CLAUSE_MAP.
578 * gimplify.c (enum omp_region_type): Make ORT_TARGET_OFFLOAD a
579 flag for ORT_TARGET, in its negation replacing ORT_TARGET_DATA.
582 * omp-low.c (gimple_code_is_oacc): Move to...
583 * gimple.h (is_gimple_omp_oacc_specifically): ... here. Update
584 users, and also use it in more places where currently we've only
585 been checking for GIMPLE_OACC_PARALLEL.
587 2014-02-18 Thomas Schwinge <thomas@codesourcery.com>
589 * omp-low.c (diagnose_sb_0, diagnose_sb_1, diagnose_sb_2): Handle
590 GIMPLE_OACC_PARALLEL.
591 * gimplify.c (gimplify_case_label_expr): Update comment.
593 * omp-low.c (diagnose_sb_0): Generalize detection which kind of
594 structured block we're in.
596 2014-02-17 Thomas Schwinge <thomas@codesourcery.com>
598 * tree-core.h (omp_clause_code) <map>: Mention pcopy, pcopyin,
599 pcopyout, pcreate OpenACC clauses.
601 2014-02-14 Ilmir Usmanov <i.usmanov@samsung.com>
602 Dmitry Bocharnikov <dmitry.b@samsung.com>
603 Evgeny Gavrin <e.gavrin@samsung.com>
605 Add OpenACC 1.0 support to GENERIC, except loop directive and subarrays.
608 * gimplify.c (is_gimple_stmt, gimplify_scan_omp_clauses,
609 implify_adjust_omp_clauses, gimplify_expr): Stub OpenACC directives
611 * omp-low.c (scan_sharing_clauses): Likewise.
612 (gimple_code_is_oacc): New helper function.
613 (scan_sharing_clauses): Use it.
614 * tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_HOST,
615 OMP_CLAUSE_OACC_DEVICE, OMP_CLAUSE_DEVICE_RESIDENT,
616 OMP_CLAUSE_USE_DEVICE, OMP_CLAUSE_GANG, OMP_CLAUSE_WAIT,
617 OMP_NO_CLAUSE_CACHE, OMP_CLAUSE_INDEPENDENT, OMP_CLAUSE_ASYNC,
618 OMP_CLAUSE_WORKER, OMP_CLAUSE_VECTOR, OMP_CLAUSE_NUM_GANGS,
619 OMP_CLAUSE_NUM_WORKERS and OMP_CLAUSE_VECTOR_LENGTH clauses.
620 * tree-pretty-print.c (dump_omp_clause): Print OpenACC clause.
621 (dump_generic_node): Print OpenACC directives and its clauses.
622 * tree.c (omp_clause_num_ops, omp_clause_code_name,
623 walk_tree_1): Add OpenACC clauses.
624 * tree.def (OACC_KERNELS, OACC_DATA, OACC_HOST_DATA, OACC_DECLARE,
625 OACC_UPDATE, OACC_ENTER_DATA, OACC_EXIT_DATA, OACC_WAIT,
626 OACC_CACHE): New tree node.
627 * tree.h (OACC_KERNELS_BODY, OACC_KERNELS_CLAUSES,
628 OACC_CLAUSE_NUM_GANGS_EXPR, OMP_CLAUSE_NUM_WORKERS_EXPR,
629 OMP_CLAUSE_VECTOR_LENGTH_EXPR, OMP_CLAUSE_VECTOR_EXPR,
630 OMP_CLAUSE_WORKER_EXPR, OMP_CLAUSE_GANG_EXPR, OMP_CLAUSE_ASYNC_EXPR,
631 OMP_WAIT_EXPR, OACC_DATA_BODY, OACC_DATA_CLAUSES, OACC_DECLARE_CLAUSES,
632 OACC_UPDATE_CLAUSES, OACC_WAIT_CLAUSES, OACC_CACHE_CLAUSES,
633 OACC_HOST_DATA_BODY, OACC_HOST_DATA_CLAUSES): New macros.
635 * generic.texi: Document OACC_KERNELS, OACC_DATA, OACC_HOST_DATA,
636 OACC_DECLARE, OACC_UPDATE, OACC_ENTER_DATA, OACC_EXIT_DATA, OACC_WAIT,
639 2014-02-07 Ilya Tocar <ilya.tocar@intel.com>
641 * ipa-inline-analysis.c (inline_free_summary): Always remove
644 2014-01-28 Thomas Schwinge <thomas@codesourcery.com>
646 * tree-core.h (omp_clause_code): Update description for
649 * tree-core.h (omp_clause_map_kind): Add OMP_CLAUSE_MAP_FORCE,
650 OMP_CLAUSE_MAP_FORCE_ALLOC, OMP_CLAUSE_MAP_FORCE_TO,
651 OMP_CLAUSE_MAP_FORCE_FROM, OMP_CLAUSE_MAP_FORCE_TOFROM,
652 OMP_CLAUSE_MAP_FORCE_PRESENT, OMP_CLAUSE_MAP_FORCE_DEALLOC, and
653 OMP_CLAUSE_MAP_FORCE_DEVICEPTR.
654 * tree-pretty-print.c (dump_omp_clause): Handle these.
655 * gimplify.c (gimplify_omp_var_data): Add GOVD_MAP_FORCE.
656 (omp_region_type): Add ORT_TARGET_MAP_FORCE.
657 (omp_add_variable, omp_notice_threadprivate_variable)
658 (omp_notice_variable, gimplify_scan_omp_clauses)
659 (gimplify_adjust_omp_clauses_1): Extend accordingly.
660 (gimplify_oacc_parallel): Add ORT_TARGET_MAP_FORCE to ORT_TARGET
662 * omp-low.c (install_var_field, scan_sharing_clauses)
663 (lower_oacc_parallel, lower_omp_target): Extend accordingly.
665 * tree-core.h (omp_clause_map_kind): Make the identifiers' bit
666 patterns more obvious. Add comments.
667 * omp-low.c (lower_oacc_parallel, lower_omp_target): Test for
668 omp_clause_map_kind flags set instead of for values.
670 * gimplify.c (gimplify_call_expr, gimplify_modify_expr)
671 (omp_firstprivatize_variable, omp_notice_threadprivate_variable)
672 (omp_notice_variable, gimplify_adjust_omp_clauses)
673 (gimplify_omp_workshare): Treat ORT_TARGET as a flag, not as a
676 2013-12-18 Thomas Schwinge <thomas@codesourcery.com>
678 * omp-low.c (lower_oacc_parallel): Switch kinds array to unsigned
679 short, and shift alignment description to begin at bit 8.
681 2013-12-04 Thomas Schwinge <thomas@codesourcery.com>
683 * gimple.h (is_a_helper): Handle GIMPLE_OACC_PARALLEL.
685 2013-11-30 Balaji V. Iyer <balaji.v.iyer@intel.com>
687 * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen):
688 Removed a carriage return from the warning string.
690 2013-11-21 Jakub Jelinek <jakub@redhat.com>
692 * config/i386/i386.c (ix86_cilkplus_default_vecsize_mangle,
693 ix86_cilkplus_vecsize_for_mangle): Remove.
694 (ix86_simd_clone_compute_vecsize_and_simdlen,
695 ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions.
696 (TARGET_CILKPLUS_DEFAULT_VECSIZE_MANGLE,
697 TARGET_CILKPLUS_VECSIZE_FOR_MANGLE): Remove.
698 (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN,
699 TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define.
700 * omp-low.c (class argno_map): Remove.
701 (argno_map::argno_map): Remove.
702 (simd_clone_vector_of_formal_parm_types): New function.
703 (simd_clone_struct_alloc): Use struct cgraph_simd_clone
704 instead of struct simd_clone and struct cgraph_simd_clone_arg
705 instead of struct simd_clone_arg.
706 (simd_clone_struct_copy): Likewise.
707 (simd_clone_clauses_extract): Likewise. Return struct
708 cgraph_simd_clone *, don't change anything in node.
709 Use simd_clone_vector_of_formal_parm_types instead of argno_map.
710 Fail if ignoring linear step.
711 (vecsize_mangle): Remove.
712 (simd_clone_compute_base_data_type): Add clone_info argument.
713 Use simd_clone_vector_of_formal_parm_types instead of argno_map.
714 (simd_clone_compute_vecsize_and_simdlen): Remove.
715 (simd_clone_mangle): Remove new_node argument, add clone_info
716 argument, return the identifier rather than changing anything in
717 node. If mangled name doesn't already exist among simd clones,
719 (simd_clone_create): Handle !old_node->definition case, don't
720 ICE if cgraph_function_versioning fails.
721 (simd_clone_adjust_return_type): Handle simdlens larger than
722 what can be returned or passed in hw register. Handle
724 (simd_clone_adjust_argument_types): Likewise. Use
725 ipa_get_vector_of_formal_parms or
726 simd_clone_vector_of_formal_parm_types instead of argno_map.
727 (simd_clone_init_simd_arrays): Handle simdlens larger than
728 what can be passed in hw register.
729 (ipa_simd_modify_function_body): Likewise. Call walk_gimple_op
730 also on GIMPLE_RETURN.
731 (simd_clone_adjust): Call targetm.simd_clone.adjust. Create
732 PHI for the iter, rather than waiting for into ssa. Handle
733 aligned clause on uniform pointer arguments. Handle linear
735 (expand_simd_clones): Don't do anything if noclone attribute
736 is present. Ignore non-prototype C declarations. Rewritten to
737 only clone if it is possible and desirable to create the simd clone.
738 Use new target simd_clone hooks to drive the process, allow
739 creating more than two clones. Handle !node->definition cloning.
740 (ipa_omp_simd_clone): Use FOR_EACH_FUNCTION instead of
741 FOR_EACH_DEFINED_FUNCTION.
742 (pass_omp_simd_clone::gate): Return true also for flag_openmp_simd.
743 * ipa-cp.c (determine_versionability): Use simd_clones field instead
744 of has_simd_clones. Also fail if node->simdclone is non-NULL.
745 (initialize_node_lattices): Set disable = true for simd clones.
746 * cgraph.c (get_simd_clone): Remove.
747 * ipa.c (symtab_remove_unreachable_nodes): If node with simd clones
748 is kept, keep also the simd clones.
749 * ipa-prop.h (ipa_get_vector_of_formal_parm_types): New prototype.
750 * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ...
751 (ipa_get_vector_of_formal_parm_types): ... this. No longer static.
752 (ipa_modify_formal_parameters): Adjust caller.
753 * target.def (TARGET_CILKPLUS_DEFAULT_VECSIZE_MANGLE,
754 TARGET_CILKPLUS_VECSIZE_FOR_MANGLE): Remove.
755 (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN,
756 TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target
758 * tree-vect-data-refs.c (vect_analyze_data_refs): Use simd_clones
759 field instead of has_simd_clones.
760 * target.h (struct cgraph_node, struct cgraph_simd_node): Declare.
761 * doc/tm.texi.in (TARGET_CILKPLUS_DEFAULT_VECSIZE_MANGLE,
762 TARGET_CILKPLUS_VECSIZE_FOR_MANGLE): Remove.
763 (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN,
764 TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add.
765 * doc/tm.texi: Regenerated.
766 * cgraph.h (enum simd_clone_arg_type): Rename to ...
767 (enum cgraph_simd_clone_arg_type): ... this. Add
768 SIMD_CLONE_ARG_TYPE_MASK.
769 (struct simd_clone_arg): Rename to ...
770 (struct cgraph_simd_clone_arg): ... this. Add orig_type and
771 vector_type fields. Adjust arg_type field's type.
772 (struct simd_clone): Rename to ...
773 (struct cgraph_simd_clone): ... this. Remove hw_vector_size
774 field. Add vecsize_int, vecsize_float, prev_clone, next_clone
775 and origin fields. Adjust args field's type.
776 (struct cgraph_node): Adjust simdclone field's type. Remove
777 simdclone_of and has_simd_clones fields. Add simd_clones field.
778 (get_simd_clone): Remove prototype.
779 * tree-vect-stmts.c (vectorizable_simd_clone_call): Use simd_clones
780 field instead of has_simd_clones, improve walking of simd clones,
781 handle arguments and/or return types larger than corresponding
782 ISA hw vector size, use targetm.simd_clone.usable hook.
784 2013-11-21 Ilya Tocar <ilya.tocar@intel.com>
786 * cgraph.h (symtab_node): Add need_dump.
787 * cgraphunit.c (ipa_passes): Run ipa_write_summaries for omp.
788 (compile): Intialize streamer for omp.
789 * ipa-inline-analysis.c (inline_generate_summary): Add flag_openmp.
790 * lto-cgraph.c (lto_set_symtab_encoder_in_partition): Respect
792 (select_what_to_dump): New.
793 * lto-streamer.c (section_name_prefix): New.
794 (lto_get_section_name): Use section_name_prefix.
795 (lto_streamer_init): Add flag_openmp.
796 * lto-streamer.h (OMP_SECTION_NAME_PREFIX): New.
797 (section_name_prefix): Ditto.
798 (select_what_to_dump): Ditto.
799 * lto/lto-partition.c (add_symbol_to_partition_1): Set need_dump.
800 (lto_promote_cross_file_statics): Dump everyhtinh.
801 * passes.c (ipa_write_summaries): Add parameter,
802 call select_what_to_dump.
803 * tree-pass.h (void ipa_write_summaries): Add parameter.
805 2013-11-15 Jakub Jelinek <jakub@redhat.com>
807 * tree-vect-stmts.c (vectorizable_simd_clone_call): Avoid
808 -Wsign-compare warning.
810 2013-11-12 Aldy Hernandez <aldyh@redhat.com>
812 * ipa-prop.h (enum ipa_parm_op): Adjust comment to IPA_PARM_OP_NEW
815 2013-11-12 Aldy Hernandez <aldyh@redhat.com>
817 * ipa-prop.c (ipa_modify_expr): Pass expr by address.
818 (ipa_get_adjustment_candidate): Add another level of indirection
819 to expr. Adjust comment.
820 (ipa_get_adjustment_candidate): Add another level of indirection
823 2013-11-11 Aldy Hernandez <aldyh@redhat.com>
825 * ipa-prop.c (get_ssa_base_param): New.
826 * ipa-prop.h (ipa_modify_expr): Rename from ipa_sra_modify_expr.
827 Remove ipa_sra_modify_function_body.
828 (ipa_get_adjustment_candidate): Rename from
829 sra_ipa_get_adjustment_candidate.
830 * omp-low.c (ipa_simd_modify_stmt_ops): Rename
831 sra_ipa_get_adjustment_candidate to ipa_get_adjustment_candidate.
832 * tree-sra.c (get_ssa_base_param): Remove default_def argument.
833 (create_access): Remove lass argument to get_ssa_base_param.
834 (disqualify_base_of_expr): Same.
835 (sra_ipa_get_adjustment_candidate): Rename to
836 ipa_get_adjustment_candidate and move to ipa-prop.c.
837 (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to
839 (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to
841 (ipa_sra_modify_function_body): Same.
843 2013-11-11 Jakub Jelinek <jakub@redhat.com>
845 * tree-vect-data-refs.c (vect_analyze_data_refs): Check loop->safelen
846 rather than loop->simdlen.
847 * tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise.
849 2013-11-08 Aldy Hernandez <aldyh@redhat.com>
851 * ipa-prop.c (ipa_modify_formal_parameters): Remove
852 synth_parm_prefix argument.
853 Use operator enum instead of bit fields.
854 Add assert for properly handling vector of references.
855 (ipa_modify_call_arguments): Use operator enum instead of bit
857 (ipa_combine_adjustments): Same.
858 Assert that IPA_PARM_OP_NEW is not used.
859 (ipa_dump_param_adjustments): Rename reduction to new_decl.
860 Use operator enum instead of bit fields.
861 * ipa-prop.h (enum ipa_parm_op): New.
862 (struct ipa_parm_adjustment): New field op.
863 Rename reduction to new_decl.
864 Rename new_arg_prefix to arg_prefix.
865 Remove new_param, remove_param, copy_param.
866 (ipa_modify_formal_parameters): Remove argument.
867 * omp-low.c (simd_clone_adjust_argument_types): Set arg_prefix.
868 Use operator enum instead of bit fields.
869 (simd_clone_adjust_argument_types): Use operator enum instead of
871 Remove last argument to ipa_modify_formal_parameters call.
872 (simd_clone_init_simd_arrays): Use operator enum.
873 (ipa_simd_modify_stmt_ops): Rename reduction to new_decl.
874 (ipa_simd_modify_function_body): Same.
875 * tree-sra.c (turn_representatives_into_adjustments): Use operator
876 enum. Set arg_prefix.
877 (get_adjustment_for_base): Use operator enum.
878 (sra_ipa_get_adjustment_candidate): Same.
879 (sra_ipa_modify_expr): Rename reduction to new_decl.
880 (sra_ipa_reset_debug_stmts): Use operator enum.
881 (modify_function): Do not pass prefix argument.
883 2013-11-07 Jakub Jelinek <jakub@redhat.com>
885 * tree-vectorizer.h (enum stmt_vec_info_type): Add
886 call_simd_clone_vec_info_type.
887 * expr.c (store_constructor): Allow CONSTRUCTOR with VECTOR_TYPE
888 (same sized) elements even if the type of the CONSTRUCTOR has
889 vector mode and target is a REG.
890 * tree-vect-data-refs.c: Include cgraph.h.
891 (vect_analyze_data_refs): Inline by hand find_data_references_in_loop
892 and find_data_references_in_bb, if find_data_references_in_stmt
893 fails, still allow calls to #pragma omp declare simd functions
894 in #pragma omp simd loops unless they contain data references among
895 the call arguments or in lhs.
896 * tree-vect-loop.c (vect_determine_vectorization_factor): If a call
897 doesn't have lhs, set STMT_VINFO_VECTYPE to vector type corresponding
898 to any of the argument types and exclude it from adjustments of the
899 vectorization factor.
900 * tree-vect-stmts.c: Include tree-ssa-loop.h and
901 tree-scalar-evolution.h.
902 (vectorizable_function): Don't handle functions with simd clones here.
903 (vectorizable_call): Nor here. Return early if call doesn't have lhs.
904 (struct simd_call_arg_info): New type.
905 (vectorizable_simd_clone_call): New function.
906 (vect_analyze_stmt, vect_transform_stmt): Call it.
908 2013-11-07 Thomas Schwinge <thomas@codesourcery.com>
910 * gimple.def (GIMPLE_OACC_PARALLEL): New code.
911 * doc/gimple.texi: Document it.
912 * gimple.h (gimple_build_oacc_parallel): New declaration.
913 (gimple_oacc_parallel_clauses, gimple_oacc_parallel_clauses_ptr)
914 (gimple_oacc_parallel_set_clauses, gimple_oacc_parallel_child_fn)
915 (gimple_oacc_parallel_child_fn_ptr)
916 (gimple_oacc_parallel_set_child_fn, gimple_oacc_parallel_data_arg)
917 (gimple_oacc_parallel_data_arg_ptr)
918 (gimple_oacc_parallel_set_data_arg): New inline functions.
919 (CASE_GIMPLE_OMP): Add GIMPLE_OACC_PARALLEL.
920 * gimple.c (gimple_build_oacc_parallel): New function.
921 (walk_gimple_op, walk_gimple_stmt, gimple_copy): Handle
922 GIMPLE_OACC_PARALLEL.
923 * gimplify.c (is_gimple_stmt): Handle GIMPLE_OACC_PARALLEL.
924 (gimplify_oacc_parallel): New function.
925 (gimplify_expr): Handle OACC_PARALLEL.
926 * cgraphbuild.c (build_cgraph_edges): Handle GIMPLE_OACC_PARALLEL.
927 * gimple-low.c (lower_stmt): Likewise.
928 * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
929 (dump_gimple_oacc_parallel): New function.
930 * oacc-builtins.def (BUILT_IN_GOACC_PARALLEL): New macro.
931 * omp-low.c (scan_oacc_parallel, expand_oacc_parallel)
932 (lower_oacc_parallel): New functions.
933 (use_pointer_for_field, build_outer_var_ref, scan_sharing_clauses)
934 (create_omp_child_function, check_omp_nesting_restrictions)
935 (scan_omp_1_stmt, lower_rec_simd_input_clauses)
936 (lower_lastprivate_clauses, lower_reduction_clauses)
937 (lower_copyprivate_clauses, lower_send_clauses)
938 (lower_send_shared_vars, expand_omp)
939 (maybe_add_implicit_barrier_cancel, create_task_copyfn)
940 (lower_omp_1, make_gimple_omp_edges): Handle GIMPLE_OACC_PARALLEL,
942 * tree-inline.c (remap_gimple_stmt): Likewise.
943 * tree-nested.c (convert_nonlocal_reference_stmt)
944 (convert_local_reference_stmt, convert_tramp_reference_stmt)
945 (convert_gimple_call): Likewise.
947 * tree.def (OACC_PARALLEL): New code.
948 * doc/generic.texi (OpenMP): Document it.
949 * tree.h (OMP_BODY, OMP_CLAUSES): Include it.
950 (OACC_PARALLEL_BODY, OACC_PARALLEL_CLAUSES): New macros.
951 * tree-pretty-print.c (dump_generic_node): Handle OACC_PARALLEL.
953 * doc/invoke.texi (-fopenacc): Update.
955 * gimplify.c (gimplify_body): Consider flag_openacc additionally
957 * omp-low.c (execute_expand_omp, execute_lower_omp)
958 (gate_diagnose_omp_blocks): Likewise.
960 * oacc-builtins.def: New file.
961 * Makefile.in (BUILTINS_DEF): Add oacc-builtins.def.
962 * builtins.def (DEF_GOACC_BUILTIN): New macro.
963 Include "oacc-builtins.def".
965 * gcc.c (LINK_COMMAND_SPEC, GOMP_SELF_SPECS): For -fopenacc, link
966 to libgomp and its dependencies.
967 * config/arc/arc.h (LINK_COMMAND_SPEC): Likewise.
968 * config/darwin.h (LINK_COMMAND_SPEC_A): Likewise.
969 * config/i386/mingw32.h (GOMP_SELF_SPECS): Likewise.
970 * config/ia64/hpux.h (LIB_SPEC): Likewise.
971 * config/pa/pa-hpux11.h (LIB_SPEC): Likewise.
972 * config/pa/pa64-hpux.h (LIB_SPEC): Likewise.
973 * doc/invoke.texi (-fopenacc): Update.
975 * doc/invoke.texi (-fopenacc): Document it.
976 * doc/sourcebuild.texi (fopenacc): Document it.
978 Backport from trunk, r204517:
980 * config/arc/arc.h (LINK_COMMAND_SPEC): For
981 -ftree-parallelize-loops=*, link to libgomp and its dependencies.
982 * config/ia64/hpux.h (LIB_SPEC): Likewise.
983 * config/pa/pa-hpux11.h (LIB_SPEC): Likewise.
984 * config/pa/pa64-hpux.h (LIB_SPEC): Likewise.
985 * gcc.c (GOMP_SELF_SPECS): Update comment about libgomp's
988 2013-11-07 Aldy Hernandez <aldyh@redhat.com>
990 * omp-low.c (ipa_simd_modify_function_body): Avoid
991 regimplification of GIMPLE_RETURNs.
993 2013-11-06 Aldy Hernandez <aldyh@redhat.com>
995 * ipa-prop.h (sra_ipa_get_adjustment_candidate): Protoize.
996 * omp-low.c (struct modify_stmt_info): New.
997 (ipa_simd_modify_function_body_ops_1): Remove.
998 (ipa_simd_modify_stmt_ops): New.
999 (ipa_simd_modify_function_body_ops): Remove.
1000 (ipa_simd_modify_function_body): Set new callback info.
1001 Remove special casing. Handle all operators with walk_gimple_op.
1002 * tree-sra.c (get_ssa_base_param): Add new argument. Use it.
1003 (disqualify_base_of_expr): Pass new argument to
1005 (sra_ipa_modify_expr): Abstract candidate search into...
1006 (sra_ipa_get_adjustment_candidate): ...here.
1008 2013-11-06 Aldy Hernandez <aldyh@redhat.com>
1010 * omp-low.c (simd_clone_mangle): Linear step of 1 is mangled as
1013 2013-11-04 Aldy Hernandez <aldyh@redhat.com>
1015 * omp-low.c (ipa_simd_modify_function_body): Adjust tree operands
1016 on the LHS of an assign.
1017 (ipa_simd_modify_function_body_ops_1): New.
1018 (ipa_simd_modify_function_body_ops): New.
1020 2013-11-02 Aldy Hernandez <aldyh@redhat.com>
1022 * omp-low.c (ipa_simd_modify_function_body): Handle empty returns.
1024 2013-11-01 Jakub Jelinek <jakub@redhat.com>
1026 * cgraph.h (enum linear_stride_type): Remove.
1027 (enum simd_clone_arg_type): New.
1028 (struct simd_clone_arg): Remove linear_stride, linear_stride_num
1029 and uniform fields. Add arg_type and linear_step.
1030 * omp-low.c (simd_clone_struct_copy): Formatting.
1031 (simd_clone_struct_alloc): Likewise. Use size_t.
1032 (simd_clone_clauses_extract, simd_clone_compute_base_data_type,
1033 simd_clone_adjust_argument_types): Adjust for struct simd_clone_arg
1035 (simd_clone_mangle): Likewise. Handle negative linear step.
1037 2013-11-01 Aldy Hernandez <aldyh@redhat.com>
1039 * tree-vect-stmts.c: Include cgraph.h.
1040 (vectorizable_call): Allow > 3 arguments when a SIMD clone may be
1042 (vectorizable_function): Use SIMD clone if available.
1043 * ipa-cp.c (determine_versionability): Nodes with SIMD clones are
1045 * ggc.h (ggc_alloc_cleared_simd_clone_stat): New.
1046 * cgraph.h (enum linear_stride_type): New.
1047 (struct simd_clone_arg): New.
1048 (struct simd_clone): New.
1049 (struct cgraph_node): Add simdclone and simdclone_of fields.
1050 (get_simd_clone): Protoize.
1051 * cgraph.c (get_simd_clone): New.
1052 Add `has_simd_clones' field.
1053 * ipa-cp.c (determine_versionability): Disallow functions with
1055 * ipa-prop.h (ipa_sra_modify_function_body): Protoize.
1056 (sra_ipa_modify_expr): Same.
1057 (struct ipa_parm_adjustment): Add new_arg_prefix and new_param
1058 fields. Document their use.
1059 * ipa-prop.c (ipa_modify_formal_parameters): Handle creating brand
1060 new parameters and minor cleanups.
1061 * omp-low.c: Add new pass_omp_simd_clone support code.
1062 (make_pass_omp_simd_clone): New.
1063 (pass_data_omp_simd_clone): Declare.
1064 (class pass_omp_simd_clone): Declare.
1065 (vecsize_mangle): New.
1066 (ipa_omp_simd_clone): New.
1067 (simd_clone_clauses_extract): New.
1068 (simd_clone_compute_base_data_type): New.
1069 (simd_clone_compute_vecsize_and_simdlen): New.
1070 (simd_clone_create): New.
1071 (simd_clone_adjust_return_type): New.
1072 (simd_clone_adjust_return_types): New.
1073 (simd_clone_adjust): New.
1074 (simd_clone_init_simd_arrays): New.
1075 (ipa_simd_modify_function_body): New.
1076 (simd_clone_mangle): New.
1077 (simd_clone_struct_alloc): New.
1078 (simd_clone_struct_copy): New.
1079 (class argno_map): New.
1080 (argno_map::argno_map(tree)): New.
1081 (argno_map::~argno_map): New.
1082 (argno_map::operator []): New.
1083 (argno_map::length): New.
1084 (expand_simd_clones): New.
1085 (create_tmp_simd_array): New.
1086 * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): New.
1087 * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document.
1088 * tree-pass.h (make_pass_omp_simd_clone): New.
1089 * passes.def (pass_omp_simd_clone): New.
1090 * target.def: Define new hook prefix "TARGET_CILKPLUS_".
1091 (default_vecsize_mangle): New.
1092 (vecsize_for_mangle): New.
1093 * doc/tm.texi.in: Add placeholder for
1094 TARGET_CILKPLUS_DEFAULT_VECSIZE_MANGLE and
1095 TARGET_CILKPLUS_VECSIZE_FOR_MANGLE.
1096 * tree-sra.c (sra_ipa_modify_expr): Remove static modifier.
1097 (ipa_sra_modify_function_body): Same.
1098 * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define.
1099 * doc/tm.texi: Regenerate.
1100 * config/i386/i386.c (ix86_cilkplus_default_vecsize_mangle): New.
1101 (ix86_cilkplus_vecsize_for_mangle): New.
1102 (TARGET_CILKPLUS_DEFAULT_VECSIZE_MANGLE): New.
1103 (TARGET_CILKPLUS_VECSIZE_FOR_MANGLE): New.
1105 2013-10-10 Jakub Jelinek <jakub@redhat.com>
1107 * tree.c (omp_remove_redundant_declare_simd_attrs): Adjust
1108 for the clauses being stored into TREE_VALUE of an extra TREE_LIST
1109 pointed out by TREE_VALUE of the attribute.
1111 2013-10-04 Jakub Jelinek <jakub@redhat.com>
1113 * omp-low.c (expand_omp_target): When handling IF clause on
1114 #pragma omp target, split new_bb rather than entry_bb. If
1115 not GF_OMP_TARGET_KIND_REGION, split new_bb right before
1116 the GOMP_TARGET stmt, rather than after labels.
1118 2013-09-26 Jakub Jelinek <jakub@redhat.com>
1120 * omp-low.c (expand_task_call): If there are depend clauses,
1121 pass bit 8 in 7th argument and pass pointer to depend array
1123 (lower_depend_clauses): New function.
1124 (lower_omp_taskreg): Handle depend clauses.
1125 * omp-builtins.def (BUILT_IN_GOMP_TASK): Use
1126 BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR
1127 instead of BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT.
1129 (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT): Remove.
1130 (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR): New.
1132 2013-09-25 Jakub Jelinek <jakub@redhat.com>
1134 * omp-low.c (lower_omp_sections, lower_omp_for, lower_omp_taskreg):
1135 Emit ctx->cancel_label before destructors.
1137 * gimple-pretty-print.c (dump_gimple_omp_block,
1138 pp_gimple_stmt_1): Handle GIMPLE_OMP_TASKGROUP.
1139 * tree-nested.c (convert_nonlocal_reference_stmt,
1140 convert_local_reference_stmt, convert_gimple_call): Likewise.
1141 * tree-cfg.c (make_edges): Likewise.
1142 * gimple.h (gimple_build_omp_taskgroup): New prototype.
1143 (gimple_has_substatement): Handle GIMPLE_OMP_TASKGROUP.
1144 (CASE_GIMPLE_OMP): Likewise.
1145 * gimplify.c (is_gimple_stmt, gimplify_expr): Handle OMP_TASKGROUP.
1146 * omp-low.c (check_omp_nesting_restrictions): Warn if #pragma omp
1147 cancel is used in nowait loop or sections construct.
1148 (scan_omp_1_stmt, expand_omp_synch, expand_omp, lower_omp_1): Handle
1149 GIMPLE_OMP_TASKGROUP.
1150 (diagnose_sb_1, diagnose_sb_2): Likewise. Handle GIMPLE_OMP_TARGET
1151 and GIMPLE_OMP_TEAMS.
1152 (lower_omp_taskgroup): New function.
1153 * tree-inline.c (remap_gimple_stmt, estimate_num_insns): Handle
1154 GIMPLE_OMP_TASKGROUP.
1155 * gimple-low.c (lower_stmt): Likewise.
1156 * tree.h (OMP_TASKGROUP_BODY): Define.
1157 * tree.def (OMP_TASKGROUP): New tree.
1158 * tree-pretty-print.c (dump_generic_node): Handle OMP_TASKGROUP.
1159 * gimple.c (gimple_build_omp_taskgroup): New function.
1160 (walk_gimple_stmt, gimple_copy): Handle GIMPLE_OMP_TASKGROUP.
1161 * gimple.def (GIMPLE_OMP_TASKGROUP): New GIMPLE code.
1163 2013-09-19 Jakub Jelinek <jakub@redhat.com>
1165 * omp-builtins.def (BUILT_IN_GOMP_TARGET_DATA,
1166 BUILT_IN_GOMP_TARGET_UPDATE): Use BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR
1167 rather than BT_FN_VOID_INT_SIZE_PTR_PTR_PTR.
1168 * builtin-types.def (BT_FN_VOID_INT_SIZE_PTR_PTR_PTR): Remove.
1169 (BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR): New.
1170 * omp-low.c (expand_omp_target): Remove fnname argument from
1171 GOMP_target, add openmp_target argument to GOMP_target,
1172 GOMP_target_data and GOMP_target_update calls.
1174 2013-09-18 Jakub Jelinek <jakub@redhat.com>
1176 * tree.h (OMP_CLAUSE_REDUCTION_OMP_ORIG_REF): Define.
1177 * tree-core.h (OMP_CLAUSE_REDUCTION_OMP_ORIG_REF): Document.
1178 * omp-low.c (lower_rec_simd_input_clauses): Don't set DECL_VALUE_EXPR
1179 on new_var if it is not a DECL_P.
1180 (lower_rec_input_clauses): Don't force max_vf = 1
1181 if OMP_CLAUSE_REDUCTION_PLACEHOLDER. Add barrier also if any
1182 OMP_CLAUSE_REDUCTION_OMP_ORIG_REF is seen. For OMP_CLAUSE_PRIVATE
1183 in simd, fix last argument to omp_clause_default_ctor langhook.
1184 Handle OMP_CLAUSE_REDUCTION_PLACEHOLDER in simd loops, if
1185 OMP_CLAUSE_REDUCTION_GIMPLE_INIT is NULL, emit omp_clause_default_ctor
1186 if any and emit omp_clause_dtor if any. Handle C++ references in
1187 OMP_CLAUSE_REDUCTION clauses.
1188 (lower_reduction_clauses): Adjust comment for UDRs. Handle
1189 C++ references in OMP_CLAUSE_REDUCTION clauses.
1190 (lower_omp_taskreg): Emit reduction merges before destructors.
1191 * tree-pretty-print.c (dump_omp_clause): Don't emit any reduction
1192 operator name if OMP_CLAUSE_REDUCTION_CODE is ERROR_MARK.
1193 * gimplify.c (omp_add_variable): Ignore GOVD_LOCAL decls for which
1194 privatize_by_reference returns true.
1196 * tree-core.h (OMP_CLAUSE_DEPEND_KIND, OMP_CLAUSE_MAP_KIND,
1197 OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION, OMP_CLAUSE_PROC_BIND_KIND):
1199 * tree.h (OMP_CLAUSE_DEPEND_KIND, OMP_CLAUSE_MAP_KIND,
1200 OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION, OMP_CLAUSE_PROC_BIND_KIND):
1203 2013-09-16 Jakub Jelinek <jakub@redhat.com>
1205 * omp-low.c (install_var_field): Use (mask & 4) to request double
1207 (scan_sharing_clauses): For OMP_CLAUSE_MAP_POINTER arrays pass
1208 7 instead of 3 to install_var_field.
1209 (lower_omp_target): For OMP_CLAUSE_MAP_POINTER arrays add extra
1212 2013-09-06 Jakub Jelinek <jakub@redhat.com>
1214 * omp-low.c (scan_sharing_clauses): Handle VLAs in
1215 OMP_CLAUSE_{MAP,TO,FROM}. Set DECL_ALIGN (field) before
1216 calling insert_field_into_struct.
1217 (scan_omp_target): Reverse TYPE_FIELDS, verify that
1218 all field alignments are the same.
1219 (lower_omp_target): Use maybe_lookup_field instead of
1220 lookup_sfield to check if field is present. Handle VLAs.
1221 * tree-pretty-print.c (dump_omp_clause): Only check
1222 OMP_CLAUSE_MAP_KIND on OMP_CLAUSE_MAP clauses.
1223 * gimplify.c (enum gimplify_omp_var_data): Add GOVD_MAP_TO_ONLY.
1224 (omp_firstprivatize_variable, omp_add_variable,
1225 gimplify_adjust_omp_clauses_1, gimplify_adjust_omp_clauses): Handle
1226 VLAs in OMP_CLAUSE_{MAP,TO,FROM}.
1228 2013-09-05 Jakub Jelinek <jakub@redhat.com>
1230 * gimplify.c (gimplify_call_expr): Don't call fold_stmt
1231 inside of #pragma omp target construct.
1232 (gimplify_modify_expr): Likewise.
1233 * omp-low.c (target_nesting_level): New variable.
1234 (lower_omp_target): Increase/restore target_nesting_level
1235 around lowering #pragma omp target body. Use TYPE_SIZE_UNIT
1236 instead of TYPE_SIZE if OMP_CLAUSE_SIZE is missing.
1237 Or log2 of needed alignment into high 5 bits of kind.
1238 (lower_omp): Call fold_stmt on all stmts inside of
1239 #pragma omp target construct.
1241 * tree-cfg.c (make_edges): For GIMPLE_OMP_TARGET
1242 with GF_OMP_TARGET_KIND_UPDATE, don't look for
1243 GIMPLE_OMP_RETURN and immediately restore previous
1245 * langhooks.c (lhd_omp_mappable_type): New function.
1246 * omp-low.c (scan_sharing_clauses): Ignore OMP_CLAUSE_SHARED
1247 in GIMPLE_OMP_TEAMS constructs. Handle OMP_CLAUSE_NUM_TEAMS,
1248 OMP_CLAUSE_THREAD_LIMIT, OMP_CLAUSE_DEVICE, OMP_CLAUSE_MAP,
1249 OMP_CLAUSE_TO and OMP_CLAUSE_FROM.
1250 (create_omp_child_function): If current function has
1251 "omp declare target" attribute or if current region
1252 is OMP_TARGET or lexically nested in it, add that
1253 attribute to the omp child function.
1254 (scan_omp_target, scan_omp_teams): New functions.
1255 (check_omp_nesting_restrictions): Fix a typo in TEAMS nesting
1257 (scan_omp_1_stmt): Handle GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
1258 (lower_rec_input_clauses): Ignore OMP_CLAUSE_SHARED
1259 in GIMPLE_OMP_TEAMS constructs.
1260 (expand_omp_synch): Handle GIMPLE_OMP_TEAMS.
1261 (expand_omp_target): New function.
1262 (expand_omp): Handle GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
1263 (build_omp_regions_1): For GIMPLE_OMP_TARGET with
1264 GF_OMP_TARGET_KIND_UPDATE, don't look for GIMPLE_OMP_RETURN and
1265 immediately restore previous region.
1266 (lower_omp_single): Emit a CLOBBER stmt after GIMPLE_OMP_RETURN.
1267 (lower_omp_taskreg): Likewise.
1268 (lower_omp_target, lower_omp_teams): New functions.
1269 (lower_omp_1): Handle GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
1270 * tree.h (enum omp_clause_map_kind): Improve description of
1271 OMP_CLAUSE_MAP_POINTER.
1272 (OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION): Define.
1273 * gimple.def (GIMPLE_OMP_TARGET): Use GSS_OMP_PARALLEL instead
1275 * langhooks.h (struct lang_hooks_for_types): Add
1276 omp_mappable_type hook.
1277 * langhooks-def.h (lhd_omp_mappable_type): New prototype.
1278 (LANG_HOOKS_OMP_MAPPABLE_TYPE): Define.
1279 (LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it.
1280 * gimple.h (gimple_omp_target_clauses, gimple_omp_target_clauses_ptr,
1281 gimple_omp_target_set_clauses): Use gimple_omp_parallel
1282 instead of gimple_omp_single.
1283 (gimple_omp_target_child_fn, gimple_omp_target_child_fn_ptr,
1284 gimple_omp_target_set_child_fn, gimple_omp_target_data_arg,
1285 gimple_omp_target_data_arg_ptr, gimple_omp_target_set_data_arg): New
1287 * omp-builtins.def (BUILT_IN_GOMP_TARGET, BUILT_IN_GOMP_TARGET_DATA,
1288 BUILT_IN_GOMP_TARGET_END_DATA, BUILT_IN_GOMP_TARGET_UPDATE,
1289 BUILT_IN_GOMP_TEAMS): New builtins.
1290 * gimple-pretty-print.c (dump_gimple_omp_target): Print child_fn
1291 for #pragma omp target.
1292 * gimplify.c (omp_notice_variable): Diagnose if implicitly mapped
1293 decl doesn't have mappable type.
1294 (gimplify_scan_omp_clauses): For OMP_CLAUSE_MAP don't clear
1296 (gimplify_adjust_omp_clauses_1): Add OMP_CLAUSE_MAP even if the same
1297 decl is already referenced in target data construct surrounding it.
1298 (gimplify_adjust_omp_clauses): Likewise. Handle
1299 OMP_CLAUSE_THREAD_LIMIT.
1300 (gimplify_omp_workshare): Fix up gimplification of target or target
1301 data construct body. For target data add GOMP_target_end_data
1302 call in a try/finally cleanup.
1303 * builtin-types.def (BT_FN_VOID_UINT_UINT,
1304 BT_FN_VOID_INT_SIZE_PTR_PTR_PTR,
1305 BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR): New.
1307 2013-07-14 Jakub Jelinek <jakub@redhat.com>
1309 * tree.h (omp_declare_simd_clauses_equal): Remove prototype.
1310 (omp_remove_redundant_declare_simd_attrs): New prototype.
1311 * tree.c (omp_declare_simd_clauses_equal): Make static.
1312 (omp_remove_redundant_declare_simd_attrs): New function.
1314 2013-07-09 Jakub Jelinek <jakub@redhat.com>
1316 * gimple-pretty-print.c (dump_gimple_omp_return): Print
1317 gimple_omp_return_lhs if non-NULL.
1318 * tree-ssa-alias.c (ref_maybe_used_by_call_p_1,
1319 call_may_clobber_ref_p_1): Handle BUILT_IN_GOMP_BARRIER_CANCEL,
1320 BUILT_IN_GOMP_LOOP_END_CANCEL, BUILT_IN_GOMP_SECTIONS_END_CANCEL.
1321 * gimple.h (gimple_omp_return_set_lhs, gimple_omp_return_lhs,
1322 gimple_omp_return_lhs_ptr): New inlines.
1323 * gimple.def (GIMPLE_OMP_RETURN): Use GSS_OMP_ATOMIC_STORE
1324 instead of GSS_BASE.
1325 * gimple.c (walk_gimple_op) <case GIMPLE_OMP_RETURN>: Walk lhs.
1326 * builtin-types.def (BT_FN_BOOL_INT, BT_FN_BOOL_INT_BOOL): New.
1327 * omp-builtins.def (BUILT_IN_GOMP_CANCELLATION_POINT): Use
1328 ATTR_NOTHROW_LEAF_LIST instead of ATTR_NULL. Return type is now
1330 (BUILT_IN_GOMP_CANCEL): Likewise. Add second argument with bool type.
1331 (BUILT_IN_BARRIER_CANCEL, BUILT_IN_GOMP_LOOP_END_CANCEL,
1332 BUILT_IN_GOMP_SECTIONS_END_CANCEL): New builtins.
1333 * omp-low.c (struct omp_context): Add cancel_label and cancellable
1335 (extract_omp_for_data): Set have_nowait even for simd implicitly.
1336 (check_omp_nesting_restrictions): Verify nesting restrictions for
1337 #pragma omp cancel and #pragma omp cancellation point.
1338 Set ctx->cancellable for regions that can be cancelled or also
1339 for any task region that contains #pragma omp cancellation point.
1340 (scan_omp_1_stmt): Check nesting restrictions even if ctx == NULL.
1341 (build_omp_barrier): Return gimple instead of tree, add lhs argument,
1342 if non-NULL, build GOMP_barrier_cancel builtin instead and set its
1344 (lower_rec_input_clauses): Adjust build_omp_barrier caller.
1345 (expand_omp_for_static_nochunk, expand_omp_for_static_chunk,
1346 expand_omp_single): Likewise. If OMP_RETURN has lhs, pass it to
1348 (expand_omp_for_generic): If OMP_RETURN has lhs, use
1349 GOMP_loop_end_cancel libcall instead of GOMP_loop_end and set its
1350 lhs from OMP_RETURN's lhs.
1351 (expand_omp_sections): If OMP_RETURN has lhs, use
1352 GOMP_sections_end_cancel libcall instead of GOMP_sections_end and set
1353 its lhs from OMP_RETURN's lhs.
1354 (maybe_add_implicit_barrier_cancel): New function.
1355 (lower_omp_sections): If ctx->cancellable, emit cancel_label before
1356 OMP_RETURN. Call maybe_add_implicit_barrier_cancel.
1357 (lower_omp_for): Likewise.
1358 (lower_omp_single): Call maybe_add_implicit_barrier_cancel.
1359 (lower_omp_taskreg): If ctx->cancellable, emit cancel_label before
1361 (lower_omp_1): If ctx->cancellable, create ctx->cancel_label.
1362 Adjust GOMP_barrier libcalls to GOMP_barrier_cancel plus conditional
1363 branch in cancellable regions, adjust GOMP_cancel and
1364 GOMP_cancellation_point in cancellable regions or remove
1365 GOMP_cancellation_point in non-cancellable regions.
1367 2013-07-03 Jakub Jelinek <jakub@redhat.com>
1369 * omp-low.c (expand_omp_single): Don't force barrier for
1372 2013-06-28 Jakub Jelinek <jakub@redhat.com>
1373 Aldy Hernandez <aldyh@redhat.com>
1375 * internal-fn.def (GOMP_SIMD_LANE, GOMP_SIMD_VF,
1376 GOMP_SIMD_LAST_LANE): New internal functions.
1377 * omp-low.c (omp_max_vf, lower_rec_simd_input_clauses): New
1379 (lower_rec_input_clauses): Add fd argument. Enforce max_vf = 1
1380 if any data sharing clauses mention VLAs or for array reductions.
1381 Handle OMP_CLAUSE__LOOPTEMP_ clause. For
1382 OMP_CLAUSE_{{FIRST,LAST,}PRIVATE,LINEAR,REDUCTION} on SIMD
1383 constructs use "omp simd array" temporaries. For OMP_CLAUSE_LINEAR
1384 adjust initial value in combined constructs. Don't emit any
1385 barriers for #pragma omp distribute. If max_vf is lower than
1386 current safelen, prepend an OMP_CLAUSE_SAFELEN clause.
1387 (lower_lastprivate_clauses): Handle "omp simd array" temporaries.
1388 (lower_reduction_clauses): Exit early for #pragma omp simd.
1389 (expand_omp_simd): Set loop->simduid from OMP_CLAUSE__SIMDUID_
1390 and cfun->has_simduid_loops if set.
1391 If OMP_CLAUSE_SAFELEN (1) is present, don't set loop->safelen
1392 nor loop->force_vect.
1393 (lower_omp_sections, lower_omp_single, lower_omp_taskreg): Adjust
1394 lower_rec_input_clauses callers.
1395 (lower_omp_for_lastprivate): Unshare vinit.
1396 (lower_omp_for): Add OMP_CLAUSE__LOOPTEMP_ clauses before calling
1397 lower_rec_input_clauses. Adjust lower_rec_input_clauses caller.
1398 Always call lower_omp_for_lastprivate at the same place, even for
1400 * tree.h (enum clause_code): Add OMP_CLAUSE__SIMDUID_.
1401 (OMP_CLAUSE__SIMDUID__DECL): Define.
1402 * tree-vectorizer.c: Include hash-table.h and tree-ssa-propagate.h.
1403 (simduid_to_vf, decl_to_simduid): New classes.
1404 (simduid_to_vf::hash, simduid_to_vf::equal, decl_to_simduid::hash,
1405 decl_to_simduid::equal): New methods.
1406 (note_simd_array_uses_struct): New struct.
1407 (adjust_simduid_builtins, note_simd_array_uses_cb,
1408 note_simd_array_uses): New functions.
1409 (vectorize_loops): Adjust "omp simd array" temporary array sizes
1410 and fold GOMP_SIMD_{LANE,VF,LAST_LANE} builtins.
1411 * tree-vectorizer.h (struct _stmt_vec_info): Add simd_lane_access_p
1413 (STMT_VINFO_SIMD_LANE_ACCESS_P): Define.
1414 * tree-data-ref.c (get_references_in_stmt): Allow GOMP_SIMD_LANE
1415 builtins in their own loops.
1416 * tree-inline.c (copy_cfg_body): Propagate has_force_vect_loops
1417 and has_simduid_loops.
1418 * function.h (struct function): Add has_simduid_loops field.
1419 * tree-ssa-ccp.c (likely_value): For GOMP_SIMD_{LANE,LAST_LANE,VF}
1420 builtins ignore the undefined magic argument.
1421 * tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE__SIMDUID_
1423 * cfgloop.h (struct loop): Add simduid field.
1424 * Makefile.in (tree-vectorizer.o): Depend on $(HASH_TABLE_H)
1425 and tree-ssa-propagate.h.
1426 * tree-vect-data-refs.c (vect_analyze_data_refs): Check for SIMD
1428 * gimplify.c (omp_add_variable): Handle combination of aligned
1429 clause and some data sharing clause for the same decl.
1430 (gimplify_omp_for): For collapse (2) and above simd loops
1431 predetermine loop iteration vars as lastprivate instead of
1433 * tree.c (omp_clause_num_ops, omp_clause_code_name): Add
1434 entries for OMP_CLAUSE__SIMDUID_.
1435 (walk_tree_1): Handle OMP_CLAUSE__SIMDUID_.
1436 * tree-vect-loop.c (vectorizable_live_operation): Handle live
1437 GOMP_SIMD_LANE result.
1438 * tree-vect-stmts.c (vectorizable_call): Vectorize GOMP_SIMD_LANE
1440 (vectorizable_store, vectorizable_load): Handle
1441 STMT_VINFO_SIMD_LANE_ACCESS_P.
1442 * internal-fn.c (expand_GOMP_SIMD_LANE, expand_GOMP_SIMD_VF,
1443 expand_GOMP_SIMD_LAST_LANE): New functions.
1445 2013-06-21 Jakub Jelinek <jakub@redhat.com>
1447 * gimple.h (enum gf_mask): Adjust GF_OMP_FOR_COMBINED
1448 value representation, add GF_OMP_FOR_COMBINED_INTO.
1449 (gimple_omp_for_combined_into_p,
1450 gimple_omp_for_set_combined_into_p): New inlines.
1451 * gimplify.c (enum omp_region_type): Remove outdated
1453 (struct gimplify_omp_ctx): Add combined_loop field.
1454 (gimplify_omp_for): Call gimple_omp_for_set_combined_into_p
1455 for inner for/simd constructs combined with an outer
1456 loop construct (for or distribute).
1457 * tree.c (omp_clause_num_ops): Add OMP_CLAUSE__LOOPTEMP_
1459 (omp_clause_code_name): Likewise.
1460 (walk_tree_1): Handle OMP_CLAUSE__LOOPTEMP_.
1461 * tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE__LOOPTEMP_.
1462 * tree.h (enum omp_clause_code): Add OMP_CLAUSE__LOOPTEMP_.
1463 (OMP_CLAUSE_DECL): Allow also on OMP_CLAUSE__LOOPTEMP_.
1464 * omp-low.c (extract_omp_for_data): Rename non_ws to simd. Don't set
1465 fd->chunk_size for non-chunk OMP_CLAUSE_SCHEDULE_STATIC, unless
1466 fd->have_ordered. For OMP_CLAUSE_SCHEDULE_STATIC non-ordered loops
1467 compute fd->iter_type the same as for simd.
1468 (get_ws_args_for): Add par_stmt argument, if
1469 gimple_omp_for_combined_into_p, use first two _looptemp_ clauses
1470 temporaries instead of fd->loop.n{1,2}.
1471 (determine_parallel_type): Adjust caller.
1472 (scan_sharing_clauses): Handle OMP_CLAUSE__LOOPTEMP_.
1473 (find_combined_for): New function.
1474 (scan_omp_parallel): If gimple_omp_parallel_combined_p and
1475 it is combined with gimple_omp_for_combined_into_p OMP_FOR,
1476 add OMP_CLAUSE__LOOPTEMP_ clauses to the parallel.
1477 (check_omp_nesting_restrictions): Don't insist that the only construct
1478 nested in OMP_DISTRIBUTE must be OMP_PARALLEL.
1479 (lower_rec_input_clauses, lower_send_clauses): Handle
1480 OMP_CLAUSE__LOOPTEMP_.
1481 (expand_omp_for_init_counts, expand_omp_for_init_vars,
1482 extract_omp_for_update_vars): New functions.
1483 (expand_omp_for_generic): Add inner_stmt argument. Use
1484 expand_omp_for_{init,update}* helper functions. Handle combined loop
1486 (expand_omp_for_static_nochunk, expand_omp_for_static_chunk):
1487 Likewise. Handle fd->collapse > 1 and broken_loop cases.
1488 (expand_omp_simd): Use expand_omp_for_init* helper functions. Handle
1489 combined loop constructs.
1490 (expand_omp_for): Add inner_stmt argument. Pass it through to
1491 expand_omp_for_{generic,static_{,no}chunk}. Use
1492 expand_omp_for_static* even for fd->collapse > 1 and/or broken_loop
1493 cases, just not when fd->have_ordered.
1494 (expand_omp): Adjust expand_omp_for caller.
1495 (lower_omp_for): If gimple_omp_parallel_combined_p, add
1496 OMP_CLAUSE__LOOPTEMP_ clauses to the GIMPLE_FOR stmt.
1498 2013-06-14 Jakub Jelinek <jakub@redhat.com>
1500 * gimple-pretty-print.c (dump_gimple_omp_for): Don't handle
1501 GF_OMP_FOR_KIND_FOR_SIMD.
1502 * gimple.h (GF_OMP_FOR_KIND_FOR_SIMD): Remove.
1503 (GF_OMP_FOR_COMBINED): New.
1504 (gimple_omp_for_combined_p, gimple_omp_for_set_combined_p): New
1506 * gimplify.c (is_gimple_stmt): Don't handle OMP_FOR_SIMD.
1507 (find_combined_omp_for): New function.
1508 (gimplify_omp_for): Handle combined OMP_DISTRIBUTE and OMP_FOR
1510 * Makefile.in (c-family/c-omp.o): Depend on $(C_PRAGMA_H).
1511 * omp-low.c (build_outer_var_ref): Fix up simd handling.
1512 (check_omp_nesting_restrictions): Don't handle
1513 GF_OMP_FOR_KIND_FOR_SIMD.
1514 * tree.def (OMP_FOR_SIMD): Remove.
1515 * tree-pretty-print.c (dump_generic_node): Don't handle OMP_FOR_SIMD.
1516 Handle NULL OMP_FOR_INIT.
1518 2013-06-12 Jakub Jelinek <jakub@redhat.com>
1520 * gimplify.c (gimplify_scan_omp_clauses): Handle
1521 OMP_CLAUSE_THREAD_LIMIT.
1522 * tree-pretty-print.c (dump_omp_clause): Likewise.
1523 * tree.c (omp_clause_num_ops, omp_clause_code_name): Add entries for
1524 OMP_CLAUSE_THREAD_LIMIT.
1525 * tree.h (enum omp_clause_code): Add OMP_CLAUSE_THREAD_LIMIT.
1526 (OMP_CLAUSE_THREAD_LIMIT_EXPR): Define.
1528 2013-06-04 Jakub Jelinek <jakub@redhat.com>
1530 * gimplify.c (gimplify_scan_omp_clauses): Handle array
1531 sections on OMP_CLAUSE_{MAP,TO,FROM} clauses, handle
1532 OMP_CLAUSE_DEPEND clause.
1533 (gimplify_adjust_omp_clauses): Handle array sections on
1534 OMP_CLAUSE_MAP, handle OMP_CLAUSE_DEPEND clause.
1535 * tree.c (omp_clause_num_ops): OMP_CLAUSE_{MAP,TO,FROM}
1536 now have 2 arguments, move OMP_CLAUSE_UNIFORM before these
1538 (omp_clause_code_name): Adjust for OMP_CLAUSE_UNIFORM movement.
1539 (walk_tree_1): Adjust to handle 2 arguments of
1540 OMP_CLAUSE_{MAP,TO,FROM}.
1541 * tree-pretty-print.c (dump_omp_clause): For OMP_CLAUSE_{MAP,TO,FROM}
1542 print OMP_CLAUSE_SIZE, and for OMP_CLAUSE_MAP handle
1543 OMP_CLAUSE_MAP_POINTER.
1544 * tree.h (enum omp_clause_code): Move OMP_CLAUSE_UNIFORM before
1545 OMP_CLAUSE_{MAP,TO,FROM}.
1546 (OMP_CLAUSE_SIZE): Define.
1547 (enum omp_clause_map_kind): Add OMP_CLAUSE_MAP_POINTER.
1548 * omp-low.c (scan_sharing_clauses): Handle OMP_CLAUSE_DEPEND.
1550 2013-05-29 Jakub Jelinek <jakub@redhat.com>
1552 * omp-builtins.def (BUILT_IN_OMP_GET_TEAM_NUM,
1553 BUILT_IN_OMP_GET_NUM_TEAMS): New built-ins.
1554 * omp-low.c (extract_omp_for_data, expand_omp_for_static_nochunk,
1555 expand_omp_for_static_chunk): Handle #pragma omp distribute.
1556 (expand_omp_for): Add assertion for non-finished distribute collapse
1558 (check_omp_nesting_restrictions): Allow orphaned distribute construct.
1560 * omp-low.c (check_omp_nesting_restrictions): Add some
1561 accelerator related nesting restrictions.
1562 (scan_omp_1_stmt): Call check_omp_nesting_restrictions
1563 even for GOMP_taskgroup_{start,end}.
1564 * gimplify.c (omp_notice_threadprivate_variable): Fix a typo.
1565 (gimplify_body): For functions with "omp declare target" attribute
1566 add ORT_TARGET region around the body.
1568 2013-05-27 Jakub Jelinek <jakub@redhat.com>
1570 * tree.def (OMP_TEAMS, OMP_TARGET_DATA, OMP_TARGET,
1571 OMP_TARGET_UPDATE): New tree codes.
1572 * tree-cfg.c (make_edges): Handle GIMPLE_OMP_TARGET
1573 and GIMPLE_OMP_TEAMS.
1574 * omp-low.c (scan_sharing_clauses): Handle OMP_CLAUSE_DIST_SCHEDULE.
1575 * gimple-low.c (lower_stmt): Handle GIMPLE_OMP_TARGET
1576 and GIMPLE_OMP_TEAMS.
1577 * tree.h (OMP_TEAMS_BODY, OMP_TEAMS_CLAUSES, OMP_TARGET_DATA_BODY,
1578 OMP_TARGET_DATA_CLAUSES, OMP_TARGET_BODY, OMP_TARGET_CLAUSES,
1579 OMP_TARGET_UPDATE_CLAUSES): Define.
1580 * tree-nested.c (convert_nonlocal_reference_stmt,
1581 convert_local_reference_stmt, convert_gimple_call): Handle
1582 GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
1583 * tree-inline.c (estimate_num_insns): Likewise.
1584 (remap_gimple_stmt): Likewise. Adjust gimple_build_omp_for
1586 * gimple.def: Adjust comments describing OMP_CLAUSEs.
1587 (GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS): New GIMPLE stmts.
1588 * tree-parloops.c (create_parallel_loop): Adjust gimple_build_omp_for
1590 * tree-pretty-print.c (dump_generic_node): Handle OMP_TEAMS,
1591 OMP_TARGET, OMP_TARGET_DATA and OMP_TARGET_UPDATE.
1592 * gimple.h (GF_OMP_TARGET_KIND_MASK, GF_OMP_TARGET_KIND_REGION,
1593 GF_OMP_TARGET_KIND_DATA, GF_OMP_TARGET_KIND_UPDATE): New.
1594 (gimple_build_omp_for): Add kind argument to prototype.
1595 (gimple_build_omp_target, gimple_build_omp_teams): New prototypes.
1596 (gimple_has_substatements): Handle GIMPLE_OMP_TARGET and
1598 (gimple_omp_subcode): Change GIMPLE_OMP_SINGLE to GIMPLE_OMP_TEAMS.
1599 (gimple_omp_target_clauses, gimple_omp_target_clauses_ptr,
1600 gimple_omp_target_set_clauses, gimple_omp_target_kind,
1601 gimple_omp_target_set_kind, gimple_omp_teams_clauses,
1602 gimple_omp_teams_clauses_ptr, gimple_omp_teams_set_clauses): New
1604 (gimple_return_set_retval): Handle GIMPLE_OMP_TARGET and
1606 * gimple.c (gimple_build_omp_for): Add kind argument, call
1607 gimple_omp_for_set_kind.
1608 (gimple_build_omp_target, gimple_build_omp_teams): New functions.
1609 (walk_gimple_op, walk_gimple_stmt, gimple_copy): Handle
1610 GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
1611 * gimple-pretty-print.c (dump_gimple_omp_target,
1612 dump_gimple_omp_teams): New functions.
1613 (pp_gimple_stmt_1): Handle GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
1614 * gimplify.c (enum gimplify_omp_var_data): Add GOVD_MAP.
1615 (enum omp_region_type): Add ORT_TEAMS, ORT_TARGET and ORT_TARGET_DATA.
1616 (omp_add_variable): Add temporary assertions.
1617 (omp_notice_threadprivate_variable): Complain if threadprivate vars
1618 appear in target region.
1619 (omp_notice_variable): ORT_TARGET, ORT_TARGET_DATA and ORT_TEAMS
1621 (omp_check_private): Ignore ORT_TARGET and ORT_TARGET_DATA regions.
1622 (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_MAP, OMP_CLAUSE_TO,
1623 OMP_CLAUSE_FROM, OMP_CLAUSE_NUM_TEAMS, OMP_CLAUSE_DIST_SCHEDULE
1624 and OMP_CLAUSE_DEVICE.
1625 (gimplify_adjust_omp_clauses): Likewise.
1626 (gimplify_adjust_omp_clauses_1): Handle GOVD_MAP. Fix up
1627 check for privatization by also testing for GOVD_LINEAR.
1628 (gimplify_omp_for): Adjust gimple_build_omp_for caller.
1630 (gimplify_omp_workshare): Handle also OMP_TARGET, OMP_TARGET_DATA
1631 and OMP_TEAMS. Clear *expr_p.
1632 (gimplify_omp_target_update): New function.
1633 (gimplify_expr): Handle OMP_TARGET, OMP_TARGET_DATA, OMP_TARGET_UPDATE
1636 2013-05-20 Jakub Jelinek <jakub@redhat.com>
1638 * omp-low.c (expand_omp_simd): For collapse > 1 loops,
1639 if some loop condition might be not true initially, add runtime
1640 test and skip the whole loop.
1642 2013-05-14 Jakub Jelinek <jakub@redhat.com>
1644 * cfgloop.h (struct loop): Add safelen and force_vect fields.
1645 * function.h (struct function): Add has_force_vect_loops field.
1646 * omp-low.c (expand_omp_simd): If !broken_loop, create loop for
1647 the simd region and set safelen and force_vect fields in it.
1648 * tree-vectorizer.c (vectorize_loops): If loop has force_vect set,
1649 vectorize it even if flag_vectorize isn't set. Clear loop->force_vect
1650 after vectorization.
1651 * tree-ssa-loop.c (gate_tree_vectorize): Return true even
1652 cfun->has_force_vect_loops.
1653 * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Don't
1654 unroll loops with loop->force_vect.
1655 * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): For
1656 unknown or bad data dependency, if loop->safelen is non-zero, just
1657 decrease *max_vf to loop->safelen if needed and return false.
1658 * tree-if-conv.c (main_tree_if_conversion): If-convert also loops with
1660 (gate_tree_if_conversion): Return true even if
1661 cfun->has_force_vect_loops.
1663 2013-05-09 Jakub Jelinek <jakub@redhat.com>
1665 * tree.c (omp_declare_simd_clauses_equal): New function.
1666 (attribute_value_equal): Call it for -fopenmp if
1667 TREE_VALUE of the attributes are both OMP_CLAUSEs.
1668 * tree.h (omp_declare_simd_clauses_equal): Declare.
1670 2013-04-30 Jakub Jelinek <jakub@redhat.com>
1672 * gimple-pretty-print.c (dump_gimple_omp_atomic_load,
1673 dump_gimple_omp_atomic_store): Handle gimple_omp_atomic_seq_cst_p.
1674 * gimple.h (enum gf_mask): Add GF_OMP_ATOMIC_SEQ_CST.
1675 (gimple_omp_atomic_set_seq_cst, gimple_omp_atomic_seq_cst_p): New
1677 * omp-low.c (expand_omp_atomic_load, expand_omp_atomic_store,
1678 expand_omp_atomic_fetch_op): If gimple_omp_atomic_seq_cst_p,
1679 pass MEMMODEL_SEQ_CST instead of MEMMODEL_RELAXED to the builtin.
1680 * gimplify.c (gimplify_omp_atomic): Handle OMP_ATOMIC_SEQ_CST.
1681 * tree-pretty-print.c (dump_generic_node): Handle OMP_ATOMIC_SEQ_CST.
1682 * tree.def (OMP_ATOMIC): Add comment that OMP_ATOMIC* must stay
1684 * tree.h (OMP_ATOMIC_SEQ_CST): Define.
1686 * omp-low.c (check_omp_nesting_restrictions): Diagnose
1687 OpenMP constructs nested inside simd region. Don't treat
1688 #pragma omp simd as work-sharing region. Disallow work-sharing
1689 constructs inside of critical region. Complain if ordered
1690 region is nested inside of parallel region without loop
1692 (scan_omp_1_stmt): Call check_omp_nesting_restrictions even
1693 for GOMP_{cancel{,lation_point},taskyield,taskwait} calls.
1695 2013-04-23 Jakub Jelinek <jakub@redhat.com>
1697 * Makefile.in (omp-low.o): Depend on $(TARGET_H).
1698 * gimplify.c (gimplify_adjust_omp_clauses): For linear clauses
1699 if outer_context is non-NULL, but not ORT_COMBINED_PARALLEL,
1700 call omp_notice_variable. Remove aligned clauses that can't
1702 * omp-low.c: Include target.h.
1703 (scan_sharing_clauses): For aligned clauses with global arrays
1704 register local replacement.
1705 (omp_clause_aligned_alignment): New function.
1706 (lower_rec_input_clauses): For aligned clauses for global
1707 arrays or automatic pointers emit __builtin_assume_aligned
1708 before the loop if possible.
1709 (expand_omp_regimplify_p, expand_omp_build_assign): New functions.
1710 (expand_omp_simd): Use them. Handle pointer iterators and broken
1712 (lower_omp_for): Call lower_omp on gimple_omp_body_ptr after
1713 calling lower_rec_input_clauses, not before it.
1715 2013-04-19 Jakub Jelinek <jakub@redhat.com>
1717 * tree.h (OMP_CLAUSE_LINEAR_NO_COPYIN,
1718 OMP_CLAUSE_LINEAR_NO_COPYOUT): Define.
1719 * omp-low.c (extract_omp_for_data): Handle #pragma omp simd.
1720 (build_outer_var_ref): For #pragma omp simd allow linear etc.
1721 clauses to bind even to private vars.
1722 (scan_sharing_clauses): Handle OMP_CLAUSE_LINEAR, OMP_CLAUSE_ALIGNED
1723 and OMP_CLAUSE_SAFELEN.
1724 (lower_rec_input_clauses): Handle OMP_CLAUSE_LINEAR. Don't emit
1725 a GOMP_barrier call for firstprivate/lastprivate in #pragma omp simd.
1726 (lower_lastprivate_clauses): Handle also OMP_CLAUSE_LINEAR.
1727 (expand_omp_simd): New function.
1728 (expand_omp_for): Handle #pragma omp simd.
1729 * gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR and
1730 GOVD_ALIGNED, add GOVD_LINEAR into GOVD_DATA_SHARE_CLASS.
1731 (enum omp_region_type): Add ORT_SIMD.
1732 (gimple_add_tmp_var, gimplify_var_or_parm_decl, omp_check_private,
1733 omp_firstprivatize_variable, omp_notice_variable): Handle ORT_SIMD
1735 (omp_is_private): Likewise. Add SIMD argument, tweak diagnostics
1736 and add extra errors in simd constructs.
1737 (gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses): Handle
1738 OMP_CLAUSE_LINEAR, OMP_CLAUSE_ALIGNED and OMP_CLAUSE_SAFELEN.
1739 (gimplify_adjust_omp_clauses_1): Handle GOVD_LASTPRIVATE and
1741 (gimplify_omp_for): Handle #pragma omp simd.
1743 2013-04-10 Jakub Jelinek <jakub@redhat.com>
1745 * builtin-types.def (DEF_FUNCTION_TYPE_8): Document.
1746 (BT_FN_VOID_OMPFN_PTR_UINT, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG,
1747 BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG): Remove.
1748 (BT_FN_VOID_OMPFN_PTR_UINT_UINT_UINT,
1749 BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_UINT,
1750 BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG_UINT): New.
1751 * gimplify.c (gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses):
1752 Handle OMP_CLAUSE_PROC_BIND.
1753 * omp-builtins.def (BUILT_IN_GOMP_TASKGROUP_START,
1754 BUILT_IN_GOMP_TASKGROUP_END, BUILT_IN_GOMP_PARALLEL_LOOP_STATIC,
1755 BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC,
1756 BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED,
1757 BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME, BUILT_IN_GOMP_PARALLEL,
1758 BUILT_IN_GOMP_PARALLEL_SECTIONS): New built-ins.
1759 (BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START,
1760 BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START,
1761 BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START,
1762 BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START,
1763 BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END,
1764 BUILT_IN_GOMP_PARALLEL_SECTIONS_START): Remove.
1765 * omp-low.c (scan_sharing_clauses): Handle OMP_CLAUSE_PROC_BIND.
1766 (expand_parallel_call): Expand #pragma omp parallel* as
1767 calls to the new GOMP_parallel_* APIs without _start at the end,
1768 instead of GOMP_parallel_*_start followed by fn.omp_fn.N call,
1769 followed by GOMP_parallel_end. Handle OMP_CLAUSE_PROC_BIND.
1770 * tree-ssa-alias.c (ref_maybe_used_by_call_p_1,
1771 call_may_clobber_ref_p_1): Handle BUILT_IN_GOMP_TASKGROUP_END
1772 instead of BUILT_IN_GOMP_PARALLEL_END.
1774 2013-03-27 Jakub Jelinek <jakub@redhat.com>
1776 * gimple-pretty-print.c (dump_gimple_omp_for): Handle different
1777 GIMPLE_OMP_FOR kinds.
1778 * tree.def (OMP_SIMD, OMP_FOR_SIMD, OMP_DISTRIBUTE): New tree codes.
1779 * gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_MASK,
1780 GF_OMP_FOR_KIND_FOR, GF_OMP_FOR_KIND_SIMD, GF_OMP_FOR_KIND_FOR_SIMD
1781 and GF_OMP_FOR_KIND_DISTRIBUTE.
1782 (gimple_omp_for_kind, gimple_omp_for_set_kind): New inline functions.
1783 * gimplify.c (is_gimple_stmt, gimplify_omp_for, gimplify_expr): Handle
1784 OMP_SIMD, OMP_FOR_SIMD and OMP_DISTRIBUTE.
1785 * tree.c (omp_clause_num_ops, omp_clause_code_name, walk_tree_1):
1786 Handle new OpenMP 4.0 clauses.
1787 * tree-pretty-print.c (dump_omp_clause): Likewise.
1788 (dump_generic_node): Handle OMP_SIMD, OMP_FOR_SIMD and OMP_DISTRIBUTE.
1789 * tree.h (enum omp_clause_code): Add OMP_CLAUSE_LINEAR,
1790 OMP_CLAUSE_ALIGNED, OMP_CLAUSE_DEPEND, OMP_CLAUSE_FROM, OMP_CLAUSE_TO,
1791 OMP_CLAUSE_UNIFORM, OMP_CLAUSE_MAP, OMP_CLAUSE_DEVICE,
1792 OMP_CLAUSE_DIST_SCHEDULE, OMP_CLAUSE_INBRANCH, OMP_CLAUSE_NOTINBRANCH,
1793 OMP_CLAUSE_NUM_TEAMS, OMP_CLAUSE_PROC_BIND, OMP_CLAUSE_SAFELEN,
1794 OMP_CLAUSE_SIMDLEN, OMP_CLAUSE_FOR, OMP_CLAUSE_PARALLEL,
1795 OMP_CLAUSE_SECTIONS and OMP_CLAUSE_TASKGROUP.
1796 (OMP_LOOP_CHECK): Define.
1797 (OMP_FOR_BODY, OMP_FOR_CLAUSES, OMP_FOR_INIT, OMP_FOR_COND,
1798 OMP_FOR_INCR, OMP_FOR_PRE_BODY): Use OMP_LOOP_CHECK instead of
1800 (OMP_CLAUSE_DECL): Extend check range up to OMP_CLAUSE_MAP.
1801 (OMP_CLAUSE_LINEAR_STEP, OMP_CLAUSE_ALIGNED_ALIGNMENT,
1802 OMP_CLAUSE_NUM_TEAMS_EXPR, OMP_CLAUSE_DEVICE_ID,
1803 OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR, OMP_CLAUSE_SAFELEN_EXPR,
1804 OMP_CLAUSE_SIMDLEN_EXPR): Define.
1805 (enum omp_clause_depend_kind, enum omp_clause_map_kind,
1806 enum omp_clause_proc_bind_kind): New enums.
1807 (OMP_CLAUSE_DEPEND_KIND, OMP_CLAUSE_MAP_KIND,
1808 OMP_CLAUSE_PROC_BIND_KIND): Define.
1809 (struct tree_omp_clause): Add subcode.depend_kind, subcode.map_kind
1810 and subcode.proc_bind_kind.
1811 (find_omp_clause): New prototype.
1812 * omp-builtins.def (BUILT_IN_GOMP_CANCEL,
1813 BUILT_IN_GOMP_CANCELLATION_POINT): New built-ins.
1814 * tree-flow.h (find_omp_clause): Remove prototype.
1816 Copyright (C) 2013-2014 Free Software Foundation, Inc.
1818 Copying and distribution of this file, with or without modification,
1819 are permitted in any medium without royalty provided the copyright
1820 notice and this notice are preserved.