GCC Middle and Back End API Reference
omp-general.h File Reference
#include "gomp-constants.h"
#include "omp-api.h"
#include "omp-selectors.h"
Include dependency graph for omp-general.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  omp_for_data_loop
 
struct  omp_for_data
 
struct  omp_addr_tokenizer::omp_addr_token
 

Namespaces

namespace  omp_addr_tokenizer
 

Macros

#define OACC_FN_ATTRIB   "oacc function"
 
#define OMP_TS_SCORE_NODE   integer_minus_one_node
 
#define OMP_TP_NAMELIST_NODE   integer_one_node
 
#define OMP_TSS_ID(NODE)    TREE_PURPOSE (NODE)
 
#define OMP_TSS_TRAIT_SELECTORS(NODE)    TREE_VALUE (NODE)
 
#define OMP_TS_ID(NODE)    TREE_PURPOSE (NODE)
 
#define OMP_TS_SCORE(NODE)
 
#define OMP_TS_PROPERTIES(NODE)
 
#define OMP_TP_NAME(NODE)    TREE_PURPOSE (NODE)
 
#define OMP_TP_VALUE(NODE)    TREE_VALUE (NODE)
 
#define OMP_TSS_CODE(t)    ((enum omp_tss_code) TREE_INT_CST_LOW (OMP_TSS_ID (t)))
 
#define OMP_TSS_NAME(t)    (omp_tss_map[OMP_TSS_CODE (t)])
 
#define OMP_TS_CODE(t)    ((enum omp_ts_code) TREE_INT_CST_LOW (OMP_TS_ID (t)))
 
#define OMP_TS_NAME(t)    (omp_ts_map[OMP_TS_CODE (t)].name)
 

Typedefs

typedef omp_addr_tokenizer::omp_addr_token omp_addr_token
 

Enumerations

enum  oacc_loop_flags {
  OLF_SEQ = 1u << 0 , OLF_AUTO = 1u << 1 , OLF_INDEPENDENT = 1u << 2 , OLF_GANG_STATIC = 1u << 3 ,
  OLF_TILE = 1u << 4 , OLF_REDUCTION = 1u << 5 , OLF_DIM_BASE = 6 , OLF_DIM_GANG = 1u << (OLF_DIM_BASE + GOMP_DIM_GANG) ,
  OLF_DIM_WORKER = 1u << (OLF_DIM_BASE + GOMP_DIM_WORKER) , OLF_DIM_VECTOR = 1u << (OLF_DIM_BASE + GOMP_DIM_VECTOR) , OLF_MAX = OLF_DIM_BASE + GOMP_DIM_MAX
}
 
enum  omp_requires {
  OMP_REQUIRES_ATOMIC_DEFAULT_MEM_ORDER = 0xf , OMP_REQUIRES_UNIFIED_ADDRESS = GOMP_REQUIRES_UNIFIED_ADDRESS , OMP_REQUIRES_UNIFIED_SHARED_MEMORY = GOMP_REQUIRES_UNIFIED_SHARED_MEMORY , OMP_REQUIRES_DYNAMIC_ALLOCATORS = 0x40 ,
  OMP_REQUIRES_REVERSE_OFFLOAD = GOMP_REQUIRES_REVERSE_OFFLOAD , OMP_REQUIRES_ATOMIC_DEFAULT_MEM_ORDER_USED = 0x100 , OMP_REQUIRES_TARGET_USED = GOMP_REQUIRES_TARGET_USED
}
 
enum  omp_addr_tokenizer::access_method_kinds {
  omp_addr_tokenizer::ACCESS_DIRECT , omp_addr_tokenizer::ACCESS_REF , omp_addr_tokenizer::ACCESS_POINTER , omp_addr_tokenizer::ACCESS_REF_TO_POINTER ,
  omp_addr_tokenizer::ACCESS_POINTER_OFFSET , omp_addr_tokenizer::ACCESS_REF_TO_POINTER_OFFSET , omp_addr_tokenizer::ACCESS_INDEXED_ARRAY , omp_addr_tokenizer::ACCESS_INDEXED_REF_TO_ARRAY
}
 
enum  omp_addr_tokenizer::structure_base_kinds { omp_addr_tokenizer::BASE_DECL , omp_addr_tokenizer::BASE_COMPONENT_EXPR , omp_addr_tokenizer::BASE_ARBITRARY_EXPR }
 
