GCC Middle and Back End API Reference
omp-low.cc File 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"
Include dependency graph for omp-low.cc:

Data Structures

struct  omp_context
 
class  omplow_simd_context
 
struct  omp_taskcopy_context
 
struct  lower_omp_regimplify_operands_data
 

Macros

#define WALK_SUBSTMTS
 

Functions

static void scan_omp (gimple_seq *, omp_context *)
 
static tree scan_omp_1_op (tree *, int *, void *)
 
static bool omp_maybe_offloaded_ctx (omp_context *ctx)
 
static bool is_oacc_parallel_or_serial (omp_context *ctx)
 
static bool is_oacc_kernels (omp_context *ctx)
 
static bool is_oacc_kernels_decomposed_part (omp_context *ctx)
 
static bool is_omp_target (gimple *stmt)
 
tree omp_member_access_dummy_var (tree decl)
 
static tree unshare_and_remap_1 (tree *tp, int *walk_subtrees, void *data)
 
static tree unshare_and_remap (tree x, tree from, tree to)
 
static tree scan_omp_op (tree *tp, omp_context *ctx)
 
static void lower_omp (gimple_seq *, omp_context *)
 
static tree lookup_decl_in_outer_ctx (tree, omp_context *)
 
static tree maybe_lookup_decl_in_outer_ctx (tree, omp_context *)
 
static bool is_parallel_ctx (omp_context *ctx)
 
static bool is_task_ctx (omp_context *ctx)
 
static bool is_taskloop_ctx (omp_context *ctx)
 
static bool is_host_teams_ctx (omp_context *ctx)
 
static bool is_taskreg_ctx (omp_context *ctx)
 
static bool is_variable_sized (const_tree expr)
 
static tree lookup_decl (tree var, omp_context *ctx)
 
static tree maybe_lookup_decl (const_tree var, omp_context *ctx)
 
static tree lookup_field (tree var, omp_context *ctx)
 
static tree lookup_sfield (splay_tree_key key, omp_context *ctx)
 
static tree lookup_sfield (tree var, omp_context *ctx)
 
static tree maybe_lookup_field (splay_tree_key key, omp_context *ctx)
 
static tree maybe_lookup_field (tree var, omp_context *ctx)
 
static bool use_pointer_for_field (tree decl, omp_context *shared_ctx)
 
static tree omp_copy_decl_2 (tree var, tree name, tree type, omp_context *ctx)
 
static tree omp_copy_decl_1 (tree var, omp_context *ctx)
 
static tree build_receiver_ref (tree var, bool by_ref, omp_context *ctx)
 
static tree build_outer_var_ref (tree var, omp_context *ctx, enum omp_clause_code code=OMP_CLAUSE_ERROR)
 
static tree build_sender_ref (splay_tree_key key, omp_context *ctx)
 
static tree build_sender_ref (tree var, omp_context *ctx)
 
static void install_var_field (tree var, bool by_ref, int mask, omp_context *ctx)
 
static tree install_var_local (tree var, omp_context *ctx)
 
static void fixup_remapped_decl (tree decl, omp_context *ctx, bool private_debug)
 
static tree omp_copy_decl (tree var, copy_body_data *cb)
 
static omp_contextnew_omp_context (gimple *stmt, omp_context *outer_ctx)
 
static gimple_seq maybe_catch_exception (gimple_seq)
 
static void finalize_task_copyfn (gomp_task *task_stmt)
 
static void delete_omp_context (splay_tree_value value)
 
static void fixup_child_record_type (omp_context *ctx)
 
static void scan_sharing_clauses (tree clauses, omp_context *ctx)
 
static tree create_omp_child_function_name (bool task_copy)
 
static void create_omp_child_function (omp_context *ctx, bool task_copy)
 
tree omp_find_combined_for (gimple_stmt_iterator *gsi_p, bool *handled_ops_p, struct walk_stmt_info *wi)
 
static void add_taskreg_looptemp_clauses (enum gf_mask msk, gimple *stmt, omp_context *outer_ctx)
 
