LLVM  16.0.0git
Namespaces | Classes | Typedefs | Enumerations | Functions
llvm::SPIRV Namespace Reference

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

Namespaces

 AccessQualifier
 
 AddressingModel
 
 BuiltIn
 
 Capability
 
 Decoration
 
 Dim
 
 ExecutionMode
 
 ExecutionModel
 
 Extension
 
 FPFastMathMode
 
 FPRoundingMode
 
 FunctionControl
 
 FunctionParameterAttribute
 
 GLSLExtInst
 
 GroupOperation
 
 ImageChannelDataType
 
 ImageChannelOrder
 
 ImageFormat
 
 ImageOperand
 
 InstructionSet
 
 KernelEnqueueFlags
 
 KernelProfilingInfo
 
 LinkageType
 
 LoopControl
 
 MemoryModel
 
 MemoryOperand
 
 MemorySemantics
 
 Opcode
 
 OpenCLExtInst
 
 OperandCategory
 
 SamplerAddressingMode
 
 SamplerFilterMode
 
 Scope
 
 SelectionControl
 
 SourceLanguage
 
 StorageClass
 

Classes

struct  CapabilityEntry
 
struct  ConvertBuiltin
 
struct  DemangledBuiltin
 
struct  DemangledType
 
class  DTSortableEntry
 
struct  ExtendedBuiltin
 
struct  ExtensionEntry
 
struct  GetBuiltin
 
struct  GroupBuiltin
 
struct  ImageQueryBuiltin
 
struct  ImageType
 
struct  ImageTypeDescriptor
 
struct  IncomingCall
 
struct  ModuleAnalysisInfo
 
struct  NativeBuiltin
 
struct  PipeType
 
struct  PipeTypeDescriptor
 
struct  RequirementHandler
 
struct  Requirements
 
struct  SampledImageTypeDescriptor
 
struct  SamplerTypeDescriptor
 
struct  SpecialTypeDescriptor
 
struct  SymbolicOperand
 
struct  VectorLoadStoreBuiltin
 

Typedefs

using InstrList = SmallVector< MachineInstr * >
 
using LocalToGlobalRegTable = std::map< Register, Register >
 
using RegisterAliasMapTy = std::map< const MachineFunction *, LocalToGlobalRegTable >
 

Enumerations

enum  ModuleSectionType {
  MB_EntryPoints, MB_DebugNames, MB_DebugModuleProcessed, MB_Annotations,
  MB_TypeConstVars, MB_ExtFuncDecls, NUM_MODULE_SECTIONS
}
 

Functions

Optional< bool > lowerBuiltin (const StringRef DemangledCall, SPIRV::InstructionSet::InstructionSet Set, MachineIRBuilder &MIRBuilder, const Register OrigRet, const Type *OrigRetTy, const SmallVectorImpl< Register > &Args, SPIRVGlobalRegistry *GR)
 
SPIRVTypelowerBuiltinType (const StructType *Type, AccessQualifier::AccessQualifier AccessQual, MachineIRBuilder &MIRBuilder, SPIRVGlobalRegistry *GR)
 Handles the translation of the provided special opaque/builtin type Type to SPIR-V type. More...
 
Optional< bool > lowerBuiltin (const StringRef DemangledCall, InstructionSet::InstructionSet Set, MachineIRBuilder &MIRBuilder, const Register OrigRet, const Type *OrigRetTy, const SmallVectorImpl< Register > &Args, SPIRVGlobalRegistry *GR)
 Lowers a builtin funtion call using the provided DemangledCall skeleton and external instruction Set. More...
 

Detailed Description

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

Typedef Documentation

◆ InstrList

Definition at line 115 of file SPIRVModuleAnalysis.h.

◆ LocalToGlobalRegTable

Definition at line 117 of file SPIRVModuleAnalysis.h.

◆ RegisterAliasMapTy

Definition at line 119 of file SPIRVModuleAnalysis.h.

Enumeration Type Documentation

◆ ModuleSectionType

Enumerator
MB_EntryPoints 
MB_DebugNames 
MB_DebugModuleProcessed 
MB_Annotations 
MB_TypeConstVars 
MB_ExtFuncDecls 
NUM_MODULE_SECTIONS 

Definition at line 32 of file SPIRVModuleAnalysis.h.

Function Documentation

◆ lowerBuiltin() [1/2]

Optional<bool> llvm::SPIRV::lowerBuiltin ( const StringRef  DemangledCall,
InstructionSet::InstructionSet  Set,
MachineIRBuilder MIRBuilder,
const Register  OrigRet,
const Type OrigRetTy,
const SmallVectorImpl< Register > &  Args,
SPIRVGlobalRegistry GR 
)

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

Returns
the lowering success status if the called function is a recognized builtin, None 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]

Optional<bool> llvm::SPIRV::lowerBuiltin ( const StringRef  DemangledCall,
SPIRV::InstructionSet::InstructionSet  Set,
MachineIRBuilder MIRBuilder,
const Register  OrigRet,
const Type OrigRetTy,
const SmallVectorImpl< Register > &  Args,
SPIRVGlobalRegistry GR 
)

◆ lowerBuiltinType()

SPIRVType * llvm::SPIRV::lowerBuiltinType ( const StructType Type,
AccessQualifier::AccessQualifier  AccessQual,
MachineIRBuilder MIRBuilder,
SPIRVGlobalRegistry GR 
)

Handles the translation of the provided special opaque/builtin type Type 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 is the special opaque/builtin type to be lowered.

Definition at line 1797 of file SPIRVBuiltins.cpp.

References assert(), llvm::buildOpName(), llvm::dbgs(), llvm::findBuiltinType(), llvm::getImageType(), llvm::MachineIRBuilder::getMRI(), llvm::StructType::getName(), llvm::getNonParametrizedType(), llvm::MachineRegisterInfo::getNumVirtRegs(), llvm::getPipeType(), llvm::getSampledImageType(), llvm::getSamplerType(), llvm::SPIRVGlobalRegistry::getSPIRVTypeID(), llvm::StructType::hasName(), LLVM_DEBUG, llvm::SPIRV::DemangledType::Opcode, and llvm::report_fatal_error().