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 "internal-fn.h"
#include "langhooks.h"
#include "gimplify.h"
#include "gimple-iterator.h"
#include "gimplify-me.h"
#include "gimple-walk.h"
#include "tree-cfg.h"
#include "tree-into-ssa.h"
#include "tree-nested.h"
#include "stor-layout.h"
#include "common/common-target.h"
#include "omp-general.h"
#include "omp-offload.h"
#include "lto-section-names.h"
#include "gomp-constants.h"
#include "gimple-pretty-print.h"
#include "intl.h"
#include "stringpool.h"
#include "attribs.h"
#include "cfgloop.h"
#include "context.h"
#include "convert.h"
#include "opts.h"
#include "sync-builtins.def"
Data Structures | |
struct | oacc_loop |
struct | var_decl_rewrite_info |
Macros | |
#define | DEF_SYNC_BUILTIN(ENUM, NAME, TYPE, ATTRS) |
Variables | |
vec< tree, va_gc > * | offload_funcs |
vec< tree, va_gc > * | offload_vars |
vec< tree, va_gc > * | offload_ind_funcs |
static int | oacc_default_dims [GOMP_DIM_MAX] |
static int | oacc_min_dims [GOMP_DIM_MAX] |
|
static |
Helper function for omp_finish_file routine. Takes decls from V_DECLS and adds their addresses and sizes to constructor-vector V_CTOR.
References build_fold_addr_expr, const_ptr_type_node, CONSTRUCTOR_APPEND_ELT, DECL_ATTRIBUTES, DECL_HAS_VALUE_EXPR_P, DECL_SIZE_UNIT, DECL_VALUE_EXPR, varpool_node::finalize_decl(), fold_convert, symtab_node::get(), i, int_size_in_bytes(), lookup_attribute(), NULL_TREE, TREE_OPERAND, tree_to_uhwi(), VAR_P, vec_safe_length(), and wide_int_to_tree().
Referenced by omp_finish_file().
DEBUG_FUNCTION void debug_oacc_loop | ( | oacc_loop * | loop | ) |
Dump loops to stderr.
References dump_oacc_loop().
int default_goacc_dim_limit | ( | int | ARG_UNUSEDaxis | ) |
Default dimension bound is unknown on accelerator and 1 on host.
Default fork/join early expander. Delete the function calls if there is no RTL expander.
References targetm.
void default_goacc_reduction | ( | gcall * | call | ) |
Default goacc.reduction early expander. LHS-opt = IFN_REDUCTION (KIND, RES_PTR, VAR, LEVEL, OP, OFFSET) If RES_PTR is not integer-zerop: SETUP - emit 'LHS = *RES_PTR', LHS = NULL TEARDOWN - emit '*RES_PTR = VAR' If LHS is not NULL emit 'LHS = VAR'
References build_simple_mem_ref, gimple_build_assign(), gimple_call_arg(), gimple_call_lhs(), gimple_seq_add_stmt(), gsi_for_stmt(), gsi_replace_with_seq(), integer_zerop(), NULL, and TREE_INT_CST_LOW.
Referenced by execute_oacc_device_lower().
bool default_goacc_validate_dims | ( | tree | ARG_UNUSEDdecl, |
int * | dims, | ||
int | ARG_UNUSEDfn_level, | ||
unsigned | ARG_UNUSEDused ) |
Default launch dimension validator. Force everything to 1. A backend that wants to provide larger dimensions must override this hook.
References changed.
|
static |
Dump OpenACC loop LOOP, its children, and its siblings.
References DECL_NAME, DECL_SOURCE_FILE, DECL_SOURCE_LINE, dump_oacc_loop(), dump_oacc_loop_part(), IDENTIFIER_POINTER, LOCATION_FILE, LOCATION_LINE, and print_gimple_stmt().
Referenced by debug_oacc_loop(), dump_oacc_loop(), and execute_oacc_loop_designation().
|
static |
Dump out the OpenACC loop head or tail beginning at FROM.
References gimple_call_arg(), gimple_call_internal_p(), gsi_bb(), gsi_end_p(), gsi_for_stmt(), gsi_next(), gsi_start_bb(), gsi_stmt(), print_gimple_stmt(), single_succ(), and TREE_INT_CST_LOW.
Referenced by dump_oacc_loop().
|
static |
PR100695 "Format decoder, quoting in 'dump_printf' etc."
PR100695 "Format decoder, quoting in 'dump_printf' etc."
References var_decl_rewrite_info::adjusted_vars, as_a(), var_decl_rewrite_info::avoid_pointer_conversion, cfun, current_function_decl, DECL_SOURCE_LOCATION, default_goacc_reduction(), dump_enabled_p(), dump_printf_loc(), FOR_ALL_BB_FN, dump_user_location_t::from_location_t(), gcc_assert, gcc_checking_assert, get_openacc_privatization_dump_flags(), gimple_build_assign(), gimple_call_arg(), gimple_call_internal_fn(), gimple_call_internal_p(), gimple_call_lhs(), gimple_call_num_args(), gimple_location(), gimple_vdef(), gimple_vuse(), gsi_end_p(), gsi_next(), gsi_prev(), gsi_remove(), gsi_replace(), gsi_start_bb(), gsi_stmt(), i, integer_minus_onep(), hash_map< KeyId, Value, Traits >::is_empty(), is_gimple_call(), is_sync_builtin_call(), LOCATION_LOCUS, mark_virtual_operands_for_renaming(), var_decl_rewrite_info::modified, oacc_get_fn_attrib(), oacc_get_fn_dim_size(), oacc_rewrite_var_decl(), oacc_xform_loop(), oacc_xform_tile(), hash_map< KeyId, Value, Traits >::put(), replace_uses_by(), var_decl_rewrite_info::stmt, targetm, TREE_CODE, TREE_INT_CST_LOW, TREE_OPERAND, TREE_TYPE, UNKNOWN_LOCATION, update_stmt(), and walk_gimple_op().
|
static |
Main entry point for oacc transformations which run on the device compiler after LTO, so we know what the target device is at this point (including the host fallback).
References oacc_loop::child, current_function_decl, DECL_ATTRIBUTES, lang_hooks::decl_printable_name, DECL_SOURCE_LOCATION, dump_enabled_p(), dump_file, dump_oacc_loop(), free_oacc_loop(), gcc_checking_assert, gcc_unreachable, inform_oacc_loop(), is_oacc_kernels(), lookup_attribute(), oacc_loop::mask, new_oacc_loop_raw(), NULL, oacc_fn_attrib_level(), oacc_get_fn_attrib(), oacc_loop_discovery(), oacc_loop_partition(), oacc_loop_process(), oacc_parse_default_dims(), oacc_set_fn_attrib(), oacc_validate_dims(), omp_clause_code_name, OMP_CLAUSE_NOHOST, omp_find_clause(), TODO_discard_function, TREE_ASM_WRITTEN, and TREE_VALUE.
|
static |
Cleanup uses of SIMT placeholder internal functions: on non-SIMT targets, VF is 1 and LANE is 0; on SIMT targets, VF is folded to a constant, and LANE is kept to be expanded to RTL later on. Also cleanup all other SIMT internal functions on non-SIMT targets, and likewise some SIMD internal functions on SIMT targets.
References symtab_node::address_taken, build_int_cst(), build_one_cst(), build_zero_cst(), builtin_decl_explicit(), cgraph_node::calls_declare_variant_alt, cfun, create_tmp_reg(), dyn_cast(), find_simtpriv_var_op(), FOR_EACH_BB_FN, FOR_EACH_BB_REVERSE_FN, gcc_assert, cgraph_node::get(), gimple_build_assign(), gimple_build_call(), gimple_build_nop(), gimple_call_arg(), gimple_call_builtin_p(), gimple_call_fn(), gimple_call_fndecl(), gimple_call_internal_fn(), gimple_call_internal_p(), gimple_call_lhs(), gimple_call_set_arg(), gimple_call_set_fn(), gimple_call_set_fndecl(), gimple_call_set_lhs(), gimple_clobber_p(), gimple_location(), gimple_regimplify_operands(), gimple_set_location(), gsi_end_p(), gsi_insert_before(), gsi_last_bb(), gsi_next(), gsi_prev(), gsi_remove(), gsi_replace(), GSI_SAME_STMT, gsi_start_bb(), gsi_stmt(), i, integer_one_node, integer_type_node, integer_zero_node, is_gimple_call(), symtab_node::need_lto_streaming, NULL, null_pointer_node, NULL_TREE, offload_funcs, offload_ind_funcs, symtab_node::offloadable, omp_resolve_declare_variant(), ompdevlow_adjust_simt_enter(), targetm, TREE_CODE, TREE_OPERAND, TREE_TYPE, unlink_stmt_vdef(), update_stmt(), vec_safe_length(), and walk_gimple_stmt().
Callback for walk_gimple_stmt used to scan for SIMT-privatized variables.
References DECL_ATTRIBUTES, DECL_HAS_VALUE_EXPR_P, lookup_attribute(), NULL_TREE, and VAR_P.
Referenced by execute_omp_device_lower().
Finish off the current OpenACC loop ending at tail marker TAIL. Return the parent loop.
Referenced by oacc_loop_discover_walk().
|
static |
Free all OpenACC loop structures within LOOP (inclusive).
References free(), and free_oacc_loop().
Referenced by execute_oacc_loop_designation(), and free_oacc_loop().
|
static |
Provide diagnostics on OpenACC loop LOOP, its children, and its siblings.
References dump_printf_loc(), dump_user_location_t::from_location_t(), inform_oacc_loop(), and MSG_OPTIMIZED_LOCATIONS.
Referenced by execute_oacc_loop_designation(), and inform_oacc_loop().
Return TRUE if CALL is a call to a builtin atomic/sync operation.
This file contains the definitions and documentation for the synchronization builtins used in the GNU compiler. Copyright (C) 2005-2024 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
Before including this file, you should define a macro: DEF_SYNC_BUILTIN (ENUM, NAME, TYPE, ATTRS) See builtins.def for details.
Synchronization Primitives. The "_N" version is the one that the user is supposed to be using. It's overloaded, and is resolved to one of the "_1" through "_16" versions, plus some extra casts.
__sync* builtins for the C++ memory model.
This one is actually a function in libatomic and not expected to be inlined, declared here for convenience of targets generating calls to it.
References BUILT_IN_NORMAL, DECL_FUNCTION_CODE(), gimple_call_builtin_p(), gimple_call_fndecl(), and NULL_TREE.
Referenced by execute_oacc_device_lower().
gimple_opt_pass * make_pass_oacc_device_lower | ( | gcc::context * | ctxt | ) |
gimple_opt_pass * make_pass_oacc_loop_designation | ( | gcc::context * | ctxt | ) |
gimple_opt_pass * make_pass_omp_device_lower | ( | gcc::context * | ctxt | ) |
gimple_opt_pass * make_pass_omp_target_link | ( | gcc::context * | ctxt | ) |
Start a new OpenACC loop structure beginning at head marker HEAD. Link into PARENT loop. Return the new loop.
References gimple_call_arg(), gimple_location(), integer_zero_node, new_oacc_loop_raw(), OLF_GANG_STATIC, and TREE_INT_CST_LOW.
Referenced by oacc_loop_discover_walk().
Create an outermost, dummy OpenACC loop for offloaded function DECL.
References DECL_SOURCE_LOCATION, new_oacc_loop_raw(), and NULL.
Referenced by oacc_loop_discovery().
Create an empty OpenACC loop structure at LOC.
References oacc_loop::child.
Referenced by execute_oacc_loop_designation(), new_oacc_loop(), new_oacc_loop_outer(), and new_oacc_loop_routine().
|
static |
Create a dummy loop encompassing a call to a openACC routine. Extract the routine's partitioning requirements.
References gcc_assert, gimple_location(), new_oacc_loop_raw(), and oacc_fn_attrib_level().
Referenced by oacc_loop_discover_walk().
|
static |
Call dim_pos (POS == true) or dim_size (POS == false) builtins for axis DIM. Return a tmp var holding the result.
References build_int_cst(), create_tmp_var, gimple_build_call_internal(), gimple_call_set_lhs(), gimple_seq_add_stmt(), integer_type_node, and unsigned_type_node.
Referenced by oacc_thread_numbers(), and oacc_xform_tile().
int oacc_fn_attrib_level | ( | tree | attr | ) |
Return level at which oacc routine may spawn a partitioned loop, or -1 if it is not a routine (i.e. is an offload fn).
References integer_zerop(), TREE_CHAIN, TREE_PURPOSE, and TREE_VALUE.
Referenced by execute_oacc_loop_designation(), new_oacc_loop_routine(), and omp_sese_active_worker_call().
int oacc_get_default_dim | ( | int | dim | ) |
Bits of OpenMP and OpenACC handling that is specific to device offloading and a lowering pass for OpenACC device directives. Copyright (C) 2005-2024 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
References gcc_assert, and oacc_default_dims.
int oacc_get_min_dim | ( | int | dim | ) |
References gcc_assert, and oacc_min_dims.
|
static |
Walk the OpenACC loop heirarchy to assign auto-partitioned loops. OUTER_MASK is the partitioning this loop is contained within. OUTER_ASSIGN is true if an outer loop is being auto-partitioned. Return the cumulative partitioning used by this loop, siblings and children.
References dump_file, G_, loop::inner, least_bit_hwi(), LOCATION_FILE, LOCATION_LINE, oacc_loop_auto_partitions(), OLF_AUTO, OLF_INDEPENDENT, OLF_TILE, and warning_at().
Referenced by oacc_loop_auto_partitions(), and oacc_loop_partition().
|
static |
DFS walk of basic blocks BB onwards, creating OpenACC loop structures as we go. By construction these loops are properly nested.
References as_a(), BB_VISITED, count, finish_oacc_loop(), basic_block_def::flags, FOR_EACH_EDGE, gcc_assert, gimple_call_arg(), gimple_call_fndecl(), gimple_call_internal_fn(), gimple_call_internal_p(), gimple_call_num_args(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), is_gimple_call(), new_oacc_loop(), new_oacc_loop_routine(), oacc_get_fn_attrib(), oacc_loop_discover_walk(), single_pred_p(), single_succ(), basic_block_def::succs, and TREE_INT_CST_LOW.
Referenced by oacc_loop_discover_walk(), and oacc_loop_discovery().
|
static |
Discover the OpenACC loops marked up by HEAD and TAIL markers for the current function.
References cfun, clear_bb_flags(), current_function_decl, ENTRY_BLOCK_PTR_FOR_FN, new_oacc_loop_outer(), oacc_loop_discover_walk(), and oacc_loop_sibling_nreverse().
Referenced by execute_oacc_loop_designation().
|
static |
Walk the OpenACC loop heirarchy checking and assigning the programmer-specified partitionings. OUTER_MASK is the partitioning this loop is contained within. Return mask of partitioning encountered. If any auto loops are discovered, set GOMP_DIM_MAX bit.
References DECL_SOURCE_LOCATION, dump_file, oacc_loop::e_mask, error_at(), oacc_loop::flags, G_, inform(), loop::inner, least_bit_hwi(), oacc_loop::loc, LOCATION_FILE, LOCATION_LINE, oacc_loop::mask, oacc_loop_fixed_partitions(), OLF_AUTO, OLF_DIM_BASE, OLF_INDEPENDENT, OLF_SEQ, OLF_TILE, and oacc_loop::parent.
Referenced by oacc_loop_fixed_partitions(), and oacc_loop_partition().
|
static |
Walk the OpenACC loop heirarchy to check and assign partitioning axes. Return mask of partitioning.
References oacc_loop_auto_partitions(), and oacc_loop_fixed_partitions().
Referenced by execute_oacc_loop_designation().
|
static |
Process the discovered OpenACC loops, setting the correct partitioning level etc.
References build_int_cst(), error_at(), gcc_unreachable, gimple_call_arg(), gimple_call_internal_fn(), gimple_call_set_arg(), integer_minus_one_node, oacc_loop_process(), oacc_loop_xform_head_tail(), OLF_REDUCTION, unsigned_type_node, and update_stmt().
Referenced by execute_oacc_loop_designation(), and oacc_loop_process().
LOOP is the first sibling. Reverse the order in place and return the new first sibling. Recurse to child loops.
References last, loop::next, NULL, and oacc_loop_sibling_nreverse().
Referenced by oacc_loop_discovery(), and oacc_loop_sibling_nreverse().
|
static |
Transform the abstract internal function markers starting at FROM to be for partitioning level LEVEL. Stop when we meet another HEAD or TAIL marker.
References build_int_cst(), gimple_call_arg(), gimple_call_arg_ptr(), gimple_call_internal_p(), gsi_bb(), gsi_end_p(), gsi_for_stmt(), gsi_next(), gsi_start_bb(), gsi_stmt(), single_succ(), TREE_INT_CST_LOW, unsigned_type_node, and update_stmt().
Referenced by oacc_loop_process().
|
static |
Parse the default dimension parameter. This is a set of :-separated optional compute dimensions. Each specified dimension is a positive integer. When device type support is added, it is planned to be a comma separated list of such compute dimensions, with all but the first prefixed by the colon-terminated device type.
References CONST_CAST, errno, error_at(), NULL, NULL_TREE, oacc_default_dims, oacc_min_dims, targetm, and UNKNOWN_LOCATION.
Referenced by execute_oacc_loop_designation().
Helper function for execute_oacc_device_lower. Rewrite VAR_DECLs (by themselves or wrapped in various other nodes) according to ADJUSTED_VARS in the var_decl_rewrite_info pointed to via DATA. Used as part of coercing gang-private variables in OpenACC offload regions to reside in GPU shared memory.
References var_decl_rewrite_info::adjusted_vars, var_decl_rewrite_info::avoid_pointer_conversion, build_fold_addr_expr, build_qualified_type(), convert_to_pointer(), field_type(), hash_map< KeyId, Value, Traits >::get(), gimple_assign_lhs(), gimple_build_assign(), gsi_for_stmt(), gsi_insert_before(), GSI_SAME_STMT, make_ssa_name(), var_decl_rewrite_info::modified, NULL, NULL_TREE, var_decl_rewrite_info::stmt, TREE_CODE, TREE_OPERAND, TREE_TYPE, TYPE_QUALS, and VAR_P.
Referenced by execute_oacc_device_lower().
|
static |
Find the number of threads (POS = false), or thread number (POS = true) for an OpenACC region partitioned as MASK. Setup code required for the calculation is added to SEQ.
References build_int_cst(), fold_build2, integer_type_node, integer_zero_node, NULL_TREE, oacc_dim_call(), and unsigned_type_node.
Referenced by oacc_xform_loop().
Validate and update the dimensions for offloaded FN. ATTRS is the raw attribute. DIMS is an array of dimensions, which is filled in. LEVEL is the partitioning level of a routine, or -1 for an offload region itself. USED is the mask of partitioned execution in the function.
References build_int_cst(), changed, DECL_ATTRIBUTES, DECL_SOURCE_LOCATION, gcc_assert, integer_type_node, lookup_attribute(), NULL_TREE, oacc_default_dims, oacc_min_dims, oacc_replace_fn_attrib(), targetm, TREE_CHAIN, tree_cons(), TREE_INT_CST_LOW, TREE_PURPOSE, TREE_VALUE, and warning_at().
Referenced by execute_oacc_loop_designation().
|
static |
Transform IFN_GOACC_LOOP calls to actual code. See expand_oacc_for for where these are generated. At the vector level, we stride loops, such that each member of a warp will operate on adjacent iterations. At the worker and gang level, each gang/warp executes a set of contiguous iterations. Chunking can override this such that each iteration engine executes a contiguous chunk, and then moves on to stride to the next chunk.
References build2(), build_int_cst(), cfun, fold_build2, fold_convert, loop::force_vectorize, gcc_unreachable, gimple_call_arg(), gimple_call_lhs(), gimplify_assign(), gsi_bb(), gsi_for_stmt(), gsi_replace_with_seq(), loop::inner, INT_MAX, integer_minus_onep(), integer_onep(), integer_zerop(), basic_block_def::loop_father, NULL, NULL_TREE, oacc_thread_numbers(), offset, OPTION_SET_P, pop_gimplify_context(), push_gimplify_context(), r, loop::safelen, targetm, TREE_INT_CST_LOW, and TREE_TYPE.
Referenced by execute_oacc_device_lower().
|
static |
Transform a GOACC_TILE call. Determines the element loop span for the specified loop of the nest. This is 1 if we're not tiling. GOACC_TILE (collapse_count, loop_no, tile_arg, gwv_tile, gwv_element);
References build_int_cst(), fold_build2, fold_convert, gcc_assert, gimple_call_arg(), gimple_call_lhs(), gimplify_assign(), gsi_for_stmt(), gsi_replace_with_seq(), integer_one_node, integer_zerop(), NULL, NULL_TREE, oacc_dim_call(), pop_gimplify_context(), push_gimplify_context(), seen_error(), tree_to_uhwi(), and TREE_TYPE.
Referenced by execute_oacc_device_lower().
Return true if DECL is a function for which its references should be analyzed.
References DECL_ATTRIBUTES, lookup_attribute(), NULL_TREE, oacc_get_fn_attrib(), and TREE_CODE.
Referenced by omp_discover_declare_target_tgt_fn_r(), and omp_discover_implicit_declare_target().
Return true if DECL Is a variable for which its initializer references should be analyzed.
References DECL_ATTRIBUTES, lookup_attribute(), and VAR_P.
Referenced by omp_discover_declare_target_var_r(), and omp_discover_implicit_declare_target().
Similarly, but ignore references outside of OMP_TARGET regions.
References NULL_TREE, OMP_CLAUSE_DEVICE, OMP_CLAUSE_DEVICE_ANCESTOR, OMP_CLAUSES, omp_discover_declare_target_tgt_fn_r(), omp_find_clause(), OMP_TARGET_BODY, TREE_CODE, TYPE_P, and walk_tree_without_duplicates.
Referenced by omp_discover_implicit_declare_target().
|
static |
Helper function for omp_discover_implicit_declare_target, called through walk_tree. Mark referenced FUNCTION_DECLs implicitly as declare target to.
References symtab_node::alias, symtab_node::alias_target, symtab_node::analyzed, CALL_EXPR_FN, symtab_node::decl, DECL_ATTRIBUTES, DECL_EXTERNAL, DECL_SAVED_TREE, g, gcc_assert, symtab_node::get(), symtab_node::get_alias_target(), get_identifier(), gcc::context::have_offload, lookup_attribute(), NULL, NULL_TREE, symtab_node::offloadable, OMP_CLAUSE_DEVICE, OMP_CLAUSE_DEVICE_ANCESTOR, OMP_CLAUSES, omp_declare_target_fn_p(), omp_discover_declare_target_tgt_fn_r(), omp_find_clause(), TREE_CHAIN, TREE_CODE, tree_cons(), TREE_OPERAND, TREE_PURPOSE, TREE_VALUE, TYPE_P, and symtab_node::ultimate_alias_target().
Referenced by omp_discover_declare_target_fn_r(), omp_discover_declare_target_tgt_fn_r(), omp_discover_declare_target_var_r(), and omp_discover_implicit_declare_target().
|
static |
Helper function for omp_discover_implicit_declare_target, called through walk_tree. Mark referenced FUNCTION_DECLs implicitly as declare target to.
References symtab_node::decl, DECL_ATTRIBUTES, DECL_SOURCE_LOCATION, lang_hooks::decls, error_at(), g, symtab_node::get(), get_identifier(), gcc::context::have_offload, is_a(), is_global_var(), lookup_attribute(), NULL, NULL_TREE, offload_vars, symtab_node::offloadable, omp_declare_target_var_p(), omp_discover_declare_target_tgt_fn_r(), lang_hooks_for_decls::omp_get_decl_init, remove_attribute(), TREE_CODE, tree_cons(), TREE_STATIC, TYPE_P, VAR_P, and vec_safe_push().
Referenced by omp_discover_implicit_declare_target().
void omp_discover_implicit_declare_target | ( | void | ) |
Perform the OpenMP implicit declare target to discovery.
References symtab_node::decl, DECL_ATTRIBUTES, DECL_SAVED_TREE, DECL_STRUCT_FUNCTION, lang_hooks::decls, first_nested_function(), FOR_EACH_DEFINED_FUNCTION, FOR_EACH_VARIABLE, lookup_attribute(), next_nested_function(), offload_ind_funcs, omp_declare_target_fn_p(), omp_declare_target_var_p(), omp_discover_declare_target_fn_r(), omp_discover_declare_target_tgt_fn_r(), omp_discover_declare_target_var_r(), lang_hooks_for_decls::omp_finish_decl_inits, lang_hooks_for_decls::omp_get_decl_init, VAR_P, vec_safe_push(), walk_tree_without_duplicates, and worklist.
Referenced by analyze_functions().
void omp_finish_file | ( | void | ) |
Create new symbols containing (address, size) pairs for global variables, marked with "omp declare target" attribute, as well as addresses for the functions, which are outlined offloading regions.
References add_decls_addresses_to_decl_constructor(), build_array_type_nelts(), build_constructor(), build_decl(), DECL_ATTRIBUTES, DECL_HAS_VALUE_EXPR_P, DECL_INITIAL, DECL_USER_ALIGN, DECL_VALUE_EXPR, varpool_node::finalize_decl(), symtab_node::get(), get_identifier(), i, lookup_attribute(), OFFLOAD_FUNC_TABLE_SECTION_NAME, offload_funcs, OFFLOAD_IND_FUNC_TABLE_SECTION_NAME, offload_ind_funcs, OFFLOAD_VAR_TABLE_SECTION_NAME, offload_vars, pointer_sized_int_node, SET_DECL_ALIGN, set_decl_section_name(), SET_TYPE_ALIGN, targetm, TREE_CONSTANT, TREE_OPERAND, TREE_STATIC, TYPE_ALIGN, UNKNOWN_LOCATION, vec_alloc(), and vec_safe_length().
Referenced by compile_file().
|
static |
Rewrite GOMP_SIMT_ENTER_ALLOC call given by GSI and remove the preceding GOMP_SIMT_ENTER call identifying the privatized variables, which are turned to structure fields and receive a DECL_VALUE_EXPR accordingly. Set *REGIMPLIFY to true, except if no privatized variables were seen.
References build3(), build_clobber(), build_decl(), build_int_cst(), build_pointer_type(), build_simple_mem_ref, DECL_ALIGN, DECL_HAS_VALUE_EXPR_P, DECL_NAME, DECL_SOURCE_LOCATION, DECL_USER_ALIGN, gcc_assert, gcc_checking_assert, gimple_build_assign(), gimple_build_call_internal(), gimple_call_arg(), gimple_call_arg_ptr(), gimple_call_internal_p(), gimple_call_lhs(), gimple_call_num_args(), gimple_call_set_lhs(), gsi_for_stmt(), gsi_insert_before(), gsi_replace(), GSI_SAME_STMT, gsi_stmt(), has_zero_uses(), i, insert_field_into_struct(), layout_type(), lang_hooks_for_types::make_type, NULL, null_pointer_node, SET_DECL_ALIGN, SET_DECL_VALUE_EXPR, single_imm_use(), SSA_NAME_DEF_STMT, TREE_ADDRESSABLE, TREE_CODE, TREE_OPERAND, TREE_THIS_VOLATILE, TREE_TYPE, TYPE_ALIGN_UNIT, TYPE_ARTIFICIAL, TYPE_NAMELESS, TYPE_SIZE_UNIT, lang_hooks::types, and VAR_P.
Referenced by execute_omp_device_lower().
|
static |
Default partitioned and minimum partitioned dimensions.
Referenced by oacc_get_default_dim(), oacc_parse_default_dims(), and oacc_validate_dims().
|
static |
Referenced by oacc_get_min_dim(), oacc_parse_default_dims(), and oacc_validate_dims().
Holds offload tables with decls.
Referenced by execute_omp_device_lower(), expand_omp_target(), input_offload_tables(), omp_finish_file(), output_offload_tables(), and prune_offload_funcs().