LLVM 24.0.0git
llvm::OpenMPIRBuilderConfig Class Reference

Captures attributes that affect generating LLVM-IR using the OpenMPIRBuilder and related classes. More...

#include "llvm/Frontend/OpenMP/OMPIRBuilder.h"

Public Types

enum class  CollapseIVMapping { DivMod , Virtual }
 Representation of a collapsed iteration space. More...

Public Member Functions

LLVM_ABI OpenMPIRBuilderConfig ()
LLVM_ABI OpenMPIRBuilderConfig (bool IsTargetDevice, bool IsGPU, bool OpenMPOffloadMandatory, bool HasRequiresReverseOffload, bool HasRequiresUnifiedAddress, bool HasRequiresUnifiedSharedMemory, bool HasRequiresDynamicAllocators)
bool isTargetDevice () const
bool isGPU () const
bool openMPOffloadMandatory () const
omp::GV getGridValue () const
unsigned getDefaultTargetAS () const
bool hasNoSignedWrap () const
void setNoSignedWrap (bool Value)
CallingConv::ID getRuntimeCC () const
bool hasRequiresFlags () const
LLVM_ABI bool hasRequiresReverseOffload () const
LLVM_ABI bool hasRequiresUnifiedAddress () const
LLVM_ABI bool hasRequiresUnifiedSharedMemory () const
LLVM_ABI bool hasRequiresDynamicAllocators () const
LLVM_ABI int64_t getRequiresFlags () const
 Returns requires directive clauses as flags compatible with those expected by libomptarget.
StringRef firstSeparator () const
StringRef separator () const
void setIsTargetDevice (bool Value)
void setIsGPU (bool Value)
void setEmitLLVMUsed (bool Value=true)
void setOpenMPOffloadMandatory (bool Value)
void setFirstSeparator (StringRef FS)
void setSeparator (StringRef S)
void setGridValue (omp::GV G)
void setDefaultTargetAS (unsigned AS)
void setRuntimeCC (CallingConv::ID CC)
LLVM_ABI void setHasRequiresReverseOffload (bool Value)
LLVM_ABI void setHasRequiresUnifiedAddress (bool Value)
LLVM_ABI void setHasRequiresUnifiedSharedMemory (bool Value)
LLVM_ABI void setHasRequiresDynamicAllocators (bool Value)

Public Attributes

CollapseIVMapping CollapseMapping = CollapseIVMapping::DivMod
 Mapping used for collapsed loops.
std::optional< bool > IsTargetDevice
 Flag to define whether to generate code for the role of the OpenMP host (if set to false) or device (if set to true) in an offloading context.
std::optional< bool > IsGPU
 Flag for specifying if the compilation is done for an accelerator.
std::optional< bool > EmitLLVMUsedMetaInfo
 Flag for specifying if LLVMUsed information should be emitted.
std::optional< bool > OpenMPOffloadMandatory
 Flag for specifying if offloading is mandatory.
std::optional< StringRef > FirstSeparator
 First separator used between the initial two parts of a name.
std::optional< StringRef > Separator
 Separator used between all of the rest consecutive parts of s name.
std::optional< bool > NoSignedWrap
 Flag for specifying whether the no-signed-wrap (nsw) flag should be added to loop induction variable arithmetic.
