LLVM: llvm::SPIRV Namespace Reference (original) (raw)

Namespaces
namespace AccessQualifier
namespace AddressingModel
namespace BuiltIn
namespace Capability
namespace CooperativeMatrixLayout
namespace CooperativeMatrixOperands
namespace Decoration
namespace Dim
namespace Environment
namespace ExecutionMode
namespace ExecutionModel
namespace Extension
namespace FPEncoding
namespace FPFastMathMode
namespace FPRoundingMode
namespace FunctionControl
namespace FunctionParameterAttribute
namespace GLSLExtInst
namespace GroupOperation
namespace ImageChannelDataType
namespace ImageChannelOrder
namespace ImageFormat
namespace ImageOperand
namespace InstructionSet
namespace KernelEnqueueFlags
namespace KernelProfilingInfo
namespace LinkageType
namespace LoopControl
namespace MatrixMultiplyAccumulateOperands
namespace MemoryModel
namespace MemoryOperand
namespace MemorySemantics
namespace NonSemanticExtInst
namespace Opcode
namespace OpenCLExtInst
namespace OperandCategory
namespace SamplerAddressingMode
namespace SamplerFilterMode
namespace Scope
namespace SelectionControl
namespace SourceLanguage
namespace SpecConstantOpOperands
namespace StorageClass
Classes
struct AtomicFloatingBuiltin
struct BuiltinType
struct CapabilityEntry
class ConvergenceRegion
class ConvergenceRegionInfo
struct ConvertBuiltin
struct DemangledBuiltin
struct EnvironmentEntry
struct ExtendedBuiltin
struct ExtensionEntry
struct FPFastMathDefaultInfo
struct FPFastMathDefaultInfoVector
struct GetBuiltin
struct GroupBuiltin
struct GroupUniformBuiltin
union ImageAttrs
struct ImageQueryBuiltin
struct IncomingCall
struct IntegerDotProductBuiltin
struct IntelSubgroupsBuiltin
struct ModuleAnalysisInfo
struct NativeBuiltin
struct OpenCLType
struct RequirementHandler
struct Requirements
struct SymbolicOperand
struct VectorLoadStoreBuiltin
Typedefs
using MIHandle = std::tuple<const MachineInstr *, Register, size_t>
using IRHandle = std::tuple<const void *, unsigned, unsigned>
using IRHandleMF = std::pair<IRHandle, const MachineFunction *>
using InstrList = SmallVector<const MachineInstr *>
using LocalToGlobalRegTable = std::map<Register, MCRegister>
using RegisterAliasMapTy
Enumerations
enum InstFlags { INST_PRINTER_WIDTH16 = 1 , INST_PRINTER_WIDTH64 = INST_PRINTER_WIDTH16 << 1 }
enum AsmComments { ASM_PRINTER_WIDTH16 = MachineInstr::TAsmComments , ASM_PRINTER_WIDTH64 = ASM_PRINTER_WIDTH16 << 1 }
enum SpecialTypeKind { STK_Empty = 0 , STK_Image, STK_SampledImage, STK_Sampler, STK_Pipe, STK_DeviceEvent, STK_ElementPointer, STK_Type, STK_Value, STK_MachineInstr, STK_VkBuffer, STK_Padding, STK_ExplictLayoutType, STK_Last = -1 }
enum ModuleSectionType { MB_EntryPoints, MB_DebugNames, MB_DebugStrings, MB_DebugModuleProcessed, MB_AliasingInsts, MB_Annotations, MB_TypeConstVars, MB_NonSemanticGlobalDI, MB_ExtFuncDecls, NUM_MODULE_SECTIONS }
Functions
std::optional< IntrinsicInst * > getConvergenceToken (BasicBlock *BB)
std::optional< const IntrinsicInst * > getConvergenceToken (const BasicBlock *BB)
ConvergenceRegionInfo getConvergenceRegions (Function &F, DominatorTree &DT, LoopInfo &LI)
unsigned getIDFromRegister (unsigned Reg)
std::string lookupBuiltinNameHelper (StringRef DemangledCall, FPDecorationId *DecorationId)
Parses the name part of the demangled builtin call.
std::tuple< int, unsigned, unsigned > mapBuiltinToOpcode (const StringRef DemangledCall, SPIRV::InstructionSet::InstructionSet Set)
Helper function for finding a builtin function attributes by a demangled function name.
std::optional< bool > lowerBuiltin (const StringRef DemangledCall, SPIRV::InstructionSet::InstructionSet Set, MachineIRBuilder &MIRBuilder, const Register OrigRet, const Type *OrigRetTy, const SmallVectorImpl< Register > &Args, SPIRVGlobalRegistry *GR, const CallBase &CB)
Type * parseBuiltinCallArgumentType (StringRef TypeStr, LLVMContext &Ctx)
bool parseBuiltinTypeStr (SmallVector< StringRef, 10 > &BuiltinArgsTypeStrs, const StringRef DemangledCall, LLVMContext &Ctx)
Type * parseBuiltinCallArgumentBaseType (const StringRef DemangledCall, unsigned ArgIdx, LLVMContext &Ctx)
Parses the provided ArgIdx argument base type in the DemangledCall skeleton.
TargetExtType * parseBuiltinTypeNameToTargetExtType (std::string TypeName, LLVMContext &Context)
Translates a string representing a SPIR-V or OpenCL builtin type to a TargetExtType that can be further lowered with lowerBuiltinType().
SPIRVType * lowerBuiltinType (const Type *OpaqueType, SPIRV::AccessQualifier::AccessQualifier AccessQual, MachineIRBuilder &MIRBuilder, SPIRVGlobalRegistry *GR)
std::optional< bool > lowerBuiltin (const StringRef DemangledCall, InstructionSet::InstructionSet Set, MachineIRBuilder &MIRBuilder, const Register OrigRet, const Type *OrigRetTy, const SmallVectorImpl< Register > &Args, SPIRVGlobalRegistry *GR, const CallBase &CB)
Lowers a builtin function call using the provided DemangledCall skeleton and external instruction Set.
SPIRVType * lowerBuiltinType (const Type *Type, AccessQualifier::AccessQualifier AccessQual, MachineIRBuilder &MIRBuilder, SPIRVGlobalRegistry *GR)
Handles the translation of the provided special opaque/builtin type Type to SPIR-V type.
size_t to_hash (const MachineInstr *MI)
MIHandle getMIKey (const MachineInstr *MI)
IRHandleMF getIRHandleMF (IRHandle Handle, const MachineFunction *MF)
IRHandle irhandle_image (const Type *SampledTy, unsigned Dim, unsigned Depth, unsigned Arrayed, unsigned MS, unsigned Sampled, unsigned ImageFormat, unsigned AQ=0)
IRHandle irhandle_sampled_image (const Type *SampledTy, const MachineInstr *ImageTy)
IRHandle irhandle_sampler ()
IRHandle irhandle_pipe (uint8_t AQ)
IRHandle irhandle_event ()
IRHandle irhandle_pointee (const Type *ElementType, unsigned AddressSpace)
IRHandle irhandle_ptr (const void *Ptr, unsigned Arg, enum SpecialTypeKind STK)
IRHandle irhandle_vkbuffer (const Type *ElementType, StorageClass::StorageClass SC, bool IsWriteable)
IRHandle irhandle_padding ()
IRHandle irhandle_explict_layout_type (const Type *Ty)
IRHandle handle (const Type *Ty)
IRHandle handle (const Value *V)
IRHandle handle (const MachineInstr *KeyMI)
bool type_has_layout_decoration (const Type *T)
static FunctionType * extractFunctionTypeFromMetadata (NamedMDNode *NMD, FunctionType *FTy, StringRef Name)
FunctionType * getOriginalFunctionType (const Function &F)
FunctionType * getOriginalFunctionType (const CallBase &CB)

