LLVM 18.0.0git
|
Lowers a builtin funtion call using the provided DemangledCall
skeleton and external instruction Set
.
More...
Namespaces | |
namespace | AccessQualifier |
namespace | AddressingModel |
namespace | BuiltIn |
namespace | Capability |
namespace | Decoration |
namespace | Dim |
namespace | ExecutionMode |
namespace | ExecutionModel |
namespace | Extension |
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 | MemoryModel |
namespace | MemoryOperand |
namespace | MemorySemantics |
namespace | Opcode |
namespace | OpenCLExtInst |
namespace | OperandCategory |
namespace | SamplerAddressingMode |
namespace | SamplerFilterMode |
namespace | Scope |
namespace | SelectionControl |
namespace | SourceLanguage |
namespace | StorageClass |
Classes | |
struct | BuiltinType |
struct | CapabilityEntry |
struct | ConvertBuiltin |
struct | DemangledBuiltin |
struct | DeviceEventTypeDescriptor |
class | DTSortableEntry |
struct | ExtendedBuiltin |
struct | ExtensionEntry |
struct | GetBuiltin |
struct | GroupBuiltin |
struct | ImageQueryBuiltin |
struct | ImageTypeDescriptor |
struct | IncomingCall |
struct | ModuleAnalysisInfo |
struct | NativeBuiltin |
struct | OpenCLType |
struct | PipeTypeDescriptor |
struct | PointerTypeDescriptor |
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 | |
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 TargetExtType * | parseBuiltinTypeNameToTargetExtType (std::string TypeName, MachineIRBuilder &MIRBuilder) |
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) |
Lowers a builtin funtion 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. | |
Lowers a builtin funtion call using the provided DemangledCall
skeleton and external instruction Set
.
using llvm::SPIRV::InstrList = typedef SmallVector<MachineInstr *> |
Definition at line 128 of file SPIRVModuleAnalysis.h.
using llvm::SPIRV::LocalToGlobalRegTable = typedef std::map<Register, Register> |
Definition at line 130 of file SPIRVModuleAnalysis.h.
using llvm::SPIRV::RegisterAliasMapTy = typedef std::map<const MachineFunction *, LocalToGlobalRegTable> |
Definition at line 131 of file SPIRVModuleAnalysis.h.
Enumerator | |
---|---|
MB_EntryPoints | |
MB_DebugNames | |
MB_DebugModuleProcessed | |
MB_Annotations | |
MB_TypeConstVars | |
MB_ExtFuncDecls | |
NUM_MODULE_SECTIONS |
Definition at line 32 of file SPIRVModuleAnalysis.h.
std::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
.
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.
std::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 | ||
) |
Definition at line 1896 of file SPIRVBuiltins.cpp.
References assert(), llvm::SPIRVGlobalRegistry::assignTypeToVReg(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::dbgs(), llvm::generateAsyncCopy(), llvm::generateAtomicInst(), llvm::generateBarrierInst(), llvm::generateBuiltinVar(), llvm::generateConvertInst(), llvm::generateDotOrFMulInst(), llvm::generateEnqueueInst(), llvm::generateExtInst(), llvm::generateGetQueryInst(), llvm::generateGroupInst(), llvm::generateImageMiscQueryInst(), llvm::generateImageSizeQueryInst(), llvm::generateLoadStoreInst(), llvm::generateReadImageInst(), llvm::generateRelationalInst(), llvm::generateSampleImageInst(), llvm::generateSelectInst(), llvm::generateSpecConstantInst(), llvm::generateVectorLoadStoreInst(), llvm::generateWriteImageInst(), llvm::MachineIRBuilder::getMRI(), llvm::MachineRegisterInfo::getRegClassOrNull(), llvm::Type::isVoidTy(), LLVM_DEBUG, llvm::lookupBuiltin(), llvm::LLT::scalar(), llvm::MachineRegisterInfo::setRegClass(), and llvm::MachineRegisterInfo::setType().
Referenced by llvm::SPIRVCallLowering::lowerCall().
SPIRVType * llvm::SPIRV::lowerBuiltinType | ( | const Type * | OpaqueType, |
SPIRV::AccessQualifier::AccessQualifier | AccessQual, | ||
MachineIRBuilder & | MIRBuilder, | ||
SPIRVGlobalRegistry * | GR | ||
) |
Definition at line 2126 of file SPIRVBuiltins.cpp.
References llvm::buildOpName(), llvm::dbgs(), llvm::getImageType(), llvm::MachineIRBuilder::getMRI(), llvm::getNonParameterizedType(), llvm::MachineRegisterInfo::getNumVirtRegs(), llvm::SPIRVGlobalRegistry::getOrCreateOpTypeDeviceEvent(), llvm::getPipeType(), llvm::getSampledImageType(), llvm::getSamplerType(), llvm::SPIRVGlobalRegistry::getSPIRVTypeID(), llvm::Type::getStructName(), LLVM_DEBUG, Name, llvm::SPIRV::BuiltinType::Opcode, parseBuiltinTypeNameToTargetExtType(), llvm::report_fatal_error(), and llvm::StringRef::str().
SPIRVType * llvm::SPIRV::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.
Generates the corresponding machine instructions for the target type or gets the already existing OpType<...> register from the global registry GR
.
Type
is the special opaque/builtin type to be lowered.
const TargetExtType * llvm::SPIRV::parseBuiltinTypeNameToTargetExtType | ( | std::string | TypeName, |
MachineIRBuilder & | MIRBuilder | ||
) |
Translates a string representing a SPIR-V or OpenCL builtin type to a TargetExtType that can be further lowered with lowerBuiltinType().
TypeName
is the full string representation of the SPIR-V or OpenCL builtin type.
Definition at line 2077 of file SPIRVBuiltins.cpp.
References assert(), llvm::StringRef::find(), llvm::TargetExtType::get(), llvm::MachineIRBuilder::getContext(), llvm::Function::getContext(), llvm::MachineFunction::getFunction(), llvm::MachineIRBuilder::getMF(), isDigit(), llvm::parseTypeString(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::report_fatal_error(), llvm::SmallVectorBase< Size_T >::size(), llvm::SPIRV::OpenCLType::SpirvTypeLiteral, llvm::StringRef::startswith(), and llvm::StringRef::substr().
Referenced by llvm::SPIRVGlobalRegistry::getOrCreateSPIRVTypeByName(), and lowerBuiltinType().