enum  omp_addr_tokenizer::token_type { omp_addr_tokenizer::ARRAY_BASE , omp_addr_tokenizer::STRUCTURE_BASE , omp_addr_tokenizer::COMPONENT_SELECTOR , omp_addr_tokenizer::ACCESS_METHOD }
 

Functions

tree make_trait_set_selector (enum omp_tss_code, tree, tree)
 
tree make_trait_selector (enum omp_ts_code, tree, tree, tree)
 
tree make_trait_property (tree, tree, tree)
 
tree omp_find_clause (tree clauses, enum omp_clause_code kind)
 
bool omp_is_allocatable_or_ptr (tree decl)
 
tree omp_check_optional_argument (tree decl, bool for_present_check)
 
bool omp_mappable_type (tree type)
 
bool omp_privatize_by_reference (tree decl)
 
void omp_adjust_for_condition (location_t loc, enum tree_code *cond_code, tree *n2, tree v, tree step)
 
tree omp_get_for_step_from_incr (location_t loc, tree incr)
 
void omp_extract_for_data (gomp_for *for_stmt, struct omp_for_data *fd, struct omp_for_data_loop *loops)
 
gimpleomp_build_barrier (tree lhs)
 
tree find_combined_omp_for (tree *, int *, void *)
 
poly_uint64 omp_max_vf (void)
 
int omp_max_simt_vf (void)
 
const charomp_context_name_list_prop (tree)
 
void omp_construct_traits_to_codes (tree, int, enum tree_code *)
 
tree omp_check_context_selector (location_t loc, tree ctx)
 
void omp_mark_declare_variant (location_t loc, tree variant, tree construct)
 
int omp_context_selector_matches (tree)
 
int omp_context_selector_set_compare (enum omp_tss_code, tree, tree)
 
tree omp_get_context_selector (tree, enum omp_tss_code, enum omp_ts_code)
 
tree omp_get_context_selector_list (tree, enum omp_tss_code)
 
tree omp_resolve_declare_variant (tree)
 
tree oacc_launch_pack (unsigned code, tree device, unsigned op)
 
tree oacc_replace_fn_attrib_attr (tree attribs, tree dims)
 
void oacc_replace_fn_attrib (tree fn, tree dims)
 
void oacc_set_fn_attrib (tree fn, tree clauses, vec< tree > *args)
 
int oacc_verify_routine_clauses (tree, tree *, location_t, const char *)
 
tree oacc_build_routine_dims (tree clauses)
 
tree oacc_get_fn_attrib (tree fn)
 
bool offloading_function_p (tree fn)
 
int oacc_get_fn_dim_size (tree fn, int axis)
 
int oacc_get_ifn_dim_arg (const gimple *stmt)
 
dump_flags_t get_openacc_privatization_dump_flags ()
 
tree omp_build_component_ref (tree obj, tree field)
 
bool omp_addr_tokenizer::omp_access_chain_p (vec< omp_addr_token * > &addr_tokens, unsigned i)
 
tree omp_addr_tokenizer::omp_accessed_addr (vec< omp_addr_token * > &addr_tokens, unsigned i, tree expr)
 
bool omp_parse_expr (vec< omp_addr_token * > &, tree)
 

Variables

enum omp_requires omp_requires_mask
 

Macro Definition Documentation

◆ OACC_FN_ATTRIB

#define OACC_FN_ATTRIB   "oacc function"

◆ OMP_TP_NAME

◆ OMP_TP_NAMELIST_NODE

◆ OMP_TP_VALUE

◆ OMP_TS_CODE

◆ OMP_TS_ID

#define OMP_TS_ID ( NODE)     TREE_PURPOSE (NODE)

◆ OMP_TS_NAME

#define OMP_TS_NAME ( t)     (omp_ts_map[OMP_TS_CODE (t)].name)

◆ OMP_TS_PROPERTIES

#define OMP_TS_PROPERTIES ( NODE)
Value:
T * ggc_alloc(ALONE_CXX_MEM_STAT_INFO)
Definition ggc.h:184
#define OMP_TS_SCORE_NODE
Definition omp-general.h:115
#define TREE_VALUE(NODE)
Definition tree.h:1210
#define TREE_CODE(NODE)
Definition tree.h:324
#define TREE_CHAIN(NODE)
Definition tree.h:511
#define TREE_PURPOSE(NODE)
Definition tree.h:1209

Referenced by dump_omp_context_selector(), omp_check_context_selector(), omp_context_selector_matches(), and omp_context_selector_set_compare().