InstrList

IRHandle

IRHandleMF

LocalToGlobalRegTable

MIHandle

RegisterAliasMapTy

Initial value:

std::map<const MachineFunction *, LocalToGlobalRegTable>

Definition at line 131 of file SPIRVModuleAnalysis.h.

AsmComments

Enumerator
ASM_PRINTER_WIDTH16
ASM_PRINTER_WIDTH64

Definition at line 63 of file SPIRVInstrInfo.h.

InstFlags

Enumerator
INST_PRINTER_WIDTH16
INST_PRINTER_WIDTH64

Definition at line 246 of file SPIRVBaseInfo.h.

ModuleSectionType

Enumerator
MB_EntryPoints
MB_DebugNames
MB_DebugStrings
MB_DebugModuleProcessed
MB_AliasingInsts
MB_Annotations
MB_TypeConstVars
MB_NonSemanticGlobalDI
MB_ExtFuncDecls
NUM_MODULE_SECTIONS

Definition at line 31 of file SPIRVModuleAnalysis.h.

SpecialTypeKind

Enumerator
STK_Empty
STK_Image
STK_SampledImage
STK_Sampler
STK_Pipe
STK_DeviceEvent
STK_ElementPointer
STK_Type
STK_Value
STK_MachineInstr
STK_VkBuffer
STK_Padding
STK_ExplictLayoutType
STK_Last

