2025-04-25 Thomas Schwinge Backported from trunk: 2025-04-25 Andrew Pinski Thomas Schwinge PR target/119737 * config/gcn/gcn.cc (gcn_hsa_declare_function_name): Properly switch sections. Backported from trunk: 2024-08-07 Julian Brown Tobias Burnus * builtins.def (DEF_GOMP_BUILTIN_COMPILER): Define DEF_GOMP_BUILTIN_COMPILER to handle the non-prefix version. * gimple-fold.cc (gimple_fold_builtin_omp_is_initial_device): New. (gimple_fold_builtin): Call it. * omp-builtins.def (BUILT_IN_OMP_IS_INITIAL_DEVICE): Define. * tree.cc (get_file_function_name): Support names for on-target constructor/destructor functions. Revert: 2023-05-12 Julian Brown * omp-builtins.def (BUILT_IN_OMP_IS_INITIAL_DEVICE): New builtin. * tree.cc (get_file_function_name): Support names for on-target constructor/destructor functions. 2025-04-17 Kwok Cheung Yeung * langhooks-def.h (lhd_omp_deep_mapping): Add new argument. * langhooks.cc (lhd_omp_deep_mapping): Likewise. * langhooks.h (omp_deep_mapping): Likewise. * omp-low.cc (allocate_omp_iterator_elems): Work on the supplied iterator set instead of the iterators in a supplied set of clauses. (free_omp_iterator_elems): Likewise. (lower_omp_target): Maintain vector of new iterators generated by deep-mapping. Allocate and free iterator element arrays using iterators found in clauses and in the new iterator vector. 2025-04-17 Kwok Cheung Yeung * gimplify.cc (enter_omp_iterator_loop_context): New function variant. (enter_omp_iterator_loop_context): Delegate to new variant. (exit_omp_iterator_loop_context): New function variant. (exit_omp_iterator_loop_context): Delegate to new variant. (assign_to_iterator_elems_array): New. (add_new_omp_iterators_entry): New. (add_new_omp_iterators_clause): Delegate to add_new_omp_iterators_entry. * gimplify.h (enter_omp_iterator_loop_context): New prototype. (enter_omp_iterator_loop_context): Remove default argument. (exit_omp_iterator_loop_context): Remove argument. (assign_to_iterator_elems_array): New prototype. (add_new_omp_iterators_entry): New prototype. (add_new_omp_iterators_clause): New prototype. * langhooks-def.h (lhd_omp_deep_mapping_cnt): Remove const from argument. (lhd_omp_deep_mapping): Likewise. * langhooks.h (omp_deep_mapping_cnt): Likewise. (omp_deep_mapping): Likewise. * omp-low.cc (lower_omp_map_iterator_expr): Delegate to assign_to_iterator_elems_array. (lower_omp_map_iterator_size): Likewise. (lower_omp_target): Remove sorry for deep mapping. 2025-04-17 Kwok Cheung Yeung * gimplify.cc (add_new_omp_iterators_clause): New. (build_omp_struct_comp_nodes): Add extra argument for loops sequence. Call add_new_omp_iterators_clause on newly generated clauses. (omp_accumulate_sibling_list): Add extra argument for loops sequence. Pass to calls to build_omp_struct_comp_nodes. Add iterators to newly generator clauses for struct accesses. (omp_build_struct_sibling_lists): Add extra argument for loops sequence. Pass to call to omp_accumulate_sibling_list. (gimplify_adjust_omp_clauses): Pass loops sequence to omp_build_struct_sibling_lists. 2025-04-17 Kwok Cheung Yeung * gimplify.cc (gimplify_omp_affinity): Use macros for accessing iterator elements. (compute_omp_iterator_count): Likewise. (build_omp_iterator_loop): Likewise. (remove_unused_omp_iterator_vars): Likewise. (build_omp_iterators_loops): Likewise. (enter_omp_iterator_loop_context_1): Likewise. (extract_base_bit_offset): Likewise. * omp-low.cc (lower_omp_map_iterator_expr): Likewise. (lower_omp_map_iterator_size): Likewise. (allocate_omp_iterator_elems): Likewise. (free_omp_iterator_elems): Likewise. * tree-inline.cc (copy_tree_body_r): Likewise. * tree-pretty-print.cc (dump_omp_iterators): Likewise. * tree.h (OMP_ITERATORS_VAR, OMP_ITERATORS_BEGIN, OMP_ITERATORS_END, OMP_ITERATORS_STEP, OMP_ITERATORS_ORIG_STEP, OMP_ITERATORS_BLOCK, OMP_ITERATORS_LABEL, OMP_ITERATORS_INDEX, OMP_ITERATORS_ELEMS, OMP_ITERATORS_COUNT, OMP_ITERATORS_EXPANDED_P): New macros. 2025-04-17 Kwok Cheung Yeung * gimplify.cc (omp_iterator_elems_length): New. (build_omp_iterators_loops): Change type of elements array to pointer of pointers if array length is non-constant, and assign size with indirect reference. Reorder elements added to iterator vector and add element containing the iteration count. Use omp_iterator_elems_length to compute element array size required. * gimplify.h (omp_iterator_elems_length): New prototype. * omp-low.cc (lower_omp_map_iterator_expr): Reorder elements read from iterator vector. If elements field is a pointer type, assign using pointer arithmetic followed by indirect reference, and return the field directly. (lower_omp_map_iterator_size): Reorder elements read from iterator vector. If elements field is a pointer type, assign using pointer arithmetic followed by indirect reference. (allocate_omp_iterator_elems): New. (free_omp_iterator_elems): New. (lower_omp_target): Call allocate_omp_iterator_elems before inserting loops sequence, and call free_omp_iterator_elems afterwards. * tree-pretty-print.cc (dump_omp_iterators): Print extra elements in iterator vector. 2025-04-17 Kwok Cheung Yeung * gimplify.cc (compute_omp_iterator_count): Account for difference in loop boundaries in Fortran. (build_omp_iterator_loop): Change upper boundary condition for Fortran. Insert block statements into innermost loop. (remove_unused_omp_iterator_vars): Copy block subblocks of old iterator to new iterator and remove original. (contains_vars_1): New. (contains_vars): New. (extract_base_bit_offset): Add iterator argument. Remove iterator variables from base. Do not set variable_offset if the offset does not contain any remaining variables. (omp_accumulate_sibling_list): Add iterator argument to extract_base_bit_offset. * tree-pretty-print.cc (dump_block_node): Ignore BLOCK_SUBBLOCKS containing iterator block statements. 2025-04-17 Kwok Cheung Yeung * gimplify.cc (gimplify_scan_omp_clauses): Add argument for iterator loop sequence. Gimplify the clause decl and size into the iterator loop if iterators are used. (gimplify_omp_workshare): Add argument for iterator loops sequence in call to gimplify_scan_omp_clauses. (gimplify_omp_target_update): Call remove_unused_omp_iterator_vars and build_omp_iterators_loops. Add loop sequence as argument when calling gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses and building the Gimple statement. * tree-pretty-print.cc (dump_omp_clause): Call dump_omp_iterators for to/from clauses with iterators. * tree.cc (omp_clause_num_ops): Add extra operand for OMP_CLAUSE_FROM and OMP_CLAUSE_TO. * tree.h (OMP_CLAUSE_HAS_ITERATORS): Add check for OMP_CLAUSE_TO and OMP_CLAUSE_FROM. (OMP_CLAUSE_ITERATORS): Likewise. 2025-04-17 Kwok Cheung Yeung * gimple-pretty-print.cc (dump_gimple_omp_target): Print expanded iterator loops. * gimple.cc (gimple_build_omp_target): Add argument for iterator loops sequence. Initialize iterator loops field. * gimple.def (GIMPLE_OMP_TARGET): Set GSS symbol to GSS_OMP_TARGET. * gimple.h (gomp_target): Set GSS symbol to GSS_OMP_TARGET. Add extra field for iterator loops. (gimple_build_omp_target): Add argument for iterator loops sequence. (gimple_omp_target_iterator_loops): New. (gimple_omp_target_iterator_loops_ptr): New. (gimple_omp_target_set_iterator_loops): New. * gimplify.cc (find_var_decl): New. (copy_omp_iterator): New. (remap_omp_iterator_var_1): New. (remap_omp_iterator_var): New. (remove_unused_omp_iterator_vars): New. (struct iterator_loop_info_t): New type. (iterator_loop_info_map_t): New type. (build_omp_iterators_loops): New. (enter_omp_iterator_loop_context_1): New. (enter_omp_iterator_loop_context): New. (enter_omp_iterator_loop_context): New. (exit_omp_iterator_loop_context): New. (gimplify_adjust_omp_clauses): Add argument for iterator loop sequence. Gimplify the clause decl and size into the iterator loop if iterators are used. (gimplify_omp_workshare): Call remove_unused_omp_iterator_vars and build_omp_iterators_loops for OpenMP target expressions. Add loop sequence as argument when calling gimplify_adjust_omp_clauses and building the Gimple statement. * gimplify.h (enter_omp_iterator_loop_context): New prototype. (exit_omp_iterator_loop_context): New prototype. * gsstruct.def (GSS_OMP_TARGET): New. * omp-low.cc (lower_omp_map_iterator_expr): New. (lower_omp_map_iterator_size): New. (finish_omp_map_iterators): New. (lower_omp_target): Add sorry if iterators used with deep mapping. Call lower_omp_map_iterator_expr before assigning to sender ref. Call lower_omp_map_iterator_size before setting the size. Insert iterator loop sequence before the statements for the target clause. * tree-nested.cc (convert_nonlocal_reference_stmt): Walk the iterator loop sequence of OpenMP target statements. (convert_local_reference_stmt): Likewise. (convert_tramp_reference_stmt): Likewise. * tree-pretty-print.cc (dump_omp_iterators): Dump extra iterator information if present. (dump_omp_clause): Call dump_omp_iterators for iterators in map clauses. * tree.cc (omp_clause_num_ops): Add operand for OMP_CLAUSE_MAP. (walk_tree_1): Do not walk last operand of OMP_CLAUSE_MAP. * tree.h (OMP_CLAUSE_HAS_ITERATORS): New. (OMP_CLAUSE_ITERATORS): New. 2025-04-17 Kwok Cheung Yeung * gimplify.cc (gimplify_omp_affinity): Use OMP_ITERATOR_DECL_P. (compute_omp_iterator_count): New. (build_omp_iterator_loop): New. (gimplify_omp_depend): Use OMP_ITERATOR_DECL_P, compute_omp_iterator_count and build_omp_iterator_loop. * tree-inline.cc (copy_tree_body_r): Use OMP_ITERATOR_DECL_P. * tree-pretty-print.cc (dump_omp_clause): Likewise. * tree.h (OMP_ITERATOR_DECL_P): New macro. 2025-04-17 Thomas Schwinge Backported from trunk: 2025-04-16 Thomas Schwinge PR target/97106 * config/nvptx/nvptx.cc (nvptx_asm_output_def_from_decls) [ACCEL_COMPILER]: Make sure to emit C++ constructor, destructor aliases. Backported from trunk: 2025-04-14 Thomas Schwinge PR target/118794 * config/gcn/gcn.opt (-mfake-exceptions): Support. * config/nvptx/nvptx.opt (-mfake-exceptions): Likewise. * config/gcn/gcn.md (define_expand "exception_receiver"): Use it. * config/nvptx/nvptx.md (define_expand "exception_receiver"): Likewise. * config/gcn/mkoffload.cc (main): Set it. * config/nvptx/mkoffload.cc (main): Likewise. * config/nvptx/nvptx.cc (nvptx_assemble_integer) : Special handling for 'SYMBOL_REF's. * except.cc (expand_dw2_landing_pad_for_region): Don't generate bogus code for (default) '#define EH_RETURN_DATA_REGNO(N) INVALID_REGNUM'. Backported from trunk: 2025-04-07 Thomas Schwinge * config/nvptx/nvptx.opt (-mfake-ptx-alloca): Update. Backported from trunk: 2025-04-03 Thomas Schwinge PR target/119573 * config/nvptx/nvptx.cc (nvptx_encode_section_info): Don't set 'DATA_AREA_CONST' for 'TREE_CONSTANT', or 'TREE_READONLY'. (nvptx_asm_declare_constant_name): Use '.global' instead of '.const'. Backported from trunk: 2025-04-08 Thomas Schwinge * config/nvptx/nvptx.cc (nvptx_asm_output_def_from_decls) [!ACCEL_COMPILER]: Don't define label 'emit_ptx_alias'. 2025-04-08 Tobias Burnus Backported from master: 2025-04-08 Tobias Burnus PR middle-end/119662 * gimplify.cc (modify_call_for_omp_dispatch): Fix GOMP_interop arg passing; add location info to function calls. 2025-04-02 Thomas Schwinge Backported from trunk: 2025-04-01 Thomas Schwinge PR target/119369 * config/gcn/gcn-protos.h (gcn_asm_weaken_decl): Declare. * config/gcn/gcn.cc (gcn_asm_weaken_decl): New. * config/gcn/gcn-hsa.h (ASM_WEAKEN_DECL): '#define' to this. 2025-04-01 Tobias Burnus Backported from master: 2025-04-01 Tobias Burnus PR middle-end/119559 * gimplify.cc (modify_call_for_omp_dispatch): Reorder checks to avoid asserts and bogus diagnostic. 2025-03-31 Tobias Burnus Backported from master: 2025-03-31 Tobias Burnus PR middle-end/119541 * gimplify.cc (modify_call_for_omp_dispatch): Limit interop claues processing by the number of append_args arguments. 2025-03-27 Tobias Burnus Backported from master: 2025-03-27 Tobias Burnus * gimplify.cc (modify_call_for_omp_dispatch): Remove sorry. 2025-03-27 Thomas Schwinge Backported from trunk: 2025-03-26 Thomas Schwinge PR driver/101544 * gcc.cc (driver_handle_option): Forward host '-lstdc++' to offloading compilation. * config/gcn/mkoffload.cc (main): Adjust. * config/nvptx/mkoffload.cc (main): Likewise. 2025-03-25 Thomas Schwinge Backported from trunk: 2025-03-24 Thomas Schwinge PR target/101544 * config/nvptx/nvptx.cc (nvptx_asm_output_def_from_decls) [ACCEL_COMPILER]: Special-case certain host-setup symbol aliases. * varasm.cc (do_assemble_alias) [ACCEL_COMPILER]: Adjust. Backported from trunk: 2025-03-24 Thomas Schwinge * config/nvptx/nvptx.cc (default_ptx_version_option): Default at least to '-mptx=6.3'. * doc/invoke.texi (Nvidia PTX Options): Update '-mptx=[...]'. 2025-03-21 Paul-Antoine Arras Backported from master: 2025-03-21 Paul-Antoine Arras Tobias Burnus * builtin-types.def (BT_FN_VOID_INT_INT_PTR_PTR_PTR_INT_PTR_INT_PTR_UINT_PTR): New. * gimple-low.cc (lower_stmt): Handle GIMPLE_OMP_INTEROP. * gimple-pretty-print.cc (dump_gimple_omp_interop): New function. (pp_gimple_stmt_1): Handle GIMPLE_OMP_INTEROP. * gimple.cc (gimple_build_omp_interop): New function. (gimple_copy): Handle GIMPLE_OMP_INTEROP. * gimple.def (GIMPLE_OMP_INTEROP): Define. * gimple.h (gimple_build_omp_interop): Declare. (gimple_omp_interop_clauses): New function. (gimple_omp_interop_clauses_ptr): Likewise. (gimple_omp_interop_set_clauses): Likewise. (gimple_return_set_retval): Handle GIMPLE_OMP_INTEROP. * gimplify.cc (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_INIT, OMP_CLAUSE_USE and OMP_CLAUSE_DESTROY. (gimplify_omp_interop): New function. (gimplify_expr): Replace sorry with call to gimplify_omp_interop. * omp-builtins.def (BUILT_IN_GOMP_INTEROP): Define. * omp-low.cc (scan_sharing_clauses): Handle OMP_CLAUSE_INIT, OMP_CLAUSE_USE and OMP_CLAUSE_DESTROY. (scan_omp_1_stmt): Handle GIMPLE_OMP_INTEROP. (lower_omp_interop_action_clauses): New function. (lower_omp_interop): Likewise. (lower_omp_1): Handle GIMPLE_OMP_INTEROP. 2025-03-19 Thomas Schwinge Backported from trunk: 2025-03-14 Thomas Schwinge PR target/92713 PR target/101544 * config/gcn/gcn.h (LIBSTDCXX): Don't set. * config/nvptx/nvptx.h (LIBSTDCXX): Likewise. 2025-02-28 Thomas Schwinge Backported from trunk: 2025-02-27 Thomas Schwinge * config/nvptx/nvptx.h (MAX_FIXED_MODE_SIZE): '#define'. Backported from trunk: 2025-02-27 Thomas Schwinge * config/nvptx/nvptx.opt (-mfake-ptx-alloca): New. * config/nvptx/nvptx-protos.h (nvptx_output_fake_ptx_alloca): Declare. * config/nvptx/nvptx.cc (nvptx_output_fake_ptx_alloca): New. * config/nvptx/nvptx.md (define_insn "@nvptx_alloca_") [!(TARGET_PTX_7_3 && TARGET_SM52)]: Use it for '-mfake-ptx-alloca'. Backported from trunk: 2025-02-27 Thomas Schwinge * config/nvptx/nvptx.md (define_expand "allocate_stack") [!TARGET_SOFT_STACK]: Move 'sorry ("dynamic stack allocation not supported");'... (define_insn "@nvptx_alloca_"): ... here. 2025-02-27 Thomas Schwinge Backported from trunk: 2025-02-22 Thomas Schwinge * config/bpf/bpf.md (define_expand "allocate_stack"): Emit 'sorry, unimplemented: dynamic stack allocation not supported'. * config/nvptx/nvptx.md (define_expand "allocate_stack") [!TARGET_SOFT_STACK && !(TARGET_PTX_7_3 && TARGET_SM52)]: Likewise. 2025-02-18 Thomas Schwinge Backported from trunk: 2025-02-14 Thomas Schwinge PR target/94282 PR target/113331 * common/config/gcn/gcn-common.cc (gcn_except_unwind_info): 'return UI_TARGET;'. * config/gcn/gcn.cc (gcn_asm_init_sections): New function. (TARGET_ASM_INIT_SECTIONS): '#define'. Backported from trunk: 2025-02-14 Thomas Schwinge PR target/86660 * common/config/nvptx/nvptx-common.cc (nvptx_except_unwind_info): 'return UI_TARGET;'. * config/nvptx/nvptx.cc (nvptx_assemble_integer): Handle 'exception_section'. (nvptx_output_section_asm_op, nvptx_asm_init_sections): New functions. (TARGET_ASM_INIT_SECTIONS): '#define'. * config/nvptx/nvptx.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): Don't '#define'. (ASM_OUTPUT_DWARF_DELTA): '#define'. Backported from trunk: 2025-02-14 Thomas Schwinge * config/nvptx/nvptx.cc (init_frag): New 'bool active' member. (output_init_frag, nvptx_assemble_value, nvptx_assemble_integer) (nvptx_output_skip, nvptx_assemble_decl_begin) (nvptx_assemble_decl_end): Sanity-check its state. Backported from trunk: 2025-02-14 Thomas Schwinge * config/nvptx/nvptx.cc (nvptx_output_skip): Clarify case of no or incomplete initializer. Backported from trunk: 2025-02-08 Thomas Schwinge * config/gcn/gcn.md (exception_receiver): 'define_expand'. * config/nvptx/nvptx.md (exception_receiver): Likewise. Backported from trunk: 2025-02-08 Thomas Schwinge * doc/sourcebuild.texi (Effective-Target Keywords): Clarify that effective-target 'exceptions' and 'exceptions_enabled' are orthogonal. Backported from trunk: 2024-05-22 Roger Sayle * except.cc (output_function_exception_table): Move call to get_personality_function after targetm_common.except_unwind_info check, to avoid ICE on targets that don't support exceptions. Backported from trunk: 2025-02-07 Thomas Schwinge * c-gimplify.cc (c_genericize): Pass 'local_dump_flags' to 'print_c_tree'. * c-pretty-print.cc (c_pretty_printer::statement): Pass 'dump_flags' to 'dump_generic_node'. (c_pretty_printer::c_pretty_printer): Initialize 'dump_flags'. (print_c_tree): Add 'dump_flags_t' formal parameter. (debug_c_tree): Adjust. * c-pretty-print.h (c_pretty_printer): Add 'dump_flags_t dump_flags'. (c_pretty_printer::c_pretty_printer): Add 'dump_flags_t' formal parameter. (print_c_tree): Adjust. Backported from trunk: 2025-01-28 Thomas Schwinge * tree-pretty-print.cc (dump_omp_clause): Clarify 'OMP_CLAUSE_MAP_RUNTIME_IMPLICIT_P'. Backported from trunk: 2025-01-08 Thomas Schwinge * doc/invoke.texi (Nvidia PTX Options): Update '-march-map=sm_50'. Backported from trunk: 2025-01-20 Thomas Schwinge * config/nvptx/t-nvptx (MULTILIB_OPTIONS): Don't add 'mptx=3.1' if neither sm_30 nor sm_35 multilib variant is built. Backported from trunk: 2024-09-24 Prathamesh Kulkarni Thomas Schwinge PR target/104957 * config/nvptx/nvptx.cc (nvptx_asm_output_def_from_decls): Use cgraph_node::get(name)->ultimate_alias_target instead of value. Backported from trunk: 2024-09-05 Thomas Schwinge PR target/104957 * config/nvptx/nvptx.cc (write_fn_proto_1): Revert 2022-03-22 change; 'write_fn_marker' also for alias DECL. (nvptx_asm_output_def_from_decls): 'write_fn_marker' for alias DEF. 2025-01-30 Tobias Burnus Backported from master: 2025-01-30 Tobias Burnus * gimplify.cc (gimplify_call_expr): For OpenMP's append_args clause processed by 'omp dispatch', update for internal-representation changes; fix handling of hidden arguments, add some comments and handle Fortran's value dummy and optional/pointer/allocatable actual args. 2025-01-28 Tobias Burnus Backported from master: 2025-01-09 Tobias Burnus * builtin-types.def (BT_FN_PTRMODE_PTR_INT_PTR): Add. * gimplify.cc (gimplify_call_expr): Add error for multiple list items to the OpenMP interop clause if no device clause; continue instead of restarting after append_args handling. (gimplify_omp_dispatch): Extract device number from the single interop-clause list item. * omp-builtins.def (BUILT_IN_OMP_GET_INTEROP_INT): Add. 2025-01-28 Tobias Burnus Backported from master: 2025-01-08 Tobias Burnus * gimplify.cc (gimplify_call_expr): Disable variant function's append_args in 'omp dispatch' when invoking the variant directly and not through the base function. 2025-01-28 Tobias Burnus Backported from master: 2024-12-18 Tobias Burnus * gimplify.cc (gimplify_call_expr): Update for OpenMP's append_args; cleanup of OpenMP's dispatch clause handling. 2025-01-27 Tobias Burnus Backported from master: 2024-12-19 Tobias Burnus * omp-general.cc (vendor_properties): Add "nec". 2025-01-27 Tobias Burnus Backported from master: 2024-12-12 Tobias Burnus * gimplify.cc (gimplify_call_expr): When handling OpenMP's dispatch, add diagnostic when there is a ptr vs. addr mismatch between need_device_{addr,ptr} and {is,has}_device_{ptr,addr}, respectively. 2025-01-27 Tobias Burnus Backported from master: 2024-11-22 Tobias Burnus * gimplify.cc (gimplify_call_expr): Add initial support for dispatch's 'interop' clause. (gimplify_scan_omp_clauses): Handle interop clause. * tree-pretty-print.cc (dump_omp_clause): Likewise. * tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_INTEROP. * tree.cc (omp_clause_num_ops, omp_clause_code_name): Add interop. 2025-01-27 Tobias Burnus Backported from master: 2024-11-22 Tobias Burnus * gimplify.cc (gimplify_expr): Handle OMP_INTEROP by printing "sorry, uninplemented". * omp-api.h (omp_get_fr_id_from_name): Change return type to 'char'. * omp-general.cc (omp_get_fr_id_from_name): Likewise; return GOMP_INTEROP_IFR_UNKNOWN not 0 if not found. (omp_get_name_from_fr_id): Return "" not NULL if not found (used for dumps). * tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_DESTROY, OMP_CLAUSE_USE, and OMP_CLAUSE_INIT. * tree-pretty-print.cc (dump_omp_init_prefer_type): New. (dump_omp_clause): Handle init, use and destroy clauses. (dump_generic_node): Handle interop directive. * tree.cc (omp_clause_num_ops, omp_clause_code_name): Add new init/use/destroy clauses. * tree.def (OACC_LOOP): Fix comment. (OMP_INTEROP): Add. * tree.h (OMP_INTEROP_CLAUSES, OMP_CLAUSE_INIT_TARGET, OMP_CLAUSE_INIT_TARGETSYNC, OMP_CLAUSE_INIT_PREFER_TYPE): New. 2025-01-27 Paul-Antoine Arras Backported from master: 2025-01-07 Paul-Antoine Arras * gimplify.cc (gimplify_call_expr): Create variable variant_substituted_p to control whether adjust_args applies. 2025-01-27 Paul-Antoine Arras Backported from master: 2025-01-02 Paul-Antoine Arras * gimplify.cc (gimplify_call_expr): Fix handling of need_device_ptr for type(c_ptr). Fix handling of nested function calls in a dispatch region. (find_ifn_gomp_dispatch): Return the IFN without stripping it. (gimplify_omp_dispatch): Keep IFN_GOMP_DISPATCH until gimplify_call_expr. 2025-01-24 Paul-Antoine Arras Backported from master: 2024-11-20 Paul-Antoine Arras * builtins.cc (builtin_fnspec): Handle BUILT_IN_OMP_GET_MAPPED_PTR. * gimple-low.cc (lower_stmt): Handle GIMPLE_OMP_DISPATCH. * gimple-pretty-print.cc (dump_gimple_omp_dispatch): New function. (pp_gimple_stmt_1): Handle GIMPLE_OMP_DISPATCH. * gimple-walk.cc (walk_gimple_stmt): Likewise. * gimple.cc (gimple_build_omp_dispatch): New function. (gimple_copy): Handle GIMPLE_OMP_DISPATCH. * gimple.def (GIMPLE_OMP_DISPATCH): Define. * gimple.h (gimple_build_omp_dispatch): Declare. (gimple_has_substatements): Handle GIMPLE_OMP_DISPATCH. (gimple_omp_dispatch_clauses): New function. (gimple_omp_dispatch_clauses_ptr): Likewise. (gimple_omp_dispatch_set_clauses): Likewise. (gimple_return_set_retval): Handle GIMPLE_OMP_DISPATCH. * gimplify.cc (enum omp_region_type): Add ORT_DISPATCH. (struct gimplify_omp_ctx): Add in_call_args. (gimplify_call_expr): Handle need_device_ptr arguments. (is_gimple_stmt): Handle OMP_DISPATCH. (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_DEVICE in a dispatch construct. Handle OMP_CLAUSE_NOVARIANTS and OMP_CLAUSE_NOCONTEXT. (omp_has_novariants): New function. (omp_has_nocontext): Likewise. (omp_construct_selector_matches): Handle OMP_DISPATCH with nocontext clause. (find_ifn_gomp_dispatch): New function. (gimplify_omp_dispatch): Likewise. (gimplify_expr): Handle OMP_DISPATCH. * gimplify.h (omp_has_novariants): Declare. * internal-fn.cc (expand_GOMP_DISPATCH): New function. * internal-fn.def (GOMP_DISPATCH): Define. * omp-builtins.def (BUILT_IN_OMP_GET_MAPPED_PTR): Define. (BUILT_IN_OMP_GET_DEFAULT_DEVICE): Define. (BUILT_IN_OMP_SET_DEFAULT_DEVICE): Define. * omp-general.cc (omp_construct_traits_to_codes): Add OMP_DISPATCH. (struct omp_ts_info): Add dispatch. (omp_resolve_declare_variant): Handle novariants. Adjust DECL_ASSEMBLER_NAME. * omp-low.cc (scan_omp_1_stmt): Handle GIMPLE_OMP_DISPATCH. (lower_omp_dispatch): New function. (lower_omp_1): Call it. * tree-inline.cc (remap_gimple_stmt): Handle GIMPLE_OMP_DISPATCH. (estimate_num_insns): Handle GIMPLE_OMP_DISPATCH. 2025-01-23 Paul-Antoine Arras Backported from master: 2024-11-20 Paul-Antoine Arras * builtin-types.def (BT_FN_PTR_CONST_PTR_INT): New. * omp-selectors.h (enum omp_ts_code): Add OMP_TRAIT_CONSTRUCT_DISPATCH. * tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_NOVARIANTS and OMP_CLAUSE_NOCONTEXT. * tree-pretty-print.cc (dump_omp_clause): Handle OMP_CLAUSE_NOVARIANTS and OMP_CLAUSE_NOCONTEXT. (dump_generic_node): Handle OMP_DISPATCH. * tree.cc (omp_clause_num_ops): Add OMP_CLAUSE_NOVARIANTS and OMP_CLAUSE_NOCONTEXT. (omp_clause_code_name): Add "novariants" and "nocontext". * tree.def (OMP_DISPATCH): New. * tree.h (OMP_DISPATCH_BODY): New macro. (OMP_DISPATCH_CLAUSES): New macro. (OMP_CLAUSE_NOVARIANTS_EXPR): New macro. (OMP_CLAUSE_NOCONTEXT_EXPR): New macro. 2025-01-23 Tobias Burnus Backported from master: 2024-10-28 Tobias Burnus * tree-core.h (enum omp_clause_code): Add comments to cross ref to OMP_CLAUSE_DECL etc. and mark the ranges used in the range checks. 2025-01-23 Tobias Burnus Backported from master: 2024-09-23 Tobias Burnus * omp-general.cc (omp_runtime_api_procname): Strip "omp_" from string; move get_device_from_uid as now a '_' suffix exists. 2025-01-23 Tobias Burnus Backported from master: 2024-09-20 Tobias Burnus * omp-general.cc (omp_runtime_api_procname): Add get_device_from_uid and omp_get_uid_from_device routines. 2025-01-23 Tobias Burnus Backported from master: 2024-09-13 Tobias Burnus PR fortran/116661 * omp-api.h (omp_get_fr_id_from_name, omp_get_name_from_fr_id): New prototypes. * omp-general.cc (omp_get_fr_id_from_name, omp_get_name_from_fr_id): New. 2025-01-23 Tobias Burnus Backported from master: 2024-09-11 Tobias Burnus * omp-general.cc (omp_runtime_api_procname): Add omp_get_interop_{int,name,ptr,rc_desc,str,type_desc} and omp_get_num_interop_properties. 2024-12-19 Thomas Schwinge PR target/65181 * config/nvptx/nvptx.cc (nvptx_get_drap_rtx): Handle '!TARGET_SOFT_STACK'. * config/nvptx/nvptx.md (define_c_enum "unspec"): Add 'UNSPEC_STACKSAVE', 'UNSPEC_STACKRESTORE'. (define_expand "allocate_stack", define_expand "save_stack_block") (define_expand "save_stack_block"): Handle '!TARGET_SOFT_STACK', PTX 'alloca'. (define_insn "@nvptx_alloca_") (define_insn "@nvptx_stacksave_") (define_insn "@nvptx_stackrestore_"): New. * doc/invoke.texi (Nvidia PTX Options): Update '-msoft-stack', '-mno-soft-stack'. * doc/sourcebuild.texi (nvptx-specific attributes): Document 'nvptx_runtime_alloca_ptx'. (Add Options): Document 'nvptx_alloca_ptx'. 2024-12-18 Thomas Schwinge PR target/65181 * config/nvptx/nvptx.cc (default_ptx_version_option): For '-march=sm_52' and higher, default at least to '-mptx=7.3'. * doc/invoke.texi (Nvidia PTX Options): Update '-mptx=[...]'. * config/nvptx/nvptx-opts.h (enum ptx_version): Add 'PTX_VERSION_7_3'. * config/nvptx/nvptx.cc (ptx_version_to_string) (ptx_version_to_number): Adjust. * config/nvptx/nvptx.h (TARGET_PTX_7_3): New. * config/nvptx/nvptx.opt (Enum(ptx_version)): Add 'EnumValue' '7.3' for 'PTX_VERSION_7_3'. * doc/invoke.texi (Nvidia PTX Options): Document '-mptx=7.3'. * doc/sourcebuild.texi (Effective-Target Keywords): Document 'nvptx_softstack'. PR target/65181 * config/nvptx/nvptx.h (STACK_SAVEAREA_MODE): '#define'. * config/nvptx/nvptx.md [!TARGET_SOFT_STACK] (save_stack_function): 'define_expand'. (restore_stack_function): Handle '!TARGET_SOFT_STACK'. PR target/65181 * config/nvptx/nvptx.md [!TARGET_SOFT_STACK] (save_stack_block): 'define_expand'. Backported from trunk: 2024-08-09 Andrew Stubbs * config/gcn/gcn.cc (gcn_asm_trampoline_template): Add .align. * config/gcn/gcn.h (TRAMPOLINE_SIZE): Increase to 40. Backported from trunk: 2024-12-09 Thomas Schwinge * config.gcc [nvptx-*]: Switch default from '-march=sm_30' to '-march=sm_52'. * doc/install.texi (Nvidia PTX Options): Update. Backported from trunk: 2024-12-09 Thomas Schwinge * config/gcn/gcn.cc (gcn_vec_constant): Fix 'real_from_integer' usage. Backported from trunk: 2024-12-06 Thomas Schwinge * config/nvptx/nvptx-sm.def: Add '89'. * config/nvptx/nvptx-gen.h: Regenerate. * config/nvptx/nvptx-gen.opt: Likewise. * config/nvptx/nvptx.cc (first_ptx_version_supporting_sm): Adjust. * config/nvptx/nvptx.opt (-march-map=sm_89, -march-map=sm_90) (march-map=sm_90a): Likewise. * config.gcc: Likewise. * doc/invoke.texi (Nvidia PTX Options): Document '-march=sm_89'. * config/nvptx/gen-multilib-matches-tests: Extend. Backported from trunk: 2024-12-06 Thomas Schwinge * config/nvptx/nvptx-opts.h (enum ptx_version): Add 'PTX_VERSION_7_8'. * config/nvptx/nvptx.cc (ptx_version_to_string) (ptx_version_to_number): Adjust. * config/nvptx/nvptx.h (TARGET_PTX_7_8): New. * config/nvptx/nvptx.opt (Enum(ptx_version)): Add 'EnumValue' '7.8' for 'PTX_VERSION_7_8'. * doc/invoke.texi (Nvidia PTX Options): Document '-mptx=7.8'. Backported from trunk: 2024-12-06 Thomas Schwinge * config/nvptx/nvptx-sm.def: Add '52'. * config/nvptx/nvptx-gen.h: Regenerate. * config/nvptx/nvptx-gen.opt: Likewise. * config/nvptx/nvptx.cc (first_ptx_version_supporting_sm): Adjust. * config/nvptx/nvptx.opt (-march-map=sm_52): Likewise. * config.gcc: Likewise. * doc/invoke.texi (Nvidia PTX Options): Document '-march=sm_52'. * config/nvptx/gen-multilib-matches-tests: Extend. Backported from trunk: 2024-12-06 Thomas Schwinge * config/nvptx/nvptx-sm.def: Add '37'. * config/nvptx/nvptx-gen.h: Regenerate. * config/nvptx/nvptx-gen.opt: Likewise. * config/nvptx/nvptx.cc (first_ptx_version_supporting_sm): Adjust. * config/nvptx/nvptx.opt (-march-map=sm_37, -march-map=sm_50): Likewise. * config.gcc: Likewise. * doc/invoke.texi (Nvidia PTX Options): Document '-march=sm_37'. * config/nvptx/gen-multilib-matches-tests: Extend. Backported from trunk: 2024-12-06 Thomas Schwinge * config/nvptx/nvptx-opts.h (enum ptx_version): Add 'PTX_VERSION_4_1'. * config/nvptx/nvptx.cc (ptx_version_to_string) (ptx_version_to_number): Adjust. * config/nvptx/nvptx.h (TARGET_PTX_4_1): New. * config/nvptx/nvptx.opt (Enum(ptx_version)): Add 'EnumValue' '4.1' for 'PTX_VERSION_4_1'. * doc/invoke.texi (Nvidia PTX Options): Document '-mptx=4.1'. Backported from trunk: 2024-12-06 Thomas Schwinge * config/nvptx/nvptx.h (TARGET_PTX_4_2): New. * config/nvptx/nvptx.opt (Enum(ptx_version)): Add 'EnumValue' '4.2' for 'PTX_VERSION_4_2'. * doc/invoke.texi (Nvidia PTX Options): Document '-mptx=4.2'. Backported from trunk: 2024-12-06 Thomas Schwinge * config/nvptx/nvptx-opts.h (enum ptx_version): Remove 'PTX_VERSION_3_0'. * config/nvptx/nvptx.cc (first_ptx_version_supporting_sm) (default_ptx_version_option, ptx_version_to_string) (ptx_version_to_number): Adjust. * config/nvptx/nvptx.h: Comment. Backported from trunk: 2024-12-06 Thomas Schwinge * config.gcc: nvptx: Support '--with-multilib-list'. * config/nvptx/gen-multilib-matches.sh: Adjust. * configure.ac: Likewise. * configure: Regenerate. * doc/install.texi: Update. * doc/invoke.texi: Align. * config/nvptx/gen-multilib-matches-tests: Extend. Backported from trunk: 2024-12-06 Thomas Schwinge * config/nvptx/gen-multilib-matches.sh: Support '--selftest'. * config/nvptx/t-nvptx (t-nvptx-gen-multilib-matches:): Invoke it. * config/nvptx/gen-multilib-matches-tests: New. Backported from trunk: 2024-12-06 Thomas Schwinge * config/nvptx/gen-h.sh: Don't pass in '$1'; compute it locally. * config/nvptx/gen-multilib-matches.sh: Likewise. * config/nvptx/gen-omp-device-properties.sh: Likewise. * config/nvptx/gen-opt.sh: Likewise. * config/nvptx/t-nvptx (s-nvptx-gen-h:, s-nvptx-gen-opt:) (t-nvptx-gen-multilib-matches:): Adjust. * config/nvptx/t-omp-device (omp-device-properties-nvptx): Likewise. Backported from trunk: 2024-12-06 Thomas Schwinge * config/nvptx/gen-multilib-matches.sh: Encapsulate main logic. Backported from trunk: 2024-12-06 Thomas Schwinge * config/nvptx/t-nvptx (multilib_matches): Don't use the 'shell' function of 'make'. * config/nvptx/gen-multilib-matches.sh: Adjust. Backported from trunk: 2024-12-06 Thomas Schwinge PR target/117916 * config/nvptx/nvptx.opt (misa=, mptx=): Tag as 'Negative' of themselves. Backported from trunk: 2024-09-05 Thomas Schwinge * doc/sourcebuild.texi (Effective-Target Keywords): Document 'nvptx_default_ptx_isa_version_at_least_6_0', 'nvptx_runtime_alias_ptx'. (Add Options): Document 'nvptx_alias_ptx'. Backported from trunk: 2024-09-04 Thomas Schwinge * config/nvptx/gen-opt.sh: Use 'enum ptx_isa' instead of 'int'. * config/nvptx/nvptx-gen.opt: Regenerate. * config/nvptx/nvptx.opt: Use 'enum ptx_version' instead of 'int'. * config/nvptx/nvptx-opts.h (enum ptx_isa): Add 'PTX_ISA_unset'. (enum ptx_version): Add 'PTX_VERSION_unset'. * config/nvptx/nvptx-c.cc (nvptx_cpu_cpp_builtins): Adjust. * config/nvptx/nvptx.cc (default_ptx_version_option) (handle_ptx_version_option, nvptx_option_override) (nvptx_file_start): Likewise. Backported from trunk: 2024-09-03 Tobias Burnus PR lto/116535 * lto-cgraph.cc (output_offload_tables): Remove offload_ frees. * lto-streamer-out.cc (lto_output): Make call to it depend on lto_get_out_decl_state ()->output_offload_tables_p. * lto-streamer.h (struct lto_out_decl_state): Add output_offload_tables_p field. * tree-pass.h (ipa_write_optimization_summaries): Add bool argument. * passes.cc (ipa_write_summaries_1): Add bool output_offload_tables_p arg. (ipa_write_summaries): Update call. (ipa_write_optimization_summaries): Accept output_offload_tables_p. 2024-08-01 Tobias Burnus Backported from master: 2024-08-01 Tobias Burnus Richard Biener * doc/tm.texi.in (TARGET_VECTORIZE_PREFER_GATHER_SCATTER): Remove documentation hook. * doc/tm.texi: Regenerate. * target.def (prefer_gather_scatter): Remove target hook under vectorizer. * tree-vect-stmts.cc (get_group_load_store_type): Remove code to optionally prefer gather/scatter instructions to scalar/elementwise fallback. * config/gcn/gcn.cc (TARGET_VECTORIZE_PREFER_GATHER_SCATTER): Remove hook definition. 2024-05-19 Roger Sayle * config/nvptx/nvptx.md (popcount2): Split into... (popcountsi2): define_insn handling SImode popcount. (popcountdi2): define_insn handling DImode popcount, with an explicit truncate:SI to produce an SImode result. 2024-04-16 Andrew Pinski PR middle-end/23872 * tree-pretty-print.cc (dump_generic_node ): Fix calls to dump_generic_node and also remove unreachable code that is testing `flags & TDF_SLIM`. 2024-06-03 Tobias Burnus * doc/install.texi (gcn): Fix date of recommended newlib version. 2024-05-10 Sandra Loosemore * tree-nested.cc (convert_nonlocal_reference_stmt): Handle GIMPLE_OMP_METADIRECTIVE specially. (convert_local_reference_stmt): Likewise. (convert_tramp_reference_stmt): Likewise. (convert_gimple_call): Likewise. * gimple-pretty-print.cc (dump_gimple_omp_metadirective): Print variants in raw output. 2024-04-22 Sandra Loosemore * tree-nested.cc (convert_tramp_reference_stmt): Use the correct accessor for GIMPLE_OMP_TARGET clauses. 2024-05-04 Sandra Loosemore * omp-general.cc (omp_complete_construct_context): Check "omp declare target" attribute, not "omp declare target block". 2024-05-04 Sandra Loosemore * cgraph.cc (symbol_table::create_edge): Don't set calls_declare_variant_alt in the caller. * cgraph.h (struct cgraph_node): Remove declare_variant_alt and calls_declare_variant_alt flags. * cgraphclones.cc (cgraph_node::create_clone): Don't copy calls_declare_variant_alt bit. * ipa-free-lang-data.cc (free_lang_data_in_decl): Adjust code referencing declare_variant_alt bit. * ipa.cc (symbol_table::remove_unreachable_nodes): Likewise. * lto-cgraph.cc (lto_output_node): Remove references to deleted bits. (output_refs): Adjust code referencing declare_variant_alt bit. (input_overwrite_node): Remove references to deleted bits. (input_refs): Adjust code referencing declare_variant_alt bit. * lto-streamer-out.cc (lto_output): Likewise. * lto-streamer.h (omp_lto_output_declare_variant_alt): Delete. (omp_lto_input_declare_variant_alt): Delete. * lto/lto-partition.cc (lto_balanced_map): Adjust code referencing deleted declare_variant_alt bit. * omp-expand.cc (expand_omp_target): Use has_metadirectives bit to trigger pass_omp_device_lower instead of calls_declare_variant_alt. * omp-general.cc (struct omp_declare_variant_entry): Delete. (struct omp_declare_variant_base_entry): Delete. (struct omp_declare_variant_hasher): Delete. (omp_declare_variant_hasher::hash): Delete. (omp_declare_variant_hasher::equal): Delete. (omp_declare_variants): Delete. (omp_declare_variant_alt_hasher): Delete. (omp_declare_variant_alt_hasher::hash): Delete. (omp_declare_variant_alt_hasher::equal): Delete. (omp_declare_variant_alt): Delete. (omp_lto_output_declare_variant_alt): Delete. (omp_lto_input_declare_variant_alt): Delete. (includes): Delete unnecessary include of gt-omp-general.h. * omp-offload.cc (execute_omp_device_lower): Remove references to deleted bit. (pass_omp_device_lower::gate): Likewise. * omp-simd-clone.cc (simd_clone_create): Likewise. * passes.cc (ipa_write_summaries): Likeise. * symtab.cc (symtab_node::get_partitioning_class): Likewise. * tree-inline.cc (expand_call_inline): Likewise. (tree_function_versioning): Likewise. 2024-05-04 Sandra Loosemore * gimple-streamer-in.cc (input_gimple_stmt): Restore gomp_metadirective context. * gimple-streamer-out.cc (output_gimple_stmt): Save gomp_metadirective context. * gimple.cc (gimple_build_omp_metadirective): Initialize gomp_metadirective context. * gimple.def (GIMPLE_OMP_METADIRECTIVE): Update comments. * gimple.h (gomp_metadirective): Add context field and update comments. (gimple_omp_metadirective_context): New. (gimple_omp_metadirective_set_context): New. * gimplify.cc (omp_resolved_variant_calls): New. (gimplify_variant_call_expr): New. (gimplify_call_expr): Adjust parameters. Call gimplify_variant_call_expr to handle declare variant substitution. (omp_construct_selector_matches): Delete. (omp_get_construct_context): New. (gimplify_omp_metadirective): Use filtered list of candidates to construct the gomp_metadirective structure. Save the construct context. (gimplify_expr): Adjust arguments to gimplify_call_expr. (gimplify_function_tree): Initialize and free omp_resolved_variant_calls around the call to gimplify_body. * gimplify.h (omp_construct_selector_matches): Delete. (omp_get_construct_context): New. * omp-general.cc (omp_construct_traits_to_codes): Delete. (omp_maybe_offloaded): Add construct_context parameter and comments. Use construct_context to check for nesting in a target directive instead of calling omp_construct_selector_matches. (expr_uses_parm_decl): New. (omp_check_context_selector): Don't reject target_device selector for "declare variant". Add missing check for invalid simd properties. Reject dynamic selectors that reference parameter variables in "declare variant" with a "sorry". (omp_construct_traits_match): New. (omp_context_selector_matches): Adjust parameters to pass in construct_context. Rewrite construct selector matching to use omp_construct_traits_match. Replace unnecessary conditionals checking that traits match the right selector set with asserts. (omp_construct_simd_compare): Add match_p parameter, use it to enable additional matching rules for simdlen and align clauses. (omp_context_selector_set_compare): Make static. Adjust call to omp_construct_simd_compare). (omp_dynamic_cond): Clean up code missed in a previously-committed patch. (omp_context_compare_score): Adjust parameters, rewrite and add comments. (omp_complete_construct_context): New. (omp_resolve_late_declare_variant): Delete. (omp_declare_variant_remove_hook): Delete. (omp_resolve_declare_variant): Delete. (omp_get_dynamic_candidates): Make non-static and adjust parameters. Call omp_complete_construct_context and pass the result to omp_context_selector_matches. Add more comments, debug output, and logic to allow resolution in some cases where candidates cannot be scored accurately. (omp_declare_variant_candidates): New. (omp_metadirective_candidates): New, split from... (omp_early_resolve_metadirective): ...here. (omp_late_resolve_metadirective): Explicitly initialize dynamic_selector field. Adjust call to omp_get_dynamic_candidates. * omp-general.h (struct omp_variant): Add comments explaining how this is used for "declare variant". (omp_construct_traits_to_codes): Delete. (omp_context_selector_matches): Adjust parameters. (omp_context_selector_set_compare): Delete. (omp_resolve_declare_variant): Delete. (omp_declare_variant_candidates): Declare. (omp_metadirective_candidates): Declare. (omp_get_dynamic_candidates): Declare. * omp-offload.cc (execute_omp_device_lower): Remove logic for the old way of handling declare variant. * tree-inline.cc (remap_gimple_stmt): Copy metadirective context. 2024-05-04 Sandra Loosemore * omp-general.cc (omp_check_context_selector): Reject other properties in the same selector set with kind(any). 2024-05-04 Sandra Loosemore * cgraph.h (struct cgraph_node): Add has_metadirectives flag. * cgraphclones.cc (cgraph_node::create_clone): Copy has_metadirectives flag. * doc/gimple.texi (Class hierarchy of GIMPLE statements): Document gomp_metadirective and gomp_variant. * gimple-low.cc (lower_omp_metadirective): New. (lower_stmt): Call it. * gimple-pretty-print.cc (dump_gimple_omp_metadirective): New. (pp_gimple_stmt_1): Call it. * gimple-streamer-in.cc (input_gimple_stmt): Handle GIMPLE_OMP_METADIRECTIVE. * gimple-streamer-out.cc (output_gimple_stmt): Likewise. * gimple-walk.cc (walk_gimple_op): Likewise. (walk_gimple_stmt): Likewise. * gimple.cc (gimple_alloc_omp_metadirective): New. (gimple_build_omp_metadirective): New. (gimple_build_omp_variant): New. * gimple.def (GIMPLE_OMP_METADIRECTIVE): New. (GIMPLE_OMP_METADIRECTIVE_VARIANT): New. * gimple.h (gomp_variant, gomp_metadirective): New. (is_a_helper ::test): New. (is_a_helper ::test): New. (is_a_helper ::test): New. (is_a_helper ::test): New. (gimple_alloc_omp_metadirective): New. (gimple_build_omp_metadirective): New. (gimple_build_omp_variant): New. (gimple_has_substatements): Handle GIMPLE_OMP_METADIRECTIVE. (gimple_has_ops): Likewise. (gimple_omp_metadirective_label): New. (gimple_omp_metadirective_set_label): New. (gimple_omp_variants): New. (gimple_omp_metadirective_set_variants): New. (gimple_return_set_retval): Handle GIMPLE_OMP_METADIRECTIVE. * gimplify.cc (is_gimple_stmt): HANDLE OMP_METADIRECTIVE. (expand_omp_metadirective): New. (gimplify_omp_metadirective): New. (gimplify_expr): Call it. * gsstruct.def (GSS_OMP_METADIRECTIVE): New. (GSS_OMP_METADIRECTIVE_VARIANT): New. * lto-cgraph.cc (lto_output_node): Handle has_metadirectives flag. (input_overwrite_node): Likewise. * omp-expand.cc (expand_omp_target): Propagate has_metadirectives flag. (build_omp_regions_1): Handle GIMPLE_OMP_METADIRECTIVE. (omp_make_gimple_edges): Likewise. * omp-general.cc (omp_late_resolve_metadirective): New. * omp-general.h (omp_late_resolve_metadirective): Declare. * omp-low.cc (struct omp_context): Add next_clone field. (new_omp_context): Handle next_clone field. (clone_omp_context): New. (delete_omp_context): Delete clones. (create_omp_child_function): Propagate has_metadirectives bit. (scan_omp_metadirective): New. (scan_omp_1_stmt): Handle GIMPLE_OMP_METADIRECTIVE. (lower_omp_metadirective): New. (lower_omp_1): Handle GIMPLE_OMP_METADIRECTIVE. Warn about direct calls to offloadable functions containing metadirectives. * omp-offload.cc: Include cfganal.h and cfghooks.h. (omp_expand_metadirective): New. (execute_omp_device_lower): Handle metadirectives. (pass_omp_device_lower::gate): Check has_metadirectives bit. * omp-simd-clone.cc (simd_clone_create): Propagate has_metadirectives flag. * tree-cfg.cc (cleanup_dead_labels): Handle GIMPLE_OMP_METADIRECTIVE. (gimple_redirect_edge_and_branch): Likewise. * tree-inline.cc (remap_gimple_stmt): Handle GIMPLE_OMP_METADIRECTIVE. (estimate_num_instructions): Likewise. (expand_call_inline): Propagate has_metadirectives flag. (tree_function_versioning): Likewise. * tree-ssa-operands.cc: Include omp-general.h. (operands_scanner::parse_ssa_operands): Handle GIMPLE_OMP_METADIRECTIVE. 2024-05-04 Sandra Loosemore * Makefile.in (GTFILES): Move omp-general.h earlier in the list. * builtin-types.def (BT_FN_BOOL_INT_CONST_PTR_CONST_PTR_CONST_PTR): New. * doc/generic.texi (OpenMP): Document OMP_METADIRECTIVE and context selector interfaces. * omp-builtins.def (BUILT_IN_GOMP_EVALUATE_TARGET_DEVICE): New. * omp-general.cc (omp_check_context_selector): Add metadirective_p parameter, use it to conditionalize target_device support. (make_omp_metadirective_variant): New. (omp_context_selector_matches): Add metadirective_p and delay_p parameters, use them to control things that can only be matched late. Handle OMP_TRAIT_SET_TARGET_DEVICE. (score_wide_int): Move definition to omp-general.h. (omp_encode_kind_arch_isa_props): New. (omp_dynamic_cond): New. (omp_context_compute_score): Handle OMP_TRAIT_SET_TARGET_DEVICE. (omp_resolve_late_declare_variant, omp_resolve_declare_variant): Adjust calls to omp_context_selector_matches. (sort_variant): New. (omp_get_dynamic_candidates): New. (omp_early_resolve_metadirective): New. * omp-general.h (score_wide_int): Moved here from omp-general.cc. (struct omp_variant): New. (OMP_METADIRECTIVE_VARIANT_SELECTOR): New. (OMP_METADIRECTIVE_VARIANT_DIRECTIVE): New. (OMP_METADIRECTIVE_VARIANT_BODY): New. (make_omp_metadirective_variant): Declare. (omp_check_context_selector): Adjust to match definition. (omp_context_selector_matches): Likewise. (omp_early_resolve_metadirective): New. * tree-pretty-print.cc (dump_omp_context_selector): Remove static qualifier. (dump_generic_node): Handle OMP_METADIRECTIVE. * tree-pretty-print.h (dump_omp_context_selector): Declare. * tree.def (OMP_METADIRECTIVE): New. * tree.h (OMP_METADIRECTIVE_VARIANTS): New. 2023-10-30 Tobias Burnus * gcc/gimplify.cc (gimplify_omp_allocate): Gimplify allocator. * omp-low.cc (lower_omp_allocate): Simplify; GOMP_free can also take a plain 0 as allocator argument (arg is unused in libgomp). 2023-07-14 Julian Brown * omp-low.cc (lower_omp_target): Reverse iteration over array dimensions. 2023-07-12 Julian Brown * omp-low.cc (lower_omp_target): Calculate volume enclosing transferred elements instead of using whole array size for noncontiguous 'target update' operations. 2023-07-03 Julian Brown * gimplify.cc (gimplify_adjust_omp_clauses): Don't gimplify VIEW_CONVERT_EXPR away in GOMP_MAP_TO_GRID/GOMP_MAP_FROM_GRID clauses. * omp-low.cc (omp_noncontig_descriptor_type): Add SPAN field. (scan_sharing_clauses): Don't store descriptor size in its OMP_CLAUSE_SIZE field. (lower_omp_target): Add missing OMP_CLAUSE_MAP check. Add special-case string handling. Handle span and bias. Use low bound instead of zero as index for trailing full dimensions. 2023-07-03 Julian Brown * gimplify.cc (omp_group_last, omp_group_base): Add GOMP_MAP_TO_GRID, GOMP_MAP_FROM_GRID support. (gimplify_adjust_omp_clauses): Support new GOMP_MAP_GRID_DIM, GOMP_MAP_GRID_STRIDE mapping nodes. Don't crash on e.g. misuse of ADDR_EXPR in mapping clauses. * omp-general.cc (omp_parse_noncontiguous_array): New function. (omp_parse_access_method): Add noncontiguous array support. (omp_parse_structure_base): Add array-shaping support. (debug_omp_tokenized_addr): Add ACCESS_NONCONTIG_ARRAY, ACCESS_NONCONTIG_REF_TO_ARRAY token support. * omp-general.h (access_method_kinds): Add ACCESS_NONCONTIG_ARRAY and ACCESS_NONCONTIG_REF_TO_ARRAY access kinds. * omp-low.cc (omp_noncontig_descriptor_type): New function. (scan_sharing_clauses): Support noncontiguous array updates. (lower_omp_target): Likewise. * tree-pretty-print.cc (dump_omp_clause): Add GOMP_MAP_TO_GRID, GOMP_MAP_FROM_GRID, GOMP_MAP_GRID_DIM, GOMP_MAP_GRID_STRIDE map kinds. (dump_generic_node): Add stride support for OMP_ARRAY_SECTION. * tree.def (OMP_ARRAY_SECTION): Add stride argument. 2023-06-30 Julian Brown * gimplify.cc (dwarf2out.h): Include. (omp_maybe_get_descriptor_from_ptr): New function. (build_omp_struct_comp_nodes): Use above function to locate array descriptor when necessary. (omp_mapping_group_data, omp_mapping_group_ptr, omp_mapping_group_pset): New functions. (omp_instantiate_mapper): Handle inlining of "declare mapper" function bodies containing setup code (e.g. for Fortran). Handle pointers to derived types. Handle GOMP_MAP_MAPPING_GROUPs. * tree-pretty-print.cc (dump_omp_clause): Handle GOMP_MAP_MAPPING_GROUP. 2023-06-30 Julian Brown * gimplify.cc (gimplify_omp_ctx): Add IMPLICIT_MAPPERS field. (new_omp_context): Initialise IMPLICIT_MAPPERS hash map. (delete_omp_context): Delete IMPLICIT_MAPPERS hash map. (instantiate_mapper_info): New structs. (remap_mapper_decl_1, omp_mapper_copy_decl, omp_instantiate_mapper, omp_instantiate_implicit_mappers): New functions. (gimplify_scan_omp_clauses): Handle MAPPER_BINDING clauses. (gimplify_adjust_omp_clauses): Instantiate implicit declared mappers. (gimplify_omp_declare_mapper): New function. (gimplify_expr): Call above function. * langhooks-def.h (lhd_omp_finish_mapper_clauses, lhd_omp_mapper_lookup, lhd_omp_extract_mapper_directive, lhd_omp_map_array_section): Add prototypes. (LANG_HOOKS_OMP_FINISH_MAPPER_CLAUSES, LANG_HOOKS_OMP_MAPPER_LOOKUP, LANG_HOOKS_OMP_EXTRACT_MAPPER_DIRECTIVE, LANG_HOOKS_OMP_MAP_ARRAY_SECTION): Define macros. (LANG_HOOK_DECLS): Add above macros. * langhooks.cc (lhd_omp_finish_mapper_clauses, lhd_omp_mapper_lookup, lhd_omp_extract_mapper_directive, lhd_omp_map_array_section): New dummy functions. * langhooks.h (lang_hooks_for_decls): Add OMP_FINISH_MAPPER_CLAUSES, OMP_MAPPER_LOOKUP, OMP_EXTRACT_MAPPER_DIRECTIVE, OMP_MAP_ARRAY_SECTION hooks. * omp-general.h (omp_name_type): Add templatized struct, hash type traits (for omp_name_type specialization). (omp_mapper_list): Add struct. * tree-core.h (omp_clause_code): Add OMP_CLAUSE__MAPPER_BINDING_. * tree-pretty-print.cc (dump_omp_clause): Support GOMP_MAP_UNSET, GOMP_MAP_PUSH_MAPPER_NAME, GOMP_MAP_POP_MAPPER_NAME artificial mapping clauses. Support OMP_CLAUSE__MAPPER_BINDING_ and OMP_DECLARE_MAPPER. * tree.cc (omp_clause_num_ops, omp_clause_code_name): Add OMP_CLAUSE__MAPPER_BINDING_. * tree.def (OMP_DECLARE_MAPPER): New tree code. * tree.h (OMP_DECLARE_MAPPER_ID, OMP_DECLARE_MAPPER_DECL, OMP_DECLARE_MAPPER_CLAUSES): New defines. (OMP_CLAUSE__MAPPER_BINDING__ID, OMP_CLAUSE__MAPPER_BINDING__DECL, OMP_CLAUSE__MAPPER_BINDING__MAPPER): New defines. 2023-06-19 Julian Brown * gimplify.cc (gimplify_adjust_omp_clauses_1): Set OMP_CLAUSE_MAP_RUNTIME_IMPLICIT_P for OpenACC also. 2023-06-19 Julian Brown * gimplify.cc (gimplify_adjust_omp_clauses_1): Handle "oacc declare create" attribute. 2023-06-19 Julian Brown * gimplify.cc (omp_tsort_mark, omp_mapping_group): Move before gimplify_omp_ctx. Add constructor to omp_mapping_group. (gimplify_omp_ctx): Add DECL_DATA_CLAUSE field. (new_omp_context, delete_omp_context): Initialise and free above field. (omp_gather_mapping_groups_1): Use constructor for omp_mapping_group. (gimplify_scan_omp_clauses): Record mappings that might be lexically inherited. Don't remove GOMP_MAP_FIRSTPRIVATE_POINTER/GOMP_MAP_FIRSTPRIVATE_REFERENCE yet. (gomp_oacc_needs_data_present): New function. (gimplify_adjust_omp_clauses_1): Implement lexical inheritance behaviour for OpenACC. (gimplify_adjust_omp_clauses): Remove GOMP_MAP_FIRSTPRIVATE_POINTER/GOMP_MAP_FIRSTPRIVATE_REFERENCE here instead, after lexical inheritance is done. 2023-05-12 Julian Brown * omp-builtins.def (BUILT_IN_OMP_IS_INITIAL_DEVICE): New builtin. * tree.cc (get_file_function_name): Support names for on-target constructor/destructor functions. 2024-06-05 Jakub Jelinek Frederik Harwath Sandra Loosemore * tree.def (OMP_TILE, OMP_UNROLL): New tree codes. * tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_PARTIAL, OMP_CLAUSE_FULL and OMP_CLAUSE_SIZES. * tree.h (OMP_LOOPXFORM_CHECK): Define. (OMP_LOOPXFORM_LOWERED): Define. (OMP_CLAUSE_PARTIAL_EXPR): Define. (OMP_CLAUSE_SIZES_LIST): Define. * tree.cc (omp_clause_num_ops, omp_clause_code_name): Add entries for OMP_CLAUSE_{PARTIAL,FULL,SIZES}. * tree-pretty-print.cc (dump_omp_clause): Handle OMP_CLAUSE_{PARTIAL,FULL,SIZES}. (dump_generic_node): Handle OMP_TILE and OMP_UNROLL. Skip printing loops with NULL OMP_FOR_INIT (node) vector element. * gimplify.cc (is_gimple_stmt): Handle OMP_TILE and OMP_UNROLL. (gimplify_omp_taskloop_expr): For SAVE_EXPR use gimplify_save_expr. (gimplify_omp_loop_xform): New function. (gimplify_omp_for): Call omp_maybe_apply_loop_xforms and if that reshuffles what the passed pointer points to, retry or return GS_OK. Handle OMP_TILE and OMP_UNROLL. (gimplify_omp_loop): Call omp_maybe_apply_loop_xforms and if that reshuffles what the passed pointer points to, return GS_OK. (gimplify_expr): Handle OMP_TILE and OMP_UNROLL. * omp-general.h (omp_loop_number_of_iterations, omp_maybe_apply_loop_xforms): Declare. * omp-general.cc (omp_adjust_for_condition): For LE_EXPR and GE_EXPR with pointers, don't add/subtract one, but the size of what the pointer points to. (omp_loop_number_of_iterations, omp_apply_tile, find_nested_loop_xform, omp_maybe_apply_loop_xforms): New functions. 2023-03-17 Andrew Stubbs * config/gcn/gcn-valu.md (gather_load): New. (scatter_store): New. (mask_gather_load): New. (mask_scatter_store): New. 2024-05-10 Thomas Schwinge * config/nvptx/nvptx.md (nvptx_uniform_warp_check): Make fit for non-full-warp execution, via 'vote.all.pred'. gcc/testsuite/ * gcc.target/nvptx/nvptx.exp (check_effective_target_default_ptx_isa_version_at_least_6_0): New. * gcc.target/nvptx/uniform-simt-2.c: Adjust. * gcc.target/nvptx/uniform-simt-5.c: New. 2024-05-28 Thomas Schwinge * config/nvptx/nvptx.h: Configure global constructor, destructor support. gcc/testsuite/ * gcc.dg/no_profile_instrument_function-attr-1.c: GCC/nvptx is 'NO_DOT_IN_LABEL' but not 'NO_DOLLAR_IN_LABEL', so '$' may apper in identifiers. * lib/target-supports.exp (check_effective_target_global_constructor): Enable for nvptx. libgcc/ * config/nvptx/crt0.c (__gbl_ctors): New weak function. (__main): Invoke it. * config/nvptx/gbl-ctors.c: New. * config/nvptx/t-nvptx: Configure global constructor, destructor support. 2022-10-24 Andrew Stubbs * tree-vect-data-refs.cc (vect_analyze_data_refs): Workaround an address-space bug. 2023-11-19 Tobias Burnus Chung-Lin Tang * builtin-types.def (BT_FN_VOID_PTRMODE): (BT_FN_PTRMODE_PTRMODE_INT_PTR): Add. * gimplify.cc (gimplify_bind_expr): Diagnose missing uses_allocators clause. (gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses, gimplify_omp_workshare): Handle uses_allocators. * omp-builtins.def (BUILT_IN_OMP_INIT_ALLOCATOR, BUILT_IN_OMP_DESTROY_ALLOCATOR): Add. * omp-low.cc (scan_sharing_clauses): * tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_USES_ALLOCATORS. * tree.cc (omp_clause_num_ops, omp_clause_code_name): Likewise. * tree-pretty-print.cc (dump_omp_clause): Handle it. * tree.h (OMP_CLAUSE_USES_ALLOCATORS_ALLOCATOR, OMP_CLAUSE_USES_ALLOCATORS_MEMSPACE, OMP_CLAUSE_USES_ALLOCATORS_TRAITS): New. 2022-10-21 Tobias Burnus * omp-oacc-kernels-decompose.cc (top_level_omp_for_in_stmt, decompose_kernels_region_body): Handle GIMPLE_DEBUG like simple assignment. 2022-07-12 Andrew Stubbs * gimple-loop-versioning.cc (loop_versioning::loop_versioning): Add comment. * omp-general.cc (omp_max_simd_vf): New function. * omp-general.h (omp_max_simd_vf): New prototype. * omp-low.cc (lower_rec_simd_input_clauses): Select largest from omp_max_vf, omp_max_simt_vf, and omp_max_simd_vf. 2023-08-23 Andrew Stubbs * omp-builtins.def (BUILT_IN_GOMP_ENABLE_PINNED_MODE): New. * omp-low.cc (omp_enable_pinned_mode): New function. (execute_lower_omp): Call omp_enable_pinned_mode. 2023-08-23 Andrew Stubbs * common.opt: Add -foffload-memory and its enum values. * coretypes.h (enum offload_memory): New. * doc/invoke.texi: Document -foffload-memory. 2022-10-19 Tobias Burnus * omp-expand.cc (expand_omp_target): Fix OpenACC in case there are more than 3 arguments to the builtin function. 2022-03-01 Tobias Burnus * langhooks-def.h (lhd_omp_deep_mapping_p, lhd_omp_deep_mapping_cnt, lhd_omp_deep_mapping): New. (LANG_HOOKS_OMP_DEEP_MAPPING_P, LANG_HOOKS_OMP_DEEP_MAPPING_CNT, LANG_HOOKS_OMP_DEEP_MAPPING): Define. (LANG_HOOKS_DECLS): Use it. * langhooks.cc (lhd_omp_deep_mapping_p, lhd_omp_deep_mapping_cnt, lhd_omp_deep_mapping): New stubs. * langhooks.h (struct lang_hooks_for_decls): Add new hooks * omp-expand.cc (expand_omp_target): Handle dynamic-size addr/sizes/kinds arrays. * omp-low.cc (build_sender_ref, fixup_child_record_type, scan_sharing_clauses, lower_omp_target): Update to handle new hooks and dynamic-size addr/sizes/kinds arrays. 2021-11-16 Frederik Harwath * tree-cfg.h (gimple_debug_cfg): Change argument type from int to dump_flags_t. 2021-03-01 Kwok Cheung Yeung * omp-expand.cc (expand_oacc_for): Convert .tile variable to diff_type before multiplying. * omp-general.cc (omp_extract_for_data): Use accumulated precision of all collapsed for-loops as precision of iteration variable, up to the precision of a long long. 2021-02-01 Chung-Lin Tang * omp-low.cc (install_var_field): Add new 'tree key_expr = NULL_TREE' default parameter. Set splay-tree lookup key to key_expr instead of var if key_expr is non-NULL. Adjust call to install_parm_decl. Update comments. (scan_sharing_clauses): Use clause tree expression as splay-tree key for map/to/from and OpenACC firstprivate cases when installing the variable field into the send/receive record type. (maybe_lookup_field_in_outer_ctx): Add code to search through construct clauses instead of entirely based on splay-tree lookup. (lower_oacc_reductions): Adjust to find map-clause of reduction variable, then create receiver-ref. (lower_omp_target): Adjust to lookup var field using clause expression. 2021-01-15 Andrew Stubbs * dwarf2out.cc (add_location_or_const_value_attribute): Set DW_AT_address_class, if appropriate. 2021-03-04 Andrew Stubbs * dwarf2out.cc (notional_parents_list): New file variable. (gen_subprogram_die): Record offload kernel functions in notional_parents_list. (fixup_notional_parents): New function. (dwarf2out_finish): Call fixup_notional_parents. (dwarf2out_c_finalize): Reset notional_parents_list. 2021-02-26 Andrew Stubbs * dwarf2out.cc (gen_subprogram_die): Replace existing low/high PC attributes, rather than ICE. 2021-01-16 Andrew Stubbs * dwarf2out.cc (gen_subprogram_die): Check offload attributes only. 2020-12-06 Andrew Stubbs * dwarf2out.cc (gen_subprogram_die): Add high/low_pc attributes for parents of offload kernels. 2021-01-13 Julian Brown * doc/tm.texi.in (TARGET_VECTORIZE_PREFER_GATHER_SCATTER): Add documentation hook. * doc/tm.texi: Regenerate. * target.def (prefer_gather_scatter): Add target hook under vectorizer. * tree-vect-stmts.cc (get_group_load_store_type): Optionally prefer gather/scatter instructions to scalar/elementwise fallback. * config/gcn/gcn.cc (TARGET_VECTORIZE_PREFER_GATHER_SCATTER): Define hook. 2021-01-13 Julian Brown * omp-offload.cc (oacc_thread_numbers): Add VF_BY_VECTORIZER parameter. Add overloaded wrapper for previous arguments & behaviour. (oacc_xform_loop): Lower vector loops to iterate a multiple of omp_max_vf times over contiguous steps on non-SIMT targets. 2020-06-03 Tobias Burnus * gimplify.cc (localize_reductions): Do not create local variable for privatized arrays. 2020-02-06 Tobias Burnus * omp-low.c (convert_from_firstprivate_int): Use VIEW_CONVERT also for vectors. 2023-04-17 Kwok Cheung Yeung * gimplify.cc (omp_group_base): Handle GOMP_MAP_DECLARE_ALLOCATE and GOMP_MAP_DECLARE_DEALLOCATE. 2020-02-19 Julian Brown * gimplify.cc (gimplify_scan_omp_clauses): Handle GOMP_MAP_DECLARE_ALLOCATE and GOMP_MAP_DECLARE_DEALLOCATE. 2018-10-04 Cesar Philippidis Julian Brown * omp-low.c (scan_sharing_clauses): Update handling of OpenACC declare create, declare copyin and declare deviceptr to have local lifetimes. (convert_to_firstprivate_int): Handle pointer types. (convert_from_firstprivate_int): Likewise. Create local storage for the values being pointed to. Add new orig_type argument. (lower_omp_target): Handle GOMP_MAP_DECLARE_{ALLOCATE,DEALLOCATE}. Add orig_type argument to convert_from_firstprivate_int call. Allow pointer types with GOMP_MAP_FIRSTPRIVATE_INT. Don't privatize firstprivate VLAs. * tree-pretty-print.c (dump_omp_clause): Handle GOMP_MAP_DECLARE_{ALLOCATE,DEALLOCATE}. 2019-09-20 Julian Brown * gimplify.cc (localize_reductions): Rewrite references for OMP_CLAUSE_PRIVATE also. 2019-09-06 Julian Brown * gimplify.cc (gimplify_omp_for): Use for_stmt in call to localize_reductions. 2019-09-06 Julian Brown * gimplify.cc (gimplify_omp_workshare): Use OMP_CLAUSES, OMP_BODY instead of OMP_TARGET_CLAUSES, OMP_TARGET_BODY. 2019-09-05 Cesar Philippidis Julian Brown * gimplify.cc (privatize_reduction): New struct. (localize_reductions_r, localize_reductions): New functions. (gimplify_omp_for): Call localize_reductions. (gimplify_omp_workshare): Likewise. * omp-low.cc (lower_oacc_reductions): Handle localized reductions. Create fewer temp vars. * tree-core.h (omp_clause_code): Add OMP_CLAUSE_REDUCTION_PRIVATE_DECL documentation. * tree.cc (omp_clause_num_ops): Bump number of ops for OMP_CLAUSE_REDUCTION to 6. (walk_tree_1): Adjust accordingly. * tree.h (OMP_CLAUSE_REDUCTION_PRIVATE_DECL): Add macro. 2019-07-10 Cesar Philippidis Chung-Lin Tang * gimplify.cc (omp_add_variable): Enable firstprivate reduction variables. 2018-09-20 Cesar Philippidis * omp-low.cc (lower_oacc_head_mark): Don't mark OpenACC auto loops as independent inside acc parallel regions. 2018-12-22 Cesar Philippidis Julian Brown Tobias Burnus * omp-low.cc (maybe_lookup_field_in_outer_ctx): New function. (convert_to_firstprivate_int): New function. (convert_from_firstprivate_int): New function. (lower_omp_target): Enable GOMP_MAP_FIRSTPRIVATE_INT in OpenACC. Remove unused variable. 2018-10-05 Nathan Sidwell Tom de Vries Thomas Schwinge Julian Brown * doc/invoke.texi (fopenacc-dim): Update. * omp-offload.cc (oacc_parse_default_dims): Update. 2018-10-30 Cesar Philippidis * config/nvptx/nvptx.cc (nvptx_propagate_unified): New. (nvptx_split_blocks): Call it for cond_uni insn. (nvptx_expand_cond_uni): New. (enum nvptx_builtins): Add NVPTX_BUILTIN_COND_UNI. (nvptx_init_builtins): Initialize it. (nvptx_expand_builtin): (nvptx_generate_vector_shuffle): Change integral SHIFT operand to tree BITS operand. (nvptx_vector_reduction): New. (nvptx_adjust_reduction_type): New. (nvptx_goacc_reduction_setup): Use it to adjust the type of ref_to_res. (nvptx_goacc_reduction_init): Don't update LHS if it doesn't exist. (nvptx_goacc_reduction_fini): Call nvptx_vector_reduction for vector. Use it to adjust the type of ref_to_res. (nvptx_goacc_reduction_teardown): * config/nvptx/nvptx.md (cond_uni): New pattern. 2018-06-29 Cesar Philippidis James Norris * gimplify.cc (enum gimplify_omp_var_data): Add GOVD_DEVICETPR. (omp_notice_variable): Add GOVD_DEVICEPTR attribute when appropriate. (gimplify_scan_omp_clauses): Add GOVD_DEVICEPTR attribute when appropriate. (gimplify_adjust_omp_clauses_1): Set GOMP_MAP_FORCE_DEVICEPTR for implicit deviceptr mappings. 2023-04-18 Kwok Cheung Yeung * gimplify.cc (omp_group_base): Handle GOMP_MAP_NONCONTIG_ARRAY_* map types. 2020-04-19 Chung-Lin Tang PR other/76739 * builtin-types.def (BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_VAR): New type. * omp-builtins.def (BUILT_IN_GOACC_DATA_START): Adjust function type to new BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_VAR. * gimplify.cc (gimplify_scan_omp_clauses): Skip gimplification of OMP_CLAUSE_SIZE of non-contiguous array maps (which is a TREE_LIST). * omp-expand.cc (expand_omp_target): Add non-contiguous array descriptor pointers to variadic arguments. * omp-low.cc (append_field_to_record_type): New function. (create_noncontig_array_descr_type): Likewise. (create_noncontig_array_descr_init_code): Likewise. (scan_sharing_clauses): For non-contiguous array map kinds, check for supported dimension structure, and install non-contiguous array variable into current omp_context. (reorder_noncontig_array_clauses): New function. (scan_omp_target): Call reorder_noncontig_array_clauses to place non-contiguous array map clauses at beginning of clause sequence. (lower_omp_target): Add handling for non-contiguous array map kinds, add all created non-contiguous array descriptors to gimple_omp_target_data_arg. 2022-06-20 Kwok Cheung Yeung * Makefile.in (REVISION_s): Change default message.