◆ OMP_TS_SCORE

#define OMP_TS_SCORE ( NODE)

◆ OMP_TS_SCORE_NODE

#define OMP_TS_SCORE_NODE   integer_minus_one_node
Accessors for OMP context selectors, used by variant directives.
These are represented internally by a multilevel TREE_LIST structure, but
these accessors should be used to avoid confusion.  The grammar is:

context-set-selector-specification:
  trait-set-selector [, trait-set-selector [, ...]]
trait-set-selector:
  trait-set-selector-name = { trait-selector [, trait-selector [, ... ]] }
trait-selector:
  trait-selector-name [ ( [trait-score: ]
                     trait-property [, trait-property  [, ...]] ) ]

trait-properties can variously be identifiers, strings, clauses, or
expressions.

All the lists are chained via TREE_CHAIN.  If a score is present, it is
internally tacked on to the properties with a TREE_PURPOSE of
OMP_TS_SCORE_NODE.   

Referenced by make_trait_selector().

◆ OMP_TSS_CODE

◆ OMP_TSS_ID

#define OMP_TSS_ID ( NODE)     TREE_PURPOSE (NODE)

◆ OMP_TSS_NAME

#define OMP_TSS_NAME ( t)     (omp_tss_map[OMP_TSS_CODE (t)])

◆ OMP_TSS_TRAIT_SELECTORS

Typedef Documentation

◆ omp_addr_token

Enumeration Type Documentation

◆ oacc_loop_flags

General types and functions that are uselful for processing of OpenMP,
   OpenACC and similar directivers at various stages of compilation.

   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/>.   
Flags for an OpenACC loop.   
Enumerator
OLF_SEQ 
OLF_AUTO 
OLF_INDEPENDENT 
OLF_GANG_STATIC 
OLF_TILE 
OLF_REDUCTION 
OLF_DIM_BASE 
OLF_DIM_GANG 
OLF_DIM_WORKER 
OLF_DIM_VECTOR 
OLF_MAX 

◆ omp_requires

Enumerator
OMP_REQUIRES_ATOMIC_DEFAULT_MEM_ORDER 
OMP_REQUIRES_UNIFIED_ADDRESS 
OMP_REQUIRES_UNIFIED_SHARED_MEMORY 
OMP_REQUIRES_DYNAMIC_ALLOCATORS 
OMP_REQUIRES_REVERSE_OFFLOAD 
OMP_REQUIRES_ATOMIC_DEFAULT_MEM_ORDER_USED 
OMP_REQUIRES_TARGET_USED 

Function Documentation

◆ find_combined_omp_for()

tree find_combined_omp_for ( tree * tp,
int * walk_subtrees,
void * data )
extern
Find OMP_FOR resp. OMP_SIMD with non-NULL OMP_FOR_INIT.  Also, fill in pdata
array, pdata[0] non-NULL if there is anything non-trivial in between,
pdata[1] is address of OMP_PARALLEL in between if any, pdata[2] is address
of OMP_FOR in between if any and pdata[3] is address of the inner
OMP_FOR/OMP_SIMD.   

References BIND_EXPR_BLOCK, BIND_EXPR_VARS, BLOCK_VARS, ggc_alloc(), NULL_TREE, OMP_FOR_INIT, TREE_CODE, tsi_one_before_end_p(), and tsi_start().

Referenced by gimplify_omp_for().

◆ get_openacc_privatization_dump_flags()

dump_flags_t get_openacc_privatization_dump_flags ( )
inline

◆ make_trait_property()

tree make_trait_property ( tree name,
tree value,
tree chain )
extern

References omp_ts_info::name, and tree_cons().

◆ make_trait_selector()

tree make_trait_selector ( enum omp_ts_code,
tree score,
tree properties,
tree chain )
extern

◆ make_trait_set_selector()

tree make_trait_set_selector ( enum omp_tss_code code,
tree selectors,
tree chain )
extern
Constructors for context selectors.   

References build_int_cst(), ggc_alloc(), integer_type_node, and tree_cons().

◆ oacc_build_routine_dims()

tree oacc_build_routine_dims ( tree clauses)
extern
Process the OpenACC 'routine' directive clauses to generate an attribute
for the level of parallelism.  All dimensions have a size of zero
(dynamic).  TREE_PURPOSE is set to indicate whether that dimension
can have a loop partitioned on it.  non-zero indicates
yes, zero indicates no.  By construction once a non-zero has been
reached, further inner dimensions must also be non-zero.  We set
TREE_VALUE to zero for the dimensions that may be partitioned and
1 for the other ones -- if a loop is (erroneously) spawned at
an outer level, we don't want to try and partition it.   