static void scan_omp_parallel (gimple_stmt_iterator *gsi, omp_context *outer_ctx)
 
static void scan_omp_task (gimple_stmt_iterator *gsi, omp_context *outer_ctx)
 
static tree finish_taskreg_remap (tree *tp, int *walk_subtrees, void *data)
 
static void finish_taskreg_scan (omp_context *ctx)
 
static omp_contextenclosing_target_ctx (omp_context *ctx)
 
static bool ctx_in_oacc_kernels_region (omp_context *ctx)
 
static unsigned check_oacc_kernel_gwv (gomp_for *stmt, omp_context *ctx)
 
static omp_contextscan_omp_for (gomp_for *stmt, omp_context *outer_ctx)
 
static void scan_omp_simd (gimple_stmt_iterator *gsi, gomp_for *stmt, omp_context *outer_ctx)
 
static tree omp_find_scan (gimple_stmt_iterator *, bool *, struct walk_stmt_info *)
 
static omp_contextmaybe_lookup_ctx (gimple *)
 
static void scan_omp_simd_scan (gimple_stmt_iterator *gsi, gomp_for *stmt, omp_context *outer_ctx)
 
static void scan_omp_sections (gomp_sections *stmt, omp_context *outer_ctx)
 
static void scan_omp_single (gomp_single *stmt, omp_context *outer_ctx)
 
static void scan_omp_target (gomp_target *stmt, omp_context *outer_ctx)
 
static void scan_omp_teams (gomp_teams *stmt, omp_context *outer_ctx)
 
static bool check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx)
 
static bool setjmp_or_longjmp_p (const_tree fndecl)
 
static tree scan_omp_1_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p, struct walk_stmt_info *wi)
 
static void maybe_remove_omp_member_access_dummy_vars (gbind *bind)
 
static void remove_member_access_dummy_vars (tree block)
 
tree omp_reduction_init_op (location_t loc, enum tree_code op, tree type)
 
tree omp_reduction_init (tree clause, tree type)
 
static tree omp_clause_aligned_alignment (tree clause)
 
static bool lower_rec_simd_input_clauses (tree new_var, omp_context *ctx, omplow_simd_context *sctx, tree &ivar, tree &lvar, tree *rvar=NULL, tree *rvar2=NULL)
 
static void handle_simd_reference (location_t loc, tree new_vard, gimple_seq *ilist)
 
static tree task_reduction_read (gimple_seq *ilist, tree tskred_temp, tree type, unsigned idx)
 
static bool lower_private_allocate (tree var, tree new_var, tree &allocator, tree &allocate_ptr, gimple_seq *ilist, omp_context *ctx, bool is_ref, tree size)
 
static void lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist, omp_context *ctx, struct omp_for_data *fd)
 
static void lower_lastprivate_conditional_clauses (tree *clauses, omp_context *ctx)
 
static void lower_lastprivate_clauses (tree clauses, tree predicate, gimple_seq *body_p, gimple_seq *stmt_list, gimple_seq *cstmt_list, omp_context *ctx)
 
static void lower_oacc_reductions (location_t loc, tree clauses, tree level, bool inner, gcall *fork, gcall *private_marker, gcall *join, gimple_seq *fork_seq, gimple_seq *join_seq, omp_context *ctx)
 
static void lower_reduction_clauses (tree clauses, gimple_seq *stmt_seqp, gimple_seq *clist, omp_context *ctx)
 
static void lower_copyprivate_clauses (tree clauses, gimple_seq *slist, gimple_seq *rlist, omp_context *ctx)
 
static void lower_send_clauses (tree clauses, gimple_seq *ilist, gimple_seq *olist, omp_context *ctx)
 
static void lower_send_shared_vars (gimple_seq *ilist, gimple_seq *olist, omp_context *ctx)
 
static unsigned lower_oacc_head_mark (location_t loc, tree ddvar, tree clauses, gimple_seq *seq, omp_context *ctx)
 
