LLVM
15.0.0git
|
Classes | |
struct | AssumptionClauseMappingInfo |
Helper to describe assume clauses. More... | |
struct | GV |
Defines various target-specific GPU grid values that must be consistent between host RTL (plugin), device RTL, and clang. More... | |
struct | OMPContext |
The context for a source location is made up of active property traits, e.g., device={kind(host)}, and constructs traits which describe the nesting in OpenMP constructs at the location. More... | |
struct | VariantMatchInfo |
Variant match information describes the required traits and how they are scored (via the ScoresMap). More... | |
Typedefs | |
using | Kernel = Function * |
Summary of a kernel (=entry point for target offloading). More... | |
using | KernelSet = SetVector< Kernel > |
Set of kernels in the module. More... | |
Functions | |
std::string | getAllAssumeClauseOptions () |
LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE () | |
TraitSet | getOpenMPContextTraitSetKind (StringRef Str) |
Parse Str and return the trait set it matches or TraitSet::invalid. More... | |
TraitSet | getOpenMPContextTraitSetForSelector (TraitSelector Selector) |
Return the trait set for which Selector is a selector. More... | |
TraitSet | getOpenMPContextTraitSetForProperty (TraitProperty Property) |
Return the trait set for which Property is a property. More... | |
StringRef | getOpenMPContextTraitSetName (TraitSet Kind) |
Return a textual representation of the trait set Kind . More... | |
TraitSelector | getOpenMPContextTraitSelectorKind (StringRef Str) |
Parse Str and return the trait set it matches or TraitSelector::invalid. More... | |
TraitSelector | getOpenMPContextTraitSelectorForProperty (TraitProperty Property) |
Return the trait selector for which Property is a property. More... | |
StringRef | getOpenMPContextTraitSelectorName (TraitSelector Kind) |
Return a textual representation of the trait selector Kind . More... | |
TraitProperty | getOpenMPContextTraitPropertyKind (TraitSet Set, TraitSelector Selector, StringRef Str) |
Parse Str and return the trait property it matches in the set Set and selector Selector or TraitProperty::invalid. More... | |
TraitProperty | getOpenMPContextTraitPropertyForSelector (TraitSelector Selector) |
Return the trait property for a singleton selector Selector . More... | |
StringRef | getOpenMPContextTraitPropertyName (TraitProperty Kind, StringRef RawString) |
Return a textual representation of the trait property Kind , which might be the raw string we parsed (RawString ) if we do not translate the property into a (distinct) enum. More... | |
StringRef | getOpenMPContextTraitPropertyFullName (TraitProperty Kind) |
Return a textual representation of the trait property Kind with selector and set name included. More... | |
std::string | listOpenMPContextTraitSets () |
Return a string listing all trait sets. More... | |
std::string | listOpenMPContextTraitSelectors (TraitSet Set) |
Return a string listing all trait selectors for Set . More... | |
std::string | listOpenMPContextTraitProperties (TraitSet Set, TraitSelector Selector) |
Return a string listing all trait properties for Set and Selector . More... | |
bool | isValidTraitSelectorForTraitSet (TraitSelector Selector, TraitSet Set, bool &AllowsTraitScore, bool &RequiresProperty) |
} More... | |
bool | isValidTraitPropertyForTraitSetAndSelector (TraitProperty Property, TraitSelector Selector, TraitSet Set) |
Return true if Property can be nested in Selector and Set . More... | |
bool | isVariantApplicableInContext (const VariantMatchInfo &VMI, const OMPContext &Ctx, bool DeviceSetOnly=false) |
Return true if VMI is applicable in Ctx , that is, all traits required by VMI are available in the OpenMP context Ctx . More... | |
int | getBestVariantMatchForContext (const SmallVectorImpl< VariantMatchInfo > &VMIs, const OMPContext &Ctx) |
Return the index (into VMIs ) of the variant with the highest score from the ones applicble in Ctx . More... | |
template<unsigned wavesize> | |
constexpr const GV & | getAMDGPUGridValues () |
bool | containsOpenMP (Module &M) |
Helper to determine if M contains OpenMP. More... | |
bool | isOpenMPDevice (Module &M) |
Helper to determine if M is a OpenMP target offloading device module. More... | |
KernelSet | getDeviceKernels (Module &M) |
Get OpenMP device kernels in M . More... | |
Variables | |
static constexpr AssumptionClauseMappingInfo | AssumptionClauseMappings [] |
All known assume clauses. More... | |
static constexpr GV | AMDGPUGridValues64 |
For AMDGPU GPUs. More... | |
static constexpr GV | AMDGPUGridValues32 |
static constexpr GV | NVPTXGridValues |
For Nvidia GPUs. More... | |
using llvm::omp::Kernel = typedef Function * |
Summary of a kernel (=entry point for target offloading).
Definition at line 21 of file OpenMPOpt.h.
using llvm::omp::KernelSet = typedef SetVector<Kernel> |
Set of kernels in the module.
Definition at line 24 of file OpenMPOpt.h.
|
strong |
Enumerator | |
---|---|
Generic | |
Global | |
Shared | |
Constant | |
Local |
Definition at line 196 of file OMPConstants.h.
|
strong |
IDs for the different default kinds.
Enumerator | |
---|---|
OMP_DEFAULT_KIND |
Definition at line 55 of file OMPConstants.h.
|
strong |
Enumerator | |
---|---|
ICV_INIT_VALUE |
Definition at line 36 of file OMPConstants.h.
|
strong |
IDs for all omp runtime library ident_t flag encodings (see their defintion in openmp/runtime/src/kmp.h).
Enumerator | |
---|---|
OMP_IDENT_FLAG |
Definition at line 66 of file OMPConstants.h.
|
strong |
IDs for all Internal Control Variables (ICVs).
Enumerator | |
---|---|
ICV_DATA_ENV |
Definition at line 27 of file OMPConstants.h.
|
strong |
Atomic compare operations. Currently OpenMP only supports ==, >, and <.
Enumerator | |
---|---|
EQ | |
MIN | |
MAX |
Definition at line 208 of file OMPConstants.h.
|
strong |
Enumerator | |
---|---|
Unknown | |
Target | |
TargetSync |
Definition at line 205 of file OMPConstants.h.
|
strong |
Definition at line 77 of file OMPConstants.h.
enum llvm::omp::OMPTgtExecModeFlags : int8_t |
Enumerator | |
---|---|
OMP_TGT_EXEC_MODE_GENERIC | |
OMP_TGT_EXEC_MODE_SPMD | |
OMP_TGT_EXEC_MODE_GENERIC_SPMD |
Definition at line 188 of file OMPConstants.h.
|
strong |
IDs for all omp runtime library (RTL) functions.
Enumerator | |
---|---|
OMP_RTL |
Definition at line 46 of file OMPConstants.h.
|
strong |
IDs for all OpenMP context trait properties (host/gpu/bsc/llvm/...)
Enumerator | |
---|---|
OMP_TRAIT_PROPERTY | |
OMP_LAST_TRAIT_PROPERTY |
Definition at line 45 of file OMPContext.h.
|
strong |
IDs for all OpenMP context selector trait (device={kind/isa...}/...).
Enumerator | |
---|---|
OMP_TRAIT_SELECTOR |
Definition at line 39 of file OMPContext.h.
|
strong |
OpenMP Context related IDs and helpers.
{ IDs for all OpenMP context selector trait sets (construct/device/...).
Enumerator | |
---|---|
OMP_TRAIT_SET |
Definition at line 33 of file OMPContext.h.
bool llvm::omp::containsOpenMP | ( | Module & | M | ) |
Helper to determine if M
contains OpenMP.
Definition at line 5208 of file OpenMPOpt.cpp.
References M.
Referenced by llvm::OpenMPOptPass::run(), and llvm::OpenMPOptCGSCCPass::run().
|
inline |
Definition at line 44 of file OMPAssume.h.
References AssumptionClauseMappings, and S.
Definition at line 102 of file OMPGridValues.h.
References AMDGPUGridValues32, and AMDGPUGridValues64.
int llvm::omp::getBestVariantMatchForContext | ( | const SmallVectorImpl< VariantMatchInfo > & | VMIs, |
const OMPContext & | Ctx | ||
) |
Return the index (into VMIs
) of the variant with the highest score from the ones applicble in Ctx
.
See llvm::isVariantApplicableInContext.
Definition at line 341 of file OMPContext.cpp.
References llvm::numbers::e, llvm::APInt::eq(), getVariantMatchScore(), isStrictSubset(), isVariantApplicableInContextHelper(), and llvm::APInt::ult().
Get OpenMP device kernels in M
.
Definition at line 5180 of file OpenMPOpt.cpp.
References llvm::MDString::getString(), llvm::AMDGPU::HSAMD::Key::Kernels, M, and llvm::NamedMDNode::operands().
Referenced by llvm::OpenMPOptPass::run(), and llvm::OpenMPOptCGSCCPass::run().
TraitProperty llvm::omp::getOpenMPContextTraitPropertyForSelector | ( | TraitSelector | Selector | ) |
Return the trait property for a singleton selector Selector
.
Definition at line 455 of file OMPContext.cpp.
References llvm::StringSwitch< T, R >::Default(), and getOpenMPContextTraitSelectorName().
StringRef llvm::omp::getOpenMPContextTraitPropertyFullName | ( | TraitProperty | Kind | ) |
Return a textual representation of the trait property Kind
with selector and set name included.
Definition at line 477 of file OMPContext.cpp.
References llvm_unreachable.
Referenced by llvm::omp::OMPContext::OMPContext().
TraitProperty llvm::omp::getOpenMPContextTraitPropertyKind | ( | TraitSet | Set, |
TraitSelector | Selector, | ||
StringRef | Str | ||
) |
Parse Str
and return the trait property it matches in the set Set
and selector Selector
or TraitProperty::invalid.
Definition at line 442 of file OMPContext.cpp.
StringRef llvm::omp::getOpenMPContextTraitPropertyName | ( | TraitProperty | Kind, |
StringRef | RawString | ||
) |
Return a textual representation of the trait property Kind
, which might be the raw string we parsed (RawString
) if we do not translate the property into a (distinct) enum.
Definition at line 465 of file OMPContext.cpp.
References llvm_unreachable.
Referenced by isVariantApplicableInContextHelper().
TraitSelector llvm::omp::getOpenMPContextTraitSelectorForProperty | ( | TraitProperty | Property | ) |
Return the trait selector for which Property
is a property.
Definition at line 423 of file OMPContext.cpp.
References llvm_unreachable.
Referenced by getVariantMatchScore(), and isVariantApplicableInContextHelper().
TraitSelector llvm::omp::getOpenMPContextTraitSelectorKind | ( | StringRef | Str | ) |
Parse Str
and return the trait set it matches or TraitSelector::invalid.
Definition at line 415 of file OMPContext.cpp.
References llvm::StringSwitch< T, R >::Default(), and S.
StringRef llvm::omp::getOpenMPContextTraitSelectorName | ( | TraitSelector | Kind | ) |
Return a textual representation of the trait selector Kind
.
Definition at line 432 of file OMPContext.cpp.
References llvm_unreachable.
Referenced by getOpenMPContextTraitPropertyForSelector().
TraitSet llvm::omp::getOpenMPContextTraitSetForProperty | ( | TraitProperty | Property | ) |
Return the trait set for which Property
is a property.
Definition at line 396 of file OMPContext.cpp.
References llvm_unreachable.
Referenced by llvm::omp::VariantMatchInfo::addTrait(), llvm::omp::OMPContext::addTrait(), getVariantMatchScore(), and isVariantApplicableInContextHelper().
TraitSet llvm::omp::getOpenMPContextTraitSetForSelector | ( | TraitSelector | Selector | ) |
Return the trait set for which Selector
is a selector.
Definition at line 386 of file OMPContext.cpp.
References llvm_unreachable.
Parse Str
and return the trait set it matches or TraitSet::invalid.
Definition at line 378 of file OMPContext.cpp.
References llvm::StringSwitch< T, R >::Default(), and S.
Return a textual representation of the trait set Kind
.
Definition at line 405 of file OMPContext.cpp.
References llvm_unreachable.
bool llvm::omp::isOpenMPDevice | ( | Module & | M | ) |
Helper to determine if M
is a OpenMP target offloading device module.
Definition at line 5216 of file OpenMPOpt.cpp.
References M.
Referenced by llvm::OpenMPOptPass::run(), and llvm::OpenMPOptCGSCCPass::run().
bool llvm::omp::isValidTraitPropertyForTraitSetAndSelector | ( | TraitProperty | Property, |
TraitSelector | Selector, | ||
TraitSet | Set | ||
) |
Return true if Property
can be nested in Selector
and Set
.
Definition at line 502 of file OMPContext.cpp.
References llvm_unreachable.
bool llvm::omp::isValidTraitSelectorForTraitSet | ( | TraitSelector | Selector, |
TraitSet | Set, | ||
bool & | AllowsTraitScore, | ||
bool & | RequiresProperty | ||
) |
}
Return true if Selector
can be nested in Set
. Also sets AllowsTraitScore
and RequiresProperty
to true/false if the user can specify a score for properties in Selector
and if the Selector
requires at least one property.
Definition at line 487 of file OMPContext.cpp.
References llvm_unreachable.
bool llvm::omp::isVariantApplicableInContext | ( | const VariantMatchInfo & | VMI, |
const OMPContext & | Ctx, | ||
bool | DeviceSetOnly = false |
||
) |
Return true if VMI
is applicable in Ctx
, that is, all traits required by VMI
are available in the OpenMP context Ctx
.
If DeviceSetOnly
is true, only the device selector set, if present, are checked. Note that we still honor extension traits provided by the user.
Definition at line 264 of file OMPContext.cpp.
References isVariantApplicableInContextHelper().
std::string llvm::omp::listOpenMPContextTraitProperties | ( | TraitSet | Set, |
TraitSelector | Selector | ||
) |
Return a string listing all trait properties for Set
and Selector
.
Definition at line 535 of file OMPContext.cpp.
References S.
std::string llvm::omp::listOpenMPContextTraitSelectors | ( | TraitSet | Set | ) |
Return a string listing all trait selectors for Set
.
Definition at line 524 of file OMPContext.cpp.
References S.
std::string llvm::omp::listOpenMPContextTraitSets | ( | ) |
Return a string listing all trait sets.
Definition at line 514 of file OMPContext.cpp.
References S.
llvm::omp::LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE | ( | ) |
|
staticconstexpr |
Definition at line 93 of file OMPGridValues.h.
Referenced by getAMDGPUGridValues().
|
staticconstexpr |
For AMDGPU GPUs.
Definition at line 84 of file OMPGridValues.h.
Referenced by getAMDGPUGridValues().
|
staticconstexpr |
All known assume clauses.
Definition at line 37 of file OMPAssume.h.
Referenced by getAllAssumeClauseOptions().
|
staticconstexpr |
For Nvidia GPUs.
Definition at line 108 of file OMPGridValues.h.