References boolean_type_node, build_int_cst(), gcc_checking_assert, ggc_alloc(), integer_type_node, NULL_TREE, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_GANG, OMP_CLAUSE_SEQ, OMP_CLAUSE_VECTOR, OMP_CLAUSE_WORKER, and tree_cons().

◆ oacc_get_fn_attrib()

◆ oacc_get_fn_dim_size()

int oacc_get_fn_dim_size ( tree fn,
int axis )
extern
Extract an oacc execution dimension from FN.  FN must be an
offloaded function or routine that has already had its execution
dimensions lowered to the target-specific values.   

References gcc_assert, ggc_alloc(), oacc_get_fn_attrib(), TREE_CHAIN, TREE_INT_CST_LOW, and TREE_VALUE.

Referenced by execute_oacc_device_lower(), execute_omp_oacc_neuter_broadcast(), fold_internal_goacc_dim(), and cfn_goacc_dim::fold_range().

◆ oacc_get_ifn_dim_arg()

int oacc_get_ifn_dim_arg ( const gimple * stmt)
extern
Extract the dimension axis from an IFN_GOACC_DIM_POS or
IFN_GOACC_DIM_SIZE call.   

References gcc_checking_assert, ggc_alloc(), gimple_call_arg(), gimple_call_internal_fn(), and TREE_INT_CST_LOW.

Referenced by fold_internal_goacc_dim(), and gimple_range_op_handler::maybe_builtin_call().

◆ oacc_launch_pack()

tree oacc_launch_pack ( unsigned code,
tree device,
unsigned op )
extern
Encode an oacc launch argument.  This matches the GOMP_LAUNCH_PACK
macro on gomp-constants.h.  We do not check for overflow.   

References build_int_cst(), fold_build2, ggc_alloc(), and unsigned_type_node.

Referenced by expand_omp_target(), and oacc_set_fn_attrib().

◆ oacc_replace_fn_attrib()

void oacc_replace_fn_attrib ( tree fn,
tree dims )
extern
Replace any existing oacc fn attribute on FN with updated
dimensions.   

References DECL_ATTRIBUTES, ggc_alloc(), and oacc_replace_fn_attrib_attr().

Referenced by expand_omp_target(), oacc_set_fn_attrib(), and oacc_validate_dims().

◆ oacc_replace_fn_attrib_attr()

tree oacc_replace_fn_attrib_attr ( tree attribs,
tree dims )
extern
Openacc compute grid dimension clauses are converted to an attribute
attached to the function.  This permits the target-side code to (a) massage
the dimensions, (b) emit that data and (c) optimize.  Non-constant
dimensions are pushed onto ARGS.

The attribute value is a TREE_LIST.  A set of dimensions is
represented as a list of INTEGER_CST.  Those that are runtime
exprs are represented as an INTEGER_CST of zero.

TODO: Normally the attribute will just contain a single such list.  If
however it contains a list of lists, this will represent the use of
device_type.  Each member of the outer list is an assoc list of
dimensions, keyed by the device type.  The first entry will be the
default.  Well, that's the plan.   
Replace any existing oacc fn attribute in ATTRIBS with updated
dimensions.   

References get_identifier(), ggc_alloc(), OACC_FN_ATTRIB, TREE_CHAIN, tree_cons(), and TREE_PURPOSE.

Referenced by oacc_replace_fn_attrib().

◆ oacc_set_fn_attrib()

void oacc_set_fn_attrib ( tree fn,
tree clauses,
vec< tree > * args )
extern
Scan CLAUSES for launch dimensions and attach them to the oacc
function attribute.  Push any that are non-constant onto the ARGS
list, along with an appropriate GOMP_LAUNCH_DIM tag.   

References ggc_alloc(), integer_zero_node, NULL_TREE, oacc_launch_pack(), oacc_replace_fn_attrib(), OMP_CLAUSE_EXPR, OMP_CLAUSE_NUM_GANGS, OMP_CLAUSE_NUM_WORKERS, OMP_CLAUSE_VECTOR_LENGTH, omp_find_clause(), TREE_CODE, and tree_cons().

Referenced by execute_oacc_loop_designation(), and expand_omp_target().

◆ oacc_verify_routine_clauses()

int oacc_verify_routine_clauses ( tree fndecl,
tree * clauses,
location_t loc,
const char * routine_str )
extern
Verify OpenACC routine clauses.

Returns 0 if FNDECL should be marked with an OpenACC 'routine' directive, 1
if it has already been marked in compatible way, and -1 if incompatible.
Upon returning, the chain of clauses will contain exactly one clause
specifying the level of parallelism.   

References build_omp_clause(), DECL_ATTRIBUTES, error_at(), gcc_checking_assert, gcc_unreachable, ggc_alloc(), inform(), lookup_attribute(), NULL_TREE, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, omp_clause_code_name, OMP_CLAUSE_GANG, OMP_CLAUSE_LOCATION, OMP_CLAUSE_NOHOST, OMP_CLAUSE_SEQ, OMP_CLAUSE_VECTOR, OMP_CLAUSE_WORKER, and TREE_VALUE.

◆ offloading_function_p()

bool offloading_function_p ( tree fn)
extern
Return true if FN is an OpenMP or OpenACC offloading function.   

References DECL_ATTRIBUTES, and lookup_attribute().

Referenced by tree_switch_conversion::switch_conversion::build_one_array().

◆ omp_adjust_for_condition()

void omp_adjust_for_condition ( location_t loc,
enum tree_code * cond_code,
tree * n2,
tree v,
tree step )
extern
Adjust *COND_CODE and *N2 so that the former is either LT_EXPR or GT_EXPR,
given that V is the loop index variable and STEP is loop step.  

References build_int_cst(), fold_build2_loc(), fold_build_pointer_plus_hwi_loc(), gcc_assert, gcc_unreachable, ggc_alloc(), integer_minus_onep(), integer_onep(), wi::neg(), POINTER_TYPE_P, wi::to_widest(), TREE_CODE, tree_int_cst_equal(), TREE_TYPE, and TYPE_SIZE_UNIT.

Referenced by omp_extract_for_data().

◆ omp_build_barrier()

◆ omp_build_component_ref()

tree omp_build_component_ref ( tree obj,
tree field )
extern
Build COMPONENT_REF and set TREE_THIS_VOLATILE and TREE_READONLY on it
as appropriate.   

References build3(), ggc_alloc(), NULL, TREE_READONLY, TREE_THIS_VOLATILE, and TREE_TYPE.

Referenced by build_outer_var_ref(), build_receiver_ref(), build_receiver_ref(), build_sender_ref(), build_sender_ref(), create_task_copyfn(), and lower_send_clauses().

◆ omp_check_context_selector()

◆ omp_check_optional_argument()

tree omp_check_optional_argument ( tree decl,
bool for_present_check )
extern
Check whether this DECL belongs to a Fortran optional argument.
With 'for_present_check' set to false, decls which are optional parameters
themselve are returned as tree - or a NULL_TREE otherwise. Those decls are
always pointers.  With 'for_present_check' set to true, the decl for checking
whether an argument is present is returned; for arguments with value
attribute this is the hidden argument and of BOOLEAN_TYPE.  If the decl is
unrelated to optional arguments, NULL_TREE is returned.   

References lang_hooks::decls, ggc_alloc(), and lang_hooks_for_decls::omp_check_optional_argument.

Referenced by lower_omp_target().

◆ omp_construct_traits_to_codes()

void omp_construct_traits_to_codes ( tree ctx,
int nconstructs,
enum tree_code * constructs )
extern
Store the construct selectors as tree codes from last to first.
CTX is a list of trait selectors, nconstructs must be equal to its
length, and the array CONSTRUCTS holds the output.   

References gcc_assert, ggc_alloc(), i, OMP_TRAIT_CONSTRUCT_TARGET, OMP_TS_CODE, and TREE_CHAIN.

Referenced by omp_construct_selector_matches(), omp_context_compute_score(), and omp_context_selector_matches().

◆ omp_context_name_list_prop()

◆ omp_context_selector_matches()

int omp_context_selector_matches ( tree ctx)
extern
Return 1 if context selector matches the current OpenMP context, 0
if it does not and -1 if it is unknown and need to be determined later.
Some properties can be checked right away during parsing (this routine),
others need to wait until the whole TU is parsed, others need to wait until
IPA, others until vectorization.   