Definition at line 55 of file SPIRVIRMapping.h.

extractFunctionTypeFromMetadata()

Definition at line 36 of file SPIRVUtils.cpp.

References assert(), llvm::dyn_cast(), llvm::find_if(), llvm::FunctionType::get(), getConstInt(), llvm::MDNode::getNumOperands(), llvm::MDNode::getOperand(), llvm::FunctionType::getReturnType(), I, llvm::FunctionType::isVarArg(), N, llvm::NamedMDNode::op_end(), llvm::NamedMDNode::operands(), and llvm::FunctionType::params().

Referenced by getOriginalFunctionType(), and getOriginalFunctionType().

getConvergenceRegions()

getConvergenceToken() [1/2]

getConvergenceToken() [2/2]

getIDFromRegister()

getIRHandleMF()

getMIKey()

getOriginalFunctionType() [1/2]

getOriginalFunctionType() [2/2]

handle() [1/3]

handle() [2/3]

Definition at line 162 of file SPIRVIRMapping.h.

References llvm::Type::getTypeID(), irhandle_ptr(), STK_Type, and llvm::unifyPtrType().

Referenced by llvm::SPIRVIRMapping::add(), llvm::SPIRVIRMapping::add(), llvm::SPIRVIRMapping::add(), llvm::SPIRVIRMapping::find(), llvm::SPIRVIRMapping::find(), llvm::SPIRVIRMapping::find(), llvm::SPIRVIRMapping::findMI(), llvm::SPIRVIRMapping::findMI(), llvm::SPIRVIRMapping::findMI(), and llvm::SPIRVGlobalRegistry::getOrCreateLayoutType().

handle() [3/3]

irhandle_event()

IRHandle llvm::SPIRV::irhandle_event ( ) inline

irhandle_explict_layout_type()

IRHandle llvm::SPIRV::irhandle_explict_layout_type ( const Type * Ty) inline

irhandle_image()

irhandle_padding()

IRHandle llvm::SPIRV::irhandle_padding ( ) inline

irhandle_pipe()

IRHandle llvm::SPIRV::irhandle_pipe ( uint8_t AQ) inline

irhandle_pointee()

irhandle_ptr()

IRHandle llvm::SPIRV::irhandle_ptr ( const void * Ptr, unsigned Arg, enum SpecialTypeKind STK ) inline

irhandle_sampled_image()

irhandle_sampler()

IRHandle llvm::SPIRV::irhandle_sampler ( ) inline

irhandle_vkbuffer()

IRHandle llvm::SPIRV::irhandle_vkbuffer ( const Type * ElementType, StorageClass::StorageClass SC, bool IsWriteable ) inline

lookupBuiltinNameHelper()

lowerBuiltin() [1/2]

Lowers a builtin function call using the provided DemangledCall skeleton and external instruction Set.

Returns

the lowering success status if the called function is a recognized builtin, std::nullopt otherwise.

DemangledCall is the skeleton of the lowered builtin function call. Set is the external instruction set containing the given builtin. OrigRet is the single original virtual return register if defined, Register(0) otherwise. OrigRetTy is the type of the OrigRet. Args are the arguments of the lowered builtin call.

lowerBuiltin() [2/2]

Definition at line 3031 of file SPIRVBuiltins.cpp.

References assert(), Call, llvm::dbgs(), llvm::generate2DBlockIOINTELInst(), llvm::generateAPFixedPointInst(), llvm::generateAsyncCopy(), llvm::generateAtomicFloatingInst(), llvm::generateAtomicInst(), llvm::generateBarrierInst(), llvm::generateBindlessImageINTELInst(), llvm::generateBlockingPipesInst(), llvm::generateBuiltinVar(), llvm::generateCastToPtrInst(), llvm::generateConstructInst(), llvm::generateConvertInst(), llvm::generateCoopMatrInst(), llvm::generateDotOrFMulInst(), llvm::generateEnqueueInst(), llvm::generateExtendedBitOpsInst(), llvm::generateExtInst(), llvm::generateGetQueryInst(), llvm::generateGroupInst(), llvm::generateGroupUniformInst(), llvm::generateICarryBorrowInst(), llvm::generateImageMiscQueryInst(), llvm::generateImageSizeQueryInst(), llvm::generateIntelSubgroupsInst(), llvm::generateKernelClockInst(), llvm::generateLoadStoreInst(), llvm::generatePipeInst(), llvm::generatePredicatedLoadStoreInst(), llvm::generateReadImageInst(), llvm::generateRelationalInst(), llvm::generateSampleImageInst(), llvm::generateSelectInst(), llvm::generateSpecConstantInst(), llvm::generateTernaryBitwiseFunctionINTELInst(), llvm::generateVectorLoadStoreInst(), llvm::generateWaveInst(), llvm::generateWriteImageInst(), llvm::SPIRVGlobalRegistry::getSPIRVTypeForVReg(), LLVM_DEBUG, and llvm::lookupBuiltin().

