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