References alloca, cfun, current_function_decl, DECL_ATTRIBUTES, ggc_alloc(), i, IDENTIFIER_POINTER, integer_nonzerop(), integer_zerop(), list_length(), lookup_attribute(), NULL, NULL_TREE, omp_construct_selector_matches(), omp_construct_traits_to_codes(), omp_context_name_list_prop(), omp_device_arch, omp_device_isa, omp_device_kind, omp_maybe_offloaded(), OMP_MEMORY_ORDER_ACQ_REL, OMP_MEMORY_ORDER_ACQUIRE, OMP_MEMORY_ORDER_RELAXED, OMP_MEMORY_ORDER_RELEASE, OMP_MEMORY_ORDER_SEQ_CST, OMP_MEMORY_ORDER_UNSPECIFIED, omp_offload_device_kind_arch_isa(), OMP_REQUIRES_ATOMIC_DEFAULT_MEM_ORDER, OMP_REQUIRES_DYNAMIC_ALLOCATORS, omp_requires_mask, OMP_REQUIRES_REVERSE_OFFLOAD, OMP_REQUIRES_UNIFIED_ADDRESS, OMP_REQUIRES_UNIFIED_SHARED_MEMORY, OMP_TP_NAME, OMP_TP_VALUE, OMP_TRAIT_DEVICE_ARCH, OMP_TRAIT_DEVICE_ISA, OMP_TRAIT_DEVICE_KIND, OMP_TRAIT_IMPLEMENTATION_ADMO, OMP_TRAIT_IMPLEMENTATION_DYNAMIC_ALLOCATORS, OMP_TRAIT_IMPLEMENTATION_EXTENSION, OMP_TRAIT_IMPLEMENTATION_REVERSE_OFFLOAD, OMP_TRAIT_IMPLEMENTATION_UNIFIED_ADDRESS, OMP_TRAIT_IMPLEMENTATION_UNIFIED_SHARED_MEMORY, OMP_TRAIT_IMPLEMENTATION_VENDOR, OMP_TRAIT_INVALID, OMP_TRAIT_SET_CONSTRUCT, OMP_TRAIT_SET_DEVICE, OMP_TRAIT_SET_IMPLEMENTATION, OMP_TRAIT_SET_USER, OMP_TRAIT_USER_CONDITION, OMP_TS_CODE, OMP_TS_PROPERTIES, OMP_TSS_CODE, OMP_TSS_TRAIT_SELECTORS, PARSING, PROP_gimple_any, r, symbol_table::state, symtab, targetm, and TREE_CHAIN.

Referenced by omp_resolve_declare_variant(), and omp_resolve_late_declare_variant().

◆ omp_context_selector_set_compare()

int omp_context_selector_set_compare ( enum omp_tss_code set,
tree ctx1,
tree ctx2 )
extern
Compare single context selector sets CTX1 and CTX2 with SET name.
CTX1 and CTX2 are lists of trait-selectors.
Return 0 if CTX1 is equal to CTX2,
-1 if CTX1 is a strict subset of CTX2,
1 if CTX2 is a strict subset of CTX1, or
2 if neither context is a subset of another one.   

References ggc_alloc(), list_length(), NULL_TREE, omp_construct_simd_compare(), omp_context_selector_props_compare(), OMP_TRAIT_CONSTRUCT_SIMD, OMP_TRAIT_INVALID, OMP_TRAIT_SET_CONSTRUCT, OMP_TS_CODE, OMP_TS_PROPERTIES, OMP_TS_SCORE, r, simple_cst_equal(), and TREE_CHAIN.

Referenced by omp_context_selector_compare(), and omp_mark_declare_variant().

◆ omp_extract_for_data()

void omp_extract_for_data ( gomp_for * for_stmt,
struct omp_for_data * fd,
struct omp_for_data_loop * loops )
extern
Extract the header elements of parallel loop FOR_STMT and store
them into *FD.   

