|
LLVM 24.0.0git
|
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 : MachineInstr::AsmPrinterFlagTy { 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_UntypedPointer , 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 } |
| using llvm::SPIRV::InstrList = SmallVector<const MachineInstr *> |
Definition at line 128 of file SPIRVModuleAnalysis.h.
| using llvm::SPIRV::IRHandle = std::tuple<const void *, unsigned, unsigned> |
Definition at line 48 of file SPIRVIRMapping.h.
| using llvm::SPIRV::IRHandleMF = std::pair<IRHandle, const MachineFunction *> |
Definition at line 49 of file SPIRVIRMapping.h.
| using llvm::SPIRV::LocalToGlobalRegTable = std::map<Register, MCRegister> |
Definition at line 130 of file SPIRVModuleAnalysis.h.
| using llvm::SPIRV::MIHandle = std::tuple<const MachineInstr *, Register, size_t> |
Definition at line 42 of file SPIRVIRMapping.h.
Definition at line 131 of file SPIRVModuleAnalysis.h.
| Enumerator | |
|---|---|
| ASM_PRINTER_WIDTH16 | |
| ASM_PRINTER_WIDTH64 | |
Definition at line 62 of file SPIRVInstrInfo.h.
| Enumerator | |
|---|---|
| INST_PRINTER_WIDTH16 | |
| INST_PRINTER_WIDTH64 | |
Definition at line 248 of file SPIRVBaseInfo.h.
| 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.
Definition at line 55 of file SPIRVIRMapping.h.
|
static |
Checks that scalar/vector numeric arguments of Call match the types implied by their mangling in DemangledCall.
Pointers and opaque builtin types (images, samplers, pipes, etc.) are not validated here, as mangling does not enforce their exact spelling.
Definition at line 3573 of file SPIRVBuiltins.cpp.
References Call, llvm::dyn_cast(), llvm::MachineInstr::getOpcode(), llvm::SPIRVGlobalRegistry::getScalarOrVectorComponentCount(), llvm::SPIRVGlobalRegistry::getScalarOrVectorComponentType(), llvm::SPIRVGlobalRegistry::getSPIRVTypeForVReg(), llvm::hasBuiltinTypePrefix(), llvm::CallBase::hasStructRetAttr(), llvm::Type::isIntegerTy(), llvm::Type::isPointerTy(), llvm::Type::isTargetExtTy(), llvm::Type::isVoidTy(), parseBuiltinCallArgumentType(), parseBuiltinTypeStr(), and llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by lowerBuiltin().
|
static |
Definition at line 87 of file SPIRVUtils.cpp.
References assert(), llvm::dyn_cast(), findNamedMDOperand(), llvm::MDNode::getNumOperands(), and llvm::MDNode::getOperand().
Referenced by getOriginalAsmConstraints().
|
static |
Definition at line 49 of file SPIRVUtils.cpp.
References assert(), llvm::dyn_cast(), findNamedMDOperand(), llvm::FunctionType::get(), llvm::getMDOperandAsConstInt(), llvm::MDNode::getNumOperands(), llvm::MDNode::getOperand(), llvm::FunctionType::getReturnType(), I, llvm::FunctionType::isVarArg(), llvm::FunctionType::params(), llvm::report_fatal_error(), and llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by getOriginalFunctionType(), and getOriginalFunctionType().
|
static |
Definition at line 36 of file SPIRVUtils.cpp.
References llvm::find_if(), N, llvm::NamedMDNode::op_end(), and llvm::NamedMDNode::operands().
Referenced by extractAsmConstraintsFromMetadata(), and extractFunctionTypeFromMetadata().
| ConvergenceRegionInfo llvm::SPIRV::getConvergenceRegions | ( | Function & | F, |
| DominatorTree & | DT, | ||
| LoopInfo & | LI ) |
Definition at line 307 of file SPIRVConvergenceRegionAnalysis.cpp.
References F.
Referenced by llvm::SPIRVConvergenceRegionAnalysis::run(), and llvm::SPIRVConvergenceRegionAnalysisWrapperPass::runOnFunction().
| std::optional< IntrinsicInst * > llvm::SPIRV::getConvergenceToken | ( | BasicBlock * | BB | ) |
Definition at line 104 of file SPIRVConvergenceRegionAnalysis.cpp.
Referenced by llvm::SPIRV::ConvergenceRegion::ConvergenceRegion().
| std::optional< const IntrinsicInst * > llvm::SPIRV::getConvergenceToken | ( | const BasicBlock * | BB | ) |
Definition at line 109 of file SPIRVConvergenceRegionAnalysis.cpp.
Definition at line 52 of file SPIRVMCTargetDesc.h.
Referenced by emitOperand(), and llvm::SPIRVInstPrinter::printOperand().
|
inline |
Definition at line 51 of file SPIRVIRMapping.h.
Referenced by llvm::SPIRVIRMapping::add(), and llvm::SPIRVIRMapping::findMI().
|
inline |
Definition at line 44 of file SPIRVIRMapping.h.
Referenced by llvm::SPIRVIRMapping::add().
Definition at line 114 of file SPIRVUtils.cpp.
References llvm::dyn_cast(), and llvm::Instruction::getMetadata().
Referenced by getOriginalAsmConstraints(), and getOriginalFunctionType().
Definition at line 131 of file SPIRVUtils.cpp.
References llvm::cast(), extractAsmConstraintsFromMetadata(), llvm::CallBase::getCalledOperand(), llvm::Instruction::getModule(), getMutatedCallsiteKey(), llvm::Module::getNamedMetadata(), and llvm::InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key.
| FunctionType * llvm::SPIRV::getOriginalFunctionType | ( | const CallBase & | CB | ) |
Definition at line 122 of file SPIRVUtils.cpp.
References extractFunctionTypeFromMetadata(), llvm::CallBase::getFunctionType(), llvm::Instruction::getModule(), getMutatedCallsiteKey(), llvm::Module::getNamedMetadata(), and llvm::InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key.
| FunctionType * llvm::SPIRV::getOriginalFunctionType | ( | const Function & | F | ) |
Definition at line 107 of file SPIRVUtils.cpp.
References extractFunctionTypeFromMetadata(), and F.
Referenced by getArgSPIRVType(), llvm::SPIRVGlobalRegistry::getDeducedGlobalValueType(), llvm::SPIRVCallLowering::lowerCall(), and llvm::SPIRVCallLowering::lowerFormalArguments().
|
inline |
Definition at line 177 of file SPIRVIRMapping.h.
References irhandle_ptr(), STK_MachineInstr, and to_hash().
Definition at line 168 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().
Definition at line 173 of file SPIRVIRMapping.h.
References irhandle_ptr(), and STK_Value.
|
inline |
Definition at line 132 of file SPIRVIRMapping.h.
References STK_DeviceEvent.
Referenced by llvm::SPIRVGlobalRegistry::getOrCreateOpTypeDeviceEvent().
Definition at line 163 of file SPIRVIRMapping.h.
References llvm::Type::getTypeID(), irhandle_ptr(), STK_ExplictLayoutType, and llvm::unifyPtrType().
Referenced by llvm::SPIRVIRMapping::add(), llvm::SPIRVIRMapping::find(), and llvm::SPIRVIRMapping::findMI().
|
inline |
Definition at line 98 of file SPIRVIRMapping.h.
References llvm::Depth, and STK_Image.
|
inline |
Definition at line 154 of file SPIRVIRMapping.h.
References STK_Padding.
Referenced by llvm::SPIRVGlobalRegistry::getOrCreatePaddingType().
Definition at line 128 of file SPIRVIRMapping.h.
References STK_Pipe.
Referenced by llvm::SPIRVGlobalRegistry::getOrCreateOpTypePipe().
Definition at line 136 of file SPIRVIRMapping.h.
References STK_ElementPointer, and llvm::unifyPtrType().
Referenced by llvm::SPIRVIRMapping::add(), llvm::SPIRVIRMapping::find(), and llvm::SPIRVIRMapping::findMI().
|
inline |
Definition at line 142 of file SPIRVIRMapping.h.
Referenced by handle(), handle(), handle(), and irhandle_explict_layout_type().
|
inline |
Definition at line 108 of file SPIRVIRMapping.h.
References assert(), llvm::MachineOperand::getImm(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), STK_SampledImage, and llvm::SPIRV::ImageAttrs::Val.
Referenced by llvm::SPIRVGlobalRegistry::getOrCreateOpTypeSampledImage().
|
inline |
Definition at line 124 of file SPIRVIRMapping.h.
References STK_Sampler.
Referenced by llvm::SPIRVGlobalRegistry::getOrCreateOpTypeSampler().
Definition at line 158 of file SPIRVIRMapping.h.
References STK_UntypedPointer.
Referenced by llvm::SPIRVGlobalRegistry::getOrCreateSPIRVUntypedPointerType().
|
inline |
Definition at line 147 of file SPIRVIRMapping.h.
References STK_VkBuffer.
Referenced by llvm::SPIRVGlobalRegistry::getOrCreateVulkanBufferType(), and llvm::SPIRVGlobalRegistry::getOrCreateVulkanPushConstantType().
Returns true if Name is a pipe or address-space-cast OpenCL builtin.
Definition at line 4150 of file SPIRVBuiltins.cpp.
References llvm::SPIRV::DemangledBuiltin::Group, and llvm::lookupBuiltin().
Referenced by llvm::isNonMangledOCLBuiltin().
| std::string llvm::SPIRV::lookupBuiltinNameHelper | ( | StringRef | DemangledCall, |
| FPDecorationId * | DecorationId ) |
Parses the name part of the demangled builtin call.
Definition at line 192 of file SPIRVBuiltins.cpp.
References llvm::demangledPostfixToDecorationId(), llvm::StringRef::size(), and llvm::StringRef::str().
Referenced by isAbortKHRBuiltin(), and llvm::lookupBuiltin().
| std::optional< bool > llvm::SPIRV::lowerBuiltin | ( | 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.
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 | ( | StringRef | DemangledCall, |
| SPIRV::InstructionSet::InstructionSet | Set, | ||
| MachineIRBuilder & | MIRBuilder, | ||
| const Register | OrigRet, | ||
| const Type * | OrigRetTy, | ||
| const SmallVectorImpl< Register > & | Args, | ||
| SPIRVGlobalRegistry * | GR, | ||
| const CallBase & | CB ) |
Definition at line 3639 of file SPIRVBuiltins.cpp.
References assert(), Call, llvm::dbgs(), demangledArgTypesMatchIR(), llvm::generate2DBlockIOINTELInst(), llvm::generateAFPInst(), llvm::generateAPFixedPointInst(), llvm::generateArithmeticInst(), 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::generateImageChannelDataTypeInst(), llvm::generateImageMiscQueryInst(), llvm::generateImageSizeQueryInst(), llvm::generateIntelSubgroupsInst(), llvm::generateKernelClockInst(), llvm::generateLoadStoreInst(), llvm::generateMulExtendedInst(), llvm::generatePipeInst(), llvm::generatePredicatedLoadStoreInst(), llvm::generateReadImageInst(), llvm::generateRelationalInst(), llvm::generateSampleImageInst(), llvm::generateSelectInst(), llvm::generateSpecConstantInst(), llvm::generateTernaryBitwiseFunctionINTELInst(), llvm::generateVectorLoadStoreInst(), llvm::generateWaveInst(), llvm::generateWriteImageInst(), llvm::MachineIRBuilder::getContext(), llvm::SPIRVGlobalRegistry::getSPIRVTypeForVReg(), LLVM_DEBUG, and llvm::lookupBuiltin().
Referenced by llvm::SPIRVCallLowering::lowerCall().
| SPIRVTypeInst llvm::SPIRV::lowerBuiltinType | ( | const Type * | OpaqueType, |
| SPIRV::AccessQualifier::AccessQualifier | AccessQual, | ||
| MachineIRBuilder & | MIRBuilder, | ||
| SPIRVGlobalRegistry * | GR ) |
Definition at line 4072 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::getVulkanPushConstantType(), LLVM_DEBUG, llvm::SPIRV::BuiltinType::Opcode, parseBuiltinTypeNameToTargetExtType(), llvm::report_fatal_error(), and llvm::StringRef::str().
| SPIRVTypeInst 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.
| std::tuple< int, unsigned, unsigned > llvm::SPIRV::mapBuiltinToOpcode | ( | StringRef | DemangledCall, |
| SPIRV::InstructionSet::InstructionSet | Set ) |
Helper function for finding a builtin function attributes by a demangled function name.
Defined in SPIRVBuiltins.cpp.
Definition at line 3493 of file SPIRVBuiltins.cpp.
References Call, llvm::lookupBuiltin(), and Reg.
| Type * llvm::SPIRV::parseBuiltinCallArgumentBaseType | ( | StringRef | DemangledCall, |
| unsigned | ArgIdx, | ||
| LLVMContext & | Ctx ) |
Parses the provided ArgIdx argument base type in the DemangledCall skeleton.
A base type is either a basic type (e.g. i32 for int), pointer element type (e.g. i8 for char*), or builtin type (TargetExtType).
DemangledCall is the skeleton of the lowered builtin function call. ArgIdx is the index of the argument to parse.
Definition at line 3832 of file SPIRVBuiltins.cpp.
References parseBuiltinCallArgumentType(), parseBuiltinTypeStr(), and llvm::SmallVectorTemplateCommon< T, typename >::size().
| Type * llvm::SPIRV::parseBuiltinCallArgumentType | ( | StringRef | TypeStr, |
| LLVMContext & | Ctx ) |
Definition at line 3775 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 demangledArgTypesMatchIR(), and parseBuiltinCallArgumentBaseType().
| TargetExtType * llvm::SPIRV::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().
TypeName is the full string representation of the SPIR-V or OpenCL builtin type.
Definition at line 4021 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().
| bool llvm::SPIRV::parseBuiltinTypeStr | ( | SmallVector< StringRef, 10 > & | BuiltinArgsTypeStrs, |
| StringRef | DemangledCall, | ||
| LLVMContext & | Ctx ) |
Definition at line 3819 of file SPIRVBuiltins.cpp.
References llvm::StringRef::find(), llvm::StringRef::npos, llvm::StringRef::slice(), and llvm::StringRef::split().
Referenced by demangledArgTypesMatchIR(), llvm::generateDotOrFMulInst(), and parseBuiltinCallArgumentBaseType().
|
inline |
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().
Definition at line 181 of file SPIRVIRMapping.h.
References llvm::isa(), and T.
Referenced by llvm::SPIRVIRMapping::add(), llvm::SPIRVIRMapping::find(), and llvm::SPIRVIRMapping::findMI().