2023-05-04 Frederik Harwath * omp-transform-loops.cc (full_unroll): Add initialization of index variable. 2023-04-27 Andrew Stubbs * config/gcn/gcn-valu.md (cmul3): Use gcn_gen_undef. (cml4): Likewise. (vec_addsub3): Likewise. (cadd3): Likewise. (vec_fmaddsub4): Likewise. (vec_fmsubadd4): Likewise, and use sub for the odd lanes. 2023-04-21 Andrew Stubbs Backport from mainline: Andrew Stubbs * config/gcn/gcn-valu.md (vnsi, VnSI): Add scalar modes. (ldexp3): Delete. (ldexp3): Change "B" to "A". 2023-04-20 Andrew Stubbs Backport from mainline: Andrew Stubbs * config/gcn/gcn-valu.md (SV_SFDF): New iterator. (SV_FP): New iterator. (scalar_mode, SCALAR_MODE): Add identity mappings for scalar modes. (recip2): Unify the two patterns using SV_FP. (div_scale): New insn. (div_fmas): New insn. (div_fixup): New insn. (div3): Unify the two expanders and rewrite using hardfp. * config/gcn/gcn.cc (gcn_md_reorg): Support "vccwait" attribute. * config/gcn/gcn.md (unspec): Add UNSPEC_DIV_SCALE, UNSPEC_DIV_FMAS, and UNSPEC_DIV_FIXUP. (vccwait): New attribute. 2023-04-13 Andrew Stubbs Backport from mainline: Andre Vieira PR tree-optimization/108888 * tree-if-conv.cc (predicate_statements): Fix gimple call check. 2023-04-03 Andrew Stubbs * config/gcn/gcn-valu.md (one_cmpl2): New. 2023-04-03 Thomas Schwinge * doc/invoke.texi (-foffload-memory=pinned): Document. 2023-03-31 Frederik Harwath * omp-transform-loops.cc (walk_omp_for_loops): Handle GIMPLE_OMP_METADIRECTIVE. 2023-03-27 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. 2023-03-22 Andrew Jenner * config/gcn/gcn-protos.h (gcn_expand_dpp_swap_pairs_insn) (gcn_expand_dpp_distribute_even_insn) (gcn_expand_dpp_distribute_odd_insn): Declare. * config/gcn/gcn-valu.md (@dpp_swap_pairs) (@dpp_distribute_even, @dpp_distribute_odd) (cmul3, cml4, vec_addsub3) (cadd3, vec_fmaddsub4, vec_fmsubadd4) (fms4, fms4_negop2, fms4) (fms4_negop2): New patterns. * config/gcn/gcn.cc (gcn_expand_dpp_swap_pairs_insn) (gcn_expand_dpp_distribute_even_insn) (gcn_expand_dpp_distribute_odd_insn): New functions. * config/gcn/gcn.md: Add entries to unspec enum. 2023-03-17 Andrew Stubbs * config/gcn/gcn.cc (gcn_class_max_nregs): Handle vectors in SGPRs. (move_callee_saved_registers): Detect the bug condition early. 2023-03-17 Andrew Stubbs Backport from mainline: Richard Sandiford * tree-vect-data-refs.cc (vect_check_gather_scatter): Restrict early-out optimisation to SSA_NAMEs. 2023-03-17 Andrew Stubbs * config/gcn/gcn-valu.md (gather_load): New. (scatter_store): New. (mask_gather_load): New. (mask_scatter_store): New. 2023-03-17 Andrew Stubbs * config/gcn/gcn-protos.h (gcn_stepped_zero_int_parallel_p): New. * config/gcn/gcn-valu.md (V_1REG_ALT): New. (V_2REG_ALT): New. (vec_extract_nop): New. (vec_extract_nop): New. (vec_extract): Use new patterns. * config/gcn/gcn.cc (gcn_stepped_zero_int_parallel_p): New. * config/gcn/predicates.md (ascending_zero_int_parallel): New. 2023-03-06 Paul-Antoine Arras Backported from master: 2023-03-06 Paul-Antoine Arras * config/gcn/gcn-valu.md (3_exec): Add patterns for {s|u}{max|min} in QI, HI and DI modes. (3): Add pattern for {s|u}{max|min} in DI mode. (cond_): Add pattern for cond_f{max|min}. (cond_): Add pattern for cond_{s|u}{max|min}. * config/gcn/gcn.cc (gcn_spill_class): Allow the exec register to be saved in SGPRs. 2023-03-01 Tobias Burnus Backported from master: 2023-03-01 Tobias Burnus PR middle-end/108546 * omp-low.cc (lower_omp_target): Remove optional handling on the receiver side, i.e. inside target (data), for use_device_ptr. 2023-02-23 Andrew Stubbs Backport from mainline: PR tree-optimization/108888 * tree-if-conv.cc (if_convertible_stmt_p): Set PLF_2 on calls to predicate. (predicate_statements): Only predicate calls with PLF_2. 2023-02-23 Andrew Stubbs * internal-fn.cc (expand_MASK_CALL): New. * internal-fn.def (MASK_CALL): New. * internal-fn.h (expand_MASK_CALL): New prototype. * omp-simd-clone.cc (simd_clone_adjust_argument_types): Set vector_type for mask arguments also. * tree-if-conv.cc: Include cgraph.h. (if_convertible_stmt_p): Do if conversions for calls to SIMD calls. (predicate_statements): Convert functions to IFN_MASK_CALL. * tree-vect-loop.cc (vect_get_datarefs_in_loop): Recognise IFN_MASK_CALL as a SIMD function call. * tree-vect-stmts.cc (vectorizable_simd_clone_call): Handle IFN_MASK_CALL as an inbranch SIMD function call. Generate the mask vector arguments. 2023-02-22 Tobias Burnus * gimplify.cc (gimplify_scan_omp_clauses): Remove Fortran special case. 2023-02-16 Andrew Stubbs * config/gcn/gcn-builtins.def (DISPATCH_PTR): New built-in. * config/gcn/gcn.cc (gcn_init_machine_status): Disable global addressing. (gcn_expand_builtin_1): Implement GCN_BUILTIN_DISPATCH_PTR. 2023-02-09 Kwok Cheung Yeung * gimplify.cc (omp_notice_variable): Apply GOVD_MAP_ALLOC_ONLY flag and defaultmap flags if the defaultmap has GOVD_MAP_FORCE_PRESENT flag set. (omp_target_reorder_clauses): Recognize maps with present modifier. Reorder present maps to come first. (gimplify_scan_omp_clauses): Set GOVD flags for present defaultmaps. (gimplify_adjust_omp_clauses_1): Set map kind for present defaultmaps. * omp-low.cc (scan_sharing_clauses): Handle 'always, present' map clauses. (lower_omp_target): Handle map clauses with 'present' modifier. Handle 'to' and 'from' clauses with 'present'. * tree-core.h (enum omp_clause_defaultmap_kind): Add OMP_CLAUSE_DEFAULTMAP_PRESENT defaultmap kind. (enum omp_clause_motion_modifier): New. (struct tree_omp_clause): Add motion_modifier field. * tree-pretty-print.cc (dump_omp_clause): Handle 'map', 'to' and 'from' clauses with 'present' modifier. Handle present defaultmap. * tree.h (OMP_CLAUSE_MOTION_MODIFIER): New. (OMP_CLAUSE_SET_MOTION_MODIFIER): New. 2023-02-06 Andrew Stubbs * config/gcn/mkoffload.cc (gcn_stack_size): New global variable. (process_asm): Create a constructor for GCN_STACK_SIZE. (main): Parse the -mstack-size option. 2023-02-06 Andrew Stubbs * config/gcn/gcn-run.cc: Include libgomp-gcn.h. (struct kernargs): Replace the common content with kernargs_abi. (struct heap): Delete. (main): Read GCN_STACK_SIZE envvar. Allocate space for the device stacks. Write the new kernargs fields. * config/gcn/gcn.cc (gcn_option_override): Remove stack_size_opt. (default_requested_args): Remove PRIVATE_SEGMENT_BUFFER_ARG and PRIVATE_SEGMENT_WAVE_OFFSET_ARG. (gcn_addr_space_convert): Mask the QUEUE_PTR_ARG content. (gcn_expand_prologue): Move the TARGET_PACKED_WORK_ITEMS to the top. Set up the stacks from the values in the kernargs, not private. (gcn_expand_builtin_1): Match the stack configuration in the prologue. (gcn_hsa_declare_function_name): Turn off the private segment. (gcn_conditional_register_usage): Ensure QUEUE_PTR is fixed. * config/gcn/gcn.h (FIXED_REGISTERS): Fix the QUEUE_PTR register. * config/gcn/gcn.opt (mstack-size): Change the description. 2023-02-02 Paul-Antoine Arras Backported from master: 2023-02-02 Paul-Antoine Arras * config/gcn/gcn-valu.md (cond_): Add cond_{ashl|ashr|lshr} 2023-02-02 Tobias Burnus Backported from master: 2023-02-02 Jakub Jelinek PR middle-end/108435 * tree-nested.cc (convert_nonlocal_omp_clauses) : If info->new_local_var_chain and *seq is not a GIMPLE_BIND, wrap the sequence into a new GIMPLE_BIND before calling declare_vars. (convert_nonlocal_omp_clauses) : Merge with the OMP_CLAUSE_LASTPRIVATE handling except for whether seq is initialized to &OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (clause) or &OMP_CLAUSE_LINEAR_GIMPLE_SEQ (clause). 2023-01-26 Tobias Burnus Backported from master: 2023-01-23 Tobias Burnus * doc/install.texi (amdgcn, nvptx): Require newlib 4.3.0. 2023-01-20 Thomas Schwinge * collect2.cc (write_c_file_glob): Allow for 'COLLECT2_MAIN_REFERENCE' override. * config.gcc : Set 'use_collect2=yes'. * config/nvptx/nvptx.h: Adjust. * config/nvptx/nvptx.cc (nvptx_assemble_undefined_decl): Notice '__nvptx_stacks', '__nvptx_uni' declarations. (nvptx_file_end): Don't emit duplicate declarations for those. * config/nvptx/nvptx.md (nvptx_uniform_warp_check): Make fit for non-full-warp execution. 2023-01-19 Tobias Burnus Backported from master: 2023-01-19 Jakub Jelinek PR middle-end/108459 * omp-expand.cc (expand_omp_for_init_counts): Use fold_build1 rather than fold_unary for NEGATE_EXPR. 2023-01-03 Sandra Loosemore Backported from master: 2023-01-03 Sandra Loosemore * cgraph.h (struct cgraph_node): Add gc_candidate bit, modify default constructor to initialize it. * cgraphunit.cc (expand_all_functions): Save gc_candidate functions for last and iterate to handle recursive calls. Delete leftover candidates at the end. * omp-simd-clone.cc (simd_clone_create): Set gc_candidate bit on local clones. * tree-vect-stmts.cc (vectorizable_simd_clone_call): Clear gc_candidate bit when a clone is used. 2022-12-21 Tobias Burnus Backported from master: 2022-12-21 Chung-Lin Tang * config/nvptx/nvptx.cc (nvptx_print_operand): Add 'p' case, adjust comments. (enum nvptx_builtins): Add NVPTX_BUILTIN_BAR_RED_AND, NVPTX_BUILTIN_BAR_RED_OR, and NVPTX_BUILTIN_BAR_RED_POPC. (nvptx_expand_bar_red): New function. (nvptx_init_builtins): Add DEFs of __builtin_nvptx_bar_red_[and/or/popc]. (nvptx_expand_builtin): Use nvptx_expand_bar_red to expand NVPTX_BUILTIN_BAR_RED_[AND/OR/POPC] cases. * config/nvptx/nvptx.md (define_c_enum "unspecv"): Add UNSPECV_BARRED_AND, UNSPECV_BARRED_OR, and UNSPECV_BARRED_POPC. (BARRED): New int iterator. (barred_op,barred_mode,barred_ptxtype): New int attrs. (nvptx_barred_): New define_insn. 2022-12-06 Marcel Vollweiler Backported from master: 2022-12-06 Marcel Vollweiler * gimplify.cc (optimize_target_teams): Set initial num_teams_upper to "-2" instead of "1" for non-existing num_teams clause in order to disambiguate from the case of an existing num_teams clause with value 1. 2022-12-06 Paul-Antoine Arras Backported from master: 2022-12-01 Paul-Antoine Arras * config/gcn/gcn-opts.h (TARGET_FIJI): -march=fiji. (TARGET_VEGA10): -march=gfx900. (TARGET_VEGA20): -march=gfx906. (TARGET_GFX908): -march=gfx908. (TARGET_GFX90a): -march=gfx90a. * config/gcn/gcn.h (TARGET_CPU_CPP_BUILTINS): Define a builtin that uniquely maps to '-march'. 2022-11-30 Paul-Antoine Arras Backported from master: 2022-11-30 Paul-Antoine Arras * config/gcn/gcn.cc (gcn_omp_device_kind_arch_isa): Add gfx803. * config/gcn/t-omp-device: Add gfx803. 2022-11-28 Tobias Burnus Backported from master: 2022-11-28 Tobias Burnus * config/gcn/gcn.cc (gcn_expand_builtin_1): Work on s1 instead of s[0:1] and use USE to prevent removal of setting that register. * config/gcn/gcn.md (prologue_use_di): Remove. 2022-11-26 Sandra Loosemore Backported from master: 2022-11-25 Sandra Loosemore * common.opt (fopenmp-target-simd-clone): New option. (target_simd_clone_device): New enum to go with it. * doc/invoke.texi (-fopenmp-target-simd-clone): Document. * flag-types.h (enum omp_target_simd_clone_device_kind): New. * omp-simd-clone.cc (auto_simd_fail): New function. (auto_simd_check_stmt): New function. (plausible_type_for_simd_clone): New function. (ok_for_auto_simd_clone): New function. (simd_clone_create): Add force_local argument, make the symbol have internal linkage if it is true. (expand_simd_clones): Also check for cloneable functions with "omp declare target". Pass explicit_p argument to simd_clone.compute_vecsize_and_simdlen target hook. * opts.cc (default_options_table): Add -fopenmp-target-simd-clone. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN): Add bool explicit_p argument. * doc/tm.texi: Regenerated. * config/aarch64/aarch64.cc (aarch64_simd_clone_compute_vecsize_and_simdlen): Update. * config/gcn/gcn.cc (gcn_simd_clone_compute_vecsize_and_simdlen): Update. * config/i386/i386.cc (ix86_simd_clone_compute_vecsize_and_simdlen): Update. 2022-11-23 Tobias Burnus Backported from master: 2022-11-22 Tobias Burnus Andrew Stubbs * config/gcn/gcn-builtins.def (FIRST_CALL_THIS_THREAD_P, GET_STACK_LIMIT): Add new builtins. * config/gcn/gcn.cc (gcn_expand_builtin_1): Expand them. * config/gcn/gcn.md (prologue_use): Add "register_operand" as arg to match_operand. (prologue_use_di): New; DI insn_and_split variant of the former. 2022-11-18 Tobias Burnus Backported from master: 2022-11-16 Tobias Burnus Andrew Stubbs * config/gcn/gcn-builtins.def (KERNARG_PTR): Add. * config/gcn/gcn.cc (gcn_init_builtin_types): Change siptr_type_node, sfptr_type_node and voidptr_type_node from FLAT to ADDR_SPACE_DEFAULT. (gcn_expand_builtin_1): Handle GCN_BUILTIN_KERNARG_PTR. (gcn_oacc_dim_size): Return in ADDR_SPACE_FLAT. 2022-11-16 Tobias Burnus Backported from master: 2022-11-16 Tobias Burnus * config/nvptx/mkoffload.cc (process): Recognize '$nohost$...' besides tailing '$nohost' as being for reverse offload. 2022-11-07 Kwok Cheung Yeung * config/gcn/gcn.cc (gcn_expand_builtin_1): Expand first argument of GCN_BUILTIN_LDEXPV to V64DFmode. 2022-11-01 Kwok Cheung Yeung Paul-Antoine Arras * builtins.cc (mathfn_built_in_explicit): New. * config/gcn/gcn.cc: Include case-cfn-macros.h. (mathfn_built_in_explicit): Add prototype. (gcn_vectorize_builtin_vectorized_function): New. (gcn_libc_has_function): New. (TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION): Define. (TARGET_LIBC_HAS_FUNCTION): Define. 2022-11-01 Kwok Cheung Yeung * config/gcn/gcn-builtins.def (FLOORVF): New builtin. (FLOORV): New builtin. * config/gcn/gcn.cc (gcn_expand_builtin_1): Expand GCN_BUILTIN_FLOORVF and GCN_BUILTIN_FLOORV. 2022-11-01 Kwok Cheung Yeung * config/gcn/gcn.cc (gcn_expand_builtin_1): Fix expansion of GCN_BUILTIN_FABSV. 2022-11-01 Marcel Vollweiler * omp-expand-metadirective.cc (omp_expand_metadirective): Add already processed labels to "labels" (the list of labels not to be deleted). 2022-11-01 Andrew Stubbs Backport from mainline: 2022-10-31 Andrew Stubbs * config/gcn/gcn-valu.md (fminmaxop): New iterator. (3): New define_expand. (3): Likewise. (reduc__scal_): Likewise. * config/gcn/gcn.md (fexpander): New attribute. 2022-11-01 Andrew Stubbs Backport from mainline: 2022-10-31 Andrew Stubbs * config/gcn/gcn-valu.md (V64_SI): Delete iterator. (V64_DI): Likewise. (V64_1REG): Likewise. (V64_INT_1REG): Likewise. (V64_2REG): Likewise. (V64_ALL): Likewise. (V64_FP): Likewise. (reduc__scal_): Use V_ALL. Use gen_vec_extract. (fold_left_plus_): Use V_FP. (*_dpp_shr_): Use V_1REG. (*_dpp_shr_): Use V_DI. (*plus_carry_dpp_shr_): Use V_INT_1REG. (*plus_carry_in_dpp_shr_): Use V_SI. (*plus_carry_dpp_shr_): Use V_DI. (mov_from_lane63_): Delete. (mov_from_lane63_): Delete. * config/gcn/gcn.cc (gcn_expand_reduc_scalar): Support partial vectors. * config/gcn/gcn.md (unspec): Remove UNSPEC_MOV_FROM_LANE63. 2022-10-28 Thomas Schwinge * omp-low.cc (oacc_privatization_candidate_p) : Restrict to 'block's. * omp-low.cc (lower_rec_simd_input_clauses): For 'ordered_max', cast 'omp_max_simt_vf ()', 'omp_max_simd_vf ()' to 'unsigned'. 2022-10-25 Abid Qadeer * omp-low.cc (usm_transform): Handle operator new with alignment. 2022-10-25 Marcel Vollweiler * omp-offload.cc (oacc_loop_auto_partitions): Removed OLF reduction handling. 2022-10-24 Andrew Stubbs * tree-vect-data-refs.cc (vect_analyze_data_refs): Workaround an address-space bug. 2022-10-24 Andrew Stubbs * config/gcn/gcn.cc (gcn_init_cumulative_args): Disallow gfx908. 2022-10-24 Andrew Stubbs * plugin/plugin-gcn.c (HSA_AMD_SYSTEM_INFO_SVM_SUPPORTED): New. (HSA_SYSTEM_INFO_SVM_ACCESSIBLE_BY_DEFAULT): New. (HSA_AMD_SVM_ATTRIB_GLOBAL_FLAG): New. (HSA_AMD_SVM_GLOBAL_FLAG_COARSE_GRAINED): New. (hsa_amd_svm_attribute_pair_t): New. (struct hsa_runtime_fn_info): Add hsa_amd_svm_attributes_set_fn. (dump_hsa_system_info): Dump HSA_AMD_SYSTEM_INFO_SVM_SUPPORTED and HSA_SYSTEM_INFO_SVM_ACCESSIBLE_BY_DEFAULT. (DLSYM_OPT_FN): New. (init_hsa_runtime_functions): Add hsa_amd_svm_attributes_set. (GOMP_OFFLOAD_usm_alloc): Use malloc and hsa_amd_svm_attributes_set. (GOMP_OFFLOAD_usm_free): Use regular free. * testsuite/libgomp.c/usm-1.c: Add -mxnack=on for amdgcn. * testsuite/libgomp.c/usm-2.c: Likewise. * testsuite/libgomp.c/usm-3.c: Likewise. * testsuite/libgomp.c/usm-4.c: Likewise. 2022-10-24 Tobias Burnus Backported from master: 2022-10-24 Tobias Burnus PR middle-end/107236 * omp-expand.cc (expand_omp_target): Set calls_declare_variant_alt in DECL_CONTEXT and not to cfun->decl. * cgraphclones.cc (cgraph_node::create_clone): Copy also the node's calls_declare_variant_alt value. 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-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-10-17 Thomas Schwinge Backported from master: 2022-10-17 Thomas Schwinge * config/gcn/gcn.cc (VnMODE): Use 'case E_QImode:' instead of 'case QImode:', etc. 2022-10-14 Julian Brown * omp-low.cc (oacc_privatization_candidate_p): Artificial vars are not privatization candidates. 2022-10-14 Julian Brown * config/gcn/gcn.cc (gcn_detect_incoming_pointer_arg): Any pointer argument forces FLAT addressing mode, not just pointer-to-non-aggregate. 2022-10-12 Andrew Stubbs * config/gcn/gcn.cc (gcn_expand_builtin_1): Change gcn_full_exec_reg to get_exec. 2022-10-12 Andrew Stubbs Backport from mainline: 2022-10-11 Andrew Stubbs * config/gcn/gcn-valu.md (neg2): New define_expand. 2022-10-12 Andrew Stubbs Backport from mainline: 2022-10-11 Andrew Stubbs * config/gcn/gcn-valu.md (vec_init): New. * config/gcn/gcn.cc (GEN_VN): Add andvNsi3, subvNsi3. (GEN_VNM): Add gathervNm_expr. (GEN_VN_NOEXEC): Add vec_seriesvNsi. (gcn_expand_vector_init): Add initialization of vectors from smaller vectors. 2022-10-12 Andrew Stubbs Backport from mainline: 2022-10-11 Andrew Stubbs * config/gcn/gcn-protos.h (get_exec): Add prototypes for two variants. * config/gcn/gcn-valu.md (vec_extract): New define_expand. * config/gcn/gcn.cc (get_exec): Export the existing function. Add a new overload variant. 2022-10-12 Andrew Stubbs Backport from mainline: 2022-10-11 Andrew Stubbs * config/gcn/gcn-valu.md (2): Use MODE_VF. (2): Likewise. * config/gcn/gcn.h (MODE_VF): New macro. 2022-10-12 Andrew Stubbs Backport from mainline: 2022-10-11 Andrew Stubbs * config/gcn/gcn-modes.def (VECTOR_MODE): Add new modes V32QI, V32HI, V32SI, V32DI, V32TI, V32HF, V32SF, V32DF, V16QI, V16HI, V16SI, V16DI, V16TI, V16HF, V16SF, V16DF, V8QI, V8HI, V8SI, V8DI, V8TI, V8HF, V8SF, V8DF, V4QI, V4HI, V4SI, V4DI, V4TI, V4HF, V4SF, V4DF, V2QI, V2HI, V2SI, V2DI, V2TI, V2HF, V2SF, V2DF. (ADJUST_ALIGNMENT): Likewise. * config/gcn/gcn-protos.h (gcn_full_exec): Delete. (gcn_full_exec_reg): Delete. (gcn_scalar_exec): Delete. (gcn_scalar_exec_reg): Delete. (vgpr_1reg_mode_p): Use inner mode to identify vector registers. (vgpr_2reg_mode_p): Likewise. (vgpr_vector_mode_p): Use VECTOR_MODE_P. * config/gcn/gcn-valu.md (V_QI, V_HI, V_HF, V_SI, V_SF, V_DI, V_DF, V_QIHI, V_1REG, V_INT_1REG, V_INT_1REG_ALT, V_FP_1REG, V_2REG, V_noQI, V_noHI, V_INT_noQI, V_INT_noHI, V_ALL, V_ALL_ALT, V_INT, V_FP): Add additional vector modes. (V64_SI, V64_DI, V64_ALL, V64_FP): New iterators. (scalar_mode, SCALAR_MODE, vnsi, VnSI, vndi, VnDI, sdwa): Add additional vector mode mappings. (mov): Implement vector length conversions. (ldexp3): Use VnSI. (frexp_exp2): Likewise. (VCVT_MODE, VCVT_FMODE, VCVT_IMODE): Add additional vector modes. (reduc__scal_): Use V64_ALL. (fold_left_plus_): Use V64_FP. (*_dpp_shr_): Use V64_1REG. (*_dpp_shr_): Use V64_DI. (*plus_carry_dpp_shr_): Use V64_INT_1REG. (*plus_carry_in_dpp_shr_): Use V64_SI. (*plus_carry_dpp_shr_): Use V64_DI. (mov_from_lane63_): Use V64_2REG. * config/gcn/gcn.cc (VnMODE): New function. (gcn_can_change_mode_class): Support multiple vector sizes. (gcn_modes_tieable_p): Likewise. (gcn_operand_part): Likewise. (gcn_scalar_exec): Delete function. (gcn_scalar_exec_reg): Delete function. (gcn_full_exec): Delete function. (gcn_full_exec_reg): Delete function. (gcn_inline_fp_constant_p): Support multiple vector sizes. (gcn_fp_constant_p): Likewise. (A): New macro. (GEN_VN_NOEXEC): New macro. (GEN_VNM_NOEXEC): New macro. (GEN_VN): New macro. (GEN_VNM): New macro. (GET_VN_FN): New macro. (CODE_FOR): New macro. (CODE_FOR_OP): New macro. (gen_mov_with_exec): Delete function. (gen_duplicate_load): Delete function. (gcn_expand_vector_init): Support multiple vector sizes. (strided_constant): Likewise. (gcn_addr_space_legitimize_address): Likewise. (gcn_expand_scalar_to_vector_address): Likewise. (gcn_expand_scaled_offsets): Likewise. (gcn_secondary_reload): Likewise. (gcn_valid_cvt_p): Likewise. (gcn_expand_builtin_1): Likewise. (gcn_make_vec_perm_address): Likewise. (gcn_vectorize_vec_perm_const): Likewise. (gcn_vector_mode_supported_p): Likewise. (gcn_autovectorize_vector_modes): New hook. (gcn_related_vector_mode): Support multiple vector sizes. (gcn_expand_dpp_shr_insn): Add FIXME comment. (gcn_md_reorg): Support multiple vector sizes. (print_reg): Likewise. (print_operand): Likewise. (TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES): New hook. 2022-10-12 Andrew Stubbs Backport from mainline: 2022-10-03 Andrew Stubbs * config/gcn/gcn-valu.md (while_ultsidi): Limit mask length using operand 3. * doc/md.texi (while_ult): Document new operand 3 usage. * internal-fn.cc (expand_while_optab_fn): Set operand 3 when lhs_type maps to a non-vector mode. 2022-10-05 Tobias Burnus Backport from mainline: 2022-10-04 Tobias Burnus * doc/invoke.texi (-fopenmp): Mention C++ attribut syntax. (-fopenmp-simd): Likewise; update permitted directives. 2022-10-05 Tobias Burnus Backport from mainline: 2022-10-04 Tobias Burnus * doc/install.texi (Specific): Add missing items to bullet list. (amdgcn): Update LLVM requirements, use version not date for newlib. (nvptx): Use version not git hash for newlib. 2022-09-27 Kwok Cheung Yeung * config/gcn/gcn-builtins.def (FABSV): New builtin. * config/gcn/gcn.cc (gcn_expand_builtin_1): Generate builtin for GCN_BUILTIN_FABSV. 2022-09-27 Kwok Cheung Yeung * config/gcn/gcn-valu.md (math_unop_insn): New attribute. (2, 2, 2, 2, *2_insn, *2_insn): Use math_unop_insn to generate assembler output. 2022-09-26 Thomas Schwinge Backported from master: 2022-09-26 Thomas Schwinge * config.gcc (with_arch) [nvptx]: Allow '--with-arch' to override the default. * config/nvptx/gen-multilib-matches.sh: New. * config/nvptx/t-nvptx (MULTILIB_OPTIONS, MULTILIB_MATCHES) (MULTILIB_EXCEPTIONS): Handle this. * doc/install.texi (Specific) : Document this. * doc/invoke.texi (Nvidia PTX Options): Likewise. 2022-09-26 Thomas Schwinge Backported from master: 2022-09-26 Thomas Schwinge * config.gcc (TM_MULTILIB_CONFIG) [nvptx]: Set to '$with_arch'. * config/nvptx/t-nvptx (MULTILIB_OPTIONS, MULTILIB_MATCHES) (MULTILIB_EXCEPTIONS): Handle it. 2022-09-26 Thomas Schwinge Backported from master: 2022-09-26 Thomas Schwinge * config.gcc (with_arch) [nvptx]: Set to 'sm_30'. * config/nvptx/nvptx.cc (nvptx_option_override): Assert that '-misa' appeared. * config/nvptx/nvptx.h (OPTION_DEFAULT_SPECS): Define. * config/nvptx/nvptx.opt (misa=): Remove 'Init'. 2022-09-26 Thomas Schwinge Backported from master: 2022-09-26 Thomas Schwinge * config/nvptx/nvptx.h (ASM_SPEC): Define. 2022-09-24 Tobias Burnus Backport from mainline: 2022-09-24 Jakub Jelinek PR c/107001 * omp-low.cc (lower_omp_taskgroup): Don't add GOMP_RETURN statement at the end. * omp-expand.cc (build_omp_regions_1): Clarify GF_OMP_TARGET_KIND_DATA is not stand-alone directive. For GIMPLE_OMP_TASKGROUP, also don't update parent. (omp_make_gimple_edges) : Reset cur_region back after new_omp_region. 2022-09-23 Thomas Schwinge Backport from master branch: 2022-05-09 Martin Liska * system.h (LIKELY): Define. (UNLIKELY): Likewise. 2022-09-12 Tobias Burnus Backport from mainline: 2022-09-12 Tobias Burnus * config/nvptx/mkoffload.cc (process): Replace a fatal_error by a warning + not enabling offloading if -misa=sm_30 prevents reverse offload. (main): Use tool_name as progname for diagnostic. * config/gcn/mkoffload.cc (main): Likewise. 2022-09-12 Tobias Burnus Backport from mainline: 2022-09-09 Tobias Burnus * config/nvptx/mkoffload.cc (struct id_map): Add 'dim' member. (record_id): Store func name without quotes, store dim separately. (process): For GOMP_REQUIRES_REVERSE_OFFLOAD, check that -march is at least sm_35, create '$offload_func_table' global array and init with reverse-offload function addresses. * config/nvptx/nvptx.cc (write_fn_proto_1, write_fn_proto): New force_public attribute to force .visible. (nvptx_declare_function_name): For "omp target device_ancestor_nohost" attribut, force .visible/TREE_PUBLIC. 2022-09-12 Tobias Burnus Backport from mainline: 2022-09-09 Tobias Burnus * config/gcn/mkoffload.cc (process_asm): Create .offload_func_table, similar to pre-existing .offload_var_table. 2022-09-09 Tobias Burnus Backport from mainline: 2022-09-09 Kwok Cheung Yeung * config/gcn/gcn-builtins.def (FABSVF, LDEXPVF, LDEXPV, FREXPVF_EXP, FREXPVF_MANT, FREXPV_EXP, FREXPV_MANT): Add new builtins. * config/gcn/gcn-protos.h (gcn_dconst1over2pi): New prototype. * config/gcn/gcn-valu.md (MATH_UNOP_1OR2REG, MATH_UNOP_1REG, MATH_UNOP_TRIG): New iterators. (math_unop): New attributes. (2, 2, 2, 2, *2_insn, *2_insn, ldexp3, ldexp3, frexp_exp2, frexp_mant2, frexp_exp2, frexp_mant2): New instructions. (2, 2): New expanders. * config/gcn/gcn.cc (init_ext_gcn_constants): Update definition of dconst1over2pi. (gcn_dconst1over2pi): New. (gcn_builtin_type_index): Add entry for v64df type. (v64df_type_node): New. (gcn_init_builtin_types): Initialize v64df_type_node. (gcn_expand_builtin_1): Expand new builtins to instructions. (print_operand): Fix assembler output for 1/(2*PI) constant. * config/gcn/gcn.md (unspec): Add new entries. 2022-09-08 Tobias Burnus Backport from mainline: 2022-05-13 Richard Biener * omp-expand.cc (expand_omp_atomic_cas): Do not short-cut computation of the new value. 2022-09-08 Tobias Burnus Backport from mainline: 2022-09-08 Jakub Jelinek * omp-expand.cc (expand_omp_ordered_sink): Add CONT_BB argument. Add doacross(sink:omp_cur_iteration-1) support. (expand_omp_ordered_source_sink): Clear counts[fd->ordered + 1]. Adjust expand_omp_ordered_sink caller. (expand_omp_for_ordered_loops): If counts[fd->ordered + 1] is non-NULL, set that variable to true at the start of outermost non-collapsed loop and set it to false at the end of innermost ordered loop. (expand_omp_for_generic): If fd->ordered, allocate 1 + (fd->ordered - fd->collapse) further elements in counts array. Copy to counts + 2 + fd->ordered the counts of fd->collapse .. fd->ordered - 1 loop if any. 2022-09-08 Tobias Burnus Backport from mainline: 2022-09-06 Jakub Jelinek * gimple.h (enum gf_mask): Add GF_OMP_ORDERED_STANDALONE enumerator. (gimple_omp_subcode): Use GIMPLE_OMP_ORDERED instead of GIMPLE_OMP_TEAMS as upper bound. (gimple_omp_ordered_standalone_p, gimple_omp_ordered_standalone): New inline functions. * gimplify.cc (find_standalone_omp_ordered): Look for OMP_ORDERED with NULL OMP_ORDERED_BODY rather than with OMP_DOACROSS clause. (gimplify_expr): Call gimple_omp_ordered_standalone for OMP_ORDERED with NULL OMP_ORDERED_BODY. * omp-low.cc (check_omp_nesting_restrictions): Use gimple_omp_ordered_standalone_p test instead of omp_find_clause (..., OMP_CLAUSE_DOACROSS). (lower_omp_ordered): Likewise. * omp-expand.cc (expand_omp, build_omp_regions_1, omp_make_gimple_edges): Likewise. 2022-09-05 Tobias Burnus Backport from mainline: 2022-09-30 Jan-Benedict Glaw * config/nvptx/nvptx.h (ASM_OUTPUT_DEF): Reference macro arguments. 2022-09-05 Tobias Burnus Backport from mainline: 2022-09-03 Jakub Jelinek * tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_DOACROSS. (enum omp_clause_depend_kind): Remove OMP_CLAUSE_DEPEND_SOURCE and OMP_CLAUSE_DEPEND_SINK, add OMP_CLAUSE_DEPEND_INVALID. (enum omp_clause_doacross_kind): New type. (struct tree_omp_clause): Add subcode.doacross_kind member. * tree.h (OMP_CLAUSE_DEPEND_SINK_NEGATIVE): Remove. (OMP_CLAUSE_DOACROSS_KIND): Define. (OMP_CLAUSE_DOACROSS_SINK_NEGATIVE): Define. (OMP_CLAUSE_DOACROSS_DEPEND): Define. (OMP_CLAUSE_ORDERED_DOACROSS): Define. * tree.cc (omp_clause_num_ops, omp_clause_code_name): Add OMP_CLAUSE_DOACROSS entries. * tree-nested.cc (convert_nonlocal_omp_clauses, convert_local_omp_clauses): Handle OMP_CLAUSE_DOACROSS. * tree-pretty-print.cc (dump_omp_clause): Don't handle OMP_CLAUSE_DEPEND_SOURCE and OMP_CLAUSE_DEPEND_SINK. Handle OMP_CLAUSE_DOACROSS. * gimplify.cc (gimplify_omp_depend): Don't handle OMP_CLAUSE_DEPEND_SOURCE and OMP_CLAUSE_DEPEND_SINK. (gimplify_scan_omp_clauses): Likewise. Handle OMP_CLAUSE_DOACROSS. (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_DOACROSS. (find_standalone_omp_ordered): New function. (gimplify_omp_for): When OMP_CLAUSE_ORDERED is present, search body for OMP_ORDERED with OMP_CLAUSE_DOACROSS and if found, set OMP_CLAUSE_ORDERED_DOACROSS. (gimplify_omp_ordered): Don't handle OMP_CLAUSE_DEPEND_SINK or OMP_CLAUSE_DEPEND_SOURCE, instead check OMP_CLAUSE_DOACROSS, adjust diagnostics that presence or absence of ordered clause parameter is irrelevant. Handle doacross(sink:omp_cur_iteration-1). Use actual user name of the clause - doacross or depend - in diagnostics. * omp-general.cc (omp_extract_for_data): Don't set fd->ordered if !OMP_CLAUSE_ORDERED_DOACROSS (t). If OMP_CLAUSE_ORDERED_DOACROSS (t) but !OMP_CLAUSE_ORDERED_EXPR (t), set fd->ordered to -1 and set it after the loop in that case to fd->collapse. * omp-low.cc (check_omp_nesting_restrictions): Don't handle OMP_CLAUSE_DEPEND_SOURCE nor OMP_CLAUSE_DEPEND_SINK, instead check OMP_CLAUSE_DOACROSS. Use actual user name of the clause - doacross or depend - in diagnostics. Diagnose mixing of stand-alone and block associated ordered constructs binding to the same loop. (lower_omp_ordered_clauses): Don't handle OMP_CLAUSE_DEPEND_SINK, instead handle OMP_CLAUSE_DOACROSS. (lower_omp_ordered): Look for OMP_CLAUSE_DOACROSS instead of OMP_CLAUSE_DEPEND. (lower_depend_clauses): Don't handle OMP_CLAUSE_DEPEND_SOURCE and OMP_CLAUSE_DEPEND_SINK. * omp-expand.cc (expand_omp_ordered_sink): Emit a sorry for doacross(sink:omp_cur_iteration-1). (expand_omp_ordered_source_sink): Use OMP_CLAUSE_DOACROSS_SINK_NEGATIVE instead of OMP_CLAUSE_DEPEND_SINK_NEGATIVE. Use actual user name of the clause - doacross or depend - in diagnostics. (expand_omp): Look for OMP_CLAUSE_DOACROSS clause instead of OMP_CLAUSE_DEPEND. (build_omp_regions_1): Likewise. (omp_make_gimple_edges): Likewise. * lto-streamer-out.cc (hash_tree): Handle OMP_CLAUSE_DOACROSS. * tree-streamer-in.cc (unpack_ts_omp_clause_value_fields): Likewise. * tree-streamer-out.cc (pack_ts_omp_clause_value_fields): Likewise. gcc/c-family/ * c-pragma.h (enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_DOACROSS. * c-omp.cc (c_finish_omp_depobj): Check also for OMP_CLAUSE_DOACROSS clause and diagnose it. Don't handle OMP_CLAUSE_DEPEND_SOURCE and OMP_CLAUSE_DEPEND_SINK. Assert kind is not OMP_CLAUSE_DEPEND_INVALID. 2022-09-01 Andrew Stubbs Backport from mainline: * config/gcn/gcn.cc (gcn_simd_clone_compute_vecsize_and_simdlen): New. (gcn_simd_clone_adjust): New. (gcn_simd_clone_usable): New. (TARGET_SIMD_CLONE_ADJUST): New. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN): New. (TARGET_SIMD_CLONE_USABLE): New. 2022-09-01 Andrew Stubbs Backport from mainline: 2022-08-30 Rainer Orth Jakub Jelinek * omp-simd-clone.cc (simd_clone_adjust_return_type, simd_clone_adjust_argument_types): Use known_eq (veclen, 0U) instead of known_eq (veclen, 0) to avoid -Wsign-compare warnings. 2022-09-01 Andrew Stubbs Backport from mainline: * doc/tm.texi: Regenerate. * omp-simd-clone.cc (simd_clone_adjust_return_type): Allow zero vecsize. (simd_clone_adjust_argument_types): Likewise. * target.def (compute_vecsize_and_simdlen): Document the new vecsize_int and vecsize_float semantics. 2022-09-01 Andrew Stubbs Backport from mainline: * config/gcn/gcn.cc (gcn_function_value): Allow vector return values. (num_arg_regs): Allow vector arguments. (gcn_function_arg): Likewise. (gcn_function_arg_advance): Likewise. (gcn_arg_partial_bytes): Likewise. (gcn_return_in_memory): Likewise. (gcn_expand_epilogue): Get return value from v8. * config/gcn/gcn.h (RETURN_VALUE_REG): Set to v8. (FIRST_PARM_REG): USE FIRST_SGPR_REG for clarity. (FIRST_VPARM_REG): New. (FUNCTION_ARG_REGNO_P): Allow vector parameters. (struct gcn_args): Add vnum field. (LIBCALL_VALUE): All vector return values. * config/gcn/gcn.md (gcn_call_value): Add vector constraints. (gcn_call_value_indirect): Likewise. 2022-08-31 Tobias Burnus Revert: 2022-06-30 Kwok Cheung Yeung * dwarf2cfi.cc (get_cfa_from_loc_descr): Check op against DW_OP_bregx. 2020-07-27 Andrew Stubbs * dwarf2cfi.cc (get_cfa_from_loc_descr): Support register spans with DW_OP_piece and DW_OP_LLVM_piece_end. * dwarf2out.cc (build_cfa_loc): Support register spans. 2022-08-30 Tobias Burnus Backport from mainline: 2022-08-26 Tobias Burnus * internal-fn.cc (expand_GOMP_TARGET_REV): New. * internal-fn.def (GOMP_TARGET_REV): New. * lto-cgraph.cc (lto_output_node, verify_node_partition): Mark 'omp target device_ancestor_host' as in_other_partition and don't error if absent. * omp-low.cc (create_omp_child_function): Mark as 'noclone'. * omp-expand.cc (expand_omp_target): For reverse offload, remove sorry, use device = GOMP_DEVICE_HOST_FALLBACK and create empty-body nohost function. * omp-offload.cc (execute_omp_device_lower): Handle IFN_GOMP_TARGET_REV. (pass_omp_target_link::execute): For ACCEL_COMPILER, don't nullify fn argument for reverse offload 2022-08-22 Tobias Burnus Backport from mainline: 2022-08-22 Tobias Burnus PR lto/106686 * lto-wrapper.cc (free_array_of_ptrs): Move before tool_cleanup. (tool_cleanup): Unlink offload_names. (compile_offload_image): Take filename argument to set it early. (compile_images_for_offload_targets): Update call; set offload_names to NULL after freeing the array. 2022-08-19 Tobias Burnus Backport from mainline: 2022-08-19 Tobias Burnus * config/gcn/mkoffload.cc (main): Add omp_requires_file and dbgobj to files_to_cleanup. * config/i386/intelmic-mkoffload.cc (prepare_target_image): Add omp_requires_file to temp_files. * config/nvptx/mkoffload.cc (omp_requires_file): New global static var. (main): Remove local omp_requires_file var. (tool_cleanup): Handle omp_requires_file. 2022-08-17 Tobias Burnus Backport from mainline: 2022-08-17 Tobias Burnus * lto-cgraph.cc (input_offload_tables): Improve requires diagnostic when filenames come out identically. 2022-08-17 Tobias Burnus Backport from mainline: 2022-08-17 Tobias Burnus Chung-Lin Tang PR c++/104493 * gimplify.cc (omp_notice_variable): Call omp_mappable_type instead of removed langhook. * omp-general.h (omp_mappable_type): New prototype. * omp-general.cc (omp_mappable_type): New; moved from ... * langhooks.cc (lhd_omp_mappable_type): ... here. * langhooks-def.h (lhd_omp_mappable_type, LANG_HOOKS_OMP_MAPPABLE_TYPE): Remove. (LANG_HOOKS_FOR_TYPES_INITIALIZER): Remote the latter. * langhooks.h (struct lang_hooks_for_types): Remove omp_mappable_type. 2022-08-02 Andrew Stubbs Backport from mainline: * omp-simd-clone.cc (simd_clone_adjust): Convert shift_cnt to match the mask type. 2022-08-02 Andrew Stubbs Backport from mainline: * config/gcn/gcn-valu.md (V_INT_noHI): New iterator. (3): Use V_INT_noHI. (v3): Likewise. 2022-08-02 Andrew Stubbs Backport from mainline: * config/gcn/gcn.md (one_cmpldi2): New. 2022-08-01 Tobias Burnus Backport from mainline: 2022-08-01 Jakub Jelinek * omp-expand.cc (expand_omp_for_init_counts, expand_omp_for_init_vars, extract_omp_for_update_vars, expand_omp_for_ordered_loops, expand_omp_simd): Don't fold_convert second argument to fold_build_pointer_plus to sizetype. 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. 2022-07-08 Tobias Burnus Backport from mainline: 2022-07-08 Thomas Schwinge * lto-cgraph.cc (input_offload_tables) : Correct 'fn2' computation. 2022-07-07 Tobias Burnus Backport from mainline: 2022-07-07 Thomas Schwinge * config/i386/intelmic-mkoffload.cc (generate_host_descr_file) (prepare_target_image, main): Handle OpenMP 'requires'. (generate_host_descr_file): Switch to 'GOMP_offload_register_ver', 'GOMP_offload_unregister_ver'. 2022-07-07 Tobias Burnus Backport from mainline: 2022-07-06 Thomas Schwinge * config/gcn/mkoffload.cc (process_obj): Clarify 'target_data' -> '[...]_data'. * config/nvptx/mkoffload.cc (process): Likewise. 2022-07-07 Tobias Burnus Backport from mainline: 2022-07-06 Thomas Schwinge * omp-general.h (enum omp_requires): Use 'GOMP_REQUIRES_[...]'. 2022-07-05 Tobias Burnus Backport from mainline: 2022-07-04 Tobias Burnus Chung-Lin Tang Thomas Schwinge * config/gcn/mkoffload.cc (process_asm): Write '#include '. (process_obj): Pass omp_requires_mask to GOMP_offload_register_ver. (main): Ask lto1 to obtain omp_requires_mask and pass it on. * config/nvptx/mkoffload.cc (process, main): Likewise. * lto-cgraph.cc (omp_requires_to_name): New. (input_offload_tables): Save omp_requires_mask. (output_offload_tables): Read it, check for consistency, save value for mkoffload. * omp-low.cc (lower_omp_target): Force output_offloadtables call for OMP_REQUIRES_TARGET_USED. 2022-07-05 Tobias Burnus Reverted: 2021-02-02 Chung-Lin Tang * omp-offload.cc (omp_finish_file): Add code to create OpenMP requires mask variable in .gnu.gomp_requires section if needed. 2022-07-05 Tobias Burnus Backport from mainline: 2022-07-01 Tobias Burnus * config/gcn/gcn-protos.h (print_operand_address): Remove register keyword on 'rtx addr' argument. 2022-07-05 Tobias Burnus Backport from mainline: 2022-06-27 Andrew Stubbs * config/gcn/gcn.md (*movbi): Remove assembler bug workarounds. (jump): Likewise. (movdi_symbol_save_scc): Likewise. 2022-07-05 Tobias Burnus Backport from mainline: 2022-06-13 Jakub Jelinek * omp-expand.cc (expand_omp_target): Remap user provided device clause arguments, -1 to -2 and -2 to -3, either at compile time if constant, or at runtime. 2022-07-05 Tobias Burnus Backport from mainline: 2022-06-09 Jakub Jelinek * omp-offload.cc (omp_discover_declare_target_tgt_fn_r, omp_discover_declare_target_fn_r): Don't walk reverse-offload target regions. 2022-07-05 Tobias Burnus Backport from mainline: 2022-06-07 Jakub Jelinek * tree.h (OMP_CLAUSE_LINEAR_OLD_LINEAR_MODIFIER): Define. * tree-pretty-print.cc (dump_omp_clause) : Adjust clause printing style depending on OMP_CLAUSE_LINEAR_OLD_LINEAR_MODIFIER. 2022-07-05 Tobias Burnus Backport from mainline: 2022-06-06 Andrew Stubbs * config.in: Regenerate. * configure: Regenerate. * configure.ac: Reinstate HAVE_GAS_ARM_EXTENDED_ARCH test. 2022-07-05 Tobias Burnus Backport from mainline: 2022-05-31 Jakub Jelinek * omp-low.cc (build_outer_var_ref): For code == OMP_CLAUSE_ALLOCATE allow var to be private in the outer context. (lower_private_allocate): Pass OMP_CLAUSE_ALLOCATE as last argument to build_outer_var_ref. 2022-07-05 Tobias Burnus Backport from mainline: 2022-05-27 Jakub Jelinek * tree-core.h (enum omp_clause_code): Rename OMP_CLAUSE_TO_DECLARE to OMP_CLAUSE_ENTER. * tree.h (OMP_CLAUSE_ENTER_TO): Define. * tree.cc (omp_clause_num_ops, omp_clause_code_name): Rename OMP_CLAUSE_TO_DECLARE to OMP_CLAUSE_ENTER. * tree-pretty-print.cc (dump_omp_clause): Handle OMP_CLAUSE_ENTER instead of OMP_CLAUSE_TO_DECLARE, if OMP_CLAUSE_ENTER_TO, print "to" instead of "enter". * tree-nested.cc (convert_nonlocal_omp_clauses, convert_local_omp_clauses): Handle OMP_CLAUSE_ENTER instead of OMP_CLAUSE_TO_DECLARE. 2022-07-05 Tobias Burnus Backport from mainline: 2022-05-25 Tobias Burnus * doc/invoke.texi (AMD GCN Options): Add gfx908/gfx90a. 2022-07-05 Tobias Burnus Backport from mainline: 2022-05-24 Jakub Jelinek PR c/105378 * omp-builtins.def (BUILT_IN_GOMP_TASKWAIT_DEPEND_NOWAIT): New builtin. * gimplify.cc (gimplify_omp_task): Diagnose taskwait with nowait clause but no depend clauses. * omp-expand.cc (expand_taskwait_call): Use BUILT_IN_GOMP_TASKWAIT_DEPEND_NOWAIT rather than BUILT_IN_GOMP_TASKWAIT_DEPEND if nowait clause is present. 2022-07-05 Tobias Burnus Backport from mainline: 2022-05-20 Marcel Vollweiler * omp-low.cc (omp_runtime_api_call): Added target_memcpy_async and target_memcpy_rect_async to omp_runtime_apis array. 2022-07-05 Tobias Burnus Backport from mainline: 2022-05-17 Tobias Burnus * omp-low.cc (check_omp_nesting_restrictions): Skip warning for target inside target if inner is reverse offload. 2022-07-04 Tobias Burnus Backport from mainline: 2022-05-17 Tobias Burnus PR target/105602 * config/gcn/t-omp-device (arch): Add 'amdgcn' besides existing 'gcn'. * config/gcn/gcn.cc (gcn_omp_device_kind_arch_isa): Likewise. 2022-07-04 Tobias Burnus Backport from mainline: 2022-05-17 Jakub Jelinek * tree-core.h (enum omp_clause_depend_kind): Add OMP_CLAUSE_DEPEND_INOUTSET. * tree-pretty-print.cc (dump_omp_clause): Handle OMP_CLAUSE_DEPEND_INOUTSET. * gimplify.cc (gimplify_omp_depend): Likewise. * omp-low.cc (lower_depend_clauses): Likewise. 2022-06-17 Andrew Stubbs * config/gcn/gcn.c (unified_shared_memory_enabled): New variable. (gcn_init_cumulative_args): Handle attribute "omp unified memory". (gcn_hsa_declare_function_name): Emit "MKOFFLOAD OPTIONS: USM+". * config/gcn/mkoffload.c (TEST_XNACK_OFF): New macro. (process_asm): Detect "MKOFFLOAD OPTIONS: USM+". Emit configure_xnack constructor, as required. * omp-low.c (create_omp_child_function): Add attribute "omp unified memory". 2022-06-10 Andrew Stubbs * config/gcn/gcn-hsa.h (XNACKOPT): New macro. (ASM_SPEC): Use XNACKOPT. * config/gcn/gcn-opts.h (enum sram_ecc_type): Rename to ... (enum hsaco_attr_type): ... this, and generalize the names. (TARGET_XNACK): New macro. * config/gcn/gcn-valu.md (gather_insn_1offset): Add xnack compatible alternatives. (gather_insn_2offsets): Likewise. * config/gcn/gcn.c (gcn_option_override): Permit -mxnack for devices other than Fiji. (gcn_expand_epilogue): Remove early-clobber problems. (output_file_start): Emit xnack attributes. (gcn_hsa_declare_function_name): Obey -mxnack setting. * config/gcn/gcn.md (xnack): New attribute. (enabled): Rework to include "xnack" attribute. (*movbi): Add xnack compatible alternatives. (*mov_insn): Likewise. (*mov_insn): Likewise. (*mov_insn): Likewise. (*movti_insn): Likewise. * config/gcn/gcn.opt (-mxnack): Add the "on/off/any" syntax. (sram_ecc_type): Rename to ... (hsaco_attr_type: ... this.) * config/gcn/mkoffload.c (SET_XNACK_ANY): New macro. (TEST_XNACK): Delete. (TEST_XNACK_ANY): New macro. (TEST_XNACK_ON): New macro. (main): Support the new -mxnack=on/off/any syntax. 2022-06-30 Kwok Cheung Yeung * dwarf2cfi.cc (get_cfa_from_loc_descr): Check op against DW_OP_bregx. 2022-06-30 Tobias Burnus * graphite-isl-ast-to-gimple.cc (graphite_oacc_analyze_scop): Update arguments of dump_printf. 2022-06-30 Kwok Cheung Yeung * omp-offload.cc (oacc_loop_warn_if_false_independent): Remove extra '.' at end of message. 2022-06-30 Kwok Cheung Yeung * omp-low.cc (usm_transform): Remove unused function argument. 2022-06-30 Kwok Cheung Yeung * omp-offload.cc (oacc_loop_get_cfg_loop): Cast tail_mark to gimple* for dump_printf. * tree-scalar-evolution.cc (oacc_ifn_call_extract): Remove unused variable 'call'. 2022-06-30 Kwok Cheung Yeung * gimplify.cc (gimplify_scan_omp_clauses): Remove extra '%<..%>' pair in format string. 2022-06-30 Kwok Cheung Yeung * omp-data-optimize.cc (omp_data_optimize_add_candidate): Suppress format checking. (omp_data_optimize_can_be_private): Likewise. (omp_data_optimize_can_be_private): Likewise. 2022-05-13 Kwok Cheung Yeung * omp-expand.cc (expand_omp_target): Gimplify launch dimensions used in function call. 2022-04-14 Kwok Cheung Yeung * graphite-oacc.cc (find_oacc_tail_marks): Check that data_dep is non-NULL before testing it. (reduction_use_in_outer_loop_p): Likewise. 2022-05-12 Jakub Jelinek Backport from mainline: 2022-05-12 Jakub Jelinek * gimplify.cc (gimplify_omp_depend): Don't build_fold_addr_expr if null_pointer_node. (gimplify_scan_omp_clauses): Likewise. * tree-pretty-print.cc (dump_omp_clause): Print null_pointer_node as omp_all_memory. 2022-04-06 Thomas Schwinge Backport from mainline: 2022-04-06 Thomas Schwinge * doc/install.texi: Don't document '--with-hsa-runtime', '--with-hsa-runtime-include', '--with-hsa-runtime-lib'. 2022-05-06 Marcel Vollweiler Backport from mainline: 2022-05-06 Marcel Vollweiler * omp-low.cc (omp_runtime_api_call): Added target_is_accessible to omp_runtime_apis array. 2022-05-05 Sandra Loosemore Backport from mainline: 2022-05-05 Sandra Loosemore * gimplify.cc (gimplify_omp_for): Update messages for SCHEDULED and ORDERED clause conflict errors. Add check for GRAINSIZE and NUM_TASKS on TASKLOOP. 2022-05-02 Marcel Vollweiler Backport from mainline: 2022-05-02 Marcel Vollweiler * omp-low.cc (omp_runtime_api_call): Added get_mapped_ptr to omp_runtime_apis array. 2022-06-17 Chung-Lin Tang Backport from mainline: 2022-06-17 Chung-Lin Tang * builtin-types.def (BT_FN_VOID_PTRMODE): Define. (BT_FN_PTRMODE_PTRMODE_INT_PTR): Define. * omp-builtins.def (BUILT_IN_OMP_INIT_ALLOCATOR): Define. (BUILT_IN_OMP_DESTROY_ALLOCATOR): Define. * tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_USES_ALLOCATORS. * tree-pretty-print.cc (dump_omp_clause): Handle OMP_CLAUSE_USES_ALLOCATORS. * tree.h (OMP_CLAUSE_USES_ALLOCATORS_ALLOCATOR): New macro. (OMP_CLAUSE_USES_ALLOCATORS_MEMSPACE): New macro. (OMP_CLAUSE_USES_ALLOCATORS_TRAITS): New macro. * tree.cc (omp_clause_num_ops): Add OMP_CLAUSE_USES_ALLOCATORS. (omp_clause_code_name): Add "uses_allocators". (walk_tree_1): Add OMP_CLAUSE_USES_ALLOCATORS case. * gimplify.cc (gimplify_scan_omp_clauses): Add checking of OpenMP target region allocate clauses, to require a uses_allocators clause to exist for allocators. (gimplify_omp_workshare): Add handling of OMP_CLAUSE_USES_ALLOCATORS for OpenMP target regions; create calls of omp_init/destroy_allocator around target region body. * omp-low.cc (lower_private_allocate): Adjust receiving of allocator. (lower_rec_input_clauses): Likewise. (create_task_copyfn): Add dereference for allocator if needed. * system.h (startswith): New function. 2022-02-24 Andrew Stubbs Backport from mainline: 2022-02-24 Andrew Stubbs * config.gcc (amdgcn): Accept --with-arch=gfx908 and gfx90a. * config/gcn/gcn-opts.h (enum gcn_isa): New. (TARGET_GCN3): Use enum gcn_isa. (TARGET_GCN3_PLUS): Likewise. (TARGET_GCN5): Likewise. (TARGET_GCN5_PLUS): Likewise. (TARGET_CDNA1): New. (TARGET_CDNA1_PLUS): New. (TARGET_CDNA2): New. (TARGET_CDNA2_PLUS): New. (TARGET_M0_LDS_LIMIT): New. (TARGET_PACKED_WORK_ITEMS): New. * config/gcn/gcn.cc (gcn_isa): Change to enum gcn_isa. (gcn_option_override): Recognise CDNA ISA variants. (gcn_omp_device_kind_arch_isa): Support gfx90a. (gcn_expand_prologue): Make m0 init optional. Add support for packed work items. (output_file_start): Support gfx90a. (gcn_hsa_declare_function_name): Support gfx90a metadata. * config/gcn/gcn.h (TARGET_CPU_CPP_BUILTINS):Add __CDNA1__ and __CDNA2__. * config/gcn/gcn.md (mulsi3_highpart): Use TARGET_GCN5_PLUS. (mulsi3_highpart_imm): Likewise. (mulsidi3): Likewise. (mulsidi3_imm): Likewise. * config/gcn/gcn.opt (gpu_type): Add gfx90a. * config/gcn/mkoffload.cc (EF_AMDGPU_MACH_AMDGCN_GFX90a): New. (main): Support gfx90a. * config/gcn/t-gcn-hsa: Add gfx90a multilib. * config/gcn/t-omp-device: Add gfx90a isa. 2022-02-15 Andrew Stubbs Backport from mainline: 2022-02-15 Andrew Stubbs * config.in: Regenerate. * config/gcn/gcn-hsa.h (X_FIJI): Delete. (X_900): Delete. (X_906): Delete. (X_908): Delete. (S_FIJI): Delete. (S_900): Delete. (S_906): Delete. (S_908): Delete. (NO_XNACK): New macro. (NO_SRAM_ECC): New macro. (SRAMOPT): Keep only v4 variant. (HSACO3_SELECT_OPT): Delete. (DRIVER_SELF_SPECS): Delete. (ASM_SPEC): Remove LLVM 9 support. * config/gcn/gcn-valu.md (gather_insn_2offsets): Remove assembler bug workaround. (scatter_insn_2offsets): Likewise. * config/gcn/gcn.cc (output_file_start): Remove LLVM 9 support. (print_operand_address): Remove assembler bug workaround. * config/gcn/mkoffload.cc (EF_AMDGPU_XNACK_V3): Delete. (EF_AMDGPU_SRAM_ECC_V3): Delete. (SET_XNACK_ON): Delete v3 variants. (SET_XNACK_OFF): Delete v3 variants. (TEST_XNACK): Delete v3 variants. (SET_SRAM_ECC_ON): Delete v3 variants. (SET_SRAM_ECC_ANY): Delete v3 variants. (SET_SRAM_ECC_OFF): Delete v3 variants. (SET_SRAM_ECC_UNSUPPORTED): Delete v3 variants. (TEST_SRAM_ECC_ANY): Delete v3 variants. (TEST_SRAM_ECC_ON): Delete v3 variants. (copy_early_debug_info): Remove v3 support. (main): Remove v3 support. * configure: Regenerate. * configure.ac: Replace all GCN feature checks with a version check. 2022-05-23 Tobias Burnus Backport from mainline: 2022-05-23 Tobias Burnus * langhooks-def.h (lhd_omp_array_size): New. (LANG_HOOKS_OMP_ARRAY_SIZE): Define. (LANG_HOOKS_DECLS): Add it. * langhooks.cc (lhd_omp_array_size): New. * langhooks.h (struct lang_hooks_for_decls): Add hook. * omp-low.cc (scan_sharing_clauses, lower_omp_target): Handle GOMP_MAP_FIRSTPRIVATE for array descriptors. 2022-05-09 Kwok Cheung Yeung Backport from master: 2022-05-04 Tobias Burnus * omp-low.cc (lower_omp_target): Fix use_device_{addr,ptr} with list item that is in an outer data-sharing clause. 2022-04-20 Andrew Stubbs * omp-low.cc: Do USM transformations for "unified_address". 2022-04-02 Andrew Stubbs * omp-low.cc (usm_transform): Transform omp_target_alloc and omp_target_free. 2022-03-31 Abid Qadeer * omp-low.cc (lower_omp_allocate): Move allocate declaration inside loop. Set it to false at the end of condition. 2022-03-30 Andrew Stubbs * omp-builtins.def (BUILT_IN_GOMP_ENABLE_PINNED_MODE): New. * omp-low.cc (omp_enable_pinned_mode): Use BUILT_IN_GOMP_ENABLE_PINNED_MODE. 2022-03-11 Andrew Stubbs Backport of the patch posted at https://gcc.gnu.org/pipermail/gcc-patches/2022-March/591354.html * omp-low.cc (omp_enable_pinned_mode): New function. (execute_lower_omp): Call omp_enable_pinned_mode. 2022-03-11 Abid Qadeer Backport of a patch posted at https://gcc.gnu.org/pipermail/gcc-patches/2022-March/591353.html * omp-low.cc (usm_transform): New function. (make_pass_usm_transform): Likewise. (class pass_usm_transform): New. * passes.def: Add pass_usm_transform. * tree-pass.h (make_pass_usm_transform): New declaration. 2022-03-10 Andrew Stubbs Backport of the patch posted at https://gcc.gnu.org/pipermail/gcc-patches/2022-March/591350.html * common.opt: Add -foffload-memory and its enum values. * coretypes.h (enum offload_memory): New. * doc/invoke.texi: Document -foffload-memory. 2022-03-09 Abid Qadeer Backport of a patch posted at https://gcc.gnu.org/pipermail/gcc-patches/2022-January/588372.html * omp-low.cc (scan_sharing_clauses): Handle OMP_CLAUSE_ALLOCATOR. (scan_omp_allocate): New. (scan_omp_1_stmt): Call it. (lower_omp_allocate): New function. (lower_omp_1): Call it. 2022-03-09 Abid Qadeer Backport of a patch posted at https://gcc.gnu.org/pipermail/gcc-patches/2022-January/588371.html * doc/gimple.texi: Describe GIMPLE_OMP_ALLOCATE. * gimple-pretty-print.cc (dump_gimple_omp_allocate): New function. (pp_gimple_stmt_1): Call it. * gimple.cc (gimple_build_omp_allocate): New function. * gimple.def (GIMPLE_OMP_ALLOCATE): New node. * gimple.h (enum gf_mask): Add GF_OMP_ALLOCATE_KIND_MASK, GF_OMP_ALLOCATE_KIND_ALLOCATE and GF_OMP_ALLOCATE_KIND_FREE. (struct gomp_allocate): New. (is_a_helper ::test): New. (is_a_helper ::test): New. (gimple_build_omp_allocate): Declare. (gimple_omp_subcode): Replace GIMPLE_OMP_TEAMS with GIMPLE_OMP_ALLOCATE. (gimple_omp_allocate_set_clauses): New. (gimple_omp_allocate_set_kind): Likewise. (gimple_omp_allocate_clauses): Likewise. (gimple_omp_allocate_kind): Likewise. (CASE_GIMPLE_OMP): Add GIMPLE_OMP_ALLOCATE. * gimplify.cc (gimplify_omp_allocate): New. (gimplify_expr): Call it. * gsstruct.def (GSS_OMP_ALLOCATE): Define. 2022-03-09 Abid Qadeer Backport of a patch posted at https://gcc.gnu.org/pipermail/gcc-patches/2022-January/588370.html * tree-core.h (struct tree_base): Add comments. * tree-pretty-print.cc (dump_generic_node): Handle allocate directive kind. * tree.h (OMP_ALLOCATE_KIND_ALLOCATE): New define. (OMP_ALLOCATE_KIND_FREE): Likewise. 2022-03-09 Abid Qadeer Backport of a patch posted at https://gcc.gnu.org/pipermail/gcc-patches/2022-January/588369.html * tree-pretty-print.cc (dump_omp_clause): Handle OMP_CLAUSE_ALLOCATOR. (dump_generic_node): Handle OMP_ALLOCATE. * tree.def (OMP_ALLOCATE): New. * tree.h (OMP_ALLOCATE_CLAUSES): Likewise. (OMP_ALLOCATE_DECL): Likewise. (OMP_ALLOCATE_ALLOCATOR): Likewise. * tree.cc (omp_clause_num_ops): Add entry for OMP_CLAUSE_ALLOCATOR. 2022-03-08 Abid Qadeer * omp-low.cc (omp_maybe_offloaded_ctx): New prototype. (scan_sharing_clauses): Check a restriction on allocate clause. 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. 2022-02-24 Chung-Lin Tang * gimplify.cc (gimplify_scan_omp_clauses): Add case for attach/detach map kind for ARRAY_REF of POINTER_TYPE. 2022-02-11 Kwok Cheung Yeung * omp-general.cc (DELAY_METADIRECTIVES_AFTER_LTO): Check that cfun is non-null before derefencing. 2022-01-28 Kwok Cheung Yeung * gimplify.cc (gimplify_omp_metadirective): Mark offloadable functions containing metadirectives with 'construct={target}' in the selector. * omp-general.cc (omp_has_target_constructor_p): New. * omp-general.h (omp_has_target_constructor_p): New prototype. * omp-low.cc (lower_omp_1): Emit warning if marked functions called outside of a target context. 2022-01-25 Kwok Cheung Yeung * builtin-types.def (BT_FN_BOOL_INT_CONST_PTR_CONST_PTR_CONST_PTR): New type. * omp-builtins.def (BUILT_IN_GOMP_EVALUATE_TARGET_DEVICE): New builtin. * omp-general.cc (omp_context_selector_matches): Handle 'target_device' selector set. (omp_dynamic_cond): Generate expression tree for 'target_device' selector set. (omp_context_compute_score): Handle selectors in 'target_device' set. 2022-01-25 Kwok Cheung Yeung * omp-general.cc (omp_dynamic_cond): Do not return user condition if constant. 2022-01-25 Kwok Cheung Yeung * omp-general.cc (omp_check_context_selector): Revert string length check. (omp_context_name_list_prop): Likewise. 2022-01-25 Kwok Cheung Yeung * Makefile.in (OBJS): Add omp-expand-metadirective.o. * gimple-streamer-in.cc (input_gimple_stmt): Add case for GIMPLE_OMP_METADIRECTIVE. Handle metadirective labels. * gimple-streamer-out.cc (output_gimple_stmt): Likewise. * omp-expand-metadirective.cc: New. * passes.def: Add pass_omp_expand_metadirective. * tree-pass.h (make_pass_omp_expand_metadirective): New prototype. 2022-01-25 Kwok Cheung Yeung * gimplify.cc (expand_omp_metadirective): New. * omp-general.cc: Include tree-pretty-print.h. (DELAY_METADIRECTIVES_AFTER_LTO): New macro. (omp_context_selector_matches): Delay resolution of selectors. Allow non-constant expressions. (omp_dynamic_cond): New. (omp_dynamic_selector_p): New. (sort_variant): New. (omp_get_dynamic_candidates): New. (omp_resolve_metadirective): New. (omp_resolve_metadirective): New. * omp-general.h (struct omp_metadirective_variant): New. (omp_resolve_metadirective): New prototype. 2022-01-25 Kwok Cheung Yeung * gimple-low.cc (lower_omp_metadirective): New. (lower_stmt): Handle GIMPLE_OMP_METADIRECTIVE. * gimple-pretty-print.cc (dump_gimple_omp_metadirective): New. (pp_gimple_stmt_1): Handle GIMPLE_OMP_METADIRECTIVE. * gimple-walk.cc (walk_gimple_op): Handle GIMPLE_OMP_METADIRECTIVE. (walk_gimple_stmt): Likewise. * gimple.cc (gimple_alloc_omp_metadirective): New. (gimple_build_omp_metadirective): New. (gimple_build_omp_metadirective_variant): New. * gimple.def (GIMPLE_OMP_METADIRECTIVE): New. (GIMPLE_OMP_METADIRECTIVE_VARIANT): New. * gimple.h (gomp_metadirective_variant): New. (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 prototype. (gimple_build_omp_metadirective): New prototype. (gimple_build_omp_metadirective_variant): New prototype. (gimple_has_substatements): Add GIMPLE_OMP_METADIRECTIVE case. (gimple_has_ops): Add GIMPLE_OMP_METADIRECTIVE. (gimple_omp_metadirective_label): New. (gimple_omp_metadirective_set_label): New. (gimple_omp_metadirective_variants): New. (gimple_omp_metadirective_set_variants): New. (CASE_GIMPLE_OMP): Add GIMPLE_OMP_METADIRECTIVE. * gimplify.cc (is_gimple_stmt): Add OMP_METADIRECTIVE. (expand_omp_metadirective): New. (gimplify_omp_metadirective): New. (gimplify_expr): Add case for OMP_METADIRECTIVE. * gsstruct.def (GSS_OMP_METADIRECTIVE): New. (GSS_OMP_METADIRECTIVE_VARIANT): New. * omp-expand.cc (build_omp_regions_1): Handle GIMPLE_OMP_METADIRECTIVE. (omp_make_gimple_edges): Likewise. * omp-low.cc (struct omp_context): Add next_clone field. (new_omp_context): Initialize next_clone field. (clone_omp_context): New. (delete_omp_context): Delete clone contexts. (scan_omp_metadirective): New. (scan_omp_1_stmt): Handle GIMPLE_OMP_METADIRECTIVE. (lower_omp_metadirective): New. (lower_omp_1): Handle GIMPLE_OMP_METADIRECTIVE. * 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_insns): Likewise. * tree-pretty-print.cc (dump_generic_node): Handle OMP_METADIRECTIVE. * tree-ssa-operands.cc (parse_ssa_operands): Handle GIMPLE_OMP_METADIRECTIVE. 2022-01-25 Kwok Cheung Yeung * omp-general.cc (omp_context_selector_matches): Add extra argument. (omp_resolve_metadirective): New stub function. * omp-general.h (struct omp_metadirective_variant): New. (omp_context_selector_matches): Add extra argument. (omp_resolve_metadirective): New prototype. * tree.def (OMP_METADIRECTIVE): New. * tree.h (OMP_METADIRECTIVE_CLAUSES): New macro. 2021-11-16 Frederik Harwath * graphite-scop-detection.cc (scop_detection::harmful_loop_in_region): Remove check for loops without data references. 2021-11-16 Frederik Harwath * graphite-scop-detection.cc (scop_context_loop): New function. (build_alias_set): Use scop_context_loop instead of find_common_loop. * graphite-isl-ast-to-gimple.cc (graphite_regenerate_ast_isl): Likewise. * graphite.h (scop_context_loop): New declaration. 2021-11-16 Frederik Harwath * graphite-optimize-isl.cc (optimize_isl): Adjust param_max_isl_operations value for OpenACC functions and add special warnings if value gets exceeded. * graphite-scop-detection.cc (build_scops): Likewise for param_graphite_max_arrays_per_scop. 2021-11-16 Frederik Harwath * tree-ssa-pre.cc (insert): Skip any insertions in OpenACC functions that might be processed by Graphite. 2021-11-16 Frederik Harwath * passes.def: Set restrict_oacc_hoisting to true for the early pass_lim instance. * tree-ssa-loop-im.cc (movement_possibility): Add restrict_oacc_hoisting flag to function; restrict movement if set. (compute_invariantness): Add restrict_oacc_hoisting flag and pass it on. (gather_mem_refs_stmt): Skip IFN_GOACC_LOOP and IFN_UNIQUE calls. (loop_invariant_motion_in_fun): Add restrict_oacc_hoisting flag and pass it on. (pass_lim::execute): Pass on new flags. * tree-ssa-loop-manip.h (loop_invariant_motion_in_fun): Adjust declaration. * gimple-loop-interchange.cc (pass_linterchange::execute): Adjust call to loop_invariant_motion_in_fun. 2021-11-16 Andrew Stubbs * common.opt: Add flag Wopenacc-false-independent. * omp-offload.cc (oacc_loop_warn_if_false_independent): New function. (oacc_loop_fixed_partitions): Call from here. 2021-11-16 Andrew Stubbs * graphite-isl-ast-to-gimple.cc: Include internal-fn.h. (graphite_oacc_analyze_scop): Implement runtime alias checks. * omp-expand.cc (expand_oacc_for): Add an additional "noalias" parameter to GOACC_LOOP internal calls, and initialise it to integer_one_node. * omp-offload.cc (oacc_xform_loop): Integrate the runtime alias check into the GOACC_LOOP expansion. 2021-11-16 Andrew Stubbs Thomas Schwinge * Makefile.in: Add pass. * doc/gimple.texi: TODO. * gimple-walk.cc (walk_gimple_seq_mod): Adjust for backward walking. * gimple-walk.h (struct walk_stmt_info): Add field. * passes.def: Add new pass. * tree-pass.h (make_pass_omp_data_optimize): New declaration. * omp-data-optimize.cc: New file. 2021-11-16 Frederik Harwath * tree-pretty-print.cc (print_omp_clause_to_str): Add new function. * tree-pretty-print.h (print_omp_clause_to_str): Add declaration. 2021-11-16 Frederik Harwath * omp-offload.cc (oacc_remove_unused_partitioning): New function for removing partitioning that is not used by any loop. (oacc_validate_dims): Call oacc_remove_unused_partitioning and enable warnings about unused partitioning. 2021-11-16 Frederik Harwath * graph.cc (oacc_get_fn_attrib): New declaration. (find_loop_location): New declaration. (draw_cfg_nodes_for_loop): Print value of the can_be_parallel flag at the top of loops in OpenACC functions. 2021-11-16 Frederik Harwath Thomas Schwinge * Makefile.in: Add graphite-oacc.o * cfgloop.cc (alloc_loop): Set can_be_parallel_valid_p to false. * cfgloop.h: Add can_be_parallel_valid_p field. * cfgloopmanip.cc (copy_loop_info): Add assert. * config/nvptx/nvptx.cc (nvptx_goacc_reduction_setup): * doc/invoke.texi: Adjust param openacc-kernels description. * doc/passes.texi: Adjust pass_ipa_oacc_kernels description. * flag-types.h (enum openacc_kernels):Add OPENACC_KERNELS_DECOMPOSE_PARLOOPS. * gimple-pretty-print.cc (dump_gimple_omp_target): Handle GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GRAPHITE. * gimple.h (enum gf_mask): Add GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GRAPHITE and widen GF_OMP_TARGET_KIND_MASK. (is_gimple_omp_oacc): Handle GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GRAPHITE. (is_gimple_omp_offloaded): Likewise. * gimplify.cc (gimplify_omp_for): Enable reduction localization for "kernels" regions. (gimplify_omp_workshare): Likewise. * graphite-dependences.cc (scop_get_reads_and_writes): Handle "kills" and "reduction" PDRs. (apply_schedule_on_deps): Add dump output for intermediate steps of the dependence computation to enable understanding of unexpected dependences. (carries_deps): Likewise. (scop_get_dependences): Handle "kill" operations and add dump output. * graphite-isl-ast-to-gimple.cc (visit_schedule_loop_node): New function. (graphite_oacc_analyze_scop): New function. * graphite-optimize-isl.cc (optimize_isl): Remove "static" and add argument to identify OpenACC use; don't fail on unchanged schedule in this case. * graphite-poly.cc (new_poly_dr): Handle "kills". (print_pdr): Likewise. (new_gimple_poly_bb): Likewise. (free_gimple_poly_bb): Likewise. (new_scop): Handle "reduction", "private", and "firstprivate" hash sets. (free_scop): Likewise. (print_isl_space): New function. (debug_isl_space): New function. * graphite-scop-detection.cc (scop_detection::can_represent_loop): Don't fail if niter is 0 in OpenACC functions. (scop_detection::add_scop): Don't reject regions with only one loop in OpenACC functions. (ignored_oacc_internal_call_p): New function. (scan_tree_for_params): Handle VIEW_CONVERT_EXPR. (stmt_has_side_effects): Ignore internal OpenACC function calls. (add_write): Likewise. (add_read): Likewise. (add_kill): New function. (add_kills): New function. (add_oacc_kills): New function. (try_generate_gimple_bb): Kill false dependences for OpenACC "private"/"firstprivate" vars. (gather_bbs::gather_bbs): Determin OpenACC "private"/"firstprivate" vars in region. (gather_bbs::before_dom_children): Add assert. (determine_openacc_reductions): New function. (build_scops): Determine OpenACC "reduction" vars in SCoP. * graphite-sese-to-poly.cc (oacc_ifn_call_extract): New declaration. (oacc_internal_call_p): New function. (build_poly_dr): Ignore internal OpenACC function calls, handle "reduction" refs. (build_poly_sr): Likewise; handle "kill" operations. * graphite.cc (graphite_transform_loops): Accept functions with only a single loop. (oacc_enable_graphite_p): New function. (gate_graphite_transforms): Enable pass on OpenACC functions. * graphite.h (enum poly_dr_type): Add PDR_KILL. (struct poly_dr): Add "is_reduction" field. (new_poly_dr): Add argument to declaration. (pdr_kill_p): New function. (print_isl_space): New declaration. (debug_isl_space): New declaration. (struct scop): Add fields "reductions_vars", "oacc_firstprivate_vars", and "oacc_private_scalars". (optimize_isl): New declaration. (graphite_oacc_analyze_scop): New declaration. * internal-fn.cc (expand_UNIQUE): Handle IFN_UNIQUE_OACC_PRIVATE_SCALAR and IFN_UNIQUE_OACC_FIRSTPRIVATE * internal-fn.h: Add OACC_PRIVATE_SCALAR and OACC_FIRSTPRIVATE * omp-expand.cc (struct omp_region): Adjust comment. (expand_omp_taskloop_for_inner): (expand_omp_for): Add asserts about expected "kernels" region types. (mark_loops_in_oacc_kernels_region): Likewise. (expand_omp_target): Likewise; handle GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GRAPHITE. (build_omp_regions_1): Handle GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GRAPHITE. Likewise. (omp_make_gimple_edges): Likewise. * omp-general.cc (oacc_get_kernels_attrib): New function. (oacc_get_fn_dim_size): Allow argument to be NULL. * omp-general.h (oacc_get_kernels_attrib): New declaration. * omp-low.cc (struct omp_context): Add fields "oacc_firstprivate_vars" and "oacc_private_scalars". (was_originally_oacc_kernels): New function. (is_oacc_kernels): (is_oacc_kernels_decomposed_graphite_part): New function. (new_omp_context): Allocate "oacc_first_private_vars" and "oacc_private_scalars" ... (delete_omp_context): ... and free from here. (oacc_record_firstprivate_var_clauses): New function. (oacc_record_private_scalars): New function. (scan_sharing_clauses): Call functions to record "private" scalars and "firstprivate" variables. (check_oacc_kernel_gwv): Add assert. (ctx_in_oacc_kernels_region): Handle GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GRAPHITE. (scan_omp_for): Likewise. (check_omp_nesting_restrictions): Likewise. (lower_oacc_head_mark): Likewise. (lower_omp_for): Likewise. (lower_omp_target): Create "private" and "firstprivate" marker call statements. (lower_oacc_head_tail): Adjust "private" and "firstprivate" marker calls. (lower_oacc_reductions): Emit "private" and "firstprivate" marker call statements. (make_oacc_firstprivate_vars_marker): New function. (make_oacc_private_scalars_marker): New function. * omp-oacc-kernels-decompose.cc (adjust_region_code_walk_stmt_fn): Assign GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GRAPHITE to region using the new "kernels" handling. (make_region_seq): Adjust default region type for new "kernels" handling; no more exceptions, let Graphite handle everything. (make_region_loop_nest): Likewise; add dump output and assert. (adjust_nested_loop_clauses): Stop creating "auto" clauses if loop has "independent", "gang" etc. (transform_kernels_loop_clauses): Likewise. * omp-offload.cc (oacc_extract_loop_call): New function. (oacc_loop_get_cfg_loop): New function. (can_be_parallel_str): New function. (oacc_loop_can_be_parallel_p): New function. (oacc_parallel_kernels_graphite_fun_p): New function. (oacc_parallel_fun_p): New function. (oacc_loop_transform_auto_into_independent): New function, ... (oacc_loop_fixed_partitions): ... called from here to transfer the result of Graphite's analysis to the loop. (execute_oacc_loop_designation): Handle "oacc functions with "parallel_kernels_graphite" attribute. (execute_oacc_device_lower): Handle IFN_UNIQUE_OACC_PRIVATE_SCALAR and IFN_UNIQUE_OACC_FIRSTPRIVATE. * omp-offload.h (oacc_extract_loop_call): Add declaration. * params.opt: Add "param=openacc-kernels" value "decompose-parloops". * sese.cc (scalar_evolution_in_region): "Redirect" SCEV analysis to outer loop for IFN_GOACC_LOOP calls. * sese.h: Add field "kill_scalar_refs". * tree-chrec.cc (chrec_fold_plus_1): Handle VIEW_CONVERT_EXPR like CASE_CONVERT. * tree-data-ref.cc (dump_data_reference): Include DR_BASE_ADDRESS and DR_OFFSET in dump output. (get_references_in_stmt): Don't reject OpenACC internal function calls. (graphite_find_data_references_in_stmt): Remove unused variable. * tree-parloops.cc (pass_parallelize_loops::execute): Disable pass with the new kernels handling, enable if requested explicitly. * tree-scalar-evolution.cc (set_scev_analyze_openacc_calls): Set flag to enable the analysis of internal OpenACC function calls (use for Graphite only). (oacc_call_analyzable_p): New function. (oacc_ifn_call_extract): New function. (oacc_simplify): New function. (add_to_evolution): Simplify OpenACC internal function calls if applicable. (follow_ssa_edge_binary): Likewise. (follow_ssa_edge_expr): Likewise. (follow_copies_to_constant): Likewise. (analyze_initial_condition): Likewise. (interpret_loop_phi): Likewise. (interpret_gimple_call): New function. (interpret_rhs_expr): Likewise. (instantiate_scev_name): Likewise. (analyze_scalar_evolution_1): Handle GIMPLE_CALL, handle default definitions. (expression_expensive_p): Consider internal OpenACC calls to be cheap. * tree-scalar-evolution.h (set_scev_analyze_openacc_calls): New declaration. (oacc_call_analyzable_p): New declaration. * tree-ssa-dce.cc (mark_stmt_if_obviously_necessary): Mark lhs of internal OpenACC function calls necessary. * tree-ssa-ifcombine.c (recognize_if_then_else): * tree-ssa-loop-niter.cc (oacc_call_analyzable_p): (oacc_ifn_call_extract): New declaration. (interpret_gimple_call): New delcaration. (expand_simple_operations): Handle internal OpenACC function calls. * tree-ssa-loop.cc (gate_oacc_kernels): Disable for new "kernels" handling. * graphite-oacc.cc: New file. * graphite-oacc.h: New file. 2021-11-16 Frederik Harwath * common.opt: Add fgraphite-runtime-alias-checks. * graphite-isl-ast-to-gimple.cc (generate_alias_cond): New function. (graphite_regenerate_ast_isl): Use from here. * graphite-poly.cc (new_scop): Create unhandled_alias_ddrs vec ... (free_scop): and release here. * graphite-scop-detection.cc (dr_defs_outside_region): New function. (dr_well_analyzed_for_runtime_alias_check_p): New function. (graphite_runtime_alias_check_p): New function. (build_alias_set): Record unhandled alias ddrs for later alias check creation if flag_graphite_runtime_alias_checks is true instead of failing. * graphite.h (struct scop): Add field unhandled_alias_ddrs. * sese.h (has_operands_from_region_p): New function. 2021-11-16 Frederik Harwath * tree-loop-distribution.cc (data_ref_segment_size): Remove function. (latch_dominated_by_data_ref): Likewise. (compute_alias_check_pairs): Likewise. * tree-data-ref.cc (data_ref_segment_size): New function, copied from tree-loop-distribution.c (compute_alias_check_pairs): Likewise. (latch_dominated_by_data_ref): Likewise. * tree-data-ref.h (compute_alias_check_pairs): New declaration. 2021-11-16 Frederik Harwath * predict.cc (pass_profile::execute): Fix dump message. 2021-11-16 Frederik Harwath * graphite-sese-to-poly.cc (build_poly_sr_1): Fix a typo and a reference to a variable which does not exist. * graphite-isl-ast-to-gimple.cc (gsi_insert_earliest): Fix typo in comment. 2021-11-16 Frederik Harwath * graphite-sese-to-poly.cc (isl_id_for_ssa_name): Rename to ... (isl_id_for_parameter): ... this new function name. (build_scop_context): Adjust function use. 2021-11-16 Frederik Harwath * graphite-scop-detection.cc (scop_detection::can_represent_loop): Output reason for failure to dump file. (scop_detection::harmful_loop_in_region): Likewise. (scop_detection::graphite_can_represent_expr): Likewise. (scop_detection::stmt_has_simple_data_refs_p): Likewise. (scop_detection::stmt_simple_for_scop_p): Likewise. (print_sese_loop_numbers): New function. (scop_detection::add_scop): Use from here to print loops in rejected SCoP. 2021-11-16 Frederik Harwath Thomas Schwinge * omp-general.cc (oacc_get_fn_dim_size): Return 0 on missing "dims". * omp-offload.cc (pass_oacc_loop_designation::clone): New member function. (pass_oacc_gimple_workers::clone): Likewise. (pass_oacc_gimple_device_lower::clone): Likewise. * passes.cc (pass_data_no_loop_optimizations): New pass_data. (class pass_no_loop_optimizations): New pass. (make_pass_no_loop_optimizations): New function. * passes.def: Move pass_oacc_{loop_designation, gimple_workers, device_lower} into tree_loop, and add copies to pass_tree_no_loop and to new pass_no_loop_optimizations. Add copies of passes pass_ccp, pass_ipa_warn, pass_complete_unrolli, pass_backprop, pass_phiprop, pass_fix_loops after the OpenACC passes in pass_tree_loop. * tree-ssa-loop-ivcanon.cc (pass_complete_unroll::clone): New member function. (pass_complete_unrolli::clone): Likewise. * tree-ssa-loop.cc (pass_fix_loops::clone): Likewise. (pass_tree_loop_init::clone): Likewise. (pass_tree_loop_done::clone): Likewise. * tree-ssa-phiprop.cc (pass_phiprop::clone): Likewise. 2021-11-16 Sandra Loosemore Tobias Burnus * expr.cc (get_inner_reference): Handle NOP_EXPR like VIEW_CONVERT_EXPR. 2021-11-16 Frederik Harwath * tree-cfg.h (gimple_debug_cfg): Change argument type from int to dump_flags_t. 2021-06-03 Julian Brown * gimplify.cc (extract_base_bit_offset): Don't look through ARRAY_REFs or INDIRECT_REFs here. (build_struct_group): Reinstate previous behaviour for handling ARRAY_REFs/INDIRECT_REFs. 2021-06-02 Julian Brown * gimplify.cc (extract_base_bit_offset): Add BASE_IND and OPENMP parameters. Handle pointer-typed indirect references for OpenACC alongside reference-typed ones. (strip_components_and_deref, aggregate_base_p): New functions. (build_struct_group): Add pointer type indirect ref handling, including chained references, for OpenACC. Also handle references to structs for OpenACC. Conditionalise bits for OpenMP only where appropriate. (gimplify_scan_omp_clauses): Rework pointer-type indirect structure access handling to work more like the reference-typed handling for OpenACC only. * omp-low.cc (scan_sharing_clauses): Handle pointer-type indirect struct references, and references to pointers to structs also. 2021-06-02 Julian Brown * gimplify.cc (insert_struct_comp_map): Refactor function into... (build_struct_comp_nodes): This new function. Remove list handling and improve self-documentation. (insert_node_after, move_node_after, move_nodes_after, move_concat_nodes_after): New helper functions. (build_struct_group): New function to build up GOMP_MAP_STRUCT node groups to map struct components. Outlined from... (gimplify_scan_omp_clauses): Here. Call above function. 2021-06-02 Julian Brown * gimplify.cc (extract_base_bit_offset): Unify ARRAY_REF/INDIRECT_REF stripping code in first call/subsequent call cases. 2021-06-02 Julian Brown * gimplify.cc (gimplify_scan_omp_clauses): Simplify condition for changing GOMP_MAP_ATTACH_DETACH to GOMP_MAP_ATTACH or GOMP_MAP_DETACH. 2021-04-07 Kwok Cheung Yeung * omp-low.cc (is_oacc_parallel_or_serial): Handle GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED and GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE. 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-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-26 Andrew Stubbs * dwarf2out.cc (gen_subprogram_die): Replace existing low/high PC attributes, rather than ICE. 2021-02-02 Chung-Lin Tang * omp-offload.cc (omp_finish_file): Add code to create OpenMP requires mask variable in .gnu.gomp_requires section if needed. 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-16 Andrew Stubbs * dwarf2out.cc (gen_subprogram_die): Check offload attributes only. 2021-01-15 Andrew Stubbs * dwarf2out.cc (add_location_or_const_value_attribute): Set DW_AT_address_class, if appropriate. 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-07-27 Andrew Stubbs * dwarf2cfi.cc (get_cfa_from_loc_descr): Support register spans with DW_OP_piece and DW_OP_LLVM_piece_end. * dwarf2out.cc (build_cfa_loc): Support register spans. 2020-08-19 Sandra Loosemore Add a "combined" flag for "acc kernels loop" etc directives. * tree.h (OACC_LOOP_COMBINED): New. 2020-06-03 Tobias Burnus * gimplify.cc (localize_reductions): Do not create local variable for privatized arrays. 2020-03-27 Sandra Loosemore * doc/invoke.texi (Option Summary): Add entries for -Wopenacc-kernels-annotate-loops and -fno-openacc-kernels-annotate-loops. (Warning Options): Document -Wopenacc-kernels-annotate-loops. (Optimization Options): Document -fno-openacc-kernels-annotate-loops. 2020-02-06 Tobias Burnus * omp-low.c (convert_from_firstprivate_int): Use VIEW_CONVERT also for vectors. 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-17 Tobias Burnus * gimplify.cc (gomp_oacc_needs_data_present): Remove unused variable. 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 Julian Brown * gimplify.cc (gimplify_adjust_omp_clauses_1): Raise error for assumed-size arrays in map clauses for Fortran/OpenMP. * omp-low.cc (lower_omp_target): Set the size of assumed-size Fortran arrays to one to allow use of data already mapped on the offload device. 2019-05-20 Julian Brown * gimplify.cc (gimplify_adjust_omp_clauses_1): Support implied no_alloc and optional arguments based on mappings in enclosing data regions. 2019-05-19 Julian Brown * gimplify.cc (oacc_array_mapping_info): Add REF field. (gimplify_scan_omp_clauses): Initialise above field for data blocks passed by reference. (gomp_oacc_needs_data_present): Handle references. (gimplify_adjust_omp_clauses_1): Handle references and optional arguments for variables declared in lexically-enclosing OpenACC data region. 2019-01-23 Thomas Schwinge * params.opt (openacc_kernels): Default to decompose. 2018-09-05 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-08-28 Julian Brown Cesar Philippidis * gimplify.cc (oacc_array_mapping_info): New struct. (gimplify_omp_ctx): Add decl_data_clause hash map. (new_omp_context): Zero-initialise above. (delete_omp_context): Delete above if allocated. (gimplify_scan_omp_clauses): Scan for array mappings on data constructs, and record in above map. (gomp_oacc_needs_data_present): New function. (gimplify_adjust_omp_clauses_1): Handle data mappings (e.g. array slices) declared in lexically-enclosing data constructs. * omp-low.cc (lower_omp_target): Allow decl for bias not to be present in OpenACC context. 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. 2019-09-20 Chung-Lin Tang Cesar Philippidis * omp-expand.cc (struct omp_region): Add inside_kernels_p field. (expand_omp_for_generic): Adjust to generate a 'sequential' loop when GOMP builtin arguments are BUILT_IN_NONE. (expand_omp_for): Use expand_omp_for_generic to generate a non-parallelized loop for OMP_FORs inside OpenACC kernels regions. (expand_omp): Mark inside_kernels_p field true for regions nested inside OpenACC kernels constructs. 2018-09-20 Cesar Philippidis Julian Brown * omp-low.c (install_var_field): New base_pointer_restrict argument. (scan_sharing_clauses): Update call to install_var_field. (omp_target_base_pointers_restrict_p): New function. (scan_omp_target): Update call to install_var_field. 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. 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.