References boolean_type_node, build_bitint_type(), build_int_cst(), build_nonstandard_integer_type(), build_one_cst(), build_zero_cst(), count, create_tmp_var, fold_binary, fold_build1, fold_build2, fold_build2_loc(), fold_convert, fold_convert_loc(), fold_unary, gcc_assert, GF_OMP_FOR_KIND_DISTRIBUTE, GF_OMP_FOR_KIND_OACC_LOOP, GF_OMP_FOR_KIND_SIMD, GF_OMP_FOR_KIND_TASKLOOP, ggc_alloc(), gimple_location(), gimple_omp_for_clauses(), gimple_omp_for_cond(), gimple_omp_for_final(), gimple_omp_for_incr(), gimple_omp_for_index(), gimple_omp_for_initial(), gimple_omp_for_kind(), i, integer_nonzerop(), integer_one_node, integer_zero_node, integer_zerop(), last, list_length(), long_integer_type_node, long_long_unsigned_type_node, omp_for_data_loop::m1, omp_for_data_loop::m2, make_tree_vec(), omp_for_data_loop::n1, omp_for_data_loop::n2, NULL, NULL_TREE, omp_adjust_for_condition(), OMP_CLAUSE__CONDTEMP_, OMP_CLAUSE__REDUCTEMP_, OMP_CLAUSE__SCANTEMP_, OMP_CLAUSE__SCANTEMP__ALLOC, OMP_CLAUSE__SCANTEMP__CONTROL, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_COLLAPSE, OMP_CLAUSE_COLLAPSE_COUNT, OMP_CLAUSE_COLLAPSE_EXPR, OMP_CLAUSE_COLLAPSE_ITERVAR, OMP_CLAUSE_DECL, OMP_CLAUSE_DIST_SCHEDULE, OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_LASTPRIVATE_CONDITIONAL, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_ORDER, OMP_CLAUSE_ORDER_UNCONSTRAINED, OMP_CLAUSE_ORDERED, OMP_CLAUSE_ORDERED_DOACROSS, OMP_CLAUSE_ORDERED_EXPR, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_SCHEDULE_AUTO, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR, OMP_CLAUSE_SCHEDULE_KIND, OMP_CLAUSE_SCHEDULE_MASK, OMP_CLAUSE_SCHEDULE_RUNTIME, OMP_CLAUSE_SCHEDULE_SIMD, OMP_CLAUSE_SCHEDULE_STATIC, OMP_CLAUSE_TILE, OMP_CLAUSE_TILE_COUNT, OMP_CLAUSE_TILE_ITERVAR, OMP_CLAUSE_TILE_LIST, omp_get_for_step_from_incr(), POINTER_TYPE_P, signed_type_for(), SSA_NAME_VAR, SSA_VAR_P, omp_for_data_loop::step, TREE_CODE, TREE_CONSTANT, tree_int_cst_lt(), TREE_OPERAND, tree_to_shwi(), TREE_TYPE, TREE_VEC_ELT, TYPE_MAX_VALUE, TYPE_MIN_VALUE, TYPE_PRECISION, and TYPE_UNSIGNED.

Referenced by add_taskreg_looptemp_clauses(), expand_omp_for(), expand_task_call(), get_ws_args_for(), gimplify_omp_for(), lower_lastprivate_conditional_clauses(), lower_omp_for(), lower_omp_for_lastprivate(), lower_omp_ordered_clauses(), and workshare_safe_to_combine_p().

◆ omp_find_clause()

tree omp_find_clause ( tree clauses,
enum omp_clause_code kind )
extern
Find an OMP clause of type KIND within CLAUSES.   

References NULL_TREE, OMP_CLAUSE_CHAIN, and OMP_CLAUSE_CODE.

Referenced by add_taskreg_looptemp_clauses(), adjust_region_code_walk_stmt_fn(), check_omp_nesting_restrictions(), determine_parallel_type(), execute_oacc_loop_designation(), expand_omp_for_generic(), expand_omp_for_init_counts(), expand_omp_for_init_vars(), expand_omp_for_static_chunk(), expand_omp_for_static_nochunk(), expand_omp_sections(), expand_omp_simd(), expand_omp_target(), expand_omp_taskloop_for_inner(), expand_omp_taskloop_for_outer(), expand_parallel_call(), expand_task_call(), expand_taskwait_call(), expand_teams_call(), find_lastprivate_looptemp(), finish_taskreg_scan(), get_target_arguments(), get_ws_args_for(), gimplify_omp_for(), gimplify_omp_loop(), gimplify_omp_target_update(), gimplify_omp_task(), gimplify_omp_workshare(), gimplify_scan_omp_clauses(), lower_depend_clauses(), lower_lastprivate_clauses(), lower_lastprivate_conditional_clauses(), lower_omp_1(), lower_omp_for(), lower_omp_for_lastprivate(), lower_omp_master(), lower_omp_ordered(), lower_omp_scan(), lower_omp_scope(), lower_omp_sections(), lower_omp_single(), lower_omp_target(), lower_omp_task_reductions(), lower_omp_taskreg(), lower_omp_teams(), lower_rec_input_clauses(), lower_rec_simd_input_clauses(), oacc_set_fn_attrib(), omp_construct_selector_matches(), omp_default_clause(), omp_discover_declare_target_fn_r(), omp_discover_declare_target_tgt_fn_r(), omp_task_reduction_iterate(), omp_task_reductions_find_first(), optimize_omp_library_calls(), optimize_target_teams(), scan_omp_1_stmt(), scan_omp_parallel(), and scan_omp_task().