Referenced by llvm::SPIRVCallLowering::lowerCall().

lowerBuiltinType() [1/2]

Definition at line 3418 of file SPIRVBuiltins.cpp.

References llvm::buildOpName(), llvm::dbgs(), llvm::dyn_cast(), llvm::MachineIRBuilder::getContext(), llvm::getCoopMatrType(), llvm::SPIRVGlobalRegistry::getImageType(), llvm::getInlineSpirvType(), llvm::getLayoutType(), llvm::MachineIRBuilder::getMRI(), llvm::getNonParameterizedType(), llvm::MachineRegisterInfo::getNumVirtRegs(), llvm::SPIRVGlobalRegistry::getOrCreateOpTypeDeviceEvent(), llvm::SPIRVGlobalRegistry::getOrCreatePaddingType(), llvm::getPipeType(), llvm::getSampledImageType(), llvm::getSamplerType(), llvm::SPIRVGlobalRegistry::getSPIRVTypeID(), llvm::Type::getStructName(), llvm::getVulkanBufferType(), LLVM_DEBUG, llvm::SPIRV::BuiltinType::Opcode, parseBuiltinTypeNameToTargetExtType(), llvm::report_fatal_error(), and llvm::StringRef::str().

lowerBuiltinType() [2/2]

Handles the translation of the provided special opaque/builtin type [Type](classllvm%5F1%5F1Type.html "The instances of the Type class are immutable: once they are created, they are never changed.") to SPIR-V type.

Generates the corresponding machine instructions for the target type or gets the already existing OpType<...> register from the global registry GR.

Returns

A machine instruction representing the OpType<...> SPIR-V type.

[Type](classllvm%5F1%5F1Type.html "The instances of the Type class are immutable: once they are created, they are never changed.") is the special opaque/builtin type to be lowered.

mapBuiltinToOpcode()

parseBuiltinCallArgumentBaseType()

parseBuiltinCallArgumentType()

Definition at line 3137 of file SPIRVBuiltins.cpp.

References assert(), llvm::StringRef::consume_back(), llvm::StringRef::consume_front(), llvm::StringRef::ends_with(), llvm::StringRef::find(), llvm::StringRef::find_first_of(), llvm::VectorType::get(), llvm::StringRef::getAsInteger(), llvm::Type::getInt8Ty(), llvm::hasBuiltinTypePrefix(), llvm::parseBasicTypeName(), parseBuiltinTypeNameToTargetExtType(), llvm::StringRef::slice(), llvm::StringRef::str(), and llvm::StringRef::substr().

Referenced by parseBuiltinCallArgumentBaseType().

parseBuiltinTypeNameToTargetExtType()

Translates a string representing a SPIR-V or OpenCL builtin type to a TargetExtType that can be further lowered with lowerBuiltinType().

Returns

A TargetExtType representing the builtin SPIR-V type.

TypeName is the full string representation of the SPIR-V or OpenCL builtin type.

Definition at line 3369 of file SPIRVBuiltins.cpp.

References assert(), llvm::StringRef::contains(), llvm::StringRef::find(), llvm::TargetExtType::get(), llvm::isDigit(), llvm::parseTypeString(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::report_fatal_error(), llvm::SPIRV::OpenCLType::SpirvTypeLiteral, llvm::SplitString(), llvm::StringRef::starts_with(), and llvm::StringRef::substr().

Referenced by llvm::SPIRVGlobalRegistry::getOrCreateSPIRVTypeByName(), lowerBuiltinType(), and parseBuiltinCallArgumentType().

parseBuiltinTypeStr()

to_hash()

Definition at line 28 of file SPIRVIRMapping.h.

References llvm::MachineOperand::getCImm(), llvm::MachineOperand::getFPImm(), llvm::MachineOperand::getType(), H, llvm::hash_combine(), I, MI, llvm::MachineOperand::MO_CImmediate, and llvm::MachineOperand::MO_FPImmediate.

Referenced by llvm::SPIRVIRMapping::findMI(), getMIKey(), and handle().

type_has_layout_decoration()

bool llvm::SPIRV::type_has_layout_decoration ( const Type * T) inline