blob: d024ee78a29bfde0a4aad206b05d71bc42a2194d [file] [log] [blame]
2019-11-18 Kwok Cheung Yeung <kcy@codesourcery.com>
Backport from mainline:
2019-11-07 Kwok Cheung Yeung <kcy@codesourcery.com>
* ira.c (setup_alloc_regs): Setup no_unit_alloc_regs for
frame pointer in multiple registers.
(ira_setup_eliminable_regset): Setup eliminable_regset,
ira_no_alloc_regs and regs_ever_live for frame pointer in
multiple registers.
2019-11-10 Kwok Cheung Yeung <kcy@codesourcery.com>
* lra-spills.c (assign_spill_hard_regs): Do not spill into
registers in eliminable_regset.
2019-11-14 Kwok Cheung Yeung <kcy@codesourcery.com>
* lra-spills.c (assign_spill_hard_regs): Check that the spill
register is suitable for the mode.
2019-11-15 Kwok Cheung Yeung <kcy@codesourcery.com>
* config/gcn/gcn.c (gcn_regno_reg_class): Return VCC_CONDITIONAL_REG
register class for VCC_LO and VCC_HI.
(gcn_spill_class): Use SGPR_REGS to spill registers in
VCC_CONDITIONAL_REG.
2019-11-15 Kwok Cheung Yeung <kcy@codesourcery.com>
* config/gcn/gcn.c (gcn_expand_prologue): Remove initialization and
prologue use of v0.
(print_operand_address): Use v1 for zero vector offset.
2019-11-15 Kwok Cheung Yeung <kcy@codesourcery.com>
* config/gcn/gcn.c (gcn_init_cumulative_args): Call reinit_regs.
2019-11-15 Kwok Cheung Yeung <kcy@codesourcery.com>
* config/gcn/gcn.c (default_requested_args): New.
(gcn_parse_amdgpu_hsa_kernel_attribute): Initialize requested args
set with default_requested_args.
(gcn_conditional_register_usage): Limit register usage of non-kernel
functions. Reassign fixed registers if a non-standard set of args is
requested.
* config/gcn/gcn.h (FIXED_REGISTERS): Fix registers according to ABI.
2019-11-15 Kwok Cheung Yeung <kcy@codesourcery.com>
* config/gcn/gcn.c (MAX_NORMAL_SGPR_COUNT, MAX_NORMAL_VGPR_COUNT): New.
(gcn_conditional_register_usage): Use constants in place of hard-coded
values.
(gcn_hsa_declare_function_name): Set lower bound for number of
SGPRs/VGPRs in non-leaf kernels to MAX_NORMAL_SGPR_COUNT and
MAX_NORMAL_VGPR_COUNT.
2019-11-15 Kwok Cheung Yeung <kcy@codesourcery.com>
* config/gcn/gcn.h (FIXED_REGISTERS): Unfix frame pointer.
(CALL_USED_REGISTERS): Make frame pointer callee-saved.
2019-10-16 Julian Brown <julian@codesourcery.com>
* config/gcn/gcn-protos.h (gcn_goacc_adjust_gangprivate_decl): Rename
to...
(gcn_goacc_adjust_private_decl): ...this.
* config/gcn/gcn-tree.c (diagnostic-core.h): Include.
(gcn_goacc_adjust_gangprivate_decl): Rename to...
(gcn_goacc_adjust_private_decl): ...this. Add LEVEL parameter.
* config/gcn/gcn.c (TARGET_GOACC_ADJUST_GANGPRIVATE_DECL): Rename to...
(TARGET_GOACC_ADJUST_PRIVATE_DECL): ...this.
* config/nvptx/nvptx.c (tree-pretty-print.h): Include.
(nvptx_goacc_adjust_private_decl): New function.
(TARGET_GOACC_ADJUST_PRIVATE_DECL): Define hook using above function.
* doc/tm.texi.in (TARGET_GOACC_ADJUST_GANGPRIVATE_DECL): Rename to...
(TARGET_GOACC_ADJUST_PRIVATE_DECL): ...this.
* doc/tm.texi: Regenerated.
* internal-fn.c (expand_UNIQUE): Handle IFN_UNIQUE_OACC_PRIVATE.
* internal-fn.h (IFN_UNIQUE_CODES): Add OACC_PRIVATE.
* omp-low.c (omp_context): Remove oacc_partitioning_levels field.
(lower_oacc_reductions): Add PRIVATE_MARKER parameter. Insert before
fork.
(lower_oacc_head_tail): Add PRIVATE_MARKER parameter. Modify its
gimple call arguments as appropriate. Don't set
oacc_partitioning_levels in omp_context. Pass private_marker to
lower_oacc_reductions.
(oacc_record_private_var_clauses): Don't check for NULL ctx.
(make_oacc_private_marker): New function.
(lower_omp_for): Only call oacc_record_vars_in_bind for
OpenACC contexts. Create private marker and pass to
lower_oacc_head_tail.
(lower_omp_target): Remove unnecessary call to
oacc_record_private_var_clauses. Remove call to mark_oacc_gangprivate.
Create private marker and pass to lower_oacc_reductions.
(process_oacc_gangprivate_1): Remove.
(lower_omp_1): Only call oacc_record_vars_in_bind for OpenACC. Don't
iterate over contexts calling process_oacc_gangprivate_1.
(omp-offload.c (oacc_loop_xform_head_tail): Treat
private-variable markers like fork/join when transforming head/tail
sequences.
(execute_oacc_device_lower): Use IFN_UNIQUE_OACC_PRIVATE instead of
"oacc gangprivate" attributes to determine partitioning level of
variables.
* omp-sese.c (find_gangprivate_vars): New function.
(find_local_vars_to_propagate): Use GANGPRIVATE_VARS parameter instead
of "oacc gangprivate" attribute to determine which variables are
gang-private.
(oacc_do_neutering): Use find_gangprivate_vars.
* target.def (adjust_gangprivate_decl): Rename to...
(adjust_private_decl): ...this. Update documentation (briefly).
2019-10-09 Tobias Burnus <tobias@codesourcery.com>
* f95-lang.c (LANG_HOOKS_OMP_ARRAY_DATA): Set to gfc_omp_array_data.
* trans-array.c (gfc_conv_descriptor_data_get): Handle ref types.
* trans-openmp.c (gfc_omp_array_data): New.
* trans.h (gfc_omp_array_data): Declare.
2019-09-20 Julian Brown <julian@codesourcery.com>
* gimplify.c (localize_reductions): Rewrite references for
OMP_CLAUSE_PRIVATE also.
2019-09-17 Tobias Burnus <tobias@codesourcery.com>
* config/gcn/gcn.c (gcn_expand_scalar_to_vector_address,
gcn_md_reorg): Remove unused statement.
(gcn_emutls_var_init): Add missing return - after sorry abort.
* config/gcn/gcn.md (movdi_symbol_save_scc): Fix condition.
* config/gcn/mkoffload.c (process_obj): Remove unused variables.
* gimplify.c (gomp_oacc_needs_data_present): Likewise.
(gimplify_adjust_omp_clauses): Fix condition by adding ().
* omp-low.c (process_oacc_gangprivate_1): Comment unused
parameter name to silence unused warning.
* omp-sese.c (omp_sese_number, omp_sese_pseudo): Remove
superfluous ().
(oacc_do_neutering): Use signed int to avoid a warning.
* tree-ssa-structalias.c (find_func_aliases_for_builtin_call,
find_func_clobbers): Use unsigned to silence warning.
2019-09-10 Julian Brown <julian@codesourcery.com>
* config/gcn/mkoffload.c (process_asm): Remove omp_data_size,
gridified_kernel_p, kernel_dependencies_count, kernel_dependencies
from emitted hsa_kernel_description struct array.
2019-09-10 Andrew Stubbs <ams@codesourcery.com>
* config/gcn/gcn.c (gcn_hsa_declare_function_name): Calculate
granulated_sgprs according to architecture.
2019-09-09 Andrew Stubbs <ams@codesourcery.com>
* config/gcn/gcn-run.c (heap_region): New global variable.
(struct hsa_runtime_fn_info): Add hsa_memory_assign_agent_fn.
(init_hsa_runtime_functions): Initialize hsa_memory_assign_agent.
(get_kernarg_region): Move contents to ....
(get_memory_region): .... here.
(get_heap_region): New function.
(init_device): Initialize the heap_region.
(device_malloc): Add region parameter.
(struct kernargs): Move heap ....
(heap): ... to global scope.
(main): Allocate heap separate to kernargs.
2019-09-06 Andrew Stubbs <ams@codesourcery.com>
Backport from mainline:
2019-06-06 Andrew Stubbs <ams@codesourcery.com>
* config.gcc (amdgcn-*-*): Allow --with-arch=gfx906.
* config/gcn/gcn.opt (gpu_type): Add gfx906.
* config/gcn/t-gcn-hsa (MULTILIB_OPTIONS): Add gfx906 multilib.
(MULTILIB_DIRNAMES): Rename gcn5 to gfx900.
Add gfx906.
2019-06-07 Andrew Stubbs <ams@codesourcery.com>
* doc/invoke.texi (AMD GCN Options): Add gfx906.
2019-09-06 Julian Brown <julian@codesourcery.com>
* gimplify.c (gimplify_omp_for): Use for_stmt in call to
localize_reductions.
2019-09-06 Julian Brown <julian@codesourcery.com>
* config/nvptx/nvptx.c (omp-sese.h): Include.
(bb_pair_t, bb_pair_vec_t, pseudo_node_t, bracket, bracket_vec_t,
bb_sese, bb_sese::~bb_sese, bb_sese::append, bb_sese::remove,
BB_SET_SESE, BB_GET_SESE, nvptx_sese_number, nvptx_sese_pseudo,
nvptx_sese_color, nvptx_find_sese): Remove.
(nvptx_neuter_pars): Call omp_find_sese instead of nvptx_find_sese.
* omp-sese.c (omp-sese.h): Include.
(struct parallel): Rename to...
(struct parallel_g): This.
(parallel::parallel, parallel::~parallel): Rename to...
(parallel_g::parallel_g, parallel_g::~parallel_g): These.
(omp_sese_dump_pars, omp_sese_find_par, omp_sese_discover_pars,
populate_single_mode_bitmaps, find_ssa_names_to_propagate,
find_partitioned_var_uses, find_local_vars_to_propagate,
neuter_worker_single): Update for parallel_g name change.
(bb_pair_t, bb_pair_vec_t): Remove.
(omp_find_sese): Make global.
* omp-sese.h (bb_pair_t, bb_pair_vec_t): New.
(omp_find_sese): Add prototype.
2019-09-06 Julian Brown <julian@codesourcery.com>
* gimplify.c (gimplify_omp_workshare): Use OMP_CLAUSES, OMP_BODY
instead of OMP_TARGET_CLAUSES, OMP_TARGET_BODY.
2019-09-05 Andrew Stubbs <ams@codesourcery.com>
Backport from mainline:
2019-07-31 Andrew Stubbs <ams@codesourcery.com>
gcc/
* config/gcn/gcn-valu.md
(scatter<mode>_insn_1offset<exec_scatter>): Remove s_waitcnt.
(scatter<mode>_insn_1offset_ds<exec_scatter>): Likewise.
(scatter<mode>_insn_2offsets<exec_scatter>): Likewise.
* config/gcn/gcn.c (gcn_md_reorg): Add delayeduse and reads to
struct ilist. Add nops for delayeduse insns.
* config/gcn/gcn.md (delayeduse): New attribute.
(*movbi): Remove s_waitcnt from stores.
(*mov<mode>_insn): Likewise.
(*movti_insn): Likewise. Add delayeduse attribute.
(sync_compare_and_swap<mode>_insn): Add delayeduse attribute.
(atomic_store<mode>): Remove or adjust s_waitcnt.
2019-09-05 Andrew Stubbs <ams@codesourcery.com>
gcc/
* config/gcn/gcn.md (*movti_insn): Set delayeduse for global_store.
(sync_compare_and_swap<mode>_insn): Likewise.
2019-09-05 Julian Brown <julian@codesourcery.com>
* config/gcn/gcn.c (gcn_goacc_validate_dims): Remove
no-flag_worker-partitioning assertion.
(TARGET_GOACC_WORKER_PARTITIONING): Define target hook to true.
* config/gcn/gcn.opt (flag_worker_partitioning): Change default to 1.
2019-09-05 Cesar Philippidis <cesar@codesourcery.com>
Julian Brown <julian@codesourcery.com>
* gimplify.c (privatize_reduction): New struct.
(localize_reductions_r, localize_reductions): New functions.
(gimplify_omp_for): Call localize_reductions.
(gimplify_omp_workshare): Likewise.
* omp-low.c (lower_oacc_reductions): Handle localized reductions.
Create fewer temp vars.
* tree-core.h (omp_clause_code): Add OMP_CLAUSE_REDUCTION_PRIVATE_DECL
documentation.
* tree.c (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-09-05 Julian Brown <julian@codesourcery.com>
* config/gcn/gcn-protos.h (gcn_goacc_adjust_propagation_record): Rename
prototype to...
(gcn_goacc_create_propagation_record): This.
* config/gcn/gcn-tree.c (gcn_goacc_adjust_propagation_record): Rename
function to...
(gcn_goacc_create_propagation_record): This. Adjust comment.
* config/gcn/gcn.c (gcn_init_builtins): Override decls for
BUILT_IN_GOACC_SINGLE_START, BUILT_IN_GOACC_SINGLE_COPY_START,
BUILT_IN_GOACC_SINGLE_COPY_END and BUILT_IN_GOACC_BARRIER.
(gcn_fork_join): Remove inaccurate comment.
(TARGET_GOACC_ADJUST_PROPAGATION_RECORD): Rename to...
(TARGET_GOACC_CREATE_PROPAGATION_RECORD): This.
2019-09-05 Julian Brown <julian@codesourcery.com>
* Makefile.in (OBJS): Add omp-sese.o.
* omp-builtins.def (BUILT_IN_GOACC_BARRIER, BUILT_IN_GOACC_SINGLE_START,
BUILT_IN_GOACC_SINGLE_COPY_START, BUILT_IN_GOACC_SINGLE_COPY_END): New
builtins.
* omp-offload.c (omp-sese.h): Include header.
(oacc_loop_xform_head_tail): Call update_stmt for modified builtin
calls.
(oacc_loop_process): Likewise.
(default_goacc_create_propagation_record): New default implementation
for TARGET_GOACC_CREATE_PROPAGATION_RECORD hook.
(execute_oacc_loop_designation): New. Split out of oacc_device_lower.
(execute_oacc_gimple_workers): New. Likewise.
(execute_oacc_device_lower): Recreate dims array.
(pass_data_oacc_loop_designation, pass_data_oacc_gimple_workers): New.
(pass_oacc_loop_designation, pass_oacc_gimple_workers): New.
(make_pass_oacc_loop_designation, make_pass_oacc_gimple_workers): New.
* omp-offload.h (oacc_fn_attrib_level): Add prototype.
* omp-sese.c: New file.
* omp-sese.h: New file.
* passes.def (pass_oacc_loop_designation, pass_oacc_gimple_workers):
Add passes.
* target.def (worker_partitioning, create_propagation_record): Add
target hooks.
* targhooks.h (default_goacc_create_propagation_record): Add prototype.
* tree-pass.h (make_pass_oacc_loop_designation,
make_pass_oacc_gimple_workers): Add prototypes.
* doc/tm.texi.in (TARGET_GOACC_WORKER_PARTITIONING,
TARGET_GOACC_CREATE_PROPAGATION_RECORD): Add documentation hooks.
* doc/tm.texi: Regenerate.
2019-09-05 Julian Brown <julian@codesourcery.com>
* omp-offload.c (convert.h): Include.
(struct addr_expr_rewrite_info): Add struct.
(rewrite_addr_expr): New function.
(is_sync_builtin_call): New function.
(execute_oacc_device_lower): Support rewriting gang-private variables
using target hook, and fix up addr_expr nodes afterwards.
* target.def (adjust_gangprivate_decl): New target hook.
* doc/tm.texi.in (TARGET_GOACC_ADJUST_GANGPRIVATE_DECL): Document new
target hook.
* doc/tm.texi: Regenerate.
2019-08-13 Julian Brown <julian@codesourcery.com>
* omp-oacc-kernels.c (add_wait): New function, split out of...
(add_async_clauses_and_wait): ...here. Call new outlined function.
(decompose_kernels_region_body): Add wait at the end of
explicitly-asynchronous kernels regions.
2019-08-08 Julian Brown <julian@codesourcery.com>
* config/gcn/gcn.c (gcn_goacc_validate_dims): Ensure
flag_worker_partitioning is not set.
(TARGET_GOACC_WORKER_PARTITIONING): Remove target hook definition.
* config/gcn/gcn.opt (macc-experimental-workers): Default to off.
2019-07-31 Julian Brown <julian@codesourcery.com>
* builtin-types.def (BT_FN_VOID_INT_INT_OMPFN_SIZE_PTR_PTR_PTR_VAR):
Remove.
* config/i386/i386.c (ix86_goacc_explode_args): New.
(TARGET_GOACC_EXPLODE_ARGS): Define, using above function.
* doc/tm.texi: Regenerated.
* doc/tm.texi.in: Add TARGET_GOACC_EXPLODE_ARGS hook.
* fortran/types.def (BT_FN_VOID_INT_INT_OMPFN_SIZE_PTR_PTR_PTR_VAR):
Remove.
* omp-builtins.def (GOACC_parallel_keyed_v2): Remove.
* omp-expand.c (expand_omp_target): Use explode_args target hook.
Use GOMP_LAUNCH_ARGS_EXPLODED launch tag.
* omp-low.c (build_receiver_ref, build_sender_ref,
create_omp_child_function, scan_omp_target, lower_omp_target): Use
explode_args target hook.
* target.def (explode_args): New target hook.
* tree-ssa-structalias.c (target.h): Include.
(find_func_aliases_for_builtin_call): Conditionalise disabling of pass
for OpenACC parallel regions based on explode_args target hook. Remove
'params' from BUILT_IN_GOACC_PARALLEL arguments.
(find_func_clobbers): Likewise.
(ipa_pta_execute): Update for removed 'params' argument.
2019-07-31 Julian Brown <julian@codesourcery.com>
Andrew Stubbs <ams@codesourcery.com>
* config.gcc (amdgcn-*-*): Add default option for gfx906.
* config/gcn/mkoffload.c: New.
* config/gcn/offload.h: New.
2019-06-25 Kwok Cheung Yeung <kcy@codesourcery.com>
Andrew Stubbs <ams@codesourcery.com>
Backport from mainline:
* config.gcc (thread_file): Set to gcn for AMD GCN.
* config/gcn/gcn.c (gcn_emutls_var_init): New function.
(TARGET_EMUTLS_VAR_INIT): New hook.
2019-05-22 Kwok Cheung Yeung <kcy@codesourcery.com>
Andrew Stubbs <amd@codesourcery.com>
Backport from mainline:
* config.gcc (gcc_cv_initfini_array): Set for AMD GCN.
* config/gcn/gcn-run.c (init_array_kernel, fini_array_kernel): New.
(kernel): Rename to...
(main_kernel): ... this.
(load_image): Load _init_array and _fini_array kernels.
(run): Add argument for kernel to run.
(main): Run init_array_kernel before main_kernel, and
fini_array_kernel after.
* config/gcn/gcn.c (gcn_handle_amdgpu_hsa_kernel_attribute): Allow
amdgpu_hsa_kernel attribute on functions.
(gcn_disable_constructors): Delete.
(TARGET_ASM_CONSTRUCTOR, TARGET_ASM_DESTRUCTOR): Delete.
* config/gcn/crt0.c (size_t): Define.
(_init_array, _fini_array): New.
(__preinit_array_start, __preinit_array_end,
__init_array_start, __init_array_end,
__fini_array_start, __fini_array_end): Declare weak references.
2019-07-10 Cesar Philippidis <cesar@codesourcery.com>
Julian Brown <julian@codesourcery.com>
* gimplify.c (gimplify_adjust_omp_clauses_1): Raise error for
assumed-size arrays in map clauses for Fortran/OpenMP.
* omp-low.c (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-07-10 Julian Brown <julian@codesourcery.com>
* gimplify.c (insert_struct_comp_map): Handle GOMP_MAP_ATTACH_DETACH.
(gimplify_scan_omp_clauses): Separate out handling of OACC_ENTER_DATA
and OACC_EXIT_DATA. Remove GOMP_MAP_POINTER and GOMP_MAP_TO_PSET
mappings, apart from those following GOMP_MAP_DECLARE_{,DE}ALLOCATE.
Handle GOMP_MAP_ATTACH_DETACH.
* tree-pretty-print.c (dump_omp_clause): Support GOMP_MAP_ATTACH_DETACH.
Print "bias" not "len" for attach/detach clause types.
2019-05-28 Julian Brown <julian@codesourcery.com>
* omp-low.c (mark_oacc_gangprivate): Add CTX parameter. Use to look up
correct decl to add attribute to.
(lower_omp_for): Move "oacc gangprivate" processing from here...
(process_oacc_gangprivate_1): ...to here. New function.
(lower_omp_target): Update call to mark_oacc_gangprivate.
(execute_lower_omp): Call process_oacc_gangprivate_1 for each OMP
context.
2019-05-30 Kwok Cheung Yeung <kcy@codesourcery.com>
* tree-vrp.c (extract_range_from_unary_expr): Set a varying range
when a reference is converted to an integral type.
2019-05-20 Julian Brown <julian@codesourcery.com>
* gimplify.c (gimplify_adjust_omp_clauses_1): Support implied no_alloc
and optional arguments based on mappings in enclosing data regions.
2019-05-19 Julian Brown <julian@codesourcery.com>
* gimplify.c (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-05-16 Julian Brown <julian@codesourcery.com>
* omp-oacc-kernels.c (find_omp_for_index_vars_1,
find_omp_for_index_vars): New functions.
(maybe_build_inner_data_region): Add IDX_VARS argument. Don't add
CREATE mapping clauses for loop index variables. Set TREE_ADDRESSABLE
flag on newly-mapped declarations as a side effect.
(decompose_kernels_region_body): Call find_omp_for_index_vars. Don't
create PRESENT clause for loop index variables. Pass index variable
set to maybe_build_inner_data_region.
2019-05-03 Kwok Cheung Yeung <kcy@codesourcery.com>
* gimplify.c (gomp_oacc_needs_data_present): Return NULL if decl is a
Fortran optional argument.
2019-02-01 Thomas Schwinge <thomas@codesourcery.com>
* omp-oacc-kernels.c (struct adjust_nested_loop_clauses_wi_info): New.
(adjust_nested_loop_clauses, transform_kernels_loop_clauses): Use it.
2019-01-23 Thomas Schwinge <thomas@codesourcery.com>
* doc/invoke.texi (-fopenacc-kernels): Update.
2019-01-24 Thomas Schwinge <thomas@codesourcery.com>
* omp-oacc-kernels.c (adjust_region_code_walk_stmt_fn)
(adjust_region_code): New functions.
(make_loops_gang_single): Update.
(make_gang_single_region): Rename to...
(make_region_seq): ... this, and update.
(make_gang_parallel_loop_region): Rename to...
(make_region_loop_nest): ... this, and update.
(is_unconditional_oacc_for_loop): Remove stmt parameter and check.
(decompose_kernels_region_body): Update.
2019-01-21 Gergö Barany <gergo@codesourcery.com>
* omp-oacc-kernels.c (add_async_clauses_and_wait): New function...
(decompose_kernels_region_body): ... called from here.
2019-01-23 Gergö Barany <gergo@codesourcery.com>
* omp-oacc-kernels.c (add_parent_or_loop_num_clause): New function.
(adjust_nested_loop_clauses): Likewise.
(transform_kernels_loop_clauses, make_gang_parallel_loop_region):
Add worker and vector clause parameters, emit error on illegal
nesting.
(visit_loops_in_gang_single_region): Emit warning on conditionally
executed code with a gang clause.
(make_loops_gang_single): New function.
(decompose_kernels_region_body): Separate out gang/worker/vector clauses
for separate handling; add call to make_loops_gang_single.
* omp-offload.c (oacc_loop_auto_partitions): Add and propagate
is_oacc_gang_single parameter.
(oacc_loop_partition): Likewise.
(execute_oacc_device_lower): Adjust call to oacc_loop_partition.
2019-01-23 Gergö Barany <gergo@codesourcery.com>
* omp-oacc-kernels.c (control_flow_regions): New class.
(control_flow_regions::control_flow_regions): New constructor.
(control_flow_regions::is_unconditional_oacc_for_loop): New method.
(control_flow_regions::find_rep): Likewise.
(control_flow_regions::union_reps): Likewise.
(control_flow_regions::compute_regions): Likewise.
(decompose_kernels_region_body): Use test for conditional execution.
2019-01-21 Gergö Barany <gergo@codesourcery.com>
* omp-oacc-kernels.c (top_level_omp_for_in_stmt): New function.
(make_gang_single_region): Likewise.
(transform_kernels_loop_clauses, make_gang_parallel_loop_region):
Likewise.
(flatten_binds): Likewise.
(make_data_region_try_statement): Likewise.
(maybe_build_inner_data_region): Likewise.
(decompose_kernels_region_body): Likewise.
(transform_kernels_region): Delegate to decompose_kernels_region_body
and make_data_region_try_statement.
2019-01-21 Gergö Barany <gergo@codesourcery.com>
* Makefile.in: Add...
* omp-oacc-kernels.c: ... this new file for the kernels conversion
pass.
* flag-types.h (enum openacc_kernels): Add "split" style. Adjust
all users.
* doc/invoke.texi (-fopenacc-kernels): Update.
* passes.def: Add pass_convert_oacc_kernels to pipeline.
* tree-pass.h (make_pass_convert_oacc_kernels): Add declaration.
2019-01-23 Thomas Schwinge <thomas@codesourcery.com>
* gimple.h (enum gf_mask): Add new target kinds
GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED,
GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE, and
GF_OMP_TARGET_KIND_OACC_DATA_KERNELS.
(is_gimple_omp_oacc): Handle new target kinds.
(is_gimple_omp_offloaded): Likewise.
* gimple-pretty-print.c (dump_gimple_omp_target): Likewise.
* omp-expand.c (expand_omp_target): Likewise.
(build_omp_regions_1): Likewise.
(omp_make_gimple_edges): Likewise.
* omp-low.c (is_oacc_parallel_or_serial): Likewise.
(was_originally_oacc_kernels): New function.
(scan_omp_for): Update check for illegal nesting.
(check_omp_nesting_restrictions): Handle new target kinds.
(lower_oacc_reductions): Likewise.
(lower_omp_target): Likewise.
* omp-offload.c (execute_oacc_device_lower): Likewise.
2019-01-30 Thomas Schwinge <thomas@codesourcery.com>
* flag-types.h (enum openacc_kernels): New type.
2018-12-19 Julian Brown <julian@codesourcery.com>
Maciej W. Rozycki <macro@codesourcery.com>
* omp-low.c (lower_omp_target): Support GOMP_MAP_NO_ALLOC.
* tree-pretty-print.c (dump_omp_clause): Likewise.
2018-12-20 Maciej W. Rozycki <macro@codesourcery.com>
* gimple.h (gf_mask): Add GF_OMP_TARGET_KIND_OACC_SERIAL
enumeration constant.
(is_gimple_omp_oacc): Handle GF_OMP_TARGET_KIND_OACC_SERIAL.
(is_gimple_omp_offloaded): Likewise.
* gimplify.c (omp_region_type): Add ORT_ACC_SERIAL enumeration
constant. Adjust the value of ORT_NONE accordingly.
(is_gimple_stmt): Handle OACC_SERIAL.
(oacc_default_clause): Handle ORT_ACC_SERIAL.
(gomp_needs_data_present): Likewise.
(gimplify_adjust_omp_clauses): Likewise.
(gimplify_omp_workshare): Handle OACC_SERIAL.
(gimplify_expr): Likewise.
* omp-expand.c (expand_omp_target): Handle
GF_OMP_TARGET_KIND_OACC_SERIAL.
(build_omp_regions_1, omp_make_gimple_edges): Likewise.
* omp-low.c (is_oacc_parallel): Rename function to...
(is_oacc_parallel_or_serial): ... this. Handle
GF_OMP_TARGET_KIND_OACC_SERIAL.
(build_receiver_ref): Adjust accordingly.
(build_sender_ref): Likewise.
(scan_sharing_clauses): Likewise.
(create_omp_child_function): Likewise.
(scan_omp_for): Likewise.
(scan_omp_target): Likewise.
(lower_oacc_head_mark): Likewise.
(convert_from_firstprivate_int): Likewise.
(lower_omp_target): Likewise.
(check_omp_nesting_restrictions): Handle
GF_OMP_TARGET_KIND_OACC_SERIAL.
(lower_oacc_reductions): Likewise.
(lower_omp_target): Likewise.
* tree-pretty-print.c (dump_generic_node): Handle OACC_SERIAL.
* tree.def (OACC_SERIAL): New tree code.
* doc/generic.texi (OpenACC): Document OACC_SERIAL.
2017-12-21 Cesar Philippidis <cesar@codesourcery.com>
* omp-low.c (install_parm_decl): Don't extract identifiers from
artifical decls.
2018-12-21 Gergö Barany <gergo@codesourcery.com>
* omp-expand.c (expand_omp_target): Handle if_present flag on
OpenACC host_data construct.
2018-12-20 Gergö Barany <gergo@codesourcery.com>
* omp-low.c (struct omp_context): New fields
local_reduction_clauses, outer_reduction_clauses.
(new_omp_context): Initialize these.
(scan_sharing_clauses): Record reduction clauses on OpenACC
constructs.
(scan_omp_for): Check reduction clauses for incorrect nesting.
2019-01-31 Kwok Cheung Yeung <kcy@codesourcery.com>
* omp-low.c (lower_omp_target): For use_device clauses, generate
conditional statements to treat Fortran optional arguments like
references if non-null, or propogate null arguments into offloaded
code otherwise.
2019-01-31 Kwok Cheung Yeung <kcy@codesourcery.com>
* omp-general.c (omp_is_optional_argument): Add comment. Add extra
check for Fortran language.
2019-01-30 Kwok Cheung Yeung <kcy@codesourcery.com>
* omp-general.c (omp_is_optional_argument): New.
* omp-general.h (omp_is_optional_argument): New.
* omp-low.c (lower_omp_target): Use size of referenced object when
optional argument used as argument to firstprivate.
2018-12-11 Julian Brown <julian@codesourcery.com>
Chung-Lin Tang <cltang@codesourcery.com>
* config/nvptx/nvptx.c (tree-hash-traits.h): Include.
(gangprivate_shared_size): New global variable.
(gangprivate_shared_align): Likewise.
(gangprivate_shared_sym): Likewise.
(gangprivate_shared_hmap): Likewise.
(nvptx_option_override): Initialize gangprivate_shared_sym,
gangprivate_shared_align.
(nvptx_file_end): Output gangprivate_shared_sym.
(nvptx_goacc_expand_accel_var): New function.
(nvptx_set_current_function): New function.
(TARGET_SET_CURRENT_FUNCTION): Define hook.
(TARGET_GOACC_EXPAND_ACCEL): Likewise.
* doc/tm.texi (TARGET_GOACC_EXPAND_ACCEL_VAR): Document new hook.
* doc/tm.texi.in (TARGET_GOACC_EXPAND_ACCEL_VAR): Likewise.
* expr.c (expand_expr_real_1): Remap decls marked with the
"oacc gangprivate" attribute.
* omp-low.c (omp_context): Add oacc_partitioning_level and
oacc_addressable_var_decls fields.
(new_omp_context): Initialize oacc_addressable_var_decls in new
omp_context.
(delete_omp_context): Delete oacc_addressable_var_decls in old
omp_context.
(lower_oacc_head_tail): Record partitioning-level count in omp context.
(oacc_record_private_var_clauses, oacc_record_vars_in_bind)
(mark_oacc_gangprivate): New functions.
(lower_omp_for): Call oacc_record_private_var_clauses with "for"
clauses. Call mark_oacc_gangprivate for gang-partitioned loops.
(lower_omp_target): Call oacc_record_private_var_clauses with "target"
clauses.
Call mark_oacc_gangprivate for offloaded target regions.
(lower_omp_1): Call vars_in_bind for GIMPLE_BIND within OMP regions.
* target.def (expand_accel_var): New hook.
2018-09-05 Cesar Philippidis <cesar@codesourcery.com>
Chung-Lin Tang <cltang@codesourcery.com>
* gimplify.c (omp_add_variable): Enable firstprivate reduction
variables.
2018-09-20 Cesar Philippidis <cesar@codesourcery.com>
* omp-low.c (lower_oacc_head_mark): Don't mark OpenACC auto
loops as independent inside acc parallel regions.
2018-10-04 Cesar Philippidis <cesar@codesourcery.com>
Julian Brown <julian@codesourcery.com>
* 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}.
2018-12-22 Cesar Philippidis <cesar@codesourcery.com>
Julian Brown <julian@codesourcery.com>
* omp-low.c (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.
2018-08-28 Julian Brown <julian@codesourcery.com>
Cesar Philippidis <cesar@codesourcery.com>
* gimplify.c (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.c (lower_omp_target): Allow decl for bias not to be present
in OpenACC context.
2018-10-05 Nathan Sidwell <nathan@acm.org>
Tom de Vries <tdevries@suse.de>
Thomas Schwinge <thomas@codesourcery.com>
Julian Brown <julian@codesourcery.com>
* doc/invoke.texi (fopenacc-dim): Update.
* omp-offload.c (oacc_parse_default_dims): Update.
(oacc_validate_dims): Emit warnings about strange partitioning choices.
2019-09-20 Chung-Lin Tang <cltang@codesourcery.com>
Cesar Philippidis <cesar@codesourcery.com>
* omp-expand.c (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 <cesar@codesourcery.com>
Julian Brown <julian@codesourcery.com>
* 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 <cesar@codesourcery.com>
* config/nvptx/nvptx.c (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 <cesar@codesourcery.com>
James Norris <jnorris@codesourcery.com>
* gimplify.c (enum gimplify_omp_var_data): Add GOVD_DEVICETPR.
(oacc_default_clause): Privatize fortran common blocks.
(omp_notice_variable): Add GOVD_DEVICEPTR attribute when appropriate.
Defer the expansion of DECL_VALUE_EXPR for common block decls.
(gimplify_scan_omp_clauses): Add GOVD_DEVICEPTR attribute when
appropriate.
(gimplify_adjust_omp_clauses_1): Set GOMP_MAP_FORCE_DEVICEPTR for
implicit deviceptr mappings.
2018-10-02 Thomas Schwinge <thomas@codesourcery.com>
Cesar Philippidis <cesar@codesourcery.com>
* omp-general.c (oacc_build_routine_dims): Move some of its
processing into...
(oacc_verify_routine_clauses): ... this new function.
* omp-general.h (oacc_verify_routine_clauses): New prototype.
2018-10-02 Thomas Schwinge <thomas@codesourcery.com>
Cesar Philippidis <cesar@codesourcery.com>
* tree-core.h (omp_clause_code): Add OMP_CLAUSE_NOHOST.
* tree.c (omp_clause_num_ops, omp_clause_code_name, walk_tree_1):
Update for these.
* tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE_NOHOST.
* gimplify.c (gimplify_scan_omp_clauses)
(gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_NOHOST.
* tree-nested.c (convert_nonlocal_omp_clauses)
(convert_local_omp_clauses): Likewise.
* omp-low.c (scan_sharing_clauses): Likewise.
* omp-offload.c (maybe_discard_oacc_function): New function.
(execute_oacc_device_lower) [!ACCEL_COMPILER]: Handle OpenACC
nohost clauses.
2019-02-05 Julian Brown <julian@codesourcery.com>
* omp-low.c (scan_sharing_clauses): Disallow dynamic (multidimensional)
arrays within structs.
2018-10-16 Chung-Lin Tang <cltang@codesourcery.com>
* tree-pretty-print.c (dump_omp_clauses): Add cases for printing
GOMP_MAP_DYNAMIC_ARRAY map kinds.
2018-10-16 Chung-Lin Tang <cltang@codesourcery.com>
* omp-low.c (dynamic_array_lookup): New function.
(dynamic_array_reference_start): Likewise.
(scan_for_op): Likewise.
(scan_for_reference): Likewise.
(da_create_bias): Likewise.
(da_dimension_peel): Likewise.
(lower_omp_1): Add case to look for start of dynamic array reference,
and handle bias adjustments for the code sequence.
2018-10-16 Chung-Lin Tang <cltang@codesourcery.com>
* omp-low.c (struct omp_context):
Add 'hash_map<tree_operand_hash, tree> *dynamic_arrays' field, also
added include of "tree-hash-traits.h".
(append_field_to_record_type): New function.
(create_dynamic_array_descr_type): Likewise.
(create_dynamic_array_descr_init_code): Likewise.
(new_omp_context): Add initialize of dynamic_arrays field.
(delete_omp_context): Add delete of dynamic_arrays field.
(scan_sharing_clauses): For dynamic array map kinds, check for
supported dimension structure, and install dynamic array variable into
current omp_context.
(lower_omp_target): Add handling for dynamic array map kinds.
2018-10-16 Chung-Lin Tang <cltang@codesourcery.com>
* gimplify.c (gimplify_scan_omp_clauses): For dynamic array map kinds,
make sure bias in each dimension are put into firstprivate variables.
2019-01-31 Julian Brown <julian@codesourcery.com>
* gimplify.c (gimplify_scan_omp_clauses): Handle array sections on
dereferenced struct members.
2018-12-14 Julian Brown <julian@codesourcery.com>
* gimplify.c (gimplify_omp_var_data): Add GOVD_MAP_HAS_ATTACHMENTS.
(insert_struct_component_mapping): Support derived-type member mappings
for arrays with descriptors which use GOMP_MAP_TO_PSET.
(gimplify_scan_omp_clauses): Rewrite GOMP_MAP_ALWAYS_POINTER to
GOMP_MAP_ATTACH for OpenACC struct/derived-type component pointers.
Handle pointer mappings that use GOMP_MAP_TO_PSET. Handle attach/detach
clauses.
(gimplify_adjust_omp_clauses_1): Skip adjustments for explicit
attach/detach clauses.
(gimplify_omp_target_update): Handle finalize for detach.
* omp-low.c (lower_omp_target): Support GOMP_MAP_ATTACH,
GOMP_MAP_DETACH, GOMP_MAP_FORCE_DETACH.
* tree-pretty-print.c (dump_omp_clause): Likewise.
2018-11-10 Julian Brown <julian@codesourcery.com>
* gimplify.c (insert_struct_comp_map, check_base_and_compare_lt): New.
(gimplify_scan_omp_clauses): Outline duplicated code into calls to
above two functions.
2015-08-20 Thomas Schwinge <thomas@codesourcery.com>
Joseph Myers <joseph@codesourcery.com>
PR libgomp/81886
* doc/invoke.texi (-ffixed-@var{reg}): Document conflict with
Fortran options.
* gcc.c (add_omp_infile_spec_func, spec_lang_mask_accept): New.
(driver_self_specs): Add spec to use %:add-omp-infile().
(static_spec_functions): Add add-omp-infile.
(struct switchstr): Add lang_mask field. Expand comment.
(struct infile): Add lang_mask field.
(add_infile, save_switch, do_spec): Add lang_mask argument.
(driver_unknown_option_callback, driver_wrong_lang_callback)
(driver_handle_option, process_command, do_self_spec)
(driver::do_spec_on_infiles, driver::maybe_run_linker): All
callers changed.
(give_switch): Check languages of switch against
spec_lang_mask_accept.
(driver::maybe_putenv_OFFLOAD_TARGETS): Don't free
offload_targets.
* gcc.h (do_spec): Update prototype.