GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "target.h"
#include "tree.h"
#include "gimple.h"
#include "tree-pass.h"
#include "ssa.h"
#include "cgraph.h"
#include "pretty-print.h"
#include "diagnostic-core.h"
#include "fold-const.h"
#include "stor-layout.h"
#include "internal-fn.h"
#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "gimplify.h"
#include "gimplify-me.h"
#include "gimple-walk.h"
#include "tree-iterator.h"
#include "tree-inline.h"
#include "langhooks.h"
#include "tree-dfa.h"
#include "tree-ssa.h"
#include "splay-tree.h"
#include "omp-general.h"
#include "omp-low.h"
#include "gimple-low.h"
#include "alloc-pool.h"
#include "symbol-summary.h"
#include "tree-nested.h"
#include "context.h"
#include "gomp-constants.h"
#include "gimple-pretty-print.h"
#include "stringpool.h"
#include "attribs.h"
#include "omp-offload.h"
#include "gt-omp-low.h"
Data Structures | |
struct | omp_context |
class | omplow_simd_context |
struct | omp_taskcopy_context |
struct | lower_omp_regimplify_operands_data |
Macros | |
#define | WALK_SUBSTMTS |
Variables | |
static splay_tree | all_contexts |
static int | taskreg_nesting_level |
static int | target_nesting_level |
static bitmap | make_addressable_vars |
static bitmap | global_nonaddressable_vars |
static vec< omp_context * > | taskreg_contexts |
static vec< gomp_task * > | task_cpyfns |
static hash_map< tree, tree > * | critical_name_mutexes |
static splay_tree | all_labels |
#define WALK_SUBSTMTS |
Referenced by check_combined_parallel(), diagnose_sb_1(), diagnose_sb_2(), omp_find_combined_for(), and omp_find_scan().
|
static |
Add _LOOPTEMP_/_REDUCTEMP_ clauses on OpenMP parallel or task.
References as_a(), build_omp_clause(), build_pointer_type(), omp_context::cb, omp_for_data::collapse, count, create_tmp_var, omp_for_data::first_nonrect, omp_for_data::for_stmt, GF_OMP_FOR_KIND_FOR, GF_OMP_FOR_KIND_TASKLOOP, gimple_omp_body(), gimple_omp_for_clauses(), gimple_omp_for_index(), gimple_omp_parallel_clauses(), gimple_omp_task_clauses(), gimple_omp_task_set_clauses(), gimple_omp_taskreg_clauses(), gimple_omp_taskreg_set_clauses(), i, insert_decl_map(), omp_for_data::iter_type, omp_for_data::last_nonrect, omp_for_data::loop, omp_for_data_loop::n2, omp_for_data::non_rect, NULL, OMP_CLAUSE__LOOPTEMP_, OMP_CLAUSE__REDUCTEMP_, OMP_CLAUSE_CHAIN, OMP_CLAUSE_DECL, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_REDUCTION, omp_extract_for_data(), omp_find_clause(), omp_find_combined_for(), pointer_sized_int_node, walk_stmt_info::stmt, TREE_CODE, TREE_TYPE, TYPE_UNSIGNED, UNKNOWN_LOCATION, and walk_gimple_seq().
Referenced by scan_omp_parallel(), and scan_omp_task().
|
static |
Build tree nodes to access VAR in the scope outer to CTX. In the case of a parallel, this is a component reference; for workshare constructs this is some variable.
References build_outer_var_ref(), build_receiver_ref(), build_simple_mem_ref, DECL_UID, DECL_VALUE_EXPR, omp_context::field_map, gcc_assert, gcc_unreachable, GF_OMP_FOR_KIND_SIMD, gimple_omp_for_kind(), is_global_var(), is_taskloop_ctx(), is_taskreg_ctx(), is_variable_sized(), lookup_decl(), omp_context::loop_p, maybe_lookup_decl(), maybe_lookup_decl_in_outer_ctx(), maybe_lookup_field(), NULL, NULL_TREE, omp_build_component_ref(), OMP_CLAUSE_ALLOCATE, OMP_CLAUSE_ERROR, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_PRIVATE, omp_member_access_dummy_var(), omp_privatize_by_reference(), omp_context::outer, omp_context::receiver_decl, omp_context::stmt, TREE_OPERAND, unshare_and_remap(), unshare_expr(), use_pointer_for_field(), and splay_tree_node< T >::value().
Referenced by build_outer_var_ref(), lower_lastprivate_clauses(), lower_oacc_head_mark(), lower_omp_for_scan(), lower_omp_scan(), lower_private_allocate(), lower_rec_input_clauses(), and lower_reduction_clauses().
|
static |
Build tree nodes to access the field for VAR on the receiver side.
References build_simple_mem_ref, lookup_field(), maybe_lookup_field(), NULL, omp_build_component_ref(), omp_context::receiver_decl, and TREE_THIS_NOTRAP.
Referenced by build_outer_var_ref(), lower_copyprivate_clauses(), lower_oacc_reductions(), lower_omp_target(), and lower_rec_input_clauses().
|
static |
Build tree nodes to access the field for VAR on the sender side.
References build_fold_indirect_ref, lookup_sfield(), omp_build_component_ref(), POINTER_TYPE_P, omp_context::sender_decl, and TREE_TYPE.
Referenced by build_sender_ref(), lower_copyprivate_clauses(), lower_omp_target(), lower_send_clauses(), and lower_send_shared_vars().
|
static |
References build_sender_ref().
|
static |
Callback for walk_stmts. Check if the current statement only contains GIMPLE_OMP_FOR or GIMPLE_OMP_SECTIONS.
References gsi_stmt(), NULL, and WALK_SUBSTMTS.
Referenced by lower_omp_taskreg().
|
static |
Check the parallelism clauses inside a OpenACC 'kernels' region. (This doesn't include OpenACC 'kernels' decomposed parts.) Until kernels handling moves to use the same loop indirection scheme as parallel, we need to do this checking early.
References as_a(), check_oacc_kernel_gwv(), error_at(), gimple_location(), gimple_omp_for_clauses(), NULL, OMP_CLAUSE_AUTO, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_GANG, OMP_CLAUSE_SEQ, OMP_CLAUSE_VECTOR, OMP_CLAUSE_WORKER, omp_context::outer, and omp_context::stmt.
Referenced by check_oacc_kernel_gwv(), and scan_omp_for().
|
static |
Check nesting restrictions.
References as_a(), omp_context::cancellable, cfun, current_function_decl, DECL_FUNCTION_CODE(), dyn_cast(), error_at(), gcc_assert, gcc_unreachable, GF_OMP_FOR_KIND_DISTRIBUTE, GF_OMP_FOR_KIND_FOR, GF_OMP_FOR_KIND_OACC_LOOP, GF_OMP_FOR_KIND_SIMD, GF_OMP_FOR_KIND_TASKLOOP, GF_OMP_TARGET_KIND_DATA, GF_OMP_TARGET_KIND_ENTER_DATA, GF_OMP_TARGET_KIND_EXIT_DATA, GF_OMP_TARGET_KIND_OACC_DATA, GF_OMP_TARGET_KIND_OACC_DATA_KERNELS, GF_OMP_TARGET_KIND_OACC_DECLARE, GF_OMP_TARGET_KIND_OACC_ENTER_DATA, GF_OMP_TARGET_KIND_OACC_EXIT_DATA, GF_OMP_TARGET_KIND_OACC_HOST_DATA, GF_OMP_TARGET_KIND_OACC_KERNELS, GF_OMP_TARGET_KIND_OACC_PARALLEL, GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE, GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED, GF_OMP_TARGET_KIND_OACC_SERIAL, GF_OMP_TARGET_KIND_OACC_UPDATE, GF_OMP_TARGET_KIND_REGION, GF_OMP_TARGET_KIND_UPDATE, gimple_call_arg(), gimple_call_fndecl(), gimple_location(), gimple_omp_critical_name(), gimple_omp_for_clauses(), gimple_omp_for_combined_into_p(), gimple_omp_for_combined_p(), gimple_omp_for_kind(), gimple_omp_ordered_clauses(), gimple_omp_ordered_standalone_p(), gimple_omp_sections_clauses(), gimple_omp_target_clauses(), gimple_omp_target_kind(), gimple_omp_task_clauses(), gimple_omp_task_taskloop_p(), integer_zerop(), is_gimple_call(), is_gimple_omp(), is_gimple_omp_oacc(), is_gimple_omp_offloaded(), is_task_ctx(), is_taskloop_ctx(), lang_GNU_Fortran(), omp_context::loop_p, omp_context::nonteams_nested_p, NULL, NULL_TREE, oacc_get_fn_attrib(), OMP_CLAUSE_BIND, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_COLLAPSE, OMP_CLAUSE_COLLAPSE_EXPR, OMP_CLAUSE_DEPEND, OMP_CLAUSE_DEVICE, OMP_CLAUSE_DEVICE_ANCESTOR, OMP_CLAUSE_DOACROSS, OMP_CLAUSE_DOACROSS_DEPEND, OMP_CLAUSE_DOACROSS_KIND, OMP_CLAUSE_DOACROSS_SOURCE, OMP_CLAUSE_LOCATION, OMP_CLAUSE_NOGROUP, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_ORDERED, OMP_CLAUSE_ORDERED_DOACROSS, OMP_CLAUSE_ORDERED_EXPR, OMP_CLAUSE_SIMD, OMP_CLAUSE_THREADS, omp_find_clause(), omp_context::order_concurrent, omp_context::outer, omp_context::stmt, walk_stmt_info::stmt, omp_context::teams_nested_p, tree_fits_shwi_p(), tree_to_shwi(), and warning_at().
Referenced by scan_omp_1_stmt().
|
static |
Build a decl for the omp child function. It'll not contain a body yet, just the bare decl.
References a, BLOCK_SUPERCONTEXT, build_decl(), build_function_type_list(), omp_context::cb, cfun, copy_list(), copy_node(), create_omp_child_function_name(), current_function_decl, DECL_ARG_TYPE, DECL_ARGUMENTS, DECL_ARTIFICIAL, DECL_ATTRIBUTES, DECL_CHAIN, DECL_CONTEXT, DECL_EXTERNAL, DECL_FUNCTION_SPECIFIC_OPTIMIZATION, DECL_FUNCTION_SPECIFIC_TARGET, DECL_FUNCTION_VERSIONED, DECL_IGNORED_P, DECL_INITIAL, DECL_NAMELESS, DECL_RESULT, DECL_SOURCE_LOCATION, DECL_UNINLINABLE, copy_body_data::dst_fn, g, gcc_checking_assert, get_attribute_name(), cgraph_node::get_create(), get_identifier(), gimple_location(), gimple_omp_task_set_copy_fn(), init_tree_ssa(), is_attribute_p(), is_gimple_omp_oacc(), is_gimple_omp_offloaded(), lookup_attribute(), make_node(), NULL, NULL_TREE, symtab_node::offloadable, omp_maybe_offloaded_ctx(), pop_cfun(), ptr_type_node, push_struct_function(), omp_context::receiver_decl, remove_attribute(), omp_context::stmt, TREE_ADDRESSABLE, TREE_CHAIN, tree_cons(), TREE_PUBLIC, TREE_READONLY, TREE_STATIC, TREE_USED, and void_type_node.
Referenced by scan_omp_parallel(), scan_omp_target(), scan_omp_task(), and scan_omp_teams().
Create a new name for omp child function. Returns an identifier.
References clone_function_name_numbered(), and current_function_decl.
Referenced by create_omp_child_function().
|
static |
Create task copyfn.
References a, alloc_stmt_list(), omp_context::allocate_map, append_to_statement_list(), BIND_EXPR_BODY, build1(), build2(), build3(), build_call_expr_loc(), build_fold_addr_expr_loc(), build_int_cst(), build_pointer_type(), build_simple_mem_ref_loc(), builtin_decl_explicit(), omp_context::cb, omp_taskcopy_context::cb, CB_CGE_MOVE, function::cfg, copy_body_data::copy_decl, omp_taskcopy_context::ctx, DECL_ALIGN_UNIT, DECL_ARGUMENTS, DECL_CHAIN, DECL_CONTEXT, DECL_HAS_VALUE_EXPR_P, copy_body_data::decl_map, DECL_P, DECL_SAVED_TREE, DECL_SOURCE_LOCATION, DECL_STRUCT_FUNCTION, DECL_UID, DECL_VALUE_EXPR, lang_hooks::decls, df, copy_body_data::dst_fn, copy_body_data::dst_node, copy_body_data::eh_lp_nr, omp_context::field_map, fold_convert, gcc_assert, gcc_checking_assert, cgraph_node::get(), hash_map< KeyId, Value, Traits >::get(), gimple_location(), gimple_omp_task_clauses(), gimple_omp_task_copy_fn(), is_variable_sized(), MAX, NULL, omp_build_component_ref(), OMP_CLAUSE__LOOPTEMP_, OMP_CLAUSE__REDUCTEMP_, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, lang_hooks_for_decls::omp_clause_copy_ctor, OMP_CLAUSE_DECL, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_IN_REDUCTION, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_PRIVATE_OUTER_REF, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_SHARED, OMP_CLAUSE_SHARED_FIRSTPRIVATE, omp_privatize_by_reference(), pointer_sized_int_node, pop_cfun(), pop_gimplify_context(), push_cfun(), push_gimplify_context(), omp_context::record_type, record_type(), omp_context::sfield_map, size_type_node, copy_body_data::src_cfun, copy_body_data::src_fn, copy_body_data::src_node, omp_context::srecord_type, task_copyfn_copy_decl(), task_copyfn_remap_type(), task_cpyfns, copy_body_data::transform_call_graph_edges, TREE_CODE, TREE_OPERAND, TREE_PURPOSE, TREE_SIDE_EFFECTS, tree_to_uhwi(), TREE_TYPE, TREE_VALUE, TYPE_FIELDS, TYPE_SIZE_UNIT, use_pointer_for_field(), splay_tree_node< T >::value(), variably_modified_type_p(), and void_type_node.
Referenced by lower_omp_taskreg().
|
static |
Return whether CTX's parent compute construct is an OpenACC 'kernels' construct. (This doesn't include OpenACC 'kernels' decomposed parts.)
References GF_OMP_TARGET_KIND_OACC_KERNELS, gimple_omp_target_kind(), NULL, omp_context::outer, and omp_context::stmt.
Referenced by lower_omp_for().
|
static |
Destroy a omp_context data structures. Called through the splay tree value delete callback.
References omp_context::allocate_map, omp_context::cb, DECL_ABSTRACT_ORIGIN, DECL_CHAIN, copy_body_data::decl_map, omp_context::field_map, omp_context::lastprivate_conditional_map, NULL, omp_context::record_type, omp_context::sfield_map, omp_context::srecord_type, omp_context::task_reduction_map, omp_context::task_reductions, and TYPE_FIELDS.
|
static |
|
static |
Check for mismatched contexts and generate an error if needed. Return true if an error is detected.
References error(), gcc_checking_assert, gimple_build_nop(), gsi_replace(), is_gimple_omp(), is_gimple_omp_oacc(), NULL, TREE_CHAIN, and TREE_VALUE.
Referenced by diagnose_sb_2().
|
static |
Pass 1: Create a minimal tree of structured blocks, and record where each label is found.
References all_labels, as_a(), diagnose_sb_1(), gimple_label_label(), gimple_omp_body(), gimple_omp_for_pre_body(), gsi_stmt(), NULL, NULL_TREE, walk_gimple_seq(), and WALK_SUBSTMTS.
Referenced by diagnose_omp_structured_block_errors(), and diagnose_sb_1().
|
static |
Pass 2: Check each branch and see if its context differs from that of the destination label's context.
References all_labels, as_a(), CASE_LABEL, diagnose_sb_0(), diagnose_sb_2(), gimple_cond_false_label(), gimple_cond_true_label(), gimple_goto_dest(), gimple_omp_body_ptr(), gimple_omp_for_pre_body_ptr(), gimple_switch_label(), gimple_switch_num_labels(), gsi_stmt(), i, NULL, NULL_TREE, TREE_CODE, splay_tree_node< T >::value(), walk_gimple_seq_mod(), and WALK_SUBSTMTS.
Referenced by diagnose_omp_structured_block_errors(), and diagnose_sb_2().
|
static |
Find the enclosing offload context.
References omp_context::outer, and omp_context::stmt.
Referenced by lower_oacc_head_mark(), and scan_omp_for().
|
static |
Main entry point.
References all_contexts, BITMAP_FREE, current_function_decl, DECL_ARGUMENTS, DECL_ARTIFICIAL, DECL_INITIAL, delete_omp_context(), finalize_task_copyfn(), finish_taskreg_scan(), FOR_EACH_VEC_ELT, gcc_assert, gimple_body(), global_nonaddressable_vars, i, lower_omp(), make_addressable_vars, NULL, pop_gimplify_context(), push_gimplify_context(), remove_member_access_dummy_vars(), scan_omp(), task_cpyfns, taskreg_contexts, taskreg_nesting_level, TREE_CODE, and TREE_TYPE.
|
static |
Finalize task copyfn.
References cgraph_node::add_new_function(), cfun, DECL_STRUCT_FUNCTION, cgraph_node::get_create(), gimple_build_bind(), gimple_omp_task_copy_fn(), gimple_seq_add_stmt(), gimple_set_body(), gimplify_body(), maybe_catch_exception(), NULL, NULL_TREE, cgraph_node::parallelized_function, pop_cfun(), and push_cfun().
Referenced by execute_lower_omp().
Helper function for finish_taskreg_scan, called through walk_tree. If maybe_lookup_decl_in_outer_context returns non-NULL for some tree, replace it in the expression.
References DECL_HAS_VALUE_EXPR_P, DECL_VALUE_EXPR, IS_TYPE_OR_DECL_P, maybe_lookup_decl_in_outer_ctx(), NULL_TREE, unshare_expr(), and VAR_P.
Referenced by finish_taskreg_scan().
|
static |
If any decls have been made addressable during scan_omp, adjust their fields if needed, and layout record types of parallel/task constructs.
References bitmap_bit_p, build_int_cst(), build_pointer_type(), DECL_ALIGN, DECL_CHAIN, DECL_UID, DECL_USER_ALIGN, f1, f2, f3, finish_taskreg_remap(), fixup_child_record_type(), fold_convert_loc(), gcc_assert, gimple_location(), gimple_omp_parallel_clauses(), gimple_omp_task_clauses(), gimple_omp_task_set_arg_align(), gimple_omp_task_set_arg_size(), gimple_omp_task_taskloop_p(), gimple_omp_taskreg_clauses(), is_global_var(), layout_type(), long_integer_type_node, lookup_field(), lookup_sfield(), make_addressable_vars, maybe_lookup_decl_in_outer_ctx(), NULL, NULL_TREE, OMP_CLAUSE__LOOPTEMP_, OMP_CLAUSE__REDUCTEMP_, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_DETACH, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_SHARED, OMP_CLAUSE_SHARED_FIRSTPRIVATE, omp_find_clause(), omp_context::record_type, SET_DECL_ALIGN, SET_TYPE_ALIGN, omp_context::srecord_type, omp_context::stmt, TREE_CHAIN, TREE_CODE, TREE_CONSTANT, TREE_THIS_VOLATILE, TREE_TYPE, TYPE_ALIGN, TYPE_ALIGN_UNIT, TYPE_FIELDS, TYPE_SIZE_UNIT, unshare_expr(), use_pointer_for_field(), and walk_tree.
Referenced by execute_lower_omp().
|
static |
Fix up RECEIVER_DECL with a type that has been remapped to the child context.
References build_decl(), build_pointer_type(), build_qualified_type(), build_reference_type(), omp_context::cb, copy_node(), copy_tree_body_r(), DECL_CHAIN, DECL_CONTEXT, DECL_FIELD_OFFSET, DECL_NAME, DECL_SIZE, DECL_SIZE_UNIT, DECL_SOURCE_LOCATION, omp_context::field_map, flexible_array_type_p(), is_gimple_omp_offloaded(), layout_type(), lang_hooks_for_types::make_type, nreverse(), NULL, omp_context::receiver_decl, omp_context::record_type, remap_type(), copy_body_data::src_fn, omp_context::stmt, TREE_TYPE, TYPE_FIELDS, TYPE_NAME, TYPE_QUAL_CONST, TYPE_QUAL_RESTRICT, lang_hooks::types, variably_modified_type_p(), and walk_tree.
Referenced by finish_taskreg_scan(), and scan_omp_target().
|
static |
Adjust the replacement for DECL in CTX for the new context. This means copying the DECL_VALUE_EXPR, and fixing up the type.
References omp_context::cb, copy_tree_body_r(), DECL_HAS_VALUE_EXPR_P, DECL_SIZE, DECL_SIZE_UNIT, DECL_VALUE_EXPR, error_mark_node, lookup_decl(), NULL, remap_decl(), remap_type(), SET_DECL_VALUE_EXPR, TREE_CONSTANT, TREE_TYPE, TYPE_SIZE, TYPE_SIZE_UNIT, and walk_tree.
Referenced by scan_sharing_clauses().
|
static |
Helper function of lower_rec_input_clauses. For a reference in simd reduction, add an underlying variable it will reference.
References build_fold_addr_expr_loc(), create_tmp_var_raw(), get_name(), gimple_add_tmp_var(), gimplify_assign(), TREE_ADDRESSABLE, TREE_CONSTANT, TREE_TYPE, and TYPE_SIZE_UNIT.
Referenced by lower_rec_input_clauses().
|
static |
Add a new field for VAR inside the structure CTX->SENDER_DECL. If BASE_POINTERS_RESTRICT, declare the field with restrict.
References build_decl(), build_pointer_type(), build_qualified_type(), DECL_ABSTRACT_ORIGIN, DECL_ALIGN, DECL_NAME, DECL_SOURCE_LOCATION, DECL_UID, DECL_USER_ALIGN, lang_hooks::decls, omp_context::field_map, gcc_assert, gcc_checking_assert, insert_field_into_struct(), is_gimple_omp_oacc(), lang_hooks_for_types::make_type, NULL_TREE, lang_hooks_for_decls::omp_array_data, omp_privatize_by_reference(), POINTER_TYPE_P, omp_context::record_type, SET_DECL_ALIGN, omp_context::sfield_map, omp_context::srecord_type, omp_context::stmt, TREE_CHAIN, TREE_CODE, TREE_THIS_VOLATILE, TREE_TYPE, TYPE_ALIGN, TYPE_FIELDS, TYPE_QUAL_RESTRICT, TYPE_QUALS, TYPE_RESTRICT, and lang_hooks::types.
Referenced by scan_sharing_clauses().
|
static |
References omp_context::cb, insert_decl_map(), and omp_copy_decl_1().
Referenced by scan_sharing_clauses().
|
inlinestatic |
Return true if CTX is for a host omp teams.
References as_a(), gimple_omp_teams_host(), and omp_context::stmt.
Referenced by is_taskreg_ctx(), lower_rec_input_clauses(), and scan_sharing_clauses().
|
static |
Return whether CTX represents an OpenACC 'kernels' construct. (This doesn't include OpenACC 'kernels' decomposed parts.)
References GF_OMP_TARGET_KIND_OACC_KERNELS, gimple_omp_target_kind(), and omp_context::stmt.
Referenced by execute_oacc_loop_designation(), expand_oacc_for(), lower_oacc_head_mark(), lower_oacc_reductions(), lower_omp_target(), scan_omp_for(), and scan_sharing_clauses().
|
static |
Return whether CTX represents an OpenACC 'kernels' decomposed part.
References GF_OMP_TARGET_KIND_OACC_DATA_KERNELS, GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE, GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED, gimple_omp_target_kind(), and omp_context::stmt.
Referenced by lower_oacc_head_mark(), lower_oacc_reductions(), lower_omp_target(), scan_omp_for(), and scan_sharing_clauses().
|
static |
Return whether CTX represents an OpenACC 'parallel' or 'serial' construct. (This doesn't include OpenACC 'kernels' decomposed parts.)
References GF_OMP_TARGET_KIND_OACC_PARALLEL, GF_OMP_TARGET_KIND_OACC_SERIAL, gimple_omp_target_kind(), and omp_context::stmt.
Referenced by lower_oacc_head_mark().
Return true if STMT corresponds to an OpenMP target region.
References GF_OMP_TARGET_KIND_DATA, GF_OMP_TARGET_KIND_ENTER_DATA, GF_OMP_TARGET_KIND_EXIT_DATA, GF_OMP_TARGET_KIND_REGION, gimple_omp_target_kind(), and omp_context::stmt.
Referenced by lower_omp_target(), lower_rec_input_clauses(), and scan_sharing_clauses().
|
inlinestatic |
Return true if CTX is for an omp parallel.
References omp_context::stmt.
Referenced by is_taskreg_ctx(), lower_lastprivate_clauses(), lower_omp_for_lastprivate(), lower_omp_taskreg(), lower_rec_input_clauses(), lower_send_shared_vars(), and scan_sharing_clauses().
|
inlinestatic |
Return true if CTX is for an omp task.
References omp_context::stmt.
Referenced by check_omp_nesting_restrictions(), is_taskreg_ctx(), lower_lastprivate_clauses(), lower_omp_taskreg(), lower_rec_input_clauses(), lower_send_clauses(), scan_sharing_clauses(), and use_pointer_for_field().
|
inlinestatic |
Return true if CTX is for an omp taskloop.
References GF_OMP_FOR_KIND_TASKLOOP, gimple_omp_for_kind(), and omp_context::stmt.
Referenced by build_outer_var_ref(), check_omp_nesting_restrictions(), lower_lastprivate_clauses(), and lower_rec_input_clauses().
|
inlinestatic |
Return true if CTX is for an omp parallel or omp task or host omp teams (the last one is strictly not a task region in OpenMP speak, but we need to treat it similarly).
References is_host_teams_ctx(), is_parallel_ctx(), and is_task_ctx().
Referenced by build_outer_var_ref(), lower_omp_for_lastprivate(), lower_rec_input_clauses(), omp_copy_decl(), scan_sharing_clauses(), and use_pointer_for_field().
|
inlinestatic |
Return true if EXPR is variable sized.
References TREE_CONSTANT, TREE_TYPE, and TYPE_SIZE_UNIT.
Referenced by build_outer_var_ref(), create_task_copyfn(), lower_omp_target(), lower_omp_task_reductions(), lower_rec_input_clauses(), lower_reduction_clauses(), lower_send_clauses(), and scan_sharing_clauses().
|
inlinestatic |
Lookup variables. The "maybe" form allows for the variable form to not have been entered, otherwise we assert that the variable must have been entered.
References omp_context::cb, copy_body_data::decl_map, and hash_map< KeyId, Value, Traits >::get().
Referenced by build_outer_var_ref(), fixup_remapped_decl(), lower_lastprivate_clauses(), lower_lastprivate_conditional_clauses(), lower_oacc_reductions(), lower_omp_for(), lower_omp_for_lastprivate(), lower_omp_for_scan(), lower_omp_scan(), lower_omp_target(), lower_rec_input_clauses(), lower_reduction_clauses(), oacc_privatization_scan_clause_chain(), oacc_privatization_scan_decl_chain(), and scan_sharing_clauses().
|
static |
Find the mapping for DECL in CTX or the immediately enclosing context that has a mapping for DECL. If CTX is a nested parallel directive, we may have to use the decl mappings created in CTX's parent context. Suppose that we have the following parallel nesting (variable UIDs showed for clarity): iD.1562 = 0; #omp parallel shared(iD.1562) -> outer parallel iD.1562 = iD.1562 + 1; #omp parallel shared (iD.1562) -> inner parallel iD.1562 = iD.1562 - 1; Each parallel structure will create a distinct .omp_data_s structure for copying iD.1562 in/out of the directive: outer parallel .omp_data_s.1.i -> iD.1562 inner parallel .omp_data_s.2.i -> iD.1562 A shared variable mapping will produce a copy-out operation before the parallel directive and a copy-in operation after it. So, in this case we would have: iD.1562 = 0; .omp_data_o.1.i = iD.1562; #omp parallel shared(iD.1562) -> outer parallel .omp_data_i.1 = &.omp_data_o.1 .omp_data_i.1->i = .omp_data_i.1->i + 1; .omp_data_o.2.i = iD.1562; -> ** #omp parallel shared(iD.1562) -> inner parallel .omp_data_i.2 = &.omp_data_o.2 .omp_data_i.2->i = .omp_data_i.2->i - 1; ** This is a problem. The symbol iD.1562 cannot be referenced inside the body of the outer parallel region. But since we are emitting this copy operation while expanding the inner parallel directive, we need to access the CTX structure of the outer parallel directive to get the correct mapping: .omp_data_o.2.i = .omp_data_i.1->i Since there may be other workshare or parallel directives enclosing the parallel directive, it may be necessary to walk up the context parent chain. This is not a problem in general because nested parallelism happens only rarely.
References gcc_assert, is_global_var(), omp_context::is_nested, maybe_lookup_decl(), NULL, and omp_context::outer.
Referenced by lower_copyprivate_clauses(), lower_lastprivate_conditional_clauses(), lower_omp_target(), lower_send_clauses(), and lower_send_shared_vars().
|
inlinestatic |
References omp_context::field_map, and splay_tree_node< T >::value().
Referenced by build_receiver_ref(), and finish_taskreg_scan().
|
inlinestatic |
References omp_context::field_map, omp_context::sfield_map, and splay_tree_node< T >::value().
Referenced by build_sender_ref(), finish_taskreg_scan(), lookup_sfield(), and lower_send_clauses().
|
inlinestatic |
References lookup_sfield().
|
static |
Generate code to implement the COPYPRIVATE clauses.
References build_fold_addr_expr_loc(), build_fold_indirect_ref_loc(), build_pointer_type(), build_receiver_ref(), build_sender_ref(), build_simple_mem_ref_loc(), lang_hooks::decls, fold_convert_loc(), gimplify_and_add(), gimplify_assign(), lookup_decl_in_outer_ctx(), NULL, lang_hooks_for_decls::omp_clause_assign_op, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_DECL, OMP_CLAUSE_LOCATION, omp_privatize_by_reference(), TREE_TYPE, and use_pointer_for_field().
Referenced by lower_omp_single_copy().
|
static |
References build4(), build_array_type_nelts(), build_clobber(), build_fold_addr_expr, build_int_cst(), build_omp_clause(), create_tmp_var, fb_rvalue, fold_convert, g, gcc_assert, gcc_unreachable, gimple_build_assign(), gimple_seq_add_stmt(), gimplify_expr(), i, is_gimple_val(), NULL, NULL_TREE, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_DEPEND, OMP_CLAUSE_DEPEND_DEPOBJ, OMP_CLAUSE_DEPEND_IN, OMP_CLAUSE_DEPEND_INOUT, OMP_CLAUSE_DEPEND_INOUTSET, OMP_CLAUSE_DEPEND_KIND, OMP_CLAUSE_DEPEND_LAST, OMP_CLAUSE_DEPEND_MUTEXINOUTSET, OMP_CLAUSE_DEPEND_OUT, omp_find_clause(), ptr_type_node, r, size_int, TREE_ADDRESSABLE, and UNKNOWN_LOCATION.
Referenced by lower_omp_target(), and lower_omp_taskreg().
|
static |
Generate code to implement the LASTPRIVATE clauses. This is used for both parallel and workshare constructs. PREDICATE may be NULL if it's always true. BODY_P is the sequence to insert early initialization if needed, STMT_LIST is where the non-conditional lastprivate handling goes into and CSTMT_LIST is a sequence that needs to be run in a critical section.
References boolean_false_node, boolean_type_node, build2(), build4(), build_call_expr_internal_loc(), build_int_cst(), build_outer_var_ref(), build_simple_mem_ref_loc(), build_zero_cst(), omp_context::combined_into_simd_safelen1, copy_node(), create_artificial_label(), create_tmp_var, DECL_ATTRIBUTES, DECL_HAS_VALUE_EXPR_P, DECL_VALUE_EXPR, lang_hooks::decls, fb_rvalue, fold_convert, force_gimple_operand(), g, gcc_assert, gcc_checking_assert, hash_map< KeyId, Value, Traits >::get(), GF_OMP_FOR_KIND_SIMD, gimple_build_call_internal(), gimple_build_cond(), gimple_build_label(), gimple_call_set_lhs(), gimple_omp_for_kind(), gimple_omp_parallel_clauses(), gimple_seq_add_seq(), gimple_seq_add_stmt(), gimplify_and_add(), gimplify_assign(), gimplify_expr(), integer_type_node, integer_zero_node, is_gimple_val(), is_global_var(), is_parallel_ctx(), is_task_ctx(), is_taskloop_ctx(), omp_context::lastprivate_conditional_map, lookup_attribute(), lookup_decl(), lower_omp(), maybe_lookup_decl_in_outer_ctx(), NULL, NULL_TREE, OMP_CLAUSE__CONDTEMP_, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE__SIMDUID__DECL, OMP_CLAUSE__SIMT_, lang_hooks_for_decls::omp_clause_assign_op, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_LASTPRIVATE_CONDITIONAL, OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ, OMP_CLAUSE_LASTPRIVATE_LOOP_IV, OMP_CLAUSE_LINEAR, OMP_CLAUSE_LINEAR_GIMPLE_SEQ, OMP_CLAUSE_LINEAR_NO_COPYIN, OMP_CLAUSE_LINEAR_NO_COPYOUT, OMP_CLAUSE_LOCATION, omp_find_clause(), omp_privatize_by_reference(), omp_context::outer, POINTER_TYPE_P, size_int, omp_context::stmt, suppress_warning(), tcc_comparison, TREE_CODE, TREE_CODE_CLASS, TREE_OPERAND, TREE_THIS_NOTRAP, tree_to_uhwi(), TREE_TYPE, TYPE_SIZE_UNIT, UNKNOWN_LOCATION, unshare_expr(), unsigned_type_node, and VAR_P.
Referenced by lower_omp_for_lastprivate(), and lower_omp_sections().
|
static |
Create temporary variables for lastprivate(conditional:) implementation in context CTX with CLAUSES.
References as_a(), omp_context::block_vars, build_omp_clause(), build_pointer_type(), create_tmp_var_raw(), current_function_decl, DECL_CHAIN, DECL_CONTEXT, DECL_SEEN_IN_BIND_EXPR_P, gcc_assert, GF_OMP_FOR_KIND_SIMD, gimple_omp_for_kind(), omp_for_data::iter_type, omp_context::lastprivate_conditional_map, lookup_decl(), lookup_decl_in_outer_ctx(), NULL, NULL_TREE, OMP_CLAUSE__CONDTEMP_, OMP_CLAUSE__CONDTEMP__ITER, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_LASTPRIVATE_CONDITIONAL, omp_extract_for_data(), omp_find_clause(), hash_map< KeyId, Value, Traits >::put(), omp_context::stmt, TREE_TYPE, UNKNOWN_LOCATION, unsigned_type_for(), and unsigned_type_node.
Referenced by lower_omp_for(), and lower_omp_sections().
|
static |
Emit an OpenACC head marker call, encapulating the partitioning and other information that must be processed by the target compiler. Return the maximum number of dimensions the associated loop might be partitioned over.
References build_int_cst(), build_outer_var_ref(), DECL_P, enclosing_target_ctx(), gcc_assert, gcc_unreachable, gimple_build_call_internal_vec(), gimple_seq_add_stmt(), gimple_set_lhs(), gimple_set_location(), integer_minus_onep(), integer_type_node, is_oacc_kernels(), is_oacc_kernels_decomposed_part(), is_oacc_parallel_or_serial(), NULL_TREE, OLF_AUTO, OLF_DIM_BASE, OLF_DIM_GANG, OLF_DIM_VECTOR, OLF_DIM_WORKER, OLF_GANG_STATIC, OLF_INDEPENDENT, OLF_REDUCTION, OLF_SEQ, OLF_TILE, OMP_CLAUSE_AUTO, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_GANG, OMP_CLAUSE_GANG_STATIC_EXPR, OMP_CLAUSE_INDEPENDENT, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_SEQ, OMP_CLAUSE_TILE, OMP_CLAUSE_VECTOR, and OMP_CLAUSE_WORKER.
Referenced by lower_oacc_head_tail().
|
static |
Generate the before and after OpenACC loop sequences. CLAUSES are the loop clauses, from which we extract reductions. Initialize HEAD and TAIL.
References build_int_cst(), count, create_tmp_var, gcc_assert, gimple_build_assign(), gimple_build_call_internal(), gimple_call_set_arg(), gimple_call_set_lhs(), gimple_seq_add_seq(), gimple_seq_add_stmt(), gimple_set_lhs(), gimple_set_location(), integer_type_node, integer_zero_node, lower_oacc_head_mark(), lower_oacc_loop_marker(), lower_oacc_reductions(), NULL, NULL_TREE, and unsigned_type_node.
Referenced by lower_omp_for().
|
static |
Emit an OpenACC lopp head or tail marker to SEQ. LEVEL is the partitioning level of the enclosed region.
References build_int_cst(), gimple_build_call_internal(), gimple_seq_add_stmt(), gimple_set_lhs(), gimple_set_location(), integer_type_node, and NULL_TREE.
Referenced by lower_oacc_head_tail().
|
static |
Build an internal UNIQUE function with type IFN_UNIQUE_OACC_PRIVATE listing the addresses of variables to be made private at the surrounding parallelism level. Such functions appear in the gimple code stream in two forms, e.g. for a partitioned loop: .data_dep.6 = .UNIQUE (OACC_HEAD_MARK, .data_dep.6, 1, 68); .data_dep.6 = .UNIQUE (OACC_PRIVATE, .data_dep.6, -1, &w); .data_dep.6 = .UNIQUE (OACC_FORK, .data_dep.6, -1); .data_dep.6 = .UNIQUE (OACC_HEAD_MARK, .data_dep.6); or alternatively, OACC_PRIVATE can appear at the top level of a parallel, not as part of a HEAD_MARK sequence: .UNIQUE (OACC_PRIVATE, 0, 0, &w); For such stand-alone appearances, the 3rd argument is always 0, denoting gang partitioning.
References build_fold_addr_expr, build_int_cst(), FOR_EACH_VEC_ELT, gcc_checking_assert, gimple_build_call_internal_vec(), i, integer_minus_one_node, integer_type_node, integer_zero_node, NULL, omp_context::oacc_privatization_candidates, and TREE_ADDRESSABLE.
Referenced by lower_omp_for(), and lower_omp_target().
|
static |
Lower the OpenACC reductions of CLAUSES for compute axis LEVEL (which might be a placeholder). INNER is true if this is an inner axis of a multi-axis loop. FORK and JOIN are (optional) fork and join markers. Generate the before-loop forking sequence in FORK_SEQ and the after-loop joining sequence to JOIN_SEQ. The general form of these sequences is GOACC_REDUCTION_SETUP GOACC_FORK GOACC_REDUCTION_INIT ... GOACC_REDUCTION_FINI GOACC_JOIN GOACC_REDUCTION_TEARDOWN.
References as_a(), build_call_expr_internal_loc(), build_fold_addr_expr, build_int_cst(), build_receiver_ref(), build_simple_mem_ref, create_tmp_var, DECL_NAME, gcc_checking_assert, GET_MODE_ALIGNMENT, GET_MODE_SIZE(), gimple_omp_for_clauses(), gimple_omp_target_clauses(), gimple_seq_add_seq(), gimple_seq_add_stmt(), gimplify_assign(), IDENTIFIER_POINTER, integer_type_node, integer_zero_node, is_gimple_omp_offloaded(), is_oacc_kernels(), is_oacc_kernels_decomposed_part(), lookup_decl(), maybe_lookup_decl(), maybe_lookup_field(), NULL, NULL_TREE, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_REDUCTION_CODE, omp_privatize_by_reference(), omp_reduction_init_op(), omp_context::outer, POINTER_TYPE_P, sizetype, omp_context::stmt, TREE_CONSTANT, TREE_TYPE, TYPE_MODE, unshare_expr(), and unsigned_type_node.
Referenced by lower_oacc_head_tail(), and lower_omp_target().
|
static |
References fold_stmt(), walk_stmt_info::gsi, gsi_end_p(), gsi_next(), gsi_start(), input_location, lower_omp_1(), target_nesting_level, and taskreg_nesting_level.
Referenced by execute_lower_omp(), lower_lastprivate_clauses(), lower_omp_1(), lower_omp_critical(), lower_omp_dispatch(), lower_omp_for(), lower_omp_for_scan(), lower_omp_master(), lower_omp_ordered(), lower_omp_scan(), lower_omp_scope(), lower_omp_sections(), lower_omp_single(), lower_omp_target(), lower_omp_task_reductions(), lower_omp_taskgroup(), lower_omp_taskreg(), lower_omp_teams(), lower_rec_input_clauses(), and lower_reduction_clauses().
|
static |
References as_a(), boolean_false_node, BUILT_IN_NORMAL, builtin_decl_explicit(), omp_context::cancel_label, omp_context::cancellable, create_artificial_label(), create_tmp_var, DECL_FUNCTION_CODE(), DECL_P, fndecl_built_in_p(), fold_convert, g, gcc_assert, get_base_address(), GF_OMP_TARGET_KIND_DATA, gimple_assign_lhs(), gimple_assume_body_ptr(), gimple_bind_body_ptr(), gimple_bind_vars(), gimple_build_assign(), gimple_build_cond(), gimple_build_label(), gimple_build_nop(), gimple_call_fndecl(), gimple_call_lhs(), gimple_call_set_fndecl(), gimple_call_set_fntype(), gimple_call_set_lhs(), gimple_catch_handler_ptr(), gimple_clobber_p(), gimple_cond_lhs_ptr(), gimple_cond_rhs_ptr(), gimple_eh_filter_failure_ptr(), gimple_has_location(), gimple_location(), gimple_omp_atomic_load_rhs_ptr(), gimple_omp_body(), gimple_omp_body_ptr(), gimple_omp_for_clauses(), gimple_omp_sections_clauses(), gimple_omp_target_kind(), gimple_omp_teams_host(), gimple_transaction_body_ptr(), gimple_try_cleanup_ptr(), gimple_try_eval_ptr(), gsi_insert_after(), gsi_replace(), gsi_replace_with_seq(), GSI_SAME_STMT, gsi_stmt(), input_location, is_gimple_omp(), is_gimple_omp_oacc(), lower_omp(), lower_omp_critical(), lower_omp_dispatch(), lower_omp_for(), lower_omp_master(), lower_omp_ordered(), lower_omp_regimplify_operands(), lower_omp_regimplify_p(), lower_omp_scan(), lower_omp_scope(), lower_omp_sections(), lower_omp_single(), lower_omp_target(), lower_omp_taskgroup(), lower_omp_taskreg(), lower_omp_teams(), make_addressable_vars, maybe_lookup_ctx(), maybe_remove_omp_member_access_dummy_vars(), NULL, NULL_TREE, oacc_privatization_scan_decl_chain(), OMP_CLAUSE__CONDTEMP_, OMP_CLAUSE__CONDTEMP__ITER, OMP_CLAUSE_CHAIN, OMP_CLAUSE_DECL, omp_find_clause(), omp_context::outer, seen_error(), omp_context::stmt, walk_stmt_info::stmt, TREE_CODE, TREE_OPERAND, TREE_TYPE, UNKNOWN_LOCATION, walk_gimple_op(), and walk_tree.
Referenced by lower_omp().
|
static |
References as_a(), BLOCK_VARS, build_call_expr_loc(), build_fold_addr_expr_loc(), builtin_decl_explicit(), hash_map< KeyId, Value, Traits >::create_ggc(), create_tmp_var_raw(), critical_name_mutexes, current_function_decl, DECL_ARTIFICIAL, DECL_COMMON, DECL_IGNORED_P, DECL_NAME, varpool_node::finalize_decl(), cgraph_node::get(), varpool_node::get_create(), get_identifier(), gimple_bind_add_seq(), gimple_bind_add_stmt(), gimple_bind_append_vars(), gimple_bind_body(), gimple_bind_set_body(), gimple_bind_vars(), gimple_build_bind(), gimple_build_omp_return(), gimple_location(), gimple_omp_body(), gimple_omp_body_ptr(), gimple_omp_critical_name(), gimple_omp_set_body(), gimplify_and_add(), gsi_replace(), gsi_stmt(), IDENTIFIER_POINTER, is_gimple_omp_offloaded(), lower_omp(), lower_omp_critical(), make_node(), maybe_catch_exception(), NULL, symtab_node::offloadable, omp_context::outer, pop_gimplify_context(), ptr_type_node, push_gimplify_context(), omp_context::stmt, TREE_PUBLIC, and TREE_STATIC.
Referenced by lower_omp_1(), and lower_omp_critical().
|
static |
Lower code for an OMP dispatch directive.
References BLOCK_VARS, omp_context::block_vars, gimple_bind_append_vars(), gimple_bind_set_body(), gimple_build_bind(), gimple_omp_body(), gimple_omp_body_ptr(), gsi_replace(), gsi_stmt(), lower_omp(), make_node(), maybe_catch_exception(), NULL, pop_gimplify_context(), and push_gimplify_context().
Referenced by lower_omp_1().
|
static |
Lower code for an OMP loop directive.
References as_a(), BLOCK_VARS, omp_context::block_vars, build_omp_clause(), build_pointer_type(), builtin_decl_explicit(), omp_context::cancel_label, omp_context::cancellable, omp_context::cb, omp_for_data::collapse, count, create_tmp_var, ctx_in_oacc_kernels_region(), DECL_P, omp_for_data::first_nonrect, g, gcc_assert, get_formal_tmp_var(), GF_OMP_FOR_KIND_FOR, GF_OMP_FOR_KIND_TASKLOOP, gimple_bind_append_vars(), gimple_bind_block(), gimple_bind_set_body(), gimple_bind_set_vars(), gimple_bind_vars(), gimple_build_assign(), gimple_build_bind(), gimple_build_call(), gimple_build_label(), gimple_build_omp_continue(), gimple_build_omp_return(), gimple_location(), gimple_omp_body(), gimple_omp_body_ptr(), gimple_omp_for_clauses(), gimple_omp_for_clauses_ptr(), gimple_omp_for_collapse(), gimple_omp_for_combined_into_p(), gimple_omp_for_final_ptr(), gimple_omp_for_incr(), gimple_omp_for_index(), gimple_omp_for_initial_ptr(), gimple_omp_for_kind(), gimple_omp_for_pre_body(), gimple_omp_for_pre_body_ptr(), gimple_omp_for_set_clauses(), gimple_omp_for_set_pre_body(), gimple_omp_set_body(), gimple_omp_taskreg_clauses(), gimple_seq_add_seq(), gimple_seq_add_stmt(), gimple_seq_empty_p(), gimple_seq_first_stmt(), gsi_replace(), gsi_stmt(), omp_for_data::have_nowait, i, insert_decl_map(), is_gimple_min_invariant(), is_gimple_omp_oacc(), omp_for_data::iter_type, omp_for_data::last_nonrect, lookup_decl(), omp_for_data::loop, lower_lastprivate_conditional_clauses(), lower_oacc_head_tail(), lower_oacc_private_marker(), lower_omp(), lower_omp_for_lastprivate(), lower_omp_for_scan(), lower_omp_task_reductions(), lower_rec_input_clauses(), lower_reduction_clauses(), make_node(), make_ssa_name(), maybe_add_implicit_barrier_cancel(), maybe_catch_exception(), maybe_lookup_decl_in_outer_ctx(), maybe_remove_omp_member_access_dummy_vars(), omp_for_data_loop::n2, omp_for_data::non_rect, NULL, NULL_TREE, oacc_privatization_scan_clause_chain(), oacc_privatization_scan_decl_chain(), OMP_CLAUSE__LOOPTEMP_, OMP_CLAUSE__REDUCTEMP_, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_LINEAR, OMP_CLAUSE_LINEAR_NO_COPYIN, OMP_CLAUSE_LINEAR_STEP, OMP_CLAUSE_REDUCTION, omp_extract_for_data(), omp_find_clause(), omp_task_reductions_find_first(), omp_context::outer, pointer_sized_int_node, pop_gimplify_context(), push_gimplify_context(), recompute_tree_invariant_for_addr_expr(), omp_context::scan_exclusive, omp_context::scan_inclusive, omp_context::simt_stmt, omp_context::stmt, TREE_CODE, TREE_OPERAND, TREE_TYPE, TREE_USED, TREE_VEC_ELT, TYPE_UNSIGNED, UNKNOWN_LOCATION, and omp_for_data_loop::v.
Referenced by lower_omp_1().
|
static |
A subroutine of lower_omp_for. Generate code to emit the predicate for a lastprivate clause. Given a loop control predicate of (V cond N2), we gate the clause on (!(V cond N2)). The lowered form is appended to *DLIST, iterator initialization is appended to *BODY_P. *CLIST is for lastprivate(conditional:) code that needs to be emitted in a critical section.
References as_a(), boolean_type_node, build2(), build_int_cst(), omp_for_data::collapse, omp_for_data_loop::cond_code, count, omp_for_data::first_nonrect, fold_convert, omp_for_data::for_stmt, gcc_assert, GF_OMP_FOR_KIND_DISTRIBUTE, GF_OMP_FOR_KIND_FOR, GF_OMP_FOR_KIND_TASKLOOP, gimple_omp_for_clauses(), gimple_omp_for_combined_into_p(), gimple_omp_for_index(), gimple_omp_for_kind(), gimple_omp_taskreg_clauses(), gimple_seq_add_seq(), gimple_seq_empty_p(), gimplify_assign(), i, integer_zerop(), is_parallel_ctx(), is_taskreg_ctx(), omp_for_data::last_nonrect, lookup_decl(), omp_for_data::loop, lower_lastprivate_clauses(), omp_for_data_loop::n1, omp_for_data_loop::n2, omp_for_data::non_rect, NULL, OMP_CLAUSE__LOOPTEMP_, OMP_CLAUSE_CHAIN, OMP_CLAUSE_DECL, omp_extract_for_data(), omp_find_clause(), omp_context::outer, omp_for_data_loop::step, omp_context::stmt, TREE_CODE, tree_fits_shwi_p(), tree_to_shwi(), TREE_TYPE, TYPE_UNSIGNED, unshare_expr(), and omp_for_data_loop::v.
Referenced by lower_omp_for().
|
static |
Helper function for lower_omp_for, add transformations for a worksharing loop with scan directives inside of it. For worksharing loop not combined with simd, transform: #pragma omp for reduction(inscan,+:r) private(i) for (i = 0; i < n; i = i + 1) { { update (r); } #pragma omp scan inclusive(r) { use (r); } } into two worksharing loops + code to merge results: num_threads = omp_get_num_threads (); thread_num = omp_get_thread_num (); if (thread_num == 0) goto <D.2099>; else goto <D.2100>; <D.2099>: var2 = r; goto <D.2101>; <D.2100>: // For UDRs this is UDR init, or if ctors are needed, copy from // var3 that has been constructed to contain the neutral element. var2 = 0; <D.2101>: ivar = 0; // The _scantemp_ clauses will arrange for rpriva to be initialized to // a shared array with num_threads elements and rprivb to a local array // number of elements equal to the number of (contiguous) iterations the // current thread will perform. controlb and controlp variables are // temporaries to handle deallocation of rprivb at the end of second // GOMP_FOR. #pragma omp for _scantemp_(rpriva) _scantemp_(rprivb) _scantemp_(controlb) \ _scantemp_(controlp) reduction(inscan,+:r) private(i) nowait for (i = 0; i < n; i = i + 1) { { // For UDRs this is UDR init or copy from var3. r = 0; // This is the input phase from user code. update (r); } { // For UDRs this is UDR merge. var2 = var2 + r; // Rather than handing it over to the user, save to local thread's // array. rprivb[ivar] = var2; // For exclusive scan, the above two statements are swapped. ivar = ivar + 1; } } // And remember the final value from this thread's into the shared // rpriva array. rpriva[(sizetype) thread_num] = var2; // If more than one thread, compute using Work-Efficient prefix sum // the inclusive parallel scan of the rpriva array. if (num_threads > 1) goto <D.2102>; else goto <D.2103>; <D.2102>: GOMP_barrier (); down = 0; k = 1; num_threadsu = (unsigned int) num_threads; thread_numup1 = (unsigned int) thread_num + 1; <D.2108>: twok = k << 1; if (twok > num_threadsu) goto <D.2110>; else goto <D.2111>; <D.2110>: down = 4294967295; k = k >> 1; if (k == num_threadsu) goto <D.2112>; else goto <D.2111>; <D.2112>: k = k >> 1; <D.2111>: twok = k << 1; cplx = .MUL_OVERFLOW (thread_nump1, twok); mul = REALPART_EXPR <cplx>; ovf = IMAGPART_EXPR <cplx>; if (ovf == 0) goto <D.2116>; else goto <D.2117>; <D.2116>: andv = k & down; andvm1 = andv + 4294967295; l = mul + andvm1; if (l < num_threadsu) goto <D.2120>; else goto <D.2117>; <D.2120>: // For UDRs this is UDR merge, performed using var2 variable as temporary, // i.e. var2 = rpriva[l - k]; UDR merge (var2, rpriva[l]); rpriva[l] = var2; rpriva[l] = rpriva[l - k] + rpriva[l]; <D.2117>: if (down == 0) goto <D.2121>; else goto <D.2122>; <D.2121>: k = k << 1; goto <D.2123>; <D.2122>: k = k >> 1; <D.2123>: GOMP_barrier (); if (k != 0) goto <D.2108>; else goto <D.2103>; <D.2103>: if (thread_num == 0) goto <D.2124>; else goto <D.2125>; <D.2124>: // For UDRs this is UDR init or copy from var3. var2 = 0; goto <D.2126>; <D.2125>: var2 = rpriva[thread_num - 1]; <D.2126>: ivar = 0; #pragma omp for _scantemp_(controlb) _scantemp_(controlp) \ reduction(inscan,+:r) private(i) for (i = 0; i < n; i = i + 1) { { // For UDRs, this is r = var2; UDR merge (r, rprivb[ivar]); r = var2 + rprivb[ivar]; } { // This is the scan phase from user code. use (r); // Plus a bump of the iterator. ivar = ivar + 1; } }
References as_a(), boolean_type_node, build1(), build2(), build_all_ones_cst(), build_complex_type(), build_fold_addr_expr_loc(), build_int_cst(), build_minus_one_cst(), build_omp_clause(), build_one_cst(), build_outer_var_ref(), build_pointer_type(), build_simple_mem_ref_loc(), build_zero_cst(), builtin_decl_explicit(), copy_gimple_seq_and_replace_locals(), create_artificial_label(), create_tmp_var, create_tmp_var_raw(), DECL_HAS_VALUE_EXPR_P, DECL_VALUE_EXPR, lang_hooks::decls, error_mark_node, fold_build2, fold_build2_loc(), fold_convert_loc(), g, gcc_assert, gimple_add_tmp_var(), gimple_build_assign(), gimple_build_call(), gimple_build_call_internal(), gimple_build_cond(), gimple_build_goto(), gimple_build_label(), gimple_build_omp_continue(), gimple_build_omp_return(), gimple_call_set_lhs(), gimple_copy(), gimple_omp_body(), gimple_omp_body_ptr(), gimple_omp_for_clauses(), gimple_omp_for_combined_p(), gimple_omp_for_set_clauses(), gimple_omp_set_body(), gimple_seq_add_seq(), gimple_seq_add_stmt(), gimplify_and_add(), gimplify_assign(), walk_stmt_info::gsi, gsi_end_p(), gsi_insert_seq_after(), gsi_next(), gsi_none(), gsi_remove(), GSI_SAME_STMT, gsi_stmt(), integer_minus_one_node, integer_one_node, integer_type_node, integer_zero_node, lookup_decl(), omp_for_data::loop, lower_omp(), maybe_lookup_ctx(), maybe_lookup_decl(), NULL, NULL_TREE, omp_build_barrier(), OMP_CLAUSE__SCANTEMP_, OMP_CLAUSE__SCANTEMP__ALLOC, OMP_CLAUSE__SCANTEMP__CONTROL, lang_hooks_for_decls::omp_clause_assign_op, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, lang_hooks_for_decls::omp_clause_default_ctor, lang_hooks_for_decls::omp_clause_dtor, OMP_CLAUSE_LOCATION, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_REDUCTION_CODE, OMP_CLAUSE_REDUCTION_GIMPLE_INIT, OMP_CLAUSE_REDUCTION_GIMPLE_MERGE, OMP_CLAUSE_REDUCTION_INSCAN, OMP_CLAUSE_REDUCTION_PLACEHOLDER, omp_find_scan(), omp_privatize_by_reference(), omp_reduction_init(), omp_context::outer, ptr_type_node, omp_context::scan_exclusive, omp_context::scan_inclusive, SET_DECL_VALUE_EXPR, size_one_node, size_zero_node, sizetype, walk_stmt_info::stmt, TREE_ADDRESSABLE, TREE_TYPE, TYPE_SIZE_UNIT, UNKNOWN_LOCATION, unshare_expr(), unsigned_type_node, omp_for_data_loop::v, walk_gimple_seq_mod(), and y.
Referenced by lower_omp_for().
|
static |
Expand code for an OpenMP master or masked directive.
References BLOCK_VARS, omp_context::block_vars, boolean_type_node, build2(), build3(), build_and_jump(), build_call_expr_loc(), builtin_decl_explicit(), fold_convert, gimple_bind_add_seq(), gimple_bind_add_stmt(), gimple_bind_append_vars(), gimple_build_bind(), gimple_build_label(), gimple_build_omp_return(), gimple_location(), gimple_omp_body(), gimple_omp_body_ptr(), gimple_omp_masked_clauses(), gimple_omp_set_body(), gimplify_and_add(), gsi_replace(), gsi_stmt(), integer_type_node, integer_zero_node, lower_omp(), make_node(), maybe_catch_exception(), NULL, OMP_CLAUSE_FILTER, OMP_CLAUSE_FILTER_EXPR, omp_find_clause(), pop_gimplify_context(), push_gimplify_context(), and void_type_node.
Referenced by lower_omp_1().
|
static |
Expand code for an OpenMP ordered directive.
References as_a(), BLOCK_VARS, omp_context::block_vars, boolean_type_node, build2(), build_int_cst(), builtin_decl_explicit(), cfun, create_artificial_label(), create_tmp_var, end(), fold_convert, g, gimple_bind_add_seq(), gimple_bind_add_stmt(), gimple_bind_append_vars(), gimple_bind_vars(), gimple_build_assign(), gimple_build_bind(), gimple_build_call(), gimple_build_call_internal(), gimple_build_cond(), gimple_build_label(), gimple_build_omp_return(), gimple_call_set_lhs(), gimple_omp_body(), gimple_omp_body_ptr(), gimple_omp_ordered_clauses(), gimple_omp_ordered_standalone_p(), gimple_omp_set_body(), gimplify_assign(), gsi_replace(), gsi_stmt(), integer_one_node, integer_type_node, integer_zero_node, lower_omp(), lower_omp_ordered_clauses(), make_node(), maybe_catch_exception(), NULL, NULL_TREE, OMP_CLAUSE_SIMD, OMP_CLAUSE_THREADS, omp_find_clause(), omp_max_simt_vf(), omp_maybe_offloaded_ctx(), pop_gimplify_context(), push_gimplify_context(), and UNKNOWN_LOCATION.
Referenced by lower_omp_1().
|
static |
Fold the OMP_ORDERED_CLAUSES for the OMP_ORDERED in STMT if possible.
References wi::abs(), as_a(), omp_for_data::collapse, omp_for_data_loop::cond_code, wi::eq_p(), error_at(), wide_int_storage::from(), gcc_assert, wi::gcd(), gimple_build_nop(), gimple_omp_for_collapse(), gimple_omp_ordered_clauses(), gimple_omp_ordered_clauses_ptr(), gsi_end_p(), gsi_next(), gsi_remove(), gsi_replace(), gsi_stmt(), wi::gts_p(), i, is_gimple_debug(), omp_for_data::loops, wi::multiple_of_p(), wi::neg_p(), NULL, NULL_TREE, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_DOACROSS, OMP_CLAUSE_DOACROSS_KIND, OMP_CLAUSE_DOACROSS_SINK, OMP_CLAUSE_LOCATION, omp_extract_for_data(), omp_for_data::ordered, omp_context::outer, POINTER_TYPE_P, sizetype, omp_for_data_loop::step, omp_context::stmt, wi::to_wide(), TREE_CHAIN, TREE_CODE, TREE_PURPOSE, TREE_TYPE, TREE_VALUE, TYPE_PRECISION, TYPE_SIGN, TYPE_UNSIGNED, UNSIGNED, warning_at(), and wide_int_to_tree().
Referenced by lower_omp_ordered().
|
static |
Wrapper around gimple_regimplify_operands that adjusts DECL_VALUE_EXPRs of omp_member_access_dummy_var vars during regimplification.
References lower_omp_regimplify_operands_data::ctx, decls, gimple_regimplify_operands(), lower_omp_regimplify_operands_p(), SET_DECL_VALUE_EXPR, and walk_gimple_op().
Referenced by lower_omp_1().
Helper function for lower_omp_regimplify_operands. Find omp_member_access_dummy_var vars and adjust temporarily their DECL_VALUE_EXPRs if needed.
References lower_omp_regimplify_operands_data::ctx, DECL_VALUE_EXPR, lower_omp_regimplify_operands_data::decls, IS_TYPE_OR_DECL_P, maybe_lookup_decl(), NULL_TREE, omp_member_access_dummy_var(), SET_DECL_VALUE_EXPR, and unshare_and_remap().
Referenced by lower_omp_regimplify_operands().
Callback for lower_omp_1. Return non-NULL if *tp needs to be regimplified. If DATA is non-NULL, lower_omp_1 is outside of OMP context, but with make_addressable_vars set.
References bitmap_bit_p, DECL_HAS_VALUE_EXPR_P, DECL_P, DECL_UID, IS_TYPE_OR_DECL_P, make_addressable_vars, NULL, NULL_TREE, recompute_tree_invariant_for_addr_expr(), TREE_CODE, and VAR_P.
Referenced by lower_omp_1().
|
static |
Expand code for an OpenMP scan directive and the structured block before the scan directive.
References as_a(), build2(), build4(), build_fold_addr_expr_loc(), build_int_cst(), build_outer_var_ref(), build_simple_mem_ref_loc(), copy_gimple_seq_and_replace_locals(), create_tmp_var, DECL_ATTRIBUTES, DECL_HAS_VALUE_EXPR_P, DECL_VALUE_EXPR, lang_hooks::decls, omp_context::for_simd_scan_phase, g, gcc_assert, GF_OMP_FOR_KIND_FOR, GF_OMP_FOR_KIND_SIMD, gimple_build_call_internal(), gimple_build_nop(), gimple_call_set_lhs(), gimple_omp_body(), gimple_omp_body_ptr(), gimple_omp_for_clauses(), gimple_omp_for_combined_into_p(), gimple_omp_for_combined_p(), gimple_omp_for_kind(), gimple_omp_scan_clauses(), gimple_seq_add_seq(), gimple_seq_add_stmt(), gimplify_and_add(), gimplify_assign(), gsi_insert_after(), gsi_insert_seq_after(), gsi_insert_seq_before(), gsi_next(), gsi_remove(), gsi_replace(), GSI_SAME_STMT, gsi_start(), gsi_stmt(), integer_type_node, lookup_attribute(), lookup_decl(), lower_omp(), lower_omp_scan(), maybe_lookup_ctx(), maybe_lookup_decl(), NULL, NULL_TREE, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE__SIMDUID__DECL, lang_hooks_for_decls::omp_clause_assign_op, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_LOCATION, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_REDUCTION_CODE, OMP_CLAUSE_REDUCTION_GIMPLE_INIT, OMP_CLAUSE_REDUCTION_GIMPLE_MERGE, OMP_CLAUSE_REDUCTION_INSCAN, OMP_CLAUSE_REDUCTION_PLACEHOLDER, omp_find_clause(), omp_privatize_by_reference(), omp_reduction_init(), omp_context::outer, omp_context::scan_exclusive, omp_context::scan_inclusive, SET_DECL_VALUE_EXPR, omp_context::stmt, TREE_ADDRESSABLE, TREE_CODE, TREE_OPERAND, TREE_THIS_NOTRAP, TREE_TYPE, unshare_expr(), unsigned_type_node, omp_for_data_loop::v, and VAR_P.
Referenced by lower_omp_1(), and lower_omp_scan().
|
static |
Lower code for an OMP scope directive.
References BLOCK_VARS, omp_context::block_vars, build_clobber(), build_omp_clause(), build_pointer_type(), builtin_decl_explicit(), create_tmp_var, g, gimple_bind_append_vars(), gimple_bind_set_body(), gimple_build_assign(), gimple_build_bind(), gimple_build_call(), gimple_build_omp_return(), gimple_omp_body(), gimple_omp_body_ptr(), gimple_omp_scope_clauses(), gimple_omp_scope_set_clauses(), gimple_omp_set_body(), gimple_seq_add_seq(), gimple_seq_add_stmt(), gsi_insert_after(), gsi_replace(), GSI_SAME_STMT, gsi_start(), gsi_stmt(), lower_omp(), lower_omp_task_reductions(), lower_rec_input_clauses(), lower_reduction_clauses(), make_node(), maybe_add_implicit_barrier_cancel(), maybe_catch_exception(), NULL, NULL_TREE, OMP_CLAUSE__REDUCTEMP_, OMP_CLAUSE_CHAIN, OMP_CLAUSE_DECL, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_REDUCTION, omp_find_clause(), omp_task_reductions_find_first(), pointer_sized_int_node, pop_gimplify_context(), push_gimplify_context(), omp_context::record_type, omp_context::sender_decl, TREE_USED, and UNKNOWN_LOCATION.
Referenced by lower_omp_1().
|
static |
Lower the OpenMP sections directive in the current statement in GSI_P. CTX is the enclosing OMP context for the current statement.
References as_a(), BLOCK_VARS, omp_context::block_vars, build_omp_clause(), build_pointer_type(), builtin_decl_explicit(), omp_context::cancel_label, omp_context::cancellable, create_tmp_var, g, gcc_assert, gimple_bind_append_vars(), gimple_bind_set_body(), gimple_bind_vars(), gimple_build_assign(), gimple_build_bind(), gimple_build_call(), gimple_build_label(), gimple_build_omp_continue(), gimple_build_omp_return(), gimple_build_omp_sections_switch(), gimple_omp_body(), gimple_omp_body_ptr(), gimple_omp_section_set_last(), gimple_omp_sections_clauses(), gimple_omp_sections_clauses_ptr(), gimple_omp_sections_set_clauses(), gimple_omp_sections_set_control(), gimple_omp_set_body(), gimple_seq_add_seq(), gimple_seq_add_stmt(), GSI_CONTINUE_LINKING, gsi_end_p(), gsi_insert_after(), gsi_insert_seq_after(), gsi_next(), gsi_one_before_end_p(), gsi_replace(), gsi_start(), gsi_stmt(), lower_lastprivate_clauses(), lower_lastprivate_conditional_clauses(), lower_omp(), lower_omp_task_reductions(), lower_rec_input_clauses(), lower_reduction_clauses(), make_node(), make_ssa_name(), maybe_add_implicit_barrier_cancel(), maybe_catch_exception(), maybe_lookup_ctx(), NULL, NULL_TREE, OMP_CLAUSE__REDUCTEMP_, OMP_CLAUSE_CHAIN, OMP_CLAUSE_DECL, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_REDUCTION, omp_find_clause(), omp_task_reductions_find_first(), pointer_sized_int_node, pop_gimplify_context(), push_gimplify_context(), TREE_USED, UNKNOWN_LOCATION, and unsigned_type_node.
Referenced by lower_omp_1().
|
static |
Expand code for an OpenMP single directive.
References as_a(), BLOCK_VARS, omp_context::block_vars, build_clobber(), g, gimple_bind_append_vars(), gimple_bind_set_body(), gimple_build_assign(), gimple_build_bind(), gimple_build_omp_return(), gimple_omp_body_ptr(), gimple_omp_set_body(), gimple_omp_single_clauses(), gimple_seq_add_seq(), gimple_seq_add_stmt(), gsi_insert_after(), gsi_replace(), GSI_SAME_STMT, gsi_start(), gsi_stmt(), lower_omp(), lower_omp_single_copy(), lower_omp_single_simple(), lower_rec_input_clauses(), make_node(), maybe_add_implicit_barrier_cancel(), maybe_catch_exception(), NULL, NULL_TREE, OMP_CLAUSE_NOWAIT, omp_find_clause(), pop_gimplify_context(), push_gimplify_context(), omp_context::record_type, omp_context::sender_decl, and TREE_USED.
Referenced by lower_omp_1().
|
static |
A subroutine of lower_omp_single. Expand the simple form of a GIMPLE_OMP_SINGLE, with a copyprivate clause: #pragma omp single copyprivate (a, b, c) Create a new structure to hold copies of 'a', 'b' and 'c' and emit: { if ((copyout_p = GOMP_single_copy_start ()) == NULL) { BODY; copyout.a = a; copyout.b = b; copyout.c = c; GOMP_single_copy_end (©out); } else { a = copyout_p->a; b = copyout_p->b; c = copyout_p->c; } GOMP_barrier (); } FIXME. It may be better to delay expanding the logic of this until pass_expand_omp. The expanded logic may make the job more difficult to a synchronization analysis pass.
References boolean_type_node, build2(), build3(), build_and_jump(), build_call_expr_loc(), build_fold_addr_expr_loc(), build_int_cst(), build_pointer_type(), builtin_decl_explicit(), create_artificial_label(), create_tmp_var, fold_convert_loc(), gimple_build_label(), gimple_location(), gimple_omp_body(), gimple_omp_single_clauses(), gimple_seq_add_seq(), gimple_seq_add_stmt(), gimplify_and_add(), gimplify_assign(), lower_copyprivate_clauses(), NULL, omp_context::receiver_decl, omp_context::record_type, omp_context::sender_decl, and void_type_node.
Referenced by lower_omp_single().
|
static |
A subroutine of lower_omp_single. Expand the simple form of a GIMPLE_OMP_SINGLE, without a copyprivate clause: if (GOMP_single_start ()) BODY; [ GOMP_barrier (); ] -> unless 'nowait' is present. FIXME. It may be better to delay expanding the logic of this until pass_expand_omp. The expanded logic may make the job more difficult to a synchronization analysis pass.
References boolean_true_node, builtin_decl_explicit(), create_artificial_label(), create_tmp_var, fold_convert_loc(), gimple_build_call(), gimple_build_cond(), gimple_build_label(), gimple_call_set_lhs(), gimple_location(), gimple_omp_body(), gimple_seq_add_seq(), gimple_seq_add_stmt(), and TREE_TYPE.
Referenced by lower_omp_single().
|
static |
Lower the GIMPLE_OMP_TARGET in the current statement in GSI_P. CTX holds context information for the directive.
References AGGREGATE_TYPE_P, as_a(), omp_context::block_vars, boolean_type_node, build1(), build2(), build3(), build_array_type_nelts(), build_call_expr_loc(), build_clobber(), build_constructor(), build_fold_addr_expr, build_fold_addr_expr_loc(), build_fold_addr_expr_with_type, build_fold_indirect_ref, build_int_cst(), build_int_cstu(), build_pointer_type(), build_receiver_ref(), build_sender_ref(), build_simple_mem_ref, builtin_decl_explicit(), omp_context::cb, ceil_log2(), CONSTRUCTOR_APPEND_ELT, create_artificial_label(), create_tmp_var, create_tmp_var_raw(), DECL_ALIGN, DECL_ALIGN_UNIT, DECL_ATTRIBUTES, DECL_BY_REFERENCE, DECL_CHAIN, DECL_CONTEXT, DECL_HAS_VALUE_EXPR_P, DECL_INITIAL, DECL_NAME, DECL_NAMELESS, DECL_P, DECL_SIZE, DECL_UID, DECL_VALUE_EXPR, lang_hooks::decls, copy_body_data::dst_fn, fb_rvalue, omp_context::field_map, flexible_array_type_p(), fold_build1_loc(), fold_build2, fold_build2_loc(), fold_convert, fold_convert_loc(), fold_indirect_ref, force_gimple_operand(), g, gcc_assert, gcc_checking_assert, gcc_unreachable, varpool_node::get(), get_addr_base_and_unit_offset(), get_base_address(), varpool_node::get_create(), get_identifier(), get_name(), GF_OMP_TARGET_KIND_DATA, GF_OMP_TARGET_KIND_ENTER_DATA, GF_OMP_TARGET_KIND_EXIT_DATA, GF_OMP_TARGET_KIND_OACC_DATA, GF_OMP_TARGET_KIND_OACC_DATA_KERNELS, GF_OMP_TARGET_KIND_OACC_DECLARE, GF_OMP_TARGET_KIND_OACC_ENTER_DATA, GF_OMP_TARGET_KIND_OACC_EXIT_DATA, GF_OMP_TARGET_KIND_OACC_HOST_DATA, GF_OMP_TARGET_KIND_OACC_KERNELS, GF_OMP_TARGET_KIND_OACC_PARALLEL, GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE, GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED, GF_OMP_TARGET_KIND_OACC_SERIAL, GF_OMP_TARGET_KIND_OACC_UPDATE, GF_OMP_TARGET_KIND_REGION, GF_OMP_TARGET_KIND_UPDATE, gimple_add_tmp_var(), gimple_bind_add_seq(), gimple_bind_add_stmt(), gimple_bind_block(), gimple_bind_body(), gimple_bind_vars(), gimple_build_assign(), gimple_build_bind(), gimple_build_cond_from_tree(), gimple_build_goto(), gimple_build_label(), gimple_build_omp_return(), gimple_call_set_arg(), gimple_location(), gimple_omp_body(), gimple_omp_set_body(), gimple_omp_target_clauses(), gimple_omp_target_clauses_ptr(), gimple_omp_target_kind(), gimple_omp_target_set_data_arg(), gimple_seq_add_seq(), gimple_seq_add_stmt(), gimple_seq_first_stmt_as_a_bind(), gimplify_and_add(), gimplify_assign(), gimplify_expr(), gsi_replace(), gsi_stmt(), handled_component_p(), i, IDENTIFIER_POINTER, input_location, integer_nonzerop(), integer_type_node, integer_zerop(), INTEGRAL_TYPE_P, is_gimple_omp_oacc(), is_gimple_omp_offloaded(), is_gimple_reg(), is_gimple_reg_type(), is_gimple_val(), is_global_var(), is_oacc_kernels(), is_oacc_kernels_decomposed_part(), is_omp_target(), is_variable_sized(), lookup_decl(), lookup_decl_in_outer_ctx(), lower_depend_clauses(), lower_oacc_private_marker(), lower_oacc_reductions(), lower_omp(), lower_rec_input_clauses(), make_node(), make_tree_vec(), mark_addressable(), maybe_catch_exception(), maybe_lookup_decl_in_outer_ctx(), maybe_lookup_field(), maybe_remove_omp_member_access_dummy_vars(), NULL, null_pointer_node, NULL_TREE, offload_vars, symtab_node::offloadable, lang_hooks_for_decls::omp_array_data, lang_hooks_for_decls::omp_array_size, omp_build_component_ref(), omp_check_optional_argument(), OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_DEPEND, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT, OMP_CLAUSE_FROM, OMP_CLAUSE_HAS_DEVICE_ADDR, OMP_CLAUSE_IN_REDUCTION, OMP_CLAUSE_IS_DEVICE_PTR, OMP_CLAUSE_LOCATION, OMP_CLAUSE_MAP, OMP_CLAUSE_MAP_IN_REDUCTION, OMP_CLAUSE_MAP_KIND, OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION, OMP_CLAUSE_MAP_RUNTIME_IMPLICIT_P, OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION, OMP_CLAUSE_MOTION_PRESENT, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_SIZE, OMP_CLAUSE_TO, OMP_CLAUSE_USE_DEVICE_ADDR, OMP_CLAUSE_USE_DEVICE_PTR, OMP_CLAUSE_USE_DEVICE_PTR_IF_PRESENT, lang_hooks_for_decls::omp_deep_mapping, lang_hooks_for_decls::omp_deep_mapping_cnt, omp_find_clause(), omp_is_allocatable_or_ptr(), omp_maybe_offloaded_ctx(), omp_privatize_by_reference(), omp_requires_mask, OMP_REQUIRES_TARGET_USED, omp_context::outer, POINTER_SIZE, pointer_sized_int_node, POINTER_TYPE_P, poly_int_tree_p(), pop_gimplify_context(), ptr_type_node, push_gimplify_context(), omp_context::receiver_decl, omp_context::record_type, record_vars_into(), omp_context::sender_decl, SET_DECL_VALUE_EXPR, short_unsigned_type_node, size_int, size_type_node, size_zero_node, sizetype, ssizetype, omp_context::stmt, walk_stmt_info::stmt, suppress_warning(), target_nesting_level, TREE_ADDRESSABLE, TREE_CODE, tree_cons(), TREE_CONSTANT, TREE_OPERAND, TREE_STATIC, TREE_THIS_NOTRAP, tree_to_uhwi(), TREE_TYPE, TREE_VEC_ELT, TYPE_ALIGN, TYPE_ALIGN_UNIT, TYPE_FIELDS, TYPE_MAX_VALUE, TYPE_PRECISION, TYPE_READONLY, TYPE_SIZE_UNIT, UNKNOWN_LOCATION, unshare_expr(), vec_alloc(), vec_safe_push(), and void_type_node.
Referenced by lower_omp_1().
|
static |
Lower task_reduction and reduction clauses (the latter unless CODE is OMP_TASKGROUP only with task modifier). Register mapping of those in START sequence and reducing them and unregister them in the END sequence.
References b, boolean_false_node, boolean_true_node, boolean_type_node, build2(), build3(), build4(), build_array_type_nelts(), build_constructor(), build_decl(), build_fold_addr_expr, build_fold_addr_expr_loc(), build_fold_indirect_ref, build_int_cst(), build_one_cst(), build_pointer_type(), build_simple_mem_ref, build_simple_mem_ref_loc(), build_zero_cst(), builtin_decl_explicit(), byte_position(), omp_context::cb, create_artificial_label(), create_tmp_var, create_tmp_var_raw(), DECL_ALIGN, DECL_CHAIN, DECL_CONTEXT, DECL_HAS_VALUE_EXPR_P, DECL_NAME, DECL_P, DECL_USER_ALIGN, DECL_VALUE_EXPR, lang_hooks::decls, end(), error_mark_node, fold_build2, fold_convert, force_gimple_operand(), g, gcc_assert, gimple_add_tmp_var(), gimple_build_assign(), gimple_build_call(), gimple_build_cond(), gimple_build_goto(), gimple_build_label(), gimple_call_set_lhs(), gimple_omp_for_clauses(), gimple_omp_parallel_clauses(), gimple_omp_scope_clauses(), gimple_omp_sections_clauses(), gimple_omp_taskreg_clauses(), gimple_seq_add_seq(), gimple_seq_add_stmt(), gimplify_assign(), gimplify_stmt(), i, INDIRECT_REF_P, integer_type_node, integer_zero_node, integer_zerop(), is_variable_sized(), last, layout_type(), lower_omp(), lang_hooks_for_types::make_type, MAX, maybe_lookup_decl(), maybe_lookup_decl_in_outer_ctx(), NULL, NULL_TREE, OMP_CLAUSE__REDUCTEMP_, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, lang_hooks_for_decls::omp_clause_dtor, OMP_CLAUSE_LOCATION, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_REDUCTION_CODE, OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER, OMP_CLAUSE_REDUCTION_GIMPLE_MERGE, OMP_CLAUSE_REDUCTION_PLACEHOLDER, OMP_CLAUSE_TASK_REDUCTION, omp_find_clause(), omp_privatize_by_reference(), omp_task_reduction_iterate(), omp_task_reductions_find_first(), omp_context::outer, pointer_sized_int_node, ptr_type_node, hash_map< KeyId, Value, Traits >::put(), r, record_type(), remap_type(), SET_DECL_ALIGN, SET_DECL_VALUE_EXPR, SET_TYPE_ALIGN, size_int, size_one_node, size_type_node, size_zero_node, omp_context::stmt, omp_context::task_reduction_map, omp_context::task_reductions, TREE_ADDRESSABLE, TREE_CODE, TREE_OPERAND, TREE_THIS_VOLATILE, TREE_TYPE, TREE_VALUE, TYPE_ALIGN, TYPE_ALIGN_UNIT, TYPE_ARG_TYPES, TYPE_DOMAIN, TYPE_FIELDS, TYPE_MAX_VALUE, TYPE_SIZE_UNIT, lang_hooks::types, UNKNOWN_LOCATION, unshare_expr(), and useless_type_conversion_p().
Referenced by lower_omp_for(), lower_omp_scope(), lower_omp_sections(), lower_omp_taskgroup(), and lower_omp_taskreg().
|
static |
Expand code for an OpenMP taskgroup directive.
References BLOCK_VARS, omp_context::block_vars, builtin_decl_explicit(), gimple_bind_add_seq(), gimple_bind_add_stmt(), gimple_bind_append_vars(), gimple_bind_body_ptr(), gimple_build_bind(), gimple_build_call(), gimple_omp_body(), gimple_omp_body_ptr(), gimple_omp_set_body(), gimple_omp_taskgroup_clauses(), gsi_replace(), gsi_stmt(), lower_omp(), lower_omp_task_reductions(), make_node(), NULL, pop_gimplify_context(), and push_gimplify_context().
Referenced by lower_omp_1().
|
static |
Lower the OpenMP parallel or task directive in the current statement in GSI_P. CTX holds context information for the directive.
References as_a(), omp_context::block_vars, build_clobber(), build_fold_addr_expr_loc(), omp_context::cancel_label, omp_context::cancellable, omp_context::cb, check_combined_parallel(), create_task_copyfn(), create_tmp_var, omp_taskcopy_context::ctx, DECL_NAMELESS, copy_body_data::dst_fn, fold_convert_loc(), gimple_bind_add_seq(), gimple_bind_add_stmt(), gimple_bind_block(), gimple_bind_body(), gimple_bind_vars(), gimple_build_assign(), gimple_build_bind(), gimple_build_label(), gimple_build_omp_continue(), gimple_build_omp_return(), gimple_location(), gimple_omp_body(), gimple_omp_parallel_clauses(), gimple_omp_parallel_combined_p(), gimple_omp_parallel_set_combined_p(), gimple_omp_set_body(), gimple_omp_task_clauses(), gimple_omp_task_clauses_ptr(), gimple_omp_task_taskloop_p(), gimple_omp_task_taskwait_p(), gimple_omp_taskreg_clauses(), gimple_omp_taskreg_set_data_arg(), gimple_seq_add_seq(), gimple_seq_add_stmt(), gimple_seq_first_stmt(), gsi_replace(), gsi_stmt(), integer_zero_node, is_parallel_ctx(), is_task_ctx(), lower_depend_clauses(), lower_omp(), lower_omp_task_reductions(), lower_rec_input_clauses(), lower_reduction_clauses(), lower_send_clauses(), lower_send_shared_vars(), make_node(), maybe_catch_exception(), maybe_remove_omp_member_access_dummy_vars(), NULL, NULL_TREE, OMP_CLAUSE__REDUCTEMP_, OMP_CLAUSE_DEPEND, OMP_CLAUSE_REDUCTION, omp_find_clause(), pop_gimplify_context(), push_gimplify_context(), omp_context::receiver_decl, omp_context::record_type, record_vars_into(), omp_context::sender_decl, omp_context::srecord_type, omp_context::stmt, walk_stmt_info::stmt, TREE_ADDRESSABLE, TREE_TYPE, and walk_gimple_seq().
Referenced by lower_omp_1().
|
static |
Expand code for an OpenMP teams directive.
References as_a(), BLOCK_VARS, omp_context::block_vars, build_int_cst(), build_one_cst(), build_zero_cst(), builtin_decl_explicit(), create_artificial_label(), create_tmp_var, fb_rvalue, fold_convert, gimple_bind_append_vars(), gimple_bind_set_body(), gimple_build_assign(), gimple_build_bind(), gimple_build_call(), gimple_build_cond(), gimple_build_goto(), gimple_build_label(), gimple_build_omp_return(), gimple_call_set_lhs(), gimple_location(), gimple_omp_body(), gimple_omp_body_ptr(), gimple_omp_set_body(), gimple_omp_teams_clauses(), gimple_seq_add_seq(), gimple_seq_add_stmt(), gimple_set_location(), gimplify_expr(), gsi_replace(), gsi_stmt(), is_gimple_val(), lower_omp(), lower_rec_input_clauses(), lower_reduction_clauses(), make_node(), NULL, NULL_TREE, OMP_CLAUSE_NUM_TEAMS, OMP_CLAUSE_NUM_TEAMS_LOWER_EXPR, OMP_CLAUSE_NUM_TEAMS_UPPER_EXPR, OMP_CLAUSE_THREAD_LIMIT, OMP_CLAUSE_THREAD_LIMIT_EXPR, omp_find_clause(), pop_gimplify_context(), push_gimplify_context(), TREE_TYPE, TREE_USED, and unsigned_type_node.
Referenced by lower_omp_1().
|
static |
Lower early initialization of privatized variable NEW_VAR if it needs an allocator (has allocate clause).
References a, omp_context::allocate_map, build_int_cst(), build_outer_var_ref(), build_pointer_type(), build_simple_mem_ref, builtin_decl_explicit(), create_tmp_var, DECL_ALIGN_UNIT, DECL_HAS_VALUE_EXPR_P, DECL_P, DECL_SIZE_UNIT, fold_convert, g, gcc_assert, hash_map< KeyId, Value, Traits >::get(), gimple_build_call(), gimple_call_set_lhs(), gimple_seq_add_stmt(), gimplify_assign(), MAX, NULL_TREE, OMP_CLAUSE_ALLOCATE, omp_privatize_by_reference(), pointer_sized_int_node, SET_DECL_VALUE_EXPR, size_type_node, TREE_CODE, TREE_PURPOSE, TREE_THIS_NOTRAP, tree_to_uhwi(), TREE_TYPE, TREE_VALUE, TYPE_ALIGN_UNIT, and TYPE_P.
Referenced by lower_rec_input_clauses().
|
static |
Generate code to implement the input clauses, FIRSTPRIVATE and COPYIN, from the receiver (aka child) side and initializers for REFERENCE_TYPE private variables. Initialization statements go in ILIST, while calls to destructors go in DLIST.
References omp_context::allocate_map, append_to_statement_list(), b, boolean_false_node, boolean_true_node, boolean_type_node, build2(), build3(), build4(), build_array_type_nelts(), build_call_expr(), build_call_expr_internal_loc(), build_call_expr_loc(), build_clobber(), build_fold_addr_expr, build_fold_addr_expr_loc(), build_fold_indirect_ref, build_int_cst(), build_omp_clause(), build_outer_var_ref(), build_pointer_type(), build_receiver_ref(), build_simple_mem_ref, build_simple_mem_ref_loc(), build_zero_cst(), builtin_decl_explicit(), c_kind, omp_context::cb, cfun, omp_context::combined_into_simd_safelen1, omp_for_data_loop::cond_code, create_artificial_label(), create_tmp_var, create_tmp_var_raw(), DECL_ALIGN, DECL_CONTEXT, DECL_HAS_VALUE_EXPR_P, DECL_IGNORED_P, copy_body_data::decl_map, DECL_P, DECL_VALUE_EXPR, lang_hooks::decls, end(), error_mark_node, fb_rvalue, omp_context::field_map, fold_build1, fold_build2, fold_build2_loc(), fold_build_pointer_plus, fold_convert, fold_convert_loc(), omp_context::for_simd_scan_phase, g, gcc_assert, gcc_unreachable, hash_map< KeyId, Value, Traits >::get(), get_name(), GF_OMP_FOR_KIND_FOR, GF_OMP_FOR_KIND_SIMD, gimple_add_tmp_var(), gimple_build_assign(), gimple_build_call(), gimple_build_call_internal(), gimple_build_call_internal_vec(), gimple_build_cond(), gimple_build_goto(), gimple_build_label(), gimple_call_set_lhs(), gimple_omp_body_ptr(), gimple_omp_for_clauses(), gimple_omp_for_collapse(), gimple_omp_for_combined_into_p(), gimple_omp_for_index(), gimple_omp_for_kind(), gimple_omp_for_set_clauses(), gimple_seq_add_seq(), gimple_seq_add_stmt(), gimplify_and_add(), gimplify_assign(), gimplify_expr(), gsi_insert_before_without_update(), GSI_SAME_STMT, gsi_start(), handle_simd_reference(), header, i, i2, omplow_simd_context::idx, initializer_zerop(), integer_one_node, integer_onep(), integer_type_node, integer_zero_node, integer_zerop(), is_gimple_omp_oacc(), is_gimple_val(), is_global_var(), is_host_teams_ctx(), is_omp_target(), is_parallel_ctx(), omplow_simd_context::is_simt, is_task_ctx(), is_taskloop_ctx(), is_taskreg_ctx(), is_variable_sized(), known_eq, omplow_simd_context::lane, omplow_simd_context::lastlane, omp_context::lastprivate_conditional_map, lookup_decl(), omp_for_data::loop, lower_omp(), lower_private_allocate(), lower_rec_simd_input_clauses(), omplow_simd_context::max_vf, maybe_gt, maybe_lookup_decl(), maybe_lookup_decl_in_outer_ctx(), omp_for_data_loop::n1, NULL, NULL_TREE, omp_build_barrier(), OMP_CLAUSE__CONDTEMP_, OMP_CLAUSE__CONDTEMP__ITER, OMP_CLAUSE__LOOPTEMP_, OMP_CLAUSE__REDUCTEMP_, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE__SIMDUID__DECL, OMP_CLAUSE__SIMT_, OMP_CLAUSE_ALIGNED, omp_clause_aligned_alignment(), lang_hooks_for_decls::omp_clause_assign_op, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, lang_hooks_for_decls::omp_clause_copy_ctor, OMP_CLAUSE_COPYIN, OMP_CLAUSE_DECL, lang_hooks_for_decls::omp_clause_default_ctor, lang_hooks_for_decls::omp_clause_dtor, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_FIRSTPRIVATE_NO_REFERENCE, OMP_CLAUSE_IF, OMP_CLAUSE_IF_EXPR, OMP_CLAUSE_IN_REDUCTION, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_LASTPRIVATE_CONDITIONAL, OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE_LOOP_IV, OMP_CLAUSE_LINEAR, OMP_CLAUSE_LINEAR_ARRAY, lang_hooks_for_decls::omp_clause_linear_ctor, OMP_CLAUSE_LINEAR_NO_COPYIN, OMP_CLAUSE_LINEAR_NO_COPYOUT, OMP_CLAUSE_LINEAR_STEP, OMP_CLAUSE_LOCATION, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_PRIVATE_DEBUG, OMP_CLAUSE_PRIVATE_OUTER_REF, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_REDUCTION_CODE, OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER, OMP_CLAUSE_REDUCTION_GIMPLE_INIT, OMP_CLAUSE_REDUCTION_GIMPLE_MERGE, OMP_CLAUSE_REDUCTION_INSCAN, OMP_CLAUSE_REDUCTION_OMP_ORIG_REF, OMP_CLAUSE_REDUCTION_PLACEHOLDER, OMP_CLAUSE_REDUCTION_TASK, OMP_CLAUSE_SAFELEN, OMP_CLAUSE_SAFELEN_EXPR, OMP_CLAUSE_SHARED, OMP_CLAUSE_SHARED_FIRSTPRIVATE, OMP_CLAUSE_SIMDLEN, OMP_CLAUSE_SIMDLEN_EXPR, omp_find_clause(), lang_hooks_for_decls::omp_private_outer_ref, omp_privatize_by_reference(), omp_reduction_init(), omp_context::outer, pointer_sized_int_node, POINTER_TYPE_P, poly_int_tree_p(), ptr_type_node, hash_map< KeyId, Value, Traits >::put(), r, omp_context::scan_exclusive, omp_context::scan_inclusive, SET_DECL_VALUE_EXPR, signed_type_for(), omplow_simd_context::simt_dlist, omplow_simd_context::simt_eargs, size_int, size_type_node, sizetype, omp_for_data_loop::step, omp_context::stmt, suppress_warning(), omp_context::task_reduction_map, task_reduction_read(), omp_context::task_reductions, TREE_ADDRESSABLE, TREE_CODE, TREE_CONSTANT, TREE_OPERAND, TREE_PURPOSE, TREE_THIS_NOTRAP, TREE_TYPE, TYPE_ALIGN, TYPE_DOMAIN, TYPE_MAX_VALUE, TYPE_SIZE_UNIT, TYPE_UNSIGNED, UNKNOWN_LOCATION, unshare_expr(), unsigned_type_node, use_pointer_for_field(), useless_type_conversion_p(), void_node, void_type_node, and y.
Referenced by lower_omp_for(), lower_omp_scope(), lower_omp_sections(), lower_omp_single(), lower_omp_target(), lower_omp_taskreg(), and lower_omp_teams().
|
static |
Helper function of lower_rec_input_clauses, used for #pragma omp simd privatization.
References build1(), build4(), build_array_type_nelts(), build_clobber(), build_pointer_type(), omp_context::cb, create_tmp_var, create_tmp_var_raw(), DECL_ATTRIBUTES, DECL_HAS_VALUE_EXPR_P, copy_body_data::decl_map, DECL_P, omp_context::for_simd_scan_phase, g, get_identifier(), gimple_add_tmp_var(), gimple_build_assign(), gimple_omp_for_clauses(), gimple_seq_add_stmt(), omplow_simd_context::idx, INTEGRAL_TYPE_P, is_gimple_reg(), omplow_simd_context::is_simt, known_eq, omplow_simd_context::lane, omplow_simd_context::lastlane, omplow_simd_context::max_vf, maybe_gt, NULL, NULL_TREE, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_REDUCTION_CODE, OMP_CLAUSE_REDUCTION_PLACEHOLDER, OMP_CLAUSE_SAFELEN, OMP_CLAUSE_SAFELEN_EXPR, omp_find_clause(), omp_max_simt_vf(), omp_max_vf(), omp_maybe_offloaded_ctx(), poly_int_tree_p(), hash_map< KeyId, Value, Traits >::put(), omp_context::scan_exclusive, SET_DECL_VALUE_EXPR, omplow_simd_context::simt_dlist, omplow_simd_context::simt_eargs, omp_context::stmt, TREE_ADDRESSABLE, tree_cons(), TREE_THIS_NOTRAP, TREE_TYPE, truth_value_p(), and unsigned_type_node.
Referenced by lower_rec_input_clauses().
|
static |
Generate code to implement the REDUCTION clauses, append it to STMT_SEQP. CLIST if non-NULL is a pointer to a sequence that should be emitted also inside of the critical section, in that case clear *CLIST afterwards, otherwise leave it as is and let the caller emit it itself.
References b, boolean_type_node, build1(), build2(), build_fold_addr_expr, build_fold_addr_expr_loc(), build_int_cst(), build_outer_var_ref(), build_pointer_type(), build_simple_mem_ref_loc(), build_zero_cst(), builtin_decl_explicit(), count, create_artificial_label(), create_tmp_var, DECL_HAS_VALUE_EXPR_P, DECL_P, DECL_VALUE_EXPR, end(), fb_rvalue, fold_build2_loc(), fold_convert, fold_convert_loc(), g, gcc_assert, GF_OMP_FOR_KIND_SIMD, gimple_build_assign(), gimple_build_call(), gimple_build_cond(), gimple_build_label(), gimple_omp_for_kind(), gimple_seq_add_seq(), gimple_seq_add_stmt(), gimplify_and_add(), gimplify_assign(), gimplify_expr(), i, INDIRECT_REF_P, integer_zerop(), is_gimple_omp_oacc(), is_gimple_val(), is_variable_sized(), lookup_decl(), lower_omp(), maybe_lookup_decl(), maybe_lookup_decl_in_outer_ctx(), NULL, OMP_ATOMIC_MEMORY_ORDER, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_LOCATION, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_REDUCTION_CODE, OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER, OMP_CLAUSE_REDUCTION_GIMPLE_MERGE, OMP_CLAUSE_REDUCTION_PLACEHOLDER, OMP_CLAUSE_REDUCTION_TASK, OMP_MEMORY_ORDER_RELAXED, omp_privatize_by_reference(), save_expr(), omp_context::scan_exclusive, omp_context::scan_inclusive, SET_DECL_VALUE_EXPR, sizetype, omp_context::stmt, TREE_CODE, TREE_OPERAND, TREE_TYPE, TYPE_DOMAIN, TYPE_MAX_VALUE, TYPE_SIZE_UNIT, UNKNOWN_LOCATION, unshare_expr(), useless_type_conversion_p(), and void_type_node.
Referenced by lower_omp_for(), lower_omp_scope(), lower_omp_sections(), lower_omp_taskreg(), and lower_omp_teams().
|
static |
Generate code to implement the clauses, FIRSTPRIVATE, COPYIN, LASTPRIVATE, and REDUCTION from the sender (aka parent) side.
References build_fold_addr_expr, build_fold_addr_expr_loc(), build_sender_ref(), DECL_ABSTRACT_ORIGIN, DECL_UID, DECL_VALUE_EXPR, lang_hooks::decls, gcc_unreachable, gimple_omp_task_taskloop_p(), gimplify_assign(), INDIRECT_REF_P, is_global_var(), is_task_ctx(), is_variable_sized(), lookup_decl_in_outer_ctx(), lookup_sfield(), maybe_lookup_decl_in_outer_ctx(), NULL, omp_build_component_ref(), OMP_CLAUSE__LOOPTEMP_, OMP_CLAUSE__REDUCTEMP_, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_COPYIN, OMP_CLAUSE_DECL, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT, OMP_CLAUSE_IN_REDUCTION, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_CLAUSE_LOCATION, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_PRIVATE_OUTER_REF, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_REDUCTION_TASK, OMP_CLAUSE_SHARED, OMP_CLAUSE_SHARED_FIRSTPRIVATE, omp_member_access_dummy_var(), lang_hooks_for_decls::omp_private_outer_ref, omp_privatize_by_reference(), omp_context::outer, omp_context::sender_decl, omp_context::stmt, suppress_warning(), TREE_CODE, TREE_OPERAND, TREE_TYPE, unshare_and_remap(), unshare_expr(), and use_pointer_for_field().
Referenced by lower_omp_taskreg().
|
static |
Generate code to implement SHARED from the sender (aka parent) side. This is trickier, since GIMPLE_OMP_PARALLEL_CLAUSES doesn't list things that got automatically shared.
References omp_context::allocate_map, build_constructor(), build_fold_addr_expr, build_sender_ref(), DECL_ABSTRACT_ORIGIN, DECL_ARTIFICIAL, DECL_BY_REFERENCE, DECL_CHAIN, DECL_HAS_VALUE_EXPR_P, DECL_VALUE_EXPR, gcc_assert, hash_map< KeyId, Value, Traits >::get(), gimplify_assign(), is_parallel_ctx(), lookup_decl_in_outer_ctx(), maybe_lookup_decl(), maybe_lookup_decl_in_outer_ctx(), NULL, omp_member_access_dummy_var(), omp_context::record_type, record_type(), omp_context::srecord_type, TREE_CODE, TREE_READONLY, TREE_TYPE, TYPE_FIELDS, unshare_and_remap(), unshare_expr(), and use_pointer_for_field().
Referenced by lower_omp_taskreg().
gimple_opt_pass * make_pass_diagnose_omp_blocks | ( | gcc::context * | ctxt | ) |
gimple_opt_pass * make_pass_lower_omp | ( | gcc::context * | ctxt | ) |
|
static |
Routines to lower OMP directives into OMP-GIMPLE.
If ctx is a worksharing context inside of a cancellable parallel region and it isn't nowait, add lhs to its GIMPLE_OMP_RETURN and conditional branch to parallel's cancel_label to handle cancellation in the implicit barrier.
References boolean_false_node, builtin_decl_explicit(), create_artificial_label(), create_tmp_var, fold_convert, g, gcc_assert, gimple_build_cond(), gimple_build_label(), gimple_omp_return_nowait_p(), gimple_omp_return_set_lhs(), gimple_seq_add_stmt(), omp_context::outer, TREE_TYPE, and UNKNOWN_LOCATION.
Referenced by lower_omp_for(), lower_omp_scope(), lower_omp_sections(), and lower_omp_single().
|
static |
If exceptions are enabled, wrap the statements in BODY in a MUST_NOT_THROW catch handler and return it. This prevents programs from violating the structured block semantics with throws.
References builtin_decl_explicit(), lang_hooks::eh_protect_cleanup_actions, g, gimple_build_eh_must_not_throw(), gimple_build_try(), gimple_seq_alloc_with_stmt(), GIMPLE_TRY_CATCH, and NULL.
Referenced by finalize_task_copyfn(), lower_omp_critical(), lower_omp_dispatch(), lower_omp_for(), lower_omp_master(), lower_omp_ordered(), lower_omp_scope(), lower_omp_sections(), lower_omp_single(), lower_omp_target(), and lower_omp_taskreg().
|
static |
If a context was created for STMT when it was scanned, return it.
References all_contexts, NULL, walk_stmt_info::stmt, and splay_tree_node< T >::value().
Referenced by lower_omp_1(), lower_omp_for_scan(), lower_omp_scan(), lower_omp_sections(), and scan_omp_simd_scan().
|
inlinestatic |
References omp_context::cb, copy_body_data::decl_map, hash_map< KeyId, Value, Traits >::get(), and NULL_TREE.
Referenced by build_outer_var_ref(), lookup_decl_in_outer_ctx(), lower_oacc_reductions(), lower_omp_for_scan(), lower_omp_regimplify_operands_p(), lower_omp_scan(), lower_omp_task_reductions(), lower_rec_input_clauses(), lower_reduction_clauses(), lower_send_shared_vars(), maybe_lookup_decl_in_outer_ctx(), omp_copy_decl(), scan_sharing_clauses(), and use_pointer_for_field().
|
static |
Similar to lookup_decl_in_outer_ctx, but return DECL if not found in outer contexts.
References maybe_lookup_decl(), NULL, and omp_context::outer.
Referenced by build_outer_var_ref(), finish_taskreg_remap(), finish_taskreg_scan(), lower_lastprivate_clauses(), lower_omp_for(), lower_omp_target(), lower_omp_task_reductions(), lower_rec_input_clauses(), lower_reduction_clauses(), lower_send_clauses(), lower_send_shared_vars(), scan_sharing_clauses(), and use_pointer_for_field().
|
inlinestatic |
References omp_context::field_map, NULL_TREE, and splay_tree_node< T >::value().
Referenced by build_outer_var_ref(), build_receiver_ref(), lower_oacc_reductions(), lower_omp_target(), and maybe_lookup_field().
|
inlinestatic |
References maybe_lookup_field().
|
static |
Re-gimplification and code generation routines.
Remove omp_member_access_dummy_var variables from gimple_bind_vars of BIND if in a method.
References current_function_decl, DECL_ARGUMENTS, DECL_ARTIFICIAL, DECL_CHAIN, gimple_bind_set_vars(), gimple_bind_vars(), omp_member_access_dummy_var(), TREE_CODE, and TREE_TYPE.
Referenced by lower_omp_1(), lower_omp_for(), lower_omp_target(), and lower_omp_taskreg().
|
static |
Create a new context, with OUTER_CTX being the surrounding context.
References copy_body_data::adjust_array_error_bounds, all_contexts, copy_body_data::block, omp_context::cb, CB_CGE_MOVE, cfun, copy_body_data::copy_decl, current_function_decl, copy_body_data::decl_map, omp_context::depth, copy_body_data::dont_remap_vla_if_no_change, copy_body_data::dst_fn, copy_body_data::dst_node, copy_body_data::eh_lp_nr, gcc_checking_assert, cgraph_node::get(), NULL, omp_copy_decl(), omp_context::outer, copy_body_data::src_cfun, copy_body_data::src_fn, copy_body_data::src_node, omp_context::stmt, walk_stmt_info::stmt, and copy_body_data::transform_call_graph_edges.
Referenced by scan_omp_1_stmt(), scan_omp_for(), scan_omp_parallel(), scan_omp_sections(), scan_omp_simd_scan(), scan_omp_single(), scan_omp_target(), scan_omp_task(), and scan_omp_teams().
|
static |
OpenACC privatization. Or, in other words, *sharing* at the respective OpenACC level of parallelism. From a correctness perspective, a non-addressable variable can't be accessed outside the current thread, so it can go in a (faster than shared memory) register -- though that register may need to be broadcast in some circumstances. A variable can only meaningfully be "shared" across workers or vector lanes if its address is taken, e.g. by a call to an atomic builtin. From an optimisation perspective, the answer might be fuzzier: maybe sometimes, using shared memory directly would be faster than broadcasting.
PR100695 "Format decoder, quoting in 'dump_printf' etc."
References dump_printf(), dump_printf_loc(), dump_user_location_t::from_location_t(), OMP_CLAUSE_CODE, and omp_clause_code_name.
Referenced by oacc_privatization_candidate_p().
|
static |
References DECL_ARTIFICIAL, DECL_EXTERNAL, dump_enabled_p(), dump_file, dump_flags, dump_printf(), gcc_checking_assert, get_openacc_privatization_dump_flags(), get_tree_code_name(), oacc_privatization_begin_diagnose_var(), print_generic_decl(), TDF_DETAILS, TREE_ADDRESSABLE, TREE_CODE, TREE_STATIC, and VAR_P.
Referenced by oacc_privatization_scan_clause_chain(), and oacc_privatization_scan_decl_chain().
|
static |
Scan CLAUSES for candidates for adjusting OpenACC privatization level in CTX.
References gcc_checking_assert, lookup_decl(), oacc_privatization_candidate_p(), omp_context::oacc_privatization_candidates, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_LOCATION, and OMP_CLAUSE_PRIVATE.
Referenced by lower_omp_for().
|
static |
Scan DECLS for candidates for adjusting OpenACC privatization level in CTX.
References DECL_CHAIN, decls, gcc_checking_assert, gimple_location(), lookup_decl(), NULL, oacc_privatization_candidate_p(), omp_context::oacc_privatization_candidates, and omp_context::stmt.
Referenced by lower_omp_1(), and lower_omp_for().
Return alignment to be assumed for var in CLAUSE, which should be OMP_CLAUSE_ALIGNED.
References build_int_cst(), build_vector_type_for_mode(), FOR_EACH_MODE_IN_CLASS, GET_MODE_CLASS, GET_MODE_SIZE(), i, integer_type_node, known_ge, modes, NULL_TREE, OMP_CLAUSE_ALIGNED_ALIGNMENT, related_vector_mode(), opt_mode< T >::require(), targetm, TYPE_ALIGN_UNIT, lang_hooks_for_types::type_for_mode, TYPE_MODE, and lang_hooks::types.
Referenced by lower_rec_input_clauses().
|
static |
The callback for remap_decl. Search all containing contexts for a mapping of the variable; this avoids having to duplicate the splay tree ahead of time. We know a mapping doesn't already exist in the given context. Create new mappings to implement default semantics.
References omp_context::cb, create_artificial_label(), current_function_decl, DECL_CONTEXT, decl_function_context(), DECL_NONLOCAL, DECL_SOURCE_LOCATION, error_mark_node, FORCED_LABEL, insert_decl_map(), is_global_var(), is_taskreg_ctx(), maybe_lookup_decl(), NULL, omp_context::outer, copy_body_data::src_fn, and TREE_CODE.
Referenced by new_omp_context().
|
static |
References DECL_NAME, omp_copy_decl_2(), and TREE_TYPE.
Referenced by install_var_local(), and scan_sharing_clauses().
|
static |
Construct a new automatic decl similar to VAR.
References bitmap_bit_p, omp_context::block_vars, copy_var_decl(), current_function_decl, DECL_CHAIN, DECL_CONTEXT, DECL_UID, global_nonaddressable_vars, make_addressable_vars, record_vars(), and TREE_ADDRESSABLE.
Referenced by omp_copy_decl_1().
tree omp_find_combined_for | ( | gimple_stmt_iterator * | gsi_p, |
bool * | handled_ops_p, | ||
struct walk_stmt_info * | wi ) |
Callback for walk_gimple_seq. Check if combined parallel contains gimple_omp_for_combined_into_p OMP_FOR.
References gimple_omp_for_combined_into_p(), gimple_omp_for_kind(), gsi_stmt(), integer_zero_node, NULL, and WALK_SUBSTMTS.
Referenced by add_taskreg_looptemp_clauses().
|
static |
Callback for walk_gimple_seq. Find #pragma omp scan statement.
References GF_OMP_FOR_KIND_SIMD, gimple_omp_for_combined_into_p(), gimple_omp_for_kind(), gsi_stmt(), integer_zero_node, NULL, and WALK_SUBSTMTS.
Referenced by lower_omp_for_scan(), and scan_omp_simd_scan().
|
static |
Return true if CTX may belong to offloaded code: either if current function is offloaded, or any enclosing context corresponds to a target region.
References current_function_decl, cgraph_node::get(), is_gimple_omp_offloaded(), omp_context::outer, and omp_context::stmt.
Referenced by create_omp_child_function(), lower_omp_ordered(), lower_omp_target(), lower_rec_simd_input_clauses(), scan_omp_1_stmt(), and scan_sharing_clauses().
If DECL is the artificial dummy VAR_DECL created for non-static data member privatization, return the underlying "this" parameter, otherwise return NULL.
References CASE_CONVERT, current_function_decl, DECL_ARTIFICIAL, DECL_CONTEXT, DECL_HAS_VALUE_EXPR_P, DECL_IGNORED_P, DECL_VALUE_EXPR, lang_hooks::decls, NULL_TREE, lang_hooks_for_decls::omp_disregard_value_expr, TREE_CODE, TREE_OPERAND, TREE_TYPE, and VAR_P.
Referenced by build_outer_var_ref(), gimplify_scan_omp_clauses(), lower_omp_regimplify_operands_p(), lower_send_clauses(), lower_send_shared_vars(), maybe_remove_omp_member_access_dummy_vars(), omp_check_private(), remove_member_access_dummy_vars(), and use_pointer_for_field().
Construct the initialization value for reduction CLAUSE.
References OMP_CLAUSE_LOCATION, OMP_CLAUSE_REDUCTION_CODE, and omp_reduction_init_op().
Referenced by lower_omp_for_scan(), lower_omp_scan(), and lower_rec_input_clauses().
Construct the initialization value for reduction operation OP.
References build_real(), build_zero_cst(), dconstinf, fold_convert_loc(), gcc_assert, gcc_unreachable, HONOR_INFINITIES(), integer_minus_one_node, integer_one_node, INTEGRAL_TYPE_P, wi::max_value(), wi::min_value(), NULL, POINTER_TYPE_P, real_arithmetic(), real_maxval(), REAL_VALUE_TYPE, SCALAR_FLOAT_TYPE_P, TYPE_MAX_VALUE, TYPE_MIN_VALUE, TYPE_MODE, TYPE_PRECISION, TYPE_SIGN, and wide_int_to_tree().
Referenced by initialize_reductions(), lower_oacc_reductions(), and omp_reduction_init().
|
inlinestatic |
Helper function for lower_omp_task_reductions. For a specific PASS find out the current clause it should be processed, or return false if all have been processed already.
References NULL_TREE, OMP_CLAUSE_CHAIN, OMP_CLAUSE_DECL, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_REDUCTION_TASK, omp_find_clause(), omp_privatize_by_reference(), TREE_CODE, TREE_CONSTANT, TREE_TYPE, and TYPE_SIZE_UNIT.
Referenced by lower_omp_task_reductions().
|
inlinestatic |
Find the first task_reduction or reduction clause or return NULL if there are none.
References NULL_TREE, OMP_CLAUSE_CHAIN, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_REDUCTION_TASK, and omp_find_clause().
Referenced by lower_omp_for(), lower_omp_scope(), lower_omp_sections(), and lower_omp_task_reductions().
|
static |
Remove omp_member_access_dummy_var variables from BLOCK_VARS of block and its subblocks.
References BLOCK_CHAIN, BLOCK_SUBBLOCKS, BLOCK_VARS, DECL_CHAIN, omp_member_access_dummy_var(), and remove_member_access_dummy_vars().
Referenced by execute_lower_omp(), and remove_member_access_dummy_vars().
|
static |
Scan all the statements starting at the current statement. CTX contains context information about the OMP directives and clauses found during the scan.
References input_location, scan_omp_1_op(), scan_omp_1_stmt(), and walk_gimple_seq_mod().
Referenced by execute_lower_omp(), scan_omp_1_stmt(), scan_omp_for(), scan_omp_parallel(), scan_omp_sections(), scan_omp_simd_scan(), scan_omp_single(), scan_omp_target(), scan_omp_task(), scan_omp_teams(), and scan_sharing_clauses().
Helper function scan_omp. Callback for walk_tree or operators in walk_gimple_stmt used to scan for OMP directives in TP.
References build_fold_addr_expr, omp_context::cb, DECL_ATTRIBUTES, DECL_P, gcc_checking_assert, gcc_fallthrough, lookup_attribute(), NULL_TREE, remap_decl(), remap_type(), wi::to_wide(), TREE_CODE, TREE_OPERAND, TREE_TYPE, TREE_VALUE, TYPE_P, and wide_int_to_tree().
Referenced by scan_omp(), and scan_omp_op().
|
static |
Helper function for scan_omp. Callback for walk_gimple_stmt used to scan for OMP directives in the current statement in GSI.
References as_a(), BUILT_IN_NORMAL, omp_context::cb, check_omp_nesting_restrictions(), DECL_BUILT_IN_CLASS, DECL_CHAIN, DECL_FUNCTION_CODE(), DECL_NAME, error_at(), GF_OMP_FOR_KIND_SIMD, GF_OMP_TARGET_KIND_REGION, gimple_bind_vars(), gimple_build_nop(), gimple_call_fndecl(), gimple_has_location(), gimple_location(), gimple_omp_body_ptr(), gimple_omp_for_clauses(), gimple_omp_for_collapse(), gimple_omp_for_combined_into_p(), gimple_omp_for_kind(), gimple_omp_masked_clauses(), gimple_omp_scan_clauses(), gimple_omp_scope_clauses(), gimple_omp_target_clauses(), gimple_omp_target_kind(), gimple_omp_taskgroup_clauses(), gimple_omp_teams_host(), walk_stmt_info::gsi, gsi_replace(), gsi_stmt(), IDENTIFIER_LENGTH, IDENTIFIER_POINTER, input_location, insert_decl_map(), is_gimple_call(), is_gimple_omp(), is_gimple_omp_offloaded(), omp_context::loop_p, new_omp_context(), NULL_TREE, OMP_CLAUSE_CODE, OMP_CLAUSE_DEVICE, OMP_CLAUSE_DEVICE_ANCESTOR, OMP_CLAUSE_EXCLUSIVE, OMP_CLAUSE_INCLUSIVE, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_REDUCTION_INSCAN, omp_find_clause(), omp_max_simt_vf(), omp_maybe_offloaded_ctx(), omp_runtime_api_call(), omp_context::order_concurrent, omp_context::outer, omp_context::scan_exclusive, omp_context::scan_inclusive, scan_omp(), scan_omp_for(), scan_omp_parallel(), scan_omp_sections(), scan_omp_simd(), scan_omp_simd_scan(), scan_omp_single(), scan_omp_target(), scan_omp_task(), scan_omp_teams(), scan_sharing_clauses(), seen_error(), setjmp_or_longjmp_p(), omp_context::stmt, walk_stmt_info::stmt, and taskreg_nesting_level.
Referenced by scan_omp().
|
static |
Scan a GIMPLE_OMP_FOR.
References chainon(), check_oacc_kernel_gwv(), curr_loop, current_function_decl, DECL_SOURCE_LOCATION, enclosing_target_ctx(), error_at(), gcc_assert, gcc_unreachable, gimple_location(), gimple_omp_body_ptr(), gimple_omp_for_clauses(), gimple_omp_for_collapse(), gimple_omp_for_final_ptr(), gimple_omp_for_incr_ptr(), gimple_omp_for_index_ptr(), gimple_omp_for_initial_ptr(), gimple_omp_for_pre_body_ptr(), gimple_omp_for_set_clauses(), i, inform(), is_gimple_omp_oacc(), is_oacc_kernels(), is_oacc_kernels_decomposed_part(), omp_context::local_reduction_clauses, new_omp_context(), NULL, oacc_get_fn_attrib(), OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, omp_clause_code_name, OMP_CLAUSE_DECL, OMP_CLAUSE_GANG, OMP_CLAUSE_GANG_EXPR, OMP_CLAUSE_LOCATION, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_REDUCTION_CODE, OMP_CLAUSE_VECTOR, OMP_CLAUSE_VECTOR_EXPR, OMP_CLAUSE_WORKER, OMP_CLAUSE_WORKER_EXPR, omp_context::outer, omp_context::outer_reduction_clauses, scan_omp(), scan_omp_op(), scan_sharing_clauses(), omp_context::stmt, TREE_CHAIN, tree_cons(), TREE_VALUE, unshare_expr(), and warning_at().
Referenced by scan_omp_1_stmt(), and scan_omp_simd().
|
inlinestatic |
Convenience function for calling scan_omp_1_op on tree operands.
References NULL, scan_omp_1_op(), and walk_tree.
Referenced by scan_omp_for(), and scan_sharing_clauses().
|
static |
Scan an OpenMP parallel directive.
References add_taskreg_looptemp_clauses(), as_a(), build_decl(), build_omp_clause(), build_pointer_type(), omp_context::cb, create_omp_child_function(), create_tmp_var, create_tmp_var_name(), DECL_ARTIFICIAL, DECL_NAMELESS, copy_body_data::dst_fn, empty_body_p(), omp_context::field_map, GF_OMP_FOR_KIND_FOR, gimple_build_nop(), gimple_location(), gimple_omp_body(), gimple_omp_body_ptr(), gimple_omp_parallel_clauses(), gimple_omp_parallel_combined_p(), gimple_omp_parallel_set_child_fn(), gimple_omp_parallel_set_clauses(), gsi_replace(), gsi_stmt(), insert_decl_map(), omp_context::is_nested, lang_hooks_for_types::make_type, new_omp_context(), NULL, NULL_TREE, OMP_CLAUSE__REDUCTEMP_, OMP_CLAUSE_CHAIN, OMP_CLAUSE_COPYIN, OMP_CLAUSE_DECL, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_REDUCTION_TASK, omp_find_clause(), pointer_sized_int_node, omp_context::receiver_decl, omp_context::record_type, scan_omp(), scan_sharing_clauses(), taskreg_contexts, taskreg_nesting_level, TYPE_ARTIFICIAL, TYPE_FIELDS, TYPE_NAME, lang_hooks::types, and UNKNOWN_LOCATION.
Referenced by scan_omp_1_stmt().
|
static |
Scan an OpenMP sections directive.
References gimple_omp_body_ptr(), gimple_omp_sections_clauses(), new_omp_context(), scan_omp(), scan_sharing_clauses(), and walk_stmt_info::stmt.
Referenced by scan_omp_1_stmt().
|
static |
Duplicate #pragma omp simd, one for SIMT, another one for SIMD.
References as_a(), build_omp_clause(), copy_gimple_seq_and_replace_locals(), create_artificial_label(), create_tmp_var_raw(), current_function_decl, DECL_CONTEXT, DECL_SEEN_IN_BIND_EXPR_P, g, gimple_bind_set_body(), gimple_bind_set_vars(), gimple_build_bind(), gimple_build_call_internal(), gimple_build_cond(), gimple_build_goto(), gimple_build_label(), gimple_call_set_lhs(), gimple_location(), gimple_omp_for_clauses(), gimple_omp_for_set_clauses(), gimple_seq_add_stmt(), gsi_replace(), integer_type_node, integer_zero_node, NULL, OMP_CLAUSE__SIMT_, OMP_CLAUSE_CHAIN, scan_omp_for(), omp_context::simt_stmt, omp_context::stmt, UNKNOWN_LOCATION, and update_stmt().
Referenced by scan_omp_1_stmt().
|
static |
Duplicate #pragma omp simd, one for the scan input phase loop and one for scan phase loop.
References as_a(), build_omp_clause(), copy_gimple_seq_and_replace_locals(), omp_context::for_simd_scan_phase, gcc_assert, gimple_build_omp_scan(), gimple_omp_body(), gimple_omp_body_ptr(), gimple_omp_scan_clauses(), gimple_omp_set_body(), gimple_seq_add_stmt(), gsi_end_p(), gsi_insert_after(), GSI_NEW_STMT, gsi_next(), gsi_none(), gsi_replace(), gsi_stmt(), integer_zero_node, maybe_lookup_ctx(), new_omp_context(), NULL, NULL_TREE, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_EXCLUSIVE, OMP_CLAUSE_INCLUSIVE, omp_find_scan(), omp_context::scan_inclusive, scan_omp(), omp_context::stmt, walk_stmt_info::stmt, UNKNOWN_LOCATION, and walk_gimple_seq_mod().
Referenced by scan_omp_1_stmt().
|
static |
Scan an OpenMP single directive.
References build_decl(), create_tmp_var_name(), omp_context::field_map, gimple_location(), gimple_omp_body_ptr(), gimple_omp_single_clauses(), layout_type(), lang_hooks_for_types::make_type, new_omp_context(), NULL, omp_context::record_type, scan_omp(), scan_sharing_clauses(), walk_stmt_info::stmt, TYPE_FIELDS, TYPE_NAME, and lang_hooks::types.
Referenced by scan_omp_1_stmt().
|
static |
Scan a GIMPLE_OMP_TARGET.
References build_decl(), omp_context::cb, create_omp_child_function(), create_tmp_var_name(), DECL_ALIGN, DECL_ARTIFICIAL, DECL_CHAIN, DECL_NAMELESS, copy_body_data::dst_fn, error_at(), omp_context::field_map, fixup_child_record_type(), gcc_assert, gimple_build_bind(), gimple_location(), gimple_omp_body_ptr(), gimple_omp_set_body(), gimple_omp_target_clauses(), gimple_omp_target_set_child_fn(), is_gimple_omp_offloaded(), layout_type(), lang_hooks_for_types::make_type, new_omp_context(), omp_context::nonteams_nested_p, nreverse(), NULL, omp_context::receiver_decl, omp_context::record_type, scan_omp(), scan_sharing_clauses(), walk_stmt_info::stmt, omp_context::teams_nested_p, TYPE_ARTIFICIAL, TYPE_FIELDS, TYPE_NAME, and lang_hooks::types.
Referenced by scan_omp_1_stmt().
|
static |
Scan an OpenMP task directive.
References add_taskreg_looptemp_clauses(), as_a(), build_decl(), build_int_cst(), omp_context::cb, create_omp_child_function(), create_tmp_var_name(), DECL_ARTIFICIAL, DECL_NAMELESS, copy_body_data::dst_fn, empty_body_p(), omp_context::field_map, GF_OMP_FOR_KIND_TASKLOOP, gimple_build_nop(), gimple_location(), gimple_omp_body(), gimple_omp_body_ptr(), gimple_omp_task_clauses(), gimple_omp_task_set_arg_align(), gimple_omp_task_set_arg_size(), gimple_omp_task_set_child_fn(), gimple_omp_task_taskloop_p(), gimple_omp_task_taskwait_p(), gsi_replace(), gsi_stmt(), omp_context::is_nested, long_integer_type_node, lang_hooks_for_types::make_type, new_omp_context(), NULL, OMP_CLAUSE_DEPEND, omp_find_clause(), omp_context::receiver_decl, omp_context::record_type, scan_omp(), scan_sharing_clauses(), omp_context::srecord_type, taskreg_contexts, taskreg_nesting_level, TYPE_ARTIFICIAL, TYPE_FIELDS, TYPE_NAME, and lang_hooks::types.
Referenced by scan_omp_1_stmt().
|
static |
Scan an OpenMP teams directive.
References build_decl(), omp_context::cb, create_omp_child_function(), create_tmp_var_name(), DECL_ARTIFICIAL, DECL_NAMELESS, copy_body_data::dst_fn, omp_context::field_map, gcc_assert, gimple_location(), gimple_omp_body_ptr(), gimple_omp_teams_clauses(), gimple_omp_teams_host(), gimple_omp_teams_set_child_fn(), lang_hooks_for_types::make_type, new_omp_context(), NULL, omp_context::receiver_decl, omp_context::record_type, scan_omp(), scan_sharing_clauses(), walk_stmt_info::stmt, taskreg_contexts, taskreg_nesting_level, TYPE_ARTIFICIAL, TYPE_FIELDS, TYPE_NAME, and lang_hooks::types.
Referenced by scan_omp_1_stmt().
|
static |
Instantiate decls as necessary in CTX to satisfy the data sharing specified by CLAUSES.
References omp_context::allocate_map, BITMAP_ALLOC, bitmap_set_bit, build_array_type(), build_decl(), build_int_cstu(), build_range_type(), build_tree_list(), omp_context::cb, COMPLETE_TYPE_P, DECL_ATTRIBUTES, DECL_CHAIN, DECL_CONTEXT, DECL_HAS_VALUE_EXPR_P, DECL_P, DECL_SIZE, DECL_UID, DECL_VALUE_EXPR, lang_hooks::decls, dump_enabled_p(), dump_printf_loc(), error_at(), omp_context::field_map, fixup_remapped_decl(), dump_user_location_t::from_location_t(), gcc_assert, gcc_checking_assert, gcc_unreachable, hash_map< KeyId, Value, Traits >::get(), get_base_address(), varpool_node::get_create(), GF_OMP_FOR_KIND_SIMD, gimple_omp_for_kind(), INDIRECT_REF_P, insert_decl_map(), insert_field_into_struct(), install_var_field(), install_var_local(), integer_onep(), integer_zero_node, integer_zerop(), is_gimple_omp_oacc(), is_gimple_omp_offloaded(), is_global_var(), is_host_teams_ctx(), is_oacc_kernels(), is_oacc_kernels_decomposed_part(), is_omp_target(), is_parallel_ctx(), is_task_ctx(), is_taskreg_ctx(), is_variable_sized(), omp_context::local_reduction_clauses, lookup_attribute(), lookup_decl(), omp_context::loop_p, make_addressable_vars, maybe_lookup_decl(), maybe_lookup_decl_in_outer_ctx(), MSG_NOTE, NULL, NULL_TREE, lang_hooks_for_decls::omp_array_data, OMP_CLAUSE__CACHE_, OMP_CLAUSE__CONDTEMP_, OMP_CLAUSE__CONDTEMP__ITER, OMP_CLAUSE__LOOPTEMP_, OMP_CLAUSE__REDUCTEMP_, OMP_CLAUSE__SIMT_, OMP_CLAUSE_ALIGNED, OMP_CLAUSE_ALLOCATE, OMP_CLAUSE_ALLOCATE_ALIGN, OMP_CLAUSE_ALLOCATE_ALLOCATOR, OMP_CLAUSE_ASYNC, OMP_CLAUSE_AUTO, OMP_CLAUSE_BIND, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_COLLAPSE, OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT, OMP_CLAUSE_DEFAULTMAP, OMP_CLAUSE_DEPEND, OMP_CLAUSE_DETACH, OMP_CLAUSE_DEVICE, OMP_CLAUSE_DIST_SCHEDULE, OMP_CLAUSE_FILTER, OMP_CLAUSE_FINAL, OMP_CLAUSE_FINALIZE, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_FROM, OMP_CLAUSE_GANG, OMP_CLAUSE_GRAINSIZE, OMP_CLAUSE_HAS_DEVICE_ADDR, OMP_CLAUSE_IF, OMP_CLAUSE_IF_PRESENT, OMP_CLAUSE_IN_REDUCTION, OMP_CLAUSE_INDEPENDENT, OMP_CLAUSE_IS_DEVICE_PTR, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ, OMP_CLAUSE_LINEAR, OMP_CLAUSE_LINEAR_GIMPLE_SEQ, OMP_CLAUSE_LOCATION, OMP_CLAUSE_MAP, OMP_CLAUSE_MAP_DECL_MAKE_ADDRESSABLE, OMP_CLAUSE_MAP_IN_REDUCTION, OMP_CLAUSE_MAP_KIND, OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION, OMP_CLAUSE_MERGEABLE, OMP_CLAUSE_NOGROUP, OMP_CLAUSE_NOHOST, OMP_CLAUSE_NONTEMPORAL, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_NUM_GANGS, OMP_CLAUSE_NUM_TASKS, OMP_CLAUSE_NUM_TEAMS, OMP_CLAUSE_NUM_THREADS, OMP_CLAUSE_NUM_WORKERS, OMP_CLAUSE_OPERAND, OMP_CLAUSE_ORDER, OMP_CLAUSE_ORDERED, OMP_CLAUSE_PRIORITY, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_PRIVATE_DEBUG, OMP_CLAUSE_PRIVATE_OUTER_REF, OMP_CLAUSE_PROC_BIND, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_REDUCTION_GIMPLE_INIT, OMP_CLAUSE_REDUCTION_GIMPLE_MERGE, OMP_CLAUSE_REDUCTION_INSCAN, OMP_CLAUSE_REDUCTION_PLACEHOLDER, OMP_CLAUSE_REDUCTION_TASK, OMP_CLAUSE_SAFELEN, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_SELF, OMP_CLAUSE_SEQ, OMP_CLAUSE_SET_CODE, OMP_CLAUSE_SHARED, OMP_CLAUSE_SHARED_FIRSTPRIVATE, OMP_CLAUSE_SHARED_READONLY, OMP_CLAUSE_SIMD, OMP_CLAUSE_SIMDLEN, OMP_CLAUSE_SIZE, OMP_CLAUSE_TASK_REDUCTION, OMP_CLAUSE_THREAD_LIMIT, OMP_CLAUSE_THREADS, OMP_CLAUSE_TILE, OMP_CLAUSE_TO, OMP_CLAUSE_UNTIED, OMP_CLAUSE_USE_DEVICE_ADDR, OMP_CLAUSE_USE_DEVICE_PTR, OMP_CLAUSE_VECTOR, OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_WAIT, OMP_CLAUSE_WORKER, omp_copy_decl_1(), lang_hooks_for_decls::omp_deep_mapping_p, omp_is_allocatable_or_ptr(), omp_maybe_offloaded_ctx(), omp_privatize_by_reference(), OMP_REQUIRES_DYNAMIC_ALLOCATORS, omp_requires_mask, omp_context::order_concurrent, omp_context::outer, POINTER_TYPE_P, poly_int_tree_p(), ptr_type_node, hash_map< KeyId, Value, Traits >::put(), omp_context::record_type, remap_type(), hash_map< KeyId, Value, Traits >::remove(), scan_omp(), scan_omp_op(), seen_error(), SET_DECL_ALIGN, size_type_node, omp_context::stmt, TREE_ADDRESSABLE, TREE_CODE, tree_cons(), TREE_OPERAND, TREE_READONLY, TREE_TYPE, TYPE_ALIGN, TYPE_FIELDS, UNKNOWN_LOCATION, and use_pointer_for_field().
Referenced by scan_omp_1_stmt(), scan_omp_for(), scan_omp_parallel(), scan_omp_sections(), scan_omp_single(), scan_omp_target(), scan_omp_task(), and scan_omp_teams().
|
static |
Return true if FNDECL is a setjmp or a longjmp.
References DECL_CONTEXT, DECL_NAME, fndecl_built_in_p(), IDENTIFIER_POINTER, NULL_TREE, TREE_CODE, and TREE_PUBLIC.
Referenced by scan_omp_1_stmt().
|
static |
References omp_taskcopy_context::cb, create_tmp_var, omp_taskcopy_context::ctx, omp_context::sfield_map, and TREE_TYPE.
Referenced by create_task_copyfn().
|
static |
References build_decl(), omp_taskcopy_context::cb, copy_node(), copy_tree_body_r(), omp_taskcopy_context::ctx, DECL_CONTEXT, DECL_FIELD_OFFSET, copy_body_data::decl_map, DECL_NAME, DECL_SIZE, DECL_SIZE_UNIT, gimple_location(), layout_type(), lang_hooks_for_types::make_type, nreverse(), NULL, hash_map< KeyId, Value, Traits >::put(), remap_type(), omp_context::stmt, TREE_CHAIN, TREE_TYPE, TYPE_FIELDS, TYPE_NAME, lang_hooks::types, and walk_tree.
Referenced by create_task_copyfn().
|
static |
Helper function for lower_rec_input_clauses. Emit into ilist sequence code to emit (type) (tskred_temp[idx]).
References build2(), build_int_cst(), create_tmp_var, g, gimple_assign_lhs(), gimple_build_assign(), gimple_seq_add_stmt(), pointer_sized_int_node, r, tree_to_uhwi(), TREE_TYPE, TYPE_SIZE_UNIT, and useless_type_conversion_p().
Referenced by lower_rec_input_clauses().
Return unshare_expr (X) with all occurrences of FROM replaced with TO.
References NULL, unshare_and_remap_1(), unshare_expr(), and walk_tree.
Referenced by build_outer_var_ref(), lower_omp_regimplify_operands_p(), lower_send_clauses(), and lower_send_shared_vars().
Helper for unshare_and_remap, called through walk_tree.
References IS_TYPE_OR_DECL_P, NULL_TREE, and unshare_expr().
Referenced by unshare_and_remap().
|
static |
Return true if DECL should be copied by pointer. SHARED_CTX is the parallel context if DECL is to be shared.
References AGGREGATE_TYPE_P, BITMAP_ALLOC, bitmap_bit_p, bitmap_set_bit, DECL_BY_REFERENCE, DECL_HAS_VALUE_EXPR_P, DECL_SIZE, DECL_UID, gcc_assert, gimple_omp_target_clauses(), gimple_omp_taskreg_clauses(), global_nonaddressable_vars, is_gimple_omp_oacc(), is_gimple_omp_offloaded(), is_gimple_reg(), is_global_var(), omp_context::is_nested, is_task_ctx(), is_taskreg_ctx(), make_addressable_vars, maybe_lookup_decl(), maybe_lookup_decl_in_outer_ctx(), NULL, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_MAP, OMP_CLAUSE_SHARED, omp_member_access_dummy_var(), omp_context::outer, POLY_INT_CST_P, omp_context::stmt, TREE_ADDRESSABLE, TREE_CODE, TREE_READONLY, TREE_TYPE, and TYPE_ATOMIC.
Referenced by build_outer_var_ref(), create_task_copyfn(), finish_taskreg_scan(), lower_copyprivate_clauses(), lower_rec_input_clauses(), lower_send_clauses(), lower_send_shared_vars(), and scan_sharing_clauses().
|
static |
Referenced by execute_lower_omp(), maybe_lookup_ctx(), and new_omp_context().
|
static |
The following is a utility to diagnose structured block violations. It is not part of the "omplower" pass, as that's invoked too late. It should be invoked by the respective front ends after gimplification.
Referenced by diagnose_omp_structured_block_errors(), diagnose_sb_1(), and diagnose_sb_2().
Gimplify a GIMPLE_OMP_CRITICAL statement. This is a relatively simple substitution of a couple of function calls. But in the NAMED case, requires that languages coordinate a symbol name. It is therefore best put here in common code.
Referenced by lower_omp_critical().
|
static |
Referenced by execute_lower_omp(), omp_copy_decl_2(), and use_pointer_for_field().
|
static |
|
static |
Referenced by lower_omp(), and lower_omp_target().
Referenced by create_task_copyfn(), and execute_lower_omp().
|
static |
Referenced by execute_lower_omp(), scan_omp_parallel(), scan_omp_task(), and scan_omp_teams().
|
static |
Referenced by execute_lower_omp(), lower_omp(), scan_omp_1_stmt(), scan_omp_parallel(), scan_omp_task(), and scan_omp_teams().