static void lower_oacc_loop_marker (location_t loc, tree ddvar, bool head, tree tofollow, gimple_seq *seq)
 
static void lower_oacc_head_tail (location_t loc, tree clauses, gcall *private_marker, gimple_seq *head, gimple_seq *tail, omp_context *ctx)
 
static void maybe_add_implicit_barrier_cancel (omp_context *ctx, gimple *omp_return, gimple_seq *body)
 
static tree omp_task_reductions_find_first (tree clauses, enum tree_code code, enum omp_clause_code ccode)
 
static void lower_omp_task_reductions (omp_context *, enum tree_code, tree, gimple_seq *, gimple_seq *)
 
static void lower_omp_sections (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 
static void lower_omp_single_simple (gomp_single *single_stmt, gimple_seq *pre_p)
 
static void lower_omp_single_copy (gomp_single *single_stmt, gimple_seq *pre_p, omp_context *ctx)
 
static void lower_omp_single (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 
static void lower_omp_scope (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 
static void lower_omp_dispatch (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 
static void lower_omp_master (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 
static bool omp_task_reduction_iterate (int pass, enum tree_code code, enum omp_clause_code ccode, tree *c, tree *decl, tree *type, tree *next)
 
static void lower_omp_taskgroup (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 
static void lower_omp_ordered_clauses (gimple_stmt_iterator *gsi_p, gomp_ordered *ord_stmt, omp_context *ctx)
 
static void lower_omp_ordered (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 
static void lower_omp_scan (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 
static void lower_omp_critical (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 
static void lower_omp_for_lastprivate (struct omp_for_data *fd, gimple_seq *body_p, gimple_seq *dlist, gimple_seq *clist, struct omp_context *ctx)
 
static void oacc_privatization_begin_diagnose_var (const dump_flags_t l_dump_flags, const location_t loc, const tree c, const tree decl)
 
static bool oacc_privatization_candidate_p (const location_t loc, const tree c, const tree decl)
 
static void oacc_privatization_scan_clause_chain (omp_context *ctx, tree clauses)
 
static void oacc_privatization_scan_decl_chain (omp_context *ctx, tree decls)
 
static void lower_omp_for_scan (gimple_seq *body_p, gimple_seq *dlist, gomp_for *stmt, struct omp_for_data *fd, omp_context *ctx)
 
static gcalllower_oacc_private_marker (omp_context *ctx)
 
static void lower_omp_for (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 
static tree check_combined_parallel (gimple_stmt_iterator *gsi_p, bool *handled_ops_p, struct walk_stmt_info *wi)
 
static tree task_copyfn_copy_decl (tree var, copy_body_data *cb)
 
static tree task_copyfn_remap_type (struct omp_taskcopy_context *tcctx, tree orig_type)
 
static void create_task_copyfn (gomp_task *task_stmt, omp_context *ctx)
 
static void lower_depend_clauses (tree *pclauses, gimple_seq *iseq, gimple_seq *oseq)
 
static void lower_omp_taskreg (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 
static void lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 
static void lower_omp_interop_action_clauses (gimple_seq *seq, vec< tree > &objs, vec< tree > *interop_types=NULL, vec< tree > *prefer_types=NULL)
 
static void lower_omp_interop (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 
static void lower_omp_teams (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 
static tree lower_omp_regimplify_p (tree *tp, int *walk_subtrees, void *data)
 
static tree lower_omp_regimplify_operands_p (tree *tp, int *walk_subtrees, void *data)
 
static void lower_omp_regimplify_operands (omp_context *ctx, gimple *stmt, gimple_stmt_iterator *gsi_p)
 
static void lower_omp_1 (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 
static unsigned int execute_lower_omp (void)
 
gimple_opt_passmake_pass_lower_omp (gcc::context *ctxt)
 
static bool diagnose_sb_0 (gimple_stmt_iterator *gsi_p, gimple *branch_ctx, gimple *label_ctx)
 
static tree diagnose_sb_1 (gimple_stmt_iterator *gsi_p, bool *handled_ops_p, struct walk_stmt_info *wi)
 
static tree diagnose_sb_2 (gimple_stmt_iterator *gsi_p, bool *handled_ops_p, struct walk_stmt_info *wi)
 
static unsigned int diagnose_omp_structured_block_errors (void)
 
gimple_opt_passmake_pass_diagnose_omp_blocks (gcc::context *ctxt)
 

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
 

Macro Definition Documentation

◆ WALK_SUBSTMTS

#define WALK_SUBSTMTS
Value:
case GIMPLE_BIND: \
case GIMPLE_TRY: \
case GIMPLE_CATCH: \
case GIMPLE_EH_FILTER: \
case GIMPLE_ASSUME: \
case GIMPLE_TRANSACTION: \
/* The sub-statements for these should be walked. @endverbatim */ \
*handled_ops_p = false; \
break;

Referenced by check_combined_parallel(), diagnose_sb_1(), diagnose_sb_2(), omp_find_combined_for(), and omp_find_scan().

Function Documentation

◆ add_taskreg_looptemp_clauses()

◆ build_outer_var_ref()

◆ build_receiver_ref()

static tree build_receiver_ref ( tree var,
bool by_ref,
omp_context * ctx )
static

◆ build_sender_ref() [1/2]

static tree build_sender_ref ( splay_tree_key key,
omp_context * ctx )
static

◆ build_sender_ref() [2/2]

static tree build_sender_ref ( tree var,
omp_context * ctx )
static

References build_sender_ref().

◆ check_combined_parallel()

static tree check_combined_parallel ( gimple_stmt_iterator * gsi_p,
bool * handled_ops_p,
struct walk_stmt_info * wi )
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().

◆ check_oacc_kernel_gwv()

static unsigned check_oacc_kernel_gwv ( gomp_for * stmt,
omp_context * ctx )
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().

◆ check_omp_nesting_restrictions()

static bool check_omp_nesting_restrictions ( gimple * stmt,
omp_context * ctx )
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().

◆ create_omp_child_function()

◆ create_omp_child_function_name()

static tree create_omp_child_function_name ( bool task_copy)
static
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().

◆ create_task_copyfn()

static void create_task_copyfn ( gomp_task * task_stmt,
omp_context * ctx )
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().

◆ ctx_in_oacc_kernels_region()

static bool ctx_in_oacc_kernels_region ( omp_context * ctx)
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().

◆ delete_omp_context()

◆ diagnose_omp_structured_block_errors()

static unsigned int diagnose_omp_structured_block_errors ( void )
static

◆ diagnose_sb_0()

static bool diagnose_sb_0 ( gimple_stmt_iterator * gsi_p,
gimple * branch_ctx,
gimple * label_ctx )
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().

◆ diagnose_sb_1()

static tree diagnose_sb_1 ( gimple_stmt_iterator * gsi_p,
bool * handled_ops_p,
struct walk_stmt_info * wi )
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().

◆ diagnose_sb_2()

◆ enclosing_target_ctx()

static omp_context * enclosing_target_ctx ( omp_context * ctx)
static
Find the enclosing offload context.

References omp_context::outer, and omp_context::stmt.

Referenced by lower_oacc_head_mark(), and scan_omp_for().

◆ execute_lower_omp()

◆ finalize_task_copyfn()

◆ finish_taskreg_remap()

static tree finish_taskreg_remap ( tree * tp,
int * walk_subtrees,
void * data )
static
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().

◆ finish_taskreg_scan()

◆ fixup_child_record_type()

◆ fixup_remapped_decl()

static void fixup_remapped_decl ( tree decl,
omp_context * ctx,
bool private_debug )
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().

◆ handle_simd_reference()

static void handle_simd_reference ( location_t loc,
tree new_vard,
gimple_seq * ilist )
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().

◆ install_var_field()

◆ install_var_local()

static tree install_var_local ( tree var,
omp_context * ctx )
static

◆ is_host_teams_ctx()

static bool is_host_teams_ctx ( omp_context * ctx)
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().

◆ is_oacc_kernels()

static bool is_oacc_kernels ( omp_context * ctx)
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().

◆ is_oacc_kernels_decomposed_part()

◆ is_oacc_parallel_or_serial()

static bool is_oacc_parallel_or_serial ( omp_context * ctx)
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().

◆ is_omp_target()

static bool is_omp_target ( gimple * stmt)
static

◆ is_parallel_ctx()

static bool is_parallel_ctx ( omp_context * ctx)
inlinestatic

◆ is_task_ctx()

◆ is_taskloop_ctx()

static bool is_taskloop_ctx ( omp_context * ctx)
inlinestatic

◆ is_taskreg_ctx()

static bool is_taskreg_ctx ( omp_context * ctx)
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().

◆ is_variable_sized()

◆ lookup_decl()

◆ lookup_decl_in_outer_ctx()

static tree lookup_decl_in_outer_ctx ( tree decl,
omp_context * ctx )
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().

◆ lookup_field()

static tree lookup_field ( tree var,
omp_context * ctx )
inlinestatic

◆ lookup_sfield() [1/2]

static tree lookup_sfield ( splay_tree_key key,
omp_context * ctx )
inlinestatic

◆ lookup_sfield() [2/2]

static tree lookup_sfield ( tree var,
omp_context * ctx )
inlinestatic

References lookup_sfield().

◆ lower_copyprivate_clauses()

◆ lower_depend_clauses()

◆ lower_lastprivate_clauses()

static void lower_lastprivate_clauses ( tree clauses,
tree predicate,
gimple_seq * body_p,
gimple_seq * stmt_list,
gimple_seq * cstmt_list,
omp_context * ctx )
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().

◆ lower_lastprivate_conditional_clauses()

◆ lower_oacc_head_mark()

◆ lower_oacc_head_tail()

static void lower_oacc_head_tail ( location_t loc,
tree clauses,
gcall * private_marker,
gimple_seq * head,
gimple_seq * tail,
omp_context * ctx )
static

◆ lower_oacc_loop_marker()

static void lower_oacc_loop_marker ( location_t loc,
tree ddvar,
bool head,
tree tofollow,
gimple_seq * seq )
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().

◆ lower_oacc_private_marker()

static gcall * lower_oacc_private_marker ( omp_context * ctx)
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().

◆ lower_oacc_reductions()

static void lower_oacc_reductions ( location_t loc,
tree clauses,
tree level,
bool inner,
gcall * fork,
gcall * private_marker,
gcall * join,
gimple_seq * fork_seq,
gimple_seq * join_seq,
omp_context * ctx )
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().

◆ lower_omp()

◆ lower_omp_1()

static void lower_omp_1 ( gimple_stmt_iterator * gsi_p,
omp_context * ctx )
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_interop(), 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().

◆ lower_omp_critical()

◆ lower_omp_dispatch()

◆ lower_omp_for()

static void lower_omp_for ( gimple_stmt_iterator * gsi_p,
omp_context * ctx )
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().

◆ lower_omp_for_lastprivate()

static void lower_omp_for_lastprivate ( struct omp_for_data * fd,
gimple_seq * body_p,
gimple_seq * dlist,
gimple_seq * clist,
struct omp_context * ctx )
static

◆ lower_omp_for_scan()

static void lower_omp_for_scan ( gimple_seq * body_p,
gimple_seq * dlist,
gomp_for * stmt,
struct omp_for_data * fd,
omp_context * ctx )
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().

◆ lower_omp_interop()

◆ lower_omp_interop_action_clauses()

static void lower_omp_interop_action_clauses ( gimple_seq * seq,
vec< tree > & objs,
vec< tree > * interop_types = NULL,
vec< tree > * prefer_types = NULL )
static

◆ lower_omp_master()

◆ lower_omp_ordered()

◆ lower_omp_ordered_clauses()

◆ lower_omp_regimplify_operands()

static void lower_omp_regimplify_operands ( omp_context * ctx,
gimple * stmt,
gimple_stmt_iterator * gsi_p )
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().

◆ lower_omp_regimplify_operands_p()

static tree lower_omp_regimplify_operands_p ( tree * tp,
int * walk_subtrees,
void * data )
static
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().

◆ lower_omp_regimplify_p()

static tree lower_omp_regimplify_p ( tree * tp,
int * walk_subtrees,
void * data )
static
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().

◆ lower_omp_scan()

static void lower_omp_scan ( gimple_stmt_iterator * gsi_p,
omp_context * ctx )
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().

◆ lower_omp_scope()

◆ lower_omp_sections()

static void lower_omp_sections ( gimple_stmt_iterator * gsi_p,
omp_context * ctx )
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().

◆ lower_omp_single()

◆ lower_omp_single_copy()

static void lower_omp_single_copy ( gomp_single * single_stmt,
gimple_seq * pre_p,
omp_context * ctx )
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 (&copyout); } 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().

◆ lower_omp_single_simple()

static void lower_omp_single_simple ( gomp_single * single_stmt,
gimple_seq * pre_p )
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().

◆ lower_omp_target()

static void lower_omp_target ( gimple_stmt_iterator * gsi_p,
omp_context * ctx )
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().

◆ lower_omp_task_reductions()

static void lower_omp_task_reductions ( omp_context * ctx,
enum tree_code code,
tree clauses,
gimple_seq * start,
gimple_seq * end )
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().

◆ lower_omp_taskgroup()

◆ lower_omp_taskreg()

static void lower_omp_taskreg ( gimple_stmt_iterator * gsi_p,
omp_context * ctx )
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().

◆ lower_omp_teams()

◆ lower_private_allocate()

◆ lower_rec_input_clauses()

static void lower_rec_input_clauses ( tree clauses,
gimple_seq * ilist,
gimple_seq * dlist,
omp_context * ctx,
struct omp_for_data * fd )
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().

◆ lower_rec_simd_input_clauses()

◆ lower_reduction_clauses()

static void lower_reduction_clauses ( tree clauses,
gimple_seq * stmt_seqp,
gimple_seq * clist,
omp_context * ctx )
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().

◆ lower_send_clauses()

◆ lower_send_shared_vars()

◆ make_pass_diagnose_omp_blocks()

gimple_opt_pass * make_pass_diagnose_omp_blocks ( gcc::context * ctxt)

◆ make_pass_lower_omp()

gimple_opt_pass * make_pass_lower_omp ( gcc::context * ctxt)

◆ maybe_add_implicit_barrier_cancel()

static void maybe_add_implicit_barrier_cancel ( omp_context * ctx,
gimple * omp_return,
gimple_seq * body )
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().

◆ maybe_catch_exception()

static gimple_seq maybe_catch_exception ( gimple_seq body)
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().

◆ maybe_lookup_ctx()

static omp_context * maybe_lookup_ctx ( gimple * stmt)
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().

◆ maybe_lookup_decl()

◆ maybe_lookup_decl_in_outer_ctx()

◆ maybe_lookup_field() [1/2]

static tree maybe_lookup_field ( splay_tree_key key,
omp_context * ctx )
inlinestatic

◆ maybe_lookup_field() [2/2]

static tree maybe_lookup_field ( tree var,
omp_context * ctx )
inlinestatic

References maybe_lookup_field().

◆ maybe_remove_omp_member_access_dummy_vars()

static void maybe_remove_omp_member_access_dummy_vars ( gbind * bind)
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().

◆ new_omp_context()

◆ oacc_privatization_begin_diagnose_var()

static void oacc_privatization_begin_diagnose_var ( const dump_flags_t l_dump_flags,
const location_t loc,
const tree c,
const tree decl )
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().

◆ oacc_privatization_candidate_p()

◆ oacc_privatization_scan_clause_chain()

static void oacc_privatization_scan_clause_chain ( omp_context * ctx,
tree clauses )
static

◆ oacc_privatization_scan_decl_chain()

static void oacc_privatization_scan_decl_chain ( omp_context * ctx,
tree decls )
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().

◆ omp_clause_aligned_alignment()

◆ omp_copy_decl()

static tree omp_copy_decl ( tree var,
copy_body_data * cb )
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().

◆ omp_copy_decl_1()

static tree omp_copy_decl_1 ( tree var,
omp_context * ctx )
static

◆ omp_copy_decl_2()

static tree omp_copy_decl_2 ( tree var,
tree name,
tree type,
omp_context * ctx )
static

◆ omp_find_combined_for()

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().

◆ omp_find_scan()

static tree omp_find_scan ( gimple_stmt_iterator * gsi_p,
bool * handled_ops_p,
struct walk_stmt_info * wi )
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().

◆ omp_maybe_offloaded_ctx()

static bool omp_maybe_offloaded_ctx ( omp_context * ctx)
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().

◆ omp_member_access_dummy_var()

◆ omp_reduction_init()

tree omp_reduction_init ( tree clause,
tree type )
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().

◆ omp_reduction_init_op()

◆ omp_task_reduction_iterate()

static bool omp_task_reduction_iterate ( int pass,
enum tree_code code,
enum omp_clause_code ccode,
tree * c,
tree * decl,
tree * type,
tree * next )
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().

◆ omp_task_reductions_find_first()

static tree omp_task_reductions_find_first ( tree clauses,
enum tree_code code,
enum omp_clause_code ccode )
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().

◆ remove_member_access_dummy_vars()

static void remove_member_access_dummy_vars ( tree block)
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().

◆ scan_omp()

static void scan_omp ( gimple_seq * body_p,
omp_context * ctx )
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().

◆ scan_omp_1_op()

static tree scan_omp_1_op ( tree * tp,
int * walk_subtrees,
void * data )
static
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().

◆ scan_omp_1_stmt()

static tree scan_omp_1_stmt ( gimple_stmt_iterator * gsi,
bool * handled_ops_p,
struct walk_stmt_info * wi )
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().

◆ scan_omp_for()

◆ scan_omp_op()

static tree scan_omp_op ( tree * tp,
omp_context * ctx )
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().

◆ scan_omp_parallel()

◆ scan_omp_sections()

static void scan_omp_sections ( gomp_sections * stmt,
omp_context * outer_ctx )
static

◆ scan_omp_simd()

◆ scan_omp_simd_scan()

◆ scan_omp_single()

◆ scan_omp_target()

◆ scan_omp_task()

◆ scan_omp_teams()

◆ scan_sharing_clauses()

static void scan_sharing_clauses ( tree clauses,
omp_context * ctx )
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_DESTROY, 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_INIT, 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, 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().

◆ setjmp_or_longjmp_p()

static bool setjmp_or_longjmp_p ( const_tree fndecl)
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().

◆ task_copyfn_copy_decl()

static tree task_copyfn_copy_decl ( tree var,
copy_body_data * cb )
static

◆ task_copyfn_remap_type()

◆ task_reduction_read()

static tree task_reduction_read ( gimple_seq * ilist,
tree tskred_temp,
tree type,
unsigned idx )
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().

◆ unshare_and_remap()

static tree unshare_and_remap ( tree x,
tree from,
tree to )
static
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().

◆ unshare_and_remap_1()

static tree unshare_and_remap_1 ( tree * tp,
int * walk_subtrees,
void * data )
static
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().

◆ use_pointer_for_field()

Variable Documentation

◆ all_contexts

splay_tree all_contexts
static

◆ all_labels

splay_tree all_labels
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().

◆ critical_name_mutexes

hash_map<tree, tree>* critical_name_mutexes
static
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().

◆ global_nonaddressable_vars

bitmap global_nonaddressable_vars
static

◆ make_addressable_vars

◆ target_nesting_level

int target_nesting_level
static

Referenced by lower_omp(), and lower_omp_target().

◆ task_cpyfns

vec<gomp_task *> task_cpyfns
static

◆ taskreg_contexts

vec<omp_context *> taskreg_contexts
static

◆ taskreg_nesting_level