◆ omp_get_context_selector()

tree omp_get_context_selector ( tree ctx,
enum omp_tss_code set,
enum omp_ts_code sel )
extern
From context selector CTX, return trait-selector with name SEL in
trait-selector-set with name SET if any, or NULL_TREE if not found.   

References ggc_alloc(), NULL_TREE, OMP_TS_CODE, OMP_TSS_CODE, OMP_TSS_TRAIT_SELECTORS, and TREE_CHAIN.

Referenced by omp_context_compute_score().

◆ omp_get_context_selector_list()

tree omp_get_context_selector_list ( tree ctx,
enum omp_tss_code set )
extern
Similar, but returns the whole trait-selector list for SET in CTX.   

References ggc_alloc(), NULL_TREE, OMP_TSS_CODE, OMP_TSS_TRAIT_SELECTORS, and TREE_CHAIN.

Referenced by omp_context_compute_score().

◆ omp_get_for_step_from_incr()

tree omp_get_for_step_from_incr ( location_t loc,
tree incr )
extern
Return the looping step from INCR, extracted from the step of a gimple omp
for statement.   

References fold_build1_loc(), fold_convert, gcc_unreachable, ggc_alloc(), ssizetype, TREE_CODE, TREE_OPERAND, and TREE_TYPE.

Referenced by omp_extract_for_data().

◆ omp_is_allocatable_or_ptr()

bool omp_is_allocatable_or_ptr ( tree decl)
extern
True if OpenMP should regard this DECL as being a scalar which has Fortran's
allocatable or pointer attribute.   

References lang_hooks::decls, and lang_hooks_for_decls::omp_is_allocatable_or_ptr.

Referenced by lower_omp_target(), and scan_sharing_clauses().

◆ omp_mappable_type()

bool omp_mappable_type ( tree type)
extern
Return true if TYPE is an OpenMP mappable type.   

References COMPLETE_TYPE_P, and error_mark_node.

Referenced by omp_notice_variable().

◆ omp_mark_declare_variant()

void omp_mark_declare_variant ( location_t loc,
tree variant,
tree construct )
extern
Register VARIANT as variant of some base function marked with
#pragma omp declare variant.  CONSTRUCT is corresponding list of
trait-selectors for the construct selector set.  This is stashed as the
value of the "omp declare variant variant" attribute on VARIANT.   

References DECL_ATTRIBUTES, error_at(), get_identifier(), ggc_alloc(), lookup_attribute(), NULL_TREE, omp_context_selector_set_compare(), OMP_TRAIT_INVALID, OMP_TRAIT_SET_CONSTRUCT, OMP_TS_CODE, TREE_CHAIN, tree_cons(), TREE_VALUE, and unshare_expr().

◆ omp_max_simt_vf()

int omp_max_simt_vf ( void )
extern
Return maximum SIMT width if offloading may target SIMT hardware.   

References ggc_alloc(), and startswith().

Referenced by expand_omp_simd(), lower_omp_ordered(), lower_rec_simd_input_clauses(), and scan_omp_1_stmt().

◆ omp_max_vf()

poly_uint64 omp_max_vf ( void )
extern
Return maximum possible vectorization factor for the target.   

References GET_MODE_CLASS, GET_MODE_NUNITS(), ggc_alloc(), i, modes, OPTION_SET_P, and targetm.

Referenced by lower_rec_simd_input_clauses(), and omp_adjust_chunk_size().

◆ omp_parse_expr()

bool omp_parse_expr ( vec< omp_addr_token * > & addr_tokens,
tree expr )
extern

◆ omp_privatize_by_reference()

◆ omp_resolve_declare_variant()

Variable Documentation

◆ omp_requires_mask

enum omp_requires omp_requires_mask
extern
General types and functions that are useful for processing of OpenMP,
   OpenACC and similar directives at various stages of compilation.

   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/>.   

Referenced by gimplify_bind_expr(), input_offload_tables(), lower_omp_target(), omp_context_selector_matches(), output_offload_tables(), and scan_sharing_clauses().