1 2021-07-26 Thomas Schwinge <thomas@codesourcery.com>
3 Backported from master:
4 2021-07-12 Martin Liska <mliska@suse.cz>
7 * gcc.c (check_offload_target_name): Call
8 candidates_list_and_hint only if we have a candidate.
10 Backported from master:
11 2021-06-30 Tobias Burnus <tobias@codesourcery.com>
13 * common.opt (foffload): Remove help as Driver only.
14 * gcc.c (display_help): Add -foffload.
16 Backported from master:
17 2021-06-30 Tobias Burnus <tobias@codesourcery.com>
19 * gcc.c (close_at_file, execute): Replace alloca by XALLOCAVEC.
20 (check_offload_target_name): Fix splitting OFFLOAD_TARGETS into
21 a candidate list; better inform no offload target is configured
22 and fix hint extraction when passed target is not '\0' at [len].
23 * common.opt (foffload): Add tailing '.'.
24 (foffload-options): Likewise; fix flag name in the help string.
26 2021-07-20 Andrew Stubbs <ams@codesourcery.com>
30 * config/gcn/gcn-hsa.h (DRIVER_SELF_SPECS): New.
31 (ASM_SPEC): Set -mattr for xnack and sram-ecc.
32 * config/gcn/gcn-opts.h (enum sram_ecc_type): New.
33 * config/gcn/gcn-valu.md: Add a warning comment.
34 * config/gcn/gcn.c (gcn_option_override): Add "sorry" for -mxnack.
35 (output_file_start): Add xnack and sram-ecc state to ".amdgcn_target".
36 * config/gcn/gcn.md: Add a warning comment.
37 * config/gcn/gcn.opt: Add -mxnack and -msram-ecc.
38 * config/gcn/mkoffload.c (EF_AMDGPU_MACH_AMDGCN_GFX908): Remove
40 (EF_AMDGPU_XNACK): New.
41 (EF_AMDGPU_SRAM_ECC): New.
43 (copy_early_debug_info): Use elf_flags.
44 (main): Handle -mxnack and -msram-ecc options.
45 * doc/invoke.texi: Document -mxnack and -msram-ecc.
47 2021-06-29 Tobias Burnus <tobias@codesourcery.com>
49 Backported from master:
50 2021-06-29 Tobias Burnus <tobias@codesourcery.com>
52 * gcc.c (check_offload_target_name): Cast len argument to
53 %q.*s to 'int'; avoid -Wstringop-truncation warning.
55 2021-06-29 Tobias Burnus <tobias@codesourcery.com>
57 Backported from master:
58 2021-06-29 Tobias Burnus <tobias@codesourcery.com>
61 * common.opt (-foffload=): Update description.
62 (-foffload-options=): New.
63 * doc/invoke.texi (C Language Options): Document
64 -foffload and -foffload-options.
65 * gcc.c (check_offload_target_name): New, split off from
66 handle_foffload_option.
67 (check_foffload_target_names): New.
68 (handle_foffload_option): Handle -foffload=default.
69 (driver_handle_option): Update for -foffload-options.
70 * lto-opts.c (lto_write_options): Use -foffload-options
72 * lto-wrapper.c (merge_and_complain, append_offload_options):
74 * opts.c (common_handle_option): Likewise.
76 2021-06-29 Tobias Burnus <tobias@codesourcery.com>
78 Backported from master:
79 2021-06-29 Tobias Burnus <tobias@codesourcery.com>
81 * doc/invoke.texi (C Language Options): Sort options
82 alphabetically in optlist and also the description itself.
83 Remove leftover -fallow-single-precision from and add missing
84 -fgnu-tm to the optlist.
86 2021-06-23 Tobias Burnus <tobias@codesourcery.com>
88 Backported from master:
89 2021-06-23 Jakub Jelinek <jakub@redhat.com>
92 * omp-low.c (lower_omp_regimplify_p): Regimplify also PARM_DECLs
93 and RESULT_DECLs that have DECL_HAS_VALUE_EXPR_P set.
95 2021-06-22 Marcel Vollweiler <marcel@codesourcery.com>
97 gcc/configure.ac: fix register issue for global_load assembler functions
99 * config.in: Regenerate.
100 * config/gcn/gcn.c (print_operand_address): Fix for global_load
102 * configure: Regenerate.
103 * configure.ac: Fix for global_load assembler functions.
105 2021-06-15 Tobias Burnus <tobias@codesourcery.com>
107 Backported from master:
108 2021-06-15 Tobias Burnus <tobias@codesourcery.com>
111 * gimplify.c (enum gimplify_defaultmap_kind): Add GDMK_SCALAR_TARGET.
112 (struct gimplify_omp_ctx): Extend defaultmap array by one.
113 (new_omp_context): Init defaultmap[GDMK_SCALAR_TARGET].
114 (omp_notice_variable): Update type classification for Fortran.
115 (gimplify_scan_omp_clauses): Update calls for new argument; handle
116 GDMK_SCALAR_TARGET; for Fortran, GDMK_POINTER avoid GOVD_MAP_0LEN_ARRAY.
117 * langhooks-def.h (lhd_omp_scalar_p): Add 'ptr_ok' argument.
118 * langhooks.c (lhd_omp_scalar_p): Likewise.
119 (LANG_HOOKS_OMP_ALLOCATABLE_P, LANG_HOOKS_OMP_SCALAR_TARGET_P): New.
120 (LANG_HOOKS_DECLS): Add them.
121 * langhooks.h (struct lang_hooks_for_decls): Add new hooks, update
122 omp_scalar_p pointer type to include the new bool argument.
124 2021-06-15 Tobias Burnus <tobias@codesourcery.com>
126 Backported from master:
127 2021-06-11 Thomas Schwinge <thomas@codesourcery.com>
129 * tree-pretty-print.h (dump_omp_clauses): Add 'bool = true'
131 * tree-pretty-print.c (dump_omp_clauses): Update.
132 (dump_generic_node) <OMP_CLAUSE>: Use it.
134 2021-06-08 Tobias Burnus <tobias@codesourcery.com>
136 Backported from master:
137 2021-06-08 Jakub Jelinek <jakub@redhat.com>
140 * tree-inline.c (copy_tree_body_r): For OMP_CLAUSE_DEPEND don't
141 check TREE_CODE if OMP_CLAUSE_DECL is NULL.
143 2021-06-04 Tobias Burnus <tobias@codesourcery.com>
145 Backported from master:
146 2021-06-04 Tobias Burnus <tobias@codesourcery.com>
148 * tree-nested.c (convert_nonlocal_omp_clauses,
149 convert_local_omp_clauses): Handle OMP_CLAUSE_BIND.
151 2021-06-04 Tobias Burnus <tobias@codesourcery.com>
153 Backported from master:
154 2021-06-03 Jakub Jelinek <jakub@redhat.com>
157 * tree-inline.c (copy_tree_body_r): Handle iterators on
158 OMP_CLAUSE_AFFINITY or OMP_CLAUSE_DEPEND.
160 2021-05-31 Tobias Burnus <tobias@codesourcery.com>
162 Backported from master:
163 2021-05-29 Jakub Jelinek <jakub@redhat.com>
166 * gimplify.c (gimplify_scan_omp_clauses): For taskloop simd
167 combined with parallel, make sure to add shared clause to
168 parallel for explicit linear clause.
170 2021-05-28 Tobias Burnus <tobias@codesourcery.com>
172 Backported from master:
173 2021-05-28 Jakub Jelinek <jakub@redhat.com>
175 * tree.h (OMP_CLAUSE_MAP_IMPLICIT): Define.
177 2021-05-28 Tobias Burnus <tobias@codesourcery.com>
179 Backported from master:
180 2021-05-28 Tobias Burnus <tobias@codesourcery.com>
182 * gimplify.c (gimplify_omp_affinity): New.
183 (gimplify_scan_omp_clauses): Call it; remove affinity clause afterwards.
184 * tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_AFFINITY.
185 * tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE_AFFINITY.
186 * tree.c (omp_clause_num_ops, omp_clause_code_name): Add clause.
187 (walk_tree_1): Handle OMP_CLAUSE_AFFINITY.
189 2021-05-26 Tobias Burnus <tobias@codesourcery.com>
191 Backported from master:
192 2021-05-26 Jakub Jelinek <jakub@redhat.com>
195 * omp-low.c: Include omp-offload.h.
196 (create_omp_child_function): If current_function_decl has
197 "omp declare target" attribute and is_gimple_omp_offloaded,
198 remove that attribute from the copy of attribute list and
199 add "omp target entrypoint" attribute instead.
200 (lower_omp_target): Mark .omp_data_sizes.* and .omp_data_kinds.*
201 variables for offloading if in omp_maybe_offloaded_ctx.
202 * omp-offload.c (pass_omp_target_link::execute): Nullify second
203 argument to GOMP_target_data_ext in offloaded code.
205 2021-05-23 Tobias Burnus <tobias@codesourcery.com>
207 Backported from master:
208 2021-05-21 Jakub Jelinek <jakub@redhat.com>
211 * tree.h (OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET): Define.
212 * gimplify.c (enum gimplify_omp_var_data): Fix up
213 GOVD_MAP_HAS_ATTACHMENTS value, add GOVD_FIRSTPRIVATE_IMPLICIT.
214 (omp_lastprivate_for_combined_outer_constructs): If combined target
215 has GOVD_FIRSTPRIVATE_IMPLICIT set for the decl, change it to
216 GOVD_MAP | GOVD_SEEN.
217 (gimplify_scan_omp_clauses): Set GOVD_FIRSTPRIVATE_IMPLICIT for
218 firstprivate clauses with OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT.
219 (gimplify_adjust_omp_clauses): For firstprivate clauses with
220 OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT either clear that bit and
221 OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET too, or remove it and
222 let it be replaced by implicit map clause.
224 2021-05-23 Tobias Burnus <tobias@codesourcery.com>
226 Backported from master:
227 2021-05-21 Jakub Jelinek <jakub@redhat.com>
230 * gimplify.c (omp_lastprivate_for_combined_outer_constructs): New
232 (gimplify_scan_omp_clauses) <case OMP_CLAUSE_LASTPRIVATE>: Use it.
233 (gimplify_omp_for): Likewise.
235 2021-05-20 Tobias Burnus <tobias@codesourcery.com>
237 Backported from master:
238 2021-05-20 Jakub Jelinek <jakub@redhat.com>
241 * gimplify.c (gimplify_scan_omp_clauses) <case OMP_CLAUSE_LINEAR>: For
242 explicit linear clause when combined with target, make it map(tofrom:)
243 instead of no clause or firstprivate.
245 2021-05-19 Tobias Burnus <tobias@codesourcery.com>
247 Backported from master:
248 2021-05-19 Jakub Jelinek <jakub@redhat.com>
251 * tree.h (OMP_MASTER_COMBINED): Define.
252 * gimplify.c (gimplify_scan_omp_clauses): Rewrite lastprivate
253 handling for outer combined/composite constructs to a loop.
254 Handle lastprivate on combined target.
255 (gimplify_expr): Formatting fix.
257 2021-05-18 Tobias Burnus <tobias@codesourcery.com>
259 Backported from master:
260 2021-05-17 Tom de Vries <tdevries@suse.de>
263 * config/nvptx/nvptx-protos.h (nvptx_output_atomic_insn): Declare
264 * config/nvptx/nvptx.c (nvptx_output_barrier)
265 (nvptx_output_atomic_insn): New function.
266 (nvptx_print_operand): Add support for 'B'.
267 * config/nvptx/nvptx.md: Use nvptx_output_atomic_insn for atomic
270 2021-05-14 Tobias Burnus <tobias@codesourcery.com>
272 Backported from master:
273 2021-05-12 Tom de Vries <tdevries@suse.de>
276 * config/nvptx/nvptx-opts.h (enum ptx_version): New enum.
277 * config/nvptx/nvptx.c (nvptx_file_start): Print .version according
278 to ptx_version_option.
279 * config/nvptx/nvptx.h (TARGET_PTX_6_3): Define.
280 * config/nvptx/nvptx.md (define_insn "nvptx_shuffle<mode>")
281 (define_insn "nvptx_vote_ballot"): Use sync variant for
283 * config/nvptx/nvptx.opt (ptx_version): Add enum.
285 * doc/invoke.texi (Nvidia PTX Options): Add mptx item.
287 2021-05-14 Tobias Burnus <tobias@codesourcery.com>
289 Backported from master:
290 2021-05-07 Tobias Burnus <tobias@codesourcery.com>
291 Tom de Vries <tdevries@suse.de>
293 * omp-low.c (lower_rec_simd_input_clauses): Set max_vf = 1 if
294 a truth_value_p reduction variable is nonintegral.
296 2021-05-14 Tobias Burnus <tobias@codesourcery.com>
298 Backported from master:
299 2021-05-04 Tobias Burnus <tobias@codesourcery.com>
301 * omp-low.c (lower_rec_input_clauses, lower_reduction_clauses): Handle
302 && and || with floating-point and complex arguments.
304 2021-05-14 Tobias Burnus <tobias@codesourcery.com>
306 Backported from master:
307 2021-05-03 Tom de Vries <tdevries@suse.de>
310 * omp-low.c (lower_rec_input_clauses): Disable SIMT for user-defined
313 2021-05-14 Tobias Burnus <tobias@codesourcery.com>
315 Backported from master:
316 2021-04-29 Tom de Vries <tdevries@suse.de>
318 * omp-expand.c (expand_omp_simd): Add step_orig, and replace uses of
319 fd->loop.step by either step or orig_step.
320 Backported from master:
322 2021-05-13 Kwok Cheung Yeung <kcy@codesourcery.com>
324 * omp-offload.c (oacc_xform_loop): Remove vec_tiles.
326 2021-05-05 Chung-Lin Tang <cltang@codesourcery.com>
328 * tree.h (OMP_CLAUSE_MAP_IMPLICIT_P): New access macro for 'implicit'
329 bit, using 'base.deprecated_flag' field of tree_node.
330 * tree-pretty-print.c (dump_omp_clause): Add support for printing
331 implicit attribute in tree dumping.
332 * gimplify.c (gimplify_adjust_omp_clauses_1):
333 Set OMP_CLAUSE_MAP_IMPLICIT_P to 1 if map clause is implicitly created.
334 (gimplify_adjust_omp_clauses): Adjust place of adding implicitly created
335 clauses, from simple append, to starting of list, after non-map clauses.
336 * omp-low.c (lower_omp_target): Add GOMP_MAP_IMPLICIT bits into kind
337 values passed to libgomp for implicit maps.
339 2021-04-30 Kwok Cheung Yeung <kcy@codesourcery.com>
341 Backport from mainline
342 2021-04-23 Thomas Schwinge <thomas@codesourcery.com>
344 * omp-offload.c (oacc_validate_dims): Implement
345 '-Wopenacc-parallelism'.
346 * doc/invoke.texi (-Wopenacc-parallelism): Document.
348 2021-04-07 Kwok Cheung Yeung <kcy@codesourcery.com>
350 * omp-low.c (is_oacc_parallel_or_serial): Handle
351 GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED and
352 GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE.
354 2021-03-01 Kwok Cheung Yeung <kcy@codesourcery.com>
356 * omp-expand.c (expand_oacc_for): Convert .tile variable to
357 diff_type before multiplying.
358 * omp-general.c (omp_extract_for_data): Use accumulated precision
359 of all collapsed for-loops as precision of iteration variable, up
360 to the precision of a long long.
362 2020-08-24 Tobias Burnus <tobias@codesourcery.com>
364 * omp-sese.c: Fix comment typo.
366 2020-08-19 Sandra Loosemore <sandra@codesourcery.com>
368 Add a "combined" flag for "acc kernels loop" etc directives.
370 * tree.h (OACC_LOOP_COMBINED): New.
372 2020-07-30 Julian Brown <julian@codesourcery.com>
374 * config/gcn/gcn-tree.c (gcn_goacc_get_worker_red_decl): Do not
375 cache/share decls for reduction temporaries between invocations.
376 (gcn_goacc_reduction_teardown): Unshare VAR on second use.
377 * config/gcn/gcn.c (gcn_init_machine_status): Do not initialise
379 * config/gcn/gcn.h (machine_function): Remove reduc_decls cache.
381 2020-07-30 Julian Brown <julian@codesourcery.com>
383 * config/gcn/gcn-tree.c (gcn_goacc_reduction_teardown): Remove useless
384 temporary variable "decl".
386 2020-07-15 Kwok Cheung Yeung <kcy@codesourcery.com>
387 Andrew Stubbs <ams@codesourcery.com>
389 * plugin/plugin-gcn.c (parse_target_attributes): Automatically set
390 the number of teams and threads if necessary.
391 (gcn_exec): Automatically set the number of gangs and workers if
394 2020-07-15 Julian Brown <julian@codesourcery.com>
396 * config/gcn/gcn.c (gimple.h): Include.
397 (gcn_fork_join): Emit barrier for worker-level joins.
398 * omp-sese.c (find_local_vars_to_propagate): Add writes_gangprivate
399 bitmap parameter. Set bit for blocks containing gang-private variable
401 (worker_single_simple): Don't emit barrier after predicated block.
402 (worker_single_copy): Don't emit barrier if we're not broadcasting
403 anything and the block contains no gang-private writes.
404 (neuter_worker_single): Don't predicate blocks that only contain NOPs
405 or internal marker functions. Pass has_gangprivate_write argument to
407 (oacc_do_neutering): Add writes_gangprivate bitmap handling.
409 2020-07-15 Julian Brown <julian@codesourcery.com>
411 * config/gcn/gcn-valu.md (scatter<mode>_insn_1offset_ds<exec_scatter>):
413 (*mov<mode>_insn, *movti_insn): Add waitcnt to ds_write alternatives.
415 2020-07-15 Julian Brown <julian@codesourcery.com>
417 * config/gcn/gcn-protos.h (gcn_goacc_adjust_private_decl): Update
419 * config/gcn/gcn-tree.c (gcn_goacc_get_worker_red_decl): Use
420 preallocated block of LDS memory.
421 (gcn_goacc_create_propagation_record): Add OFFSET parameter, and return
422 temporary LDS space at that offset. Return pointer in "sender" case.
423 (gcn_goacc_adjust_private_decl): Return var.
424 * config/gcn/gcn.c (acc_lds_size, gangprivate_hwm, lds_allocs): New
426 (ACC_LDS_SIZE): Define as acc_lds_size.
427 (gcn_init_machine_status): Don't initialise lds_allocated and
428 lds_allocs fields of machine function struct.
429 (gcn_option_override): Handle default size for gang-private variables
430 and -mgang-local-size option.
431 (gcn_expand_prologue): Use LDS_SIZE instead of LDS_SIZE-1 when
433 (gcn_shared_mem_layout): New function.
434 (gcn_print_lds_decl): Update comment. Use global lds_allocs map and
435 gangprivate_hwm variable.
436 (TARGET_GOACC_SHARED_MEM_LAYOUT): Define target hook.
437 * config/gcn/gcn.h (machine_function): Remove lds_allocated,
438 lds_allocs. Add reduction_base, reduction_limit.
439 * config/gcn/gcn.opt (gang_local_size_opt): New global.
440 (mgang-local-size=): New option.
441 * config/nvptx/nvptx.c (nvptx_goacc_adjust_private_decl): Return var.
442 * doc/tm.texi.in (TARGET_GOACC_SHARED_MEM_LAYOUT): Place documentation
444 * doc/tm.texi: Regenerate.
445 * omp-offload.c (addr_expr_rewrite_info): Change adjusted_vars to a
447 (rewrite_addr_expr): Rewrite VAR_DECLs also.
448 (default_goacc_create_propagation_record): Add OFFSET parameter.
449 (execute_oacc_gimple_workers): Calculate per-function reduction
450 temporary and private-variable size. Call OpenACC shared_mem_layout
451 hook. Move num_workers==1 handling here.
452 (execute_oacc_device_lower): Fix for adjusted_vars being a hash_map
453 rather than a hash_set.
454 (pass_oacc_gimple_workers::gate): Remove num_workers==1 handling from
455 here. Enable pass for all OpenACC routines in order to call shared
457 * omp-sese.c (targhooks.h, diagnostic-core.h): Add includes.
458 (build_sender_ref): Handle sender_decl being pointer.
459 (worker_single_copy): Add PLACEMENT and ISOLATE_BROADCASTS parameters.
460 Pass placement argument to create_propagation_record hook invocations.
461 Handle sender_decl being pointer and isolate_broadcasts inserting extra
463 (blk_offset_map_t): Add typedef.
464 (neuter_worker_single): Add BLK_OFFSET_MAP parameter. Pass
465 preallocated range to worker_single_copy call.
466 (dfs_broadcast_reachable_1): New function.
467 (idx_decl_pair_t, used_range_vec_t): New typedefs.
468 (sort_size_descending): New function.
469 (addr_range): New class.
470 (splay_tree_compare_addr_range, splay_tree_free_key, first_fit_range,
471 merge_ranges_1, merge_ranges): New functions.
472 (oacc_do_neutering): Add BOUNDS_LO, BOUNDS_HI parameters. Arrange
473 layout of shared memory for broadcast operations.
474 * omp-sese.h (oacc_do_neutering): Update prototype.
475 * target.def (adjust_private_decl): Change return type to tree.
476 (create_propagation_record): Add OFFSET parameter.
477 (shared_mem_layout): New hook.
478 * targhooks.h (default_goacc_create_propagation_record): Update
481 2020-07-15 Julian Brown <julian@codesourcery.com>
483 * omp-offload.c (pass_oacc_gimple_workers::gate): Disable worker
484 partitioning if num_workers is 1.
486 2020-06-06 Kwok Cheung Yeung <kcy@codesourcery.com>
488 * omp-sese.c (oacc_build_component_ref): Apply address space of
489 base object to the entire component reference.
491 2020-03-27 Sandra Loosemore <sandra@codesourcery.com>
493 * doc/invoke.texi (Option Summary): Add entries for
494 -Wopenacc-kernels-annotate-loops and
495 -fno-openacc-kernels-annotate-loops.
496 (Warning Options): Document -Wopenacc-kernels-annotate-loops.
497 (Optimization Options): Document -fno-openacc-kernels-annotate-loops.
499 2020-03-19 Kwok Cheung Yeung <kcy@codesourcery.com>
501 * omp-offload.c (oacc_loop_auto_partitions): Check for 'omp declare
502 target' attributes with a gang clause attached.
504 2020-03-16 Tobias Burnus <tobias@codesourcery.com>
506 * omp-oacc-kernels-decompose.cc (maybe_build_inner_data_region):
507 is_gimple_reg vars are not yet mapped, fall through to map is as
508 before the transformation.
509 (omp_oacc_kernels_decompose_1): Don't map is_gimple_reg vars.
510 (decompose_kernels_region_body): Use tofrom for is_gimple_reg vars.
511 (omp_oacc_kernels_decompose_1): Handle is_gimple_reg vars as without
514 2020-03-12 Kwok Cheung Yeung <kcy@codesourcery.com>
516 * omp-sese.c (install_var_field): Generate a field name for a VAR_DECL
517 using the DECL_UID if it does not have a DECL_NAME.
519 2019-10-21 Julian Brown <julian@codesourcery.com>
521 * omp-oacc-kernels-decompose.cc (decompose_kernels_region_body): Add
522 inhibit_async parameter. Force asynchronous kernel launches to
523 run synchronously if they have problematic variable mappings.
524 Don't add explicit wait for decomposed kernels regions we forced
526 (omp_oacc_kernels_decompose_1): Detect problematic variable mappings,
527 and inhibit asynchronous execution if we find any.
529 2020-02-06 Tobias Burnus <tobias@codesourcery.com>
531 * omp-low.c (convert_from_firstprivate_int):
532 Use VIEW_CONVERT also for vectors.
534 2020-02-20 Kwok Cheung Yeung <kcy@codesourcery.com>
536 * omp-general.c (oacc_verify_routine_clauses): Handle
539 2020-02-19 Julian Brown <julian@codesourcery.com>
541 * gimplify.c (gimplify_scan_omp_clauses): Handle
542 GOMP_MAP_DECLARE_ALLOCATE and GOMP_MAP_DECLARE_DEALLOCATE.
544 2018-10-04 Cesar Philippidis <cesar@codesourcery.com>
545 Julian Brown <julian@codesourcery.com>
547 * omp-low.c (scan_sharing_clauses): Update handling of OpenACC declare
548 create, declare copyin and declare deviceptr to have local lifetimes.
549 (convert_to_firstprivate_int): Handle pointer types.
550 (convert_from_firstprivate_int): Likewise. Create local storage for
551 the values being pointed to. Add new orig_type argument.
552 (lower_omp_target): Handle GOMP_MAP_DECLARE_{ALLOCATE,DEALLOCATE}.
553 Add orig_type argument to convert_from_firstprivate_int call.
554 Allow pointer types with GOMP_MAP_FIRSTPRIVATE_INT. Don't privatize
556 * tree-pretty-print.c (dump_omp_clause): Handle
557 GOMP_MAP_DECLARE_{ALLOCATE,DEALLOCATE}.
559 2019-10-16 Julian Brown <julian@codesourcery.com>
560 Tobias Burnus <tobias@codesourcery.com>
562 * config/gcn/gcn-protos.h (gcn_goacc_adjust_gangprivate_decl): Rename
564 (gcn_goacc_adjust_private_decl): ...this.
565 * config/gcn/gcn-tree.c (diagnostic-core.h): Include.
566 (gcn_goacc_adjust_gangprivate_decl): Rename to...
567 (gcn_goacc_adjust_private_decl): ...this. Add LEVEL parameter.
568 * config/gcn/gcn.c (TARGET_GOACC_ADJUST_GANGPRIVATE_DECL): Rename to...
569 (TARGET_GOACC_ADJUST_PRIVATE_DECL): ...this.
570 * config/nvptx/nvptx.c (tree-pretty-print.h): Include.
571 (nvptx_goacc_adjust_private_decl): New function.
572 (TARGET_GOACC_ADJUST_PRIVATE_DECL): Define hook using above function.
573 * doc/tm.texi.in (TARGET_GOACC_ADJUST_GANGPRIVATE_DECL): Rename to...
574 (TARGET_GOACC_ADJUST_PRIVATE_DECL): ...this.
575 * doc/tm.texi: Regenerated.
576 * internal-fn.c (expand_UNIQUE): Handle IFN_UNIQUE_OACC_PRIVATE.
577 * internal-fn.h (IFN_UNIQUE_CODES): Add OACC_PRIVATE.
578 * omp-low.c (omp_context): Remove oacc_partitioning_levels field.
579 (lower_oacc_reductions): Add PRIVATE_MARKER parameter. Insert before
581 (lower_oacc_head_tail): Add PRIVATE_MARKER parameter. Modify its
582 gimple call arguments as appropriate. Don't set
583 oacc_partitioning_levels in omp_context. Pass private_marker to
584 lower_oacc_reductions.
585 (oacc_record_private_var_clauses): Don't check for NULL ctx.
586 (mark_oacc_gangprivate): Remove unused function.
587 (make_oacc_private_marker): New function.
588 (lower_omp_for): Only call oacc_record_vars_in_bind for
589 OpenACC contexts. Create private marker and pass to
590 lower_oacc_head_tail.
591 (lower_omp_target): Remove unnecessary call to
592 oacc_record_private_var_clauses. Remove call to mark_oacc_gangprivate.
593 Create private marker and pass to lower_oacc_reductions.
594 (process_oacc_gangprivate_1): Remove.
595 (lower_omp_1): Only call oacc_record_vars_in_bind for OpenACC. Don't
596 iterate over contexts calling process_oacc_gangprivate_1.
597 (omp-offload.c (oacc_loop_xform_head_tail): Treat
598 private-variable markers like fork/join when transforming head/tail
600 (execute_oacc_device_lower): Use IFN_UNIQUE_OACC_PRIVATE instead of
601 "oacc gangprivate" attributes to determine partitioning level of
602 variables. Remove unused variables.
603 * omp-sese.c (find_gangprivate_vars): New function.
604 (find_local_vars_to_propagate): Use GANGPRIVATE_VARS parameter instead
605 of "oacc gangprivate" attribute to determine which variables are
607 (oacc_do_neutering): Use find_gangprivate_vars.
608 * target.def (adjust_gangprivate_decl): Rename to...
609 (adjust_private_decl): ...this. Update documentation (briefly).
611 2019-09-20 Julian Brown <julian@codesourcery.com>
613 * gimplify.c (localize_reductions): Rewrite references for
614 OMP_CLAUSE_PRIVATE also.
616 2019-09-17 Tobias Burnus <tobias@codesourcery.com>
618 * gimplify.c (gomp_oacc_needs_data_present): Remove unused variables.
619 * omp-low.c (process_oacc_gangprivate_1): Comment unused
620 parameter name to silence unused warning.
621 * omp-sese.c (omp_sese_number, omp_sese_pseudo): Remove
623 (oacc_do_neutering): Use signed int to avoid a warning.
625 2019-09-06 Julian Brown <julian@codesourcery.com>
627 * gimplify.c (gimplify_omp_for): Use for_stmt in call to
630 2019-09-06 Julian Brown <julian@codesourcery.com>
632 * config/nvptx/nvptx.c (omp-sese.h): Include.
633 (bb_pair_t, bb_pair_vec_t, pseudo_node_t, bracket, bracket_vec_t,
634 bb_sese, bb_sese::~bb_sese, bb_sese::append, bb_sese::remove,
635 BB_SET_SESE, BB_GET_SESE, nvptx_sese_number, nvptx_sese_pseudo,
636 nvptx_sese_color, nvptx_find_sese): Remove.
637 (nvptx_neuter_pars): Call omp_find_sese instead of nvptx_find_sese.
638 * omp-sese.c (omp-sese.h): Include.
639 (struct parallel): Rename to...
640 (struct parallel_g): This.
641 (parallel::parallel, parallel::~parallel): Rename to...
642 (parallel_g::parallel_g, parallel_g::~parallel_g): These.
643 (omp_sese_dump_pars, omp_sese_find_par, omp_sese_discover_pars,
644 populate_single_mode_bitmaps, find_ssa_names_to_propagate,
645 find_partitioned_var_uses, find_local_vars_to_propagate,
646 neuter_worker_single): Update for parallel_g name change.
647 (bb_pair_t, bb_pair_vec_t): Remove.
648 (omp_find_sese): Make global.
649 * omp-sese.h (bb_pair_t, bb_pair_vec_t): New.
650 (omp_find_sese): Add prototype.
652 2019-09-06 Julian Brown <julian@codesourcery.com>
654 * gimplify.c (gimplify_omp_workshare): Use OMP_CLAUSES, OMP_BODY
655 instead of OMP_TARGET_CLAUSES, OMP_TARGET_BODY.
657 2019-09-05 Julian Brown <julian@codesourcery.com>
659 * config/gcn/gcn.c (gcn_goacc_validate_dims): Remove
660 no-flag_worker-partitioning assertion.
661 (TARGET_GOACC_WORKER_PARTITIONING): Define target hook to true.
662 * config/gcn/gcn.opt (flag_worker_partitioning): Change default to 1.
664 2019-09-05 Cesar Philippidis <cesar@codesourcery.com>
665 Julian Brown <julian@codesourcery.com>
667 * gimplify.c (privatize_reduction): New struct.
668 (localize_reductions_r, localize_reductions): New functions.
669 (gimplify_omp_for): Call localize_reductions.
670 (gimplify_omp_workshare): Likewise.
671 * omp-low.c (lower_oacc_reductions): Handle localized reductions.
672 Create fewer temp vars.
673 * tree-core.h (omp_clause_code): Add OMP_CLAUSE_REDUCTION_PRIVATE_DECL
675 * tree.c (omp_clause_num_ops): Bump number of ops for
676 OMP_CLAUSE_REDUCTION to 6.
677 (walk_tree_1): Adjust accordingly.
678 * tree.h (OMP_CLAUSE_REDUCTION_PRIVATE_DECL): Add macro.
680 2019-09-05 Julian Brown <julian@codesourcery.com>
682 * config/gcn/gcn-protos.h (gcn_goacc_adjust_propagation_record): Rename
684 (gcn_goacc_create_propagation_record): This.
685 * config/gcn/gcn-tree.c (gcn_goacc_adjust_propagation_record): Rename
687 (gcn_goacc_create_propagation_record): This. Adjust comment.
688 * config/gcn/gcn.c (gcn_init_builtins): Override decls for
689 BUILT_IN_GOACC_SINGLE_START, BUILT_IN_GOACC_SINGLE_COPY_START,
690 BUILT_IN_GOACC_SINGLE_COPY_END and BUILT_IN_GOACC_BARRIER.
691 (gcn_fork_join): Remove inaccurate comment.
692 (TARGET_GOACC_ADJUST_PROPAGATION_RECORD): Rename to...
693 (TARGET_GOACC_CREATE_PROPAGATION_RECORD): This.
695 2019-09-05 Julian Brown <julian@codesourcery.com>
697 * Makefile.in (OBJS): Add omp-sese.o.
698 * omp-builtins.def (BUILT_IN_GOACC_BARRIER, BUILT_IN_GOACC_SINGLE_START,
699 BUILT_IN_GOACC_SINGLE_COPY_START, BUILT_IN_GOACC_SINGLE_COPY_END): New
701 * omp-offload.c (omp-sese.h): Include header.
702 (oacc_loop_xform_head_tail): Call update_stmt for modified builtin
704 (oacc_loop_process): Likewise.
705 (default_goacc_create_propagation_record): New default implementation
706 for TARGET_GOACC_CREATE_PROPAGATION_RECORD hook.
707 (execute_oacc_loop_designation): New. Split out of oacc_device_lower.
708 (execute_oacc_gimple_workers): New. Likewise.
709 (execute_oacc_device_lower): Recreate dims array.
710 (pass_data_oacc_loop_designation, pass_data_oacc_gimple_workers): New.
711 (pass_oacc_loop_designation, pass_oacc_gimple_workers): New.
712 (make_pass_oacc_loop_designation, make_pass_oacc_gimple_workers): New.
713 * omp-offload.h (oacc_fn_attrib_level): Add prototype.
714 * omp-sese.c: New file.
715 * omp-sese.h: New file.
716 * passes.def (pass_oacc_loop_designation, pass_oacc_gimple_workers):
718 * target.def (worker_partitioning, create_propagation_record): Add
720 * targhooks.h (default_goacc_create_propagation_record): Add prototype.
721 * tree-pass.h (make_pass_oacc_loop_designation,
722 make_pass_oacc_gimple_workers): Add prototypes.
723 * doc/tm.texi.in (TARGET_GOACC_WORKER_PARTITIONING,
724 TARGET_GOACC_CREATE_PROPAGATION_RECORD): Add documentation hooks.
725 * doc/tm.texi: Regenerate.
727 2019-09-05 Julian Brown <julian@codesourcery.com>
729 * omp-offload.c (convert.h): Include.
730 (struct addr_expr_rewrite_info): Add struct.
731 (rewrite_addr_expr): New function.
732 (is_sync_builtin_call): New function.
733 (execute_oacc_device_lower): Support rewriting gang-private variables
734 using target hook, and fix up addr_expr nodes afterwards.
735 * target.def (adjust_gangprivate_decl): New target hook.
736 * doc/tm.texi.in (TARGET_GOACC_ADJUST_GANGPRIVATE_DECL): Document new
738 * doc/tm.texi: Regenerate.
740 2019-08-13 Julian Brown <julian@codesourcery.com>
742 * omp-oacc-kernels-decompose.cc (add_wait): New function, split out
744 (add_async_clauses_and_wait): ...here. Call new outlined function.
745 (decompose_kernels_region_body): Add wait at the end of
746 explicitly-asynchronous kernels regions.
748 2019-07-10 Cesar Philippidis <cesar@codesourcery.com>
749 Julian Brown <julian@codesourcery.com>
751 * gimplify.c (gimplify_adjust_omp_clauses_1): Raise error for
752 assumed-size arrays in map clauses for Fortran/OpenMP.
753 * omp-low.c (lower_omp_target): Set the size of assumed-size Fortran
754 arrays to one to allow use of data already mapped on the offload device.
756 2019-05-28 Julian Brown <julian@codesourcery.com>
758 * omp-low.c (mark_oacc_gangprivate): Add CTX parameter. Use to look up
759 correct decl to add attribute to.
760 (lower_omp_for): Move "oacc gangprivate" processing from here...
761 (process_oacc_gangprivate_1): ...to here. New function.
762 (lower_omp_target): Update call to mark_oacc_gangprivate.
763 (execute_lower_omp): Call process_oacc_gangprivate_1 for each OMP
766 2019-05-20 Julian Brown <julian@codesourcery.com>
768 * gimplify.c (gimplify_adjust_omp_clauses_1): Support implied no_alloc
769 and optional arguments based on mappings in enclosing data regions.
771 2019-05-19 Julian Brown <julian@codesourcery.com>
773 * gimplify.c (oacc_array_mapping_info): Add REF field.
774 (gimplify_scan_omp_clauses): Initialise above field for data blocks
776 (gomp_oacc_needs_data_present): Handle references.
777 (gimplify_adjust_omp_clauses_1): Handle references and optional
778 arguments for variables declared in lexically-enclosing OpenACC data
781 2019-05-16 Julian Brown <julian@codesourcery.com>
783 * omp-oacc-kernels-decompose.cc (find_omp_for_index_vars_1,
784 find_omp_for_index_vars): New functions.
785 (maybe_build_inner_data_region): Add IDX_VARS argument. Don't add
786 CREATE mapping clauses for loop index variables. Set TREE_ADDRESSABLE
787 flag on newly-mapped declarations as a side effect.
788 (decompose_kernels_region_body): Call find_omp_for_index_vars. Don't
789 create PRESENT clause for loop index variables. Pass index variable
790 set to maybe_build_inner_data_region.
792 2019-01-23 Thomas Schwinge <thomas@codesourcery.com>
794 * params.opt (openacc_kernels): Default to decompose.
796 2018-12-11 Julian Brown <julian@codesourcery.com>
797 Chung-Lin Tang <cltang@codesourcery.com>
799 * config/nvptx/nvptx.c (tree-hash-traits.h): Include.
800 (gangprivate_shared_size): New global variable.
801 (gangprivate_shared_align): Likewise.
802 (gangprivate_shared_sym): Likewise.
803 (gangprivate_shared_hmap): Likewise.
804 (nvptx_option_override): Initialize gangprivate_shared_sym,
805 gangprivate_shared_align.
806 (nvptx_file_end): Output gangprivate_shared_sym.
807 (nvptx_goacc_expand_accel_var): New function.
808 (nvptx_set_current_function): New function.
809 (TARGET_SET_CURRENT_FUNCTION): Define hook.
810 (TARGET_GOACC_EXPAND_ACCEL): Likewise.
811 * doc/tm.texi (TARGET_GOACC_EXPAND_ACCEL_VAR): Document new hook.
812 * doc/tm.texi.in (TARGET_GOACC_EXPAND_ACCEL_VAR): Likewise.
813 * expr.c (expand_expr_real_1): Remap decls marked with the
814 "oacc gangprivate" attribute.
815 * omp-low.c (omp_context): Add oacc_partitioning_level and
816 oacc_addressable_var_decls fields.
817 (new_omp_context): Initialize oacc_addressable_var_decls in new
819 (delete_omp_context): Delete oacc_addressable_var_decls in old
821 (lower_oacc_head_tail): Record partitioning-level count in omp context.
822 (oacc_record_private_var_clauses, oacc_record_vars_in_bind)
823 (mark_oacc_gangprivate): New functions.
824 (lower_omp_for): Call oacc_record_private_var_clauses with "for"
825 clauses. Call mark_oacc_gangprivate for gang-partitioned loops.
826 (lower_omp_target): Call oacc_record_private_var_clauses with "target"
828 Call mark_oacc_gangprivate for offloaded target regions.
829 (lower_omp_1): Call vars_in_bind for GIMPLE_BIND within OMP regions.
830 * target.def (expand_accel_var): New hook.
832 2018-09-05 Cesar Philippidis <cesar@codesourcery.com>
833 Chung-Lin Tang <cltang@codesourcery.com>
835 * gimplify.c (omp_add_variable): Enable firstprivate reduction
838 2018-09-20 Cesar Philippidis <cesar@codesourcery.com>
840 * omp-low.c (lower_oacc_head_mark): Don't mark OpenACC auto
841 loops as independent inside acc parallel regions.
843 2018-12-22 Cesar Philippidis <cesar@codesourcery.com>
844 Julian Brown <julian@codesourcery.com>
845 Tobias Burnus <tobias@codesourcery.com>
847 * omp-low.c (maybe_lookup_field_in_outer_ctx): New function.
848 (convert_to_firstprivate_int): New function.
849 (convert_from_firstprivate_int): New function.
850 (lower_omp_target): Enable GOMP_MAP_FIRSTPRIVATE_INT in OpenACC.
851 Remove unused variable.
853 2018-08-28 Julian Brown <julian@codesourcery.com>
854 Cesar Philippidis <cesar@codesourcery.com>
856 * gimplify.c (oacc_array_mapping_info): New struct.
857 (gimplify_omp_ctx): Add decl_data_clause hash map.
858 (new_omp_context): Zero-initialise above.
859 (delete_omp_context): Delete above if allocated.
860 (gimplify_scan_omp_clauses): Scan for array mappings on data constructs,
861 and record in above map.
862 (gomp_oacc_needs_data_present): New function.
863 (gimplify_adjust_omp_clauses_1): Handle data mappings (e.g. array
864 slices) declared in lexically-enclosing data constructs.
865 * omp-low.c (lower_omp_target): Allow decl for bias not to be present
868 2018-10-05 Nathan Sidwell <nathan@acm.org>
869 Tom de Vries <tdevries@suse.de>
870 Thomas Schwinge <thomas@codesourcery.com>
871 Julian Brown <julian@codesourcery.com>
873 * doc/invoke.texi (fopenacc-dim): Update.
874 * omp-offload.c (oacc_parse_default_dims): Update.
875 (oacc_validate_dims): Emit warnings about strange partitioning choices.
877 2019-09-20 Chung-Lin Tang <cltang@codesourcery.com>
878 Cesar Philippidis <cesar@codesourcery.com>
880 * omp-expand.c (struct omp_region): Add inside_kernels_p field.
881 (expand_omp_for_generic): Adjust to generate a 'sequential' loop
882 when GOMP builtin arguments are BUILT_IN_NONE.
883 (expand_omp_for): Use expand_omp_for_generic to generate a
884 non-parallelized loop for OMP_FORs inside OpenACC kernels regions.
885 (expand_omp): Mark inside_kernels_p field true for regions
886 nested inside OpenACC kernels constructs.
888 2018-09-20 Cesar Philippidis <cesar@codesourcery.com>
889 Julian Brown <julian@codesourcery.com>
891 * omp-low.c (install_var_field): New base_pointer_restrict
893 (scan_sharing_clauses): Update call to install_var_field.
894 (omp_target_base_pointers_restrict_p): New function.
895 (scan_omp_target): Update call to install_var_field.
897 2018-10-30 Cesar Philippidis <cesar@codesourcery.com>
899 * config/nvptx/nvptx.c (nvptx_propagate_unified): New.
900 (nvptx_split_blocks): Call it for cond_uni insn.
901 (nvptx_expand_cond_uni): New.
902 (enum nvptx_builtins): Add NVPTX_BUILTIN_COND_UNI.
903 (nvptx_init_builtins): Initialize it.
904 (nvptx_expand_builtin):
905 (nvptx_generate_vector_shuffle): Change integral SHIFT operand to
907 (nvptx_vector_reduction): New.
908 (nvptx_adjust_reduction_type): New.
909 (nvptx_goacc_reduction_setup): Use it to adjust the type of ref_to_res.
910 (nvptx_goacc_reduction_init): Don't update LHS if it doesn't exist.
911 (nvptx_goacc_reduction_fini): Call nvptx_vector_reduction for vector.
912 Use it to adjust the type of ref_to_res.
913 (nvptx_goacc_reduction_teardown):
914 * config/nvptx/nvptx.md (cond_uni): New pattern.
916 2018-06-29 Cesar Philippidis <cesar@codesourcery.com>
917 James Norris <jnorris@codesourcery.com>
919 * gimplify.c (enum gimplify_omp_var_data): Add GOVD_DEVICETPR.
920 (omp_notice_variable): Add GOVD_DEVICEPTR attribute when appropriate.
921 (gimplify_scan_omp_clauses): Add GOVD_DEVICEPTR attribute when
923 (gimplify_adjust_omp_clauses_1): Set GOMP_MAP_FORCE_DEVICEPTR for
924 implicit deviceptr mappings.
926 2018-10-02 Thomas Schwinge <thomas@codesourcery.com>
927 Cesar Philippidis <cesar@codesourcery.com>
929 * tree-core.h (omp_clause_code): Add OMP_CLAUSE_NOHOST.
930 * tree.c (omp_clause_num_ops, omp_clause_code_name, walk_tree_1):
932 * tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE_NOHOST.
933 * gimplify.c (gimplify_scan_omp_clauses)
934 (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_NOHOST.
935 * tree-nested.c (convert_nonlocal_omp_clauses)
936 (convert_local_omp_clauses): Likewise.
937 * omp-low.c (scan_sharing_clauses): Likewise.
938 * omp-offload.c (maybe_discard_oacc_function): New function.
939 (execute_oacc_device_lower) [!ACCEL_COMPILER]: Handle OpenACC
942 2020-04-19 Chung-Lin Tang <cltang@codesourcery.com>
946 * builtin-types.def (BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_VAR): New type.
947 * omp-builtins.def (BUILT_IN_GOACC_DATA_START): Adjust function type
948 to new BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_VAR.
949 * gimplify.c (gimplify_scan_omp_clauses): Skip gimplification of
950 OMP_CLAUSE_SIZE of non-contiguous array maps (which is a TREE_LIST).
951 * omp-expand.c (expand_omp_target): Add non-contiguous array descriptor
952 pointers to variadic arguments.
953 * omp-low.c (append_field_to_record_type): New function.
954 (create_noncontig_array_descr_type): Likewise.
955 (create_noncontig_array_descr_init_code): Likewise.
956 (scan_sharing_clauses): For non-contiguous array map kinds, check for
957 supported dimension structure, and install non-contiguous array
958 variable into current omp_context.
959 (reorder_noncontig_array_clauses): New function.
960 (scan_omp_target): Call reorder_noncontig_array_clauses to place
961 non-contiguous array map clauses at beginning of clause sequence.
962 (lower_omp_target): Add handling for non-contiguous array map kinds,
963 add all created non-contiguous array descriptors to
964 gimple_omp_target_data_arg.