std::optional< omp::GV > GridValue
SmallVector< Triple > TargetTriples
 When compilation is being done for the OpenMP host (i.e.
unsigned DefaultTargetAS = 0
CallingConv::ID RuntimeCC = llvm::CallingConv::C

Detailed Description

Captures attributes that affect generating LLVM-IR using the OpenMPIRBuilder and related classes.

Note that not all attributes are required for all classes or functions. In some use cases the configuration is not necessary at all, because because the only functions that are called are ones that are not dependent on the configuration.

Definition at line 103 of file OMPIRBuilder.h.

Member Enumeration Documentation

◆ CollapseIVMapping

Representation of a collapsed iteration space.

Enumerator
DivMod 

Decode source indices from the logical index using division and remainder in each iteration.

Virtual 

Retain the physical nest and decode each assigned range once.

Definition at line 106 of file OMPIRBuilder.h.

Constructor & Destructor Documentation

◆ OpenMPIRBuilderConfig() [1/2]

OpenMPIRBuilderConfig::OpenMPIRBuilderConfig ( )

Definition at line 586 of file OMPIRBuilder.cpp.

◆ OpenMPIRBuilderConfig() [2/2]

OpenMPIRBuilderConfig::OpenMPIRBuilderConfig ( bool IsTargetDevice,
bool IsGPU,
bool OpenMPOffloadMandatory,
bool HasRequiresReverseOffload,
bool HasRequiresUnifiedAddress,
bool HasRequiresUnifiedSharedMemory,
bool HasRequiresDynamicAllocators )

Definition at line 589 of file OMPIRBuilder.cpp.

References IsGPU, IsTargetDevice, and OpenMPOffloadMandatory.

Member Function Documentation

◆ firstSeparator()

StringRef llvm::OpenMPIRBuilderConfig::firstSeparator ( ) const
inline

Definition at line 210 of file OMPIRBuilder.h.

References FirstSeparator, and isGPU().

◆ getDefaultTargetAS()

unsigned llvm::OpenMPIRBuilderConfig::getDefaultTargetAS ( ) const
inline

Definition at line 191 of file OMPIRBuilder.h.

References DefaultTargetAS.

◆ getGridValue()

omp::GV llvm::OpenMPIRBuilderConfig::getGridValue ( ) const
inline

Definition at line 186 of file OMPIRBuilder.h.

References assert(), and GridValue.

◆ getRequiresFlags()

int64_t OpenMPIRBuilderConfig::getRequiresFlags ( ) const

Returns requires directive clauses as flags compatible with those expected by libomptarget.

Definition at line 622 of file OMPIRBuilder.cpp.

References hasRequiresFlags().

◆ getRuntimeCC()

CallingConv::ID llvm::OpenMPIRBuilderConfig::getRuntimeCC ( ) const
inline

Definition at line 196 of file OMPIRBuilder.h.

References RuntimeCC.

◆ hasNoSignedWrap()

bool llvm::OpenMPIRBuilderConfig::hasNoSignedWrap ( ) const
inline

Definition at line 193 of file OMPIRBuilder.h.

References NoSignedWrap.

◆ hasRequiresDynamicAllocators()

bool OpenMPIRBuilderConfig::hasRequiresDynamicAllocators ( ) const

Definition at line 618 of file OMPIRBuilder.cpp.

◆ hasRequiresFlags()

bool llvm::OpenMPIRBuilderConfig::hasRequiresFlags ( ) const
inline

Definition at line 198 of file OMPIRBuilder.h.

Referenced by getRequiresFlags().

◆ hasRequiresReverseOffload()

bool OpenMPIRBuilderConfig::hasRequiresReverseOffload ( ) const

Definition at line 606 of file OMPIRBuilder.cpp.

◆ hasRequiresUnifiedAddress()

bool OpenMPIRBuilderConfig::hasRequiresUnifiedAddress ( ) const

Definition at line 610 of file OMPIRBuilder.cpp.

◆ hasRequiresUnifiedSharedMemory()

bool OpenMPIRBuilderConfig::hasRequiresUnifiedSharedMemory ( ) const

Definition at line 614 of file OMPIRBuilder.cpp.

◆ isGPU()

bool llvm::OpenMPIRBuilderConfig::isGPU ( ) const
inline

Definition at line 175 of file OMPIRBuilder.h.

References assert(), and IsGPU.

Referenced by firstSeparator(), and separator().

◆ isTargetDevice()

bool llvm::OpenMPIRBuilderConfig::isTargetDevice ( ) const
inline

Definition at line 170 of file OMPIRBuilder.h.

References assert(), and IsTargetDevice.

Referenced by createOutlinedFunction(), and FixupDebugInfoForOutlinedFunction().

◆ openMPOffloadMandatory()

bool llvm::OpenMPIRBuilderConfig::openMPOffloadMandatory ( ) const
inline

Definition at line 180 of file OMPIRBuilder.h.

References assert(), and OpenMPOffloadMandatory.

◆ separator()

StringRef llvm::OpenMPIRBuilderConfig::separator ( ) const
inline

Definition at line 220 of file OMPIRBuilder.h.

References isGPU(), and Separator.

◆ setDefaultTargetAS()

void llvm::OpenMPIRBuilderConfig::setDefaultTargetAS ( unsigned AS)
inline

Definition at line 235 of file OMPIRBuilder.h.

References DefaultTargetAS.

◆ setEmitLLVMUsed()

void llvm::OpenMPIRBuilderConfig::setEmitLLVMUsed ( bool Value = true)
inline

Definition at line 230 of file OMPIRBuilder.h.

References EmitLLVMUsedMetaInfo.

◆ setFirstSeparator()

void llvm::OpenMPIRBuilderConfig::setFirstSeparator ( StringRef FS)
inline

Definition at line 232 of file OMPIRBuilder.h.

References FirstSeparator.

◆ setGridValue()

void llvm::OpenMPIRBuilderConfig::setGridValue ( omp::GV G)
inline

Definition at line 234 of file OMPIRBuilder.h.

References G, and GridValue.

◆ setHasRequiresDynamicAllocators()

void OpenMPIRBuilderConfig::setHasRequiresDynamicAllocators ( bool Value)

Definition at line 648 of file OMPIRBuilder.cpp.

◆ setHasRequiresReverseOffload()

void OpenMPIRBuilderConfig::setHasRequiresReverseOffload ( bool Value)

Definition at line 627 of file OMPIRBuilder.cpp.

◆ setHasRequiresUnifiedAddress()

void OpenMPIRBuilderConfig::setHasRequiresUnifiedAddress ( bool Value)

Definition at line 634 of file OMPIRBuilder.cpp.

◆ setHasRequiresUnifiedSharedMemory()

void OpenMPIRBuilderConfig::setHasRequiresUnifiedSharedMemory ( bool Value)

Definition at line 641 of file OMPIRBuilder.cpp.

◆ setIsGPU()

void llvm::OpenMPIRBuilderConfig::setIsGPU ( bool Value)
inline

Definition at line 229 of file OMPIRBuilder.h.

References IsGPU.

◆ setIsTargetDevice()

void llvm::OpenMPIRBuilderConfig::setIsTargetDevice ( bool Value)
inline

Definition at line 228 of file OMPIRBuilder.h.

References IsTargetDevice.

◆ setNoSignedWrap()

void llvm::OpenMPIRBuilderConfig::setNoSignedWrap ( bool Value)
inline

Definition at line 194 of file OMPIRBuilder.h.

References NoSignedWrap.

◆ setOpenMPOffloadMandatory()

void llvm::OpenMPIRBuilderConfig::setOpenMPOffloadMandatory ( bool Value)
inline

Definition at line 231 of file OMPIRBuilder.h.

References OpenMPOffloadMandatory.

◆ setRuntimeCC()

void llvm::OpenMPIRBuilderConfig::setRuntimeCC ( CallingConv::ID CC)
inline

Definition at line 236 of file OMPIRBuilder.h.

References CC, and RuntimeCC.

◆ setSeparator()

void llvm::OpenMPIRBuilderConfig::setSeparator ( StringRef S)
inline

Definition at line 233 of file OMPIRBuilder.h.

References Separator.

Member Data Documentation

◆ CollapseMapping

CollapseIVMapping llvm::OpenMPIRBuilderConfig::CollapseMapping = CollapseIVMapping::DivMod

Mapping used for collapsed loops.

Definition at line 115 of file OMPIRBuilder.h.

◆ DefaultTargetAS

unsigned llvm::OpenMPIRBuilderConfig::DefaultTargetAS = 0

Definition at line 157 of file OMPIRBuilder.h.

Referenced by getDefaultTargetAS(), and setDefaultTargetAS().

◆ EmitLLVMUsedMetaInfo

std::optional<bool> llvm::OpenMPIRBuilderConfig::EmitLLVMUsedMetaInfo

Flag for specifying if LLVMUsed information should be emitted.

Definition at line 134 of file OMPIRBuilder.h.

Referenced by setEmitLLVMUsed().

◆ FirstSeparator

std::optional<StringRef> llvm::OpenMPIRBuilderConfig::FirstSeparator

First separator used between the initial two parts of a name.

Definition at line 140 of file OMPIRBuilder.h.

Referenced by firstSeparator(), and setFirstSeparator().

◆ GridValue

std::optional<omp::GV> llvm::OpenMPIRBuilderConfig::GridValue

Definition at line 150 of file OMPIRBuilder.h.

Referenced by getGridValue(), and setGridValue().

◆ IsGPU

std::optional<bool> llvm::OpenMPIRBuilderConfig::IsGPU

Flag for specifying if the compilation is done for an accelerator.

It is set according to the architecture of the target triple and currently only true when targeting AMDGPU or NVPTX. Today, these targets can only perform the role of an OpenMP target device, so IsTargetDevice must also be true if IsGPU is true. This restriction might be lifted if an accelerator- like target with the ability to work as the OpenMP host is added, or if the capabilities of the currently supported GPU architectures are expanded.

Definition at line 131 of file OMPIRBuilder.h.

Referenced by isGPU(), OpenMPIRBuilderConfig(), and setIsGPU().

◆ IsTargetDevice

std::optional<bool> llvm::OpenMPIRBuilderConfig::IsTargetDevice

Flag to define whether to generate code for the role of the OpenMP host (if set to false) or device (if set to true) in an offloading context.

It is set when the -fopenmp-is-target-device compiler frontend option is specified.

Definition at line 121 of file OMPIRBuilder.h.

Referenced by isTargetDevice(), OpenMPIRBuilderConfig(), and setIsTargetDevice().

◆ NoSignedWrap

std::optional<bool> llvm::OpenMPIRBuilderConfig::NoSignedWrap

Flag for specifying whether the no-signed-wrap (nsw) flag should be added to loop induction variable arithmetic.

Set when the frontend guarantees that signed integer overflow is undefined (with -fno-wrapv).

Definition at line 147 of file OMPIRBuilder.h.

Referenced by hasNoSignedWrap(), and setNoSignedWrap().

◆ OpenMPOffloadMandatory

std::optional<bool> llvm::OpenMPIRBuilderConfig::OpenMPOffloadMandatory

Flag for specifying if offloading is mandatory.

Definition at line 137 of file OMPIRBuilder.h.

Referenced by OpenMPIRBuilderConfig(), openMPOffloadMandatory(), and setOpenMPOffloadMandatory().

◆ RuntimeCC

CallingConv::ID llvm::OpenMPIRBuilderConfig::RuntimeCC = llvm::CallingConv::C

Definition at line 159 of file OMPIRBuilder.h.

Referenced by getRuntimeCC(), and setRuntimeCC().

◆ Separator

std::optional<StringRef> llvm::OpenMPIRBuilderConfig::Separator

Separator used between all of the rest consecutive parts of s name.

Definition at line 142 of file OMPIRBuilder.h.

Referenced by separator(), and setSeparator().

◆ TargetTriples

SmallVector<Triple> llvm::OpenMPIRBuilderConfig::TargetTriples

When compilation is being done for the OpenMP host (i.e.

IsTargetDevice = / false), this contains the list of offloading triples associated, if any.

Definition at line 154 of file OMPIRBuilder.h.


The documentation for this class was generated from the following files: