|
LLVM 23.0.0git
|
#include "DXILOpBuilder.h"#include "DXILConstants.h"#include "llvm/IR/Module.h"#include "llvm/Support/DXILABI.h"#include "llvm/Support/ErrorHandling.h"#include <optional>#include "DXILOperation.inc"Go to the source code of this file.
Classes | |
| struct | OpStage |
| struct | OpCodeProperty |
Namespaces | |
| namespace | llvm |
| This is an optimization pass for GlobalISel generic memory operations. | |
| namespace | llvm::dxil |
Macros | |
| #define | DXIL_OP_OPERATION_TABLE |
| #define | DXIL_OP_FUNCTION_TYPE(OpCode, RetType, ...) |
| #define | DXIL_VERSION(MAJOR, MINOR) |
| #define | DXIL_OP_ATTRIBUTES(OpCode, VersionMajor, VersionMinor, ...) |
Functions | |
| static const char * | getOverloadTypeName (OverloadKind Kind) |
| static OverloadKind | getOverloadKind (Type *Ty) |
| static std::string | getTypeName (OverloadKind Kind, Type *Ty) |
| static std::string | constructOverloadName (OverloadKind Kind, Type *Ty, const OpCodeProperty &Prop) |
| static std::string | constructOverloadTypeName (OverloadKind Kind, StringRef TypeName) |
| static StructType * | getOrCreateStructType (StringRef Name, ArrayRef< Type * > EltTys, LLVMContext &Ctx) |
| static StructType * | getResRetType (Type *ElementTy) |
| static StructType * | getCBufRetType (Type *ElementTy) |
| static StructType * | getHandleType (LLVMContext &Ctx) |
| static StructType * | getResBindType (LLVMContext &Context) |
| static StructType * | getResPropsType (LLVMContext &Context) |
| static StructType * | getSplitDoubleType (LLVMContext &Context) |
| static StructType * | getBinaryWithCarryType (LLVMContext &Context) |
| static StructType * | getDimensionsType (LLVMContext &Context) |
| static StructType * | getFouri32sType (LLVMContext &Context) |
| static Type * | getTypeFromOpParamType (OpParamType Kind, LLVMContext &Ctx, Type *OverloadTy) |
| static ShaderKind | getShaderKindEnum (Triple::EnvironmentType EnvType) |
| static SmallVector< Type * > | getArgTypesFromOpParamTypes (ArrayRef< dxil::OpParamType > Types, LLVMContext &Context, Type *OverloadTy) |
| static FunctionType * | getDXILOpFunctionType (dxil::OpCode OpCode, LLVMContext &Context, Type *OverloadTy) |
| Construct DXIL function type. | |
| template<typename T> | |
| static std::optional< size_t > | getPropIndex (ArrayRef< T > PropList, const VersionTuple DXILVer) |
| Get index of the property from PropList valid for the most recent DXIL version not greater than DXILVer. | |
| static constexpr uint64_t | computeSwitchEnum (dxil::OpCode OpCode, uint16_t VersionMajor, uint16_t VersionMinor) |
| static dxil::Attributes | getDXILAttributes (dxil::OpCode OpCode, VersionTuple DXILVersion) |
| Get the set of attributes for a given DXIL OpCode and the DXIL version. | |
| static AttributeList | getDXILFnAttributeList (LLVMContext &Ctx, dxil::OpCode OpCode, VersionTuple DXILVersion) |
| Get the attributes to apply to the function for the DXIL operation with the given OpCode and DXIL version. | |
| static Error | llvm::dxil::makeOpError (dxil::OpCode OpCode, Twine Msg) |
Variables | |
| constexpr StringLiteral | DXILOpNamePrefix = "dx.op." |
| #define DXIL_OP_ATTRIBUTES | ( | OpCode, | |
| VersionMajor, | |||
| VersionMinor, | |||
| ... ) |
| #define DXIL_OP_FUNCTION_TYPE | ( | OpCode, | |
| RetType, | |||
| ... ) |
| #define DXIL_OP_OPERATION_TABLE |
Definition at line 162 of file DXILOpBuilder.cpp.
| #define DXIL_VERSION | ( | MAJOR, | |
| MINOR ) |
|
staticconstexpr |
Definition at line 434 of file DXILOpBuilder.cpp.
Referenced by getDXILAttributes().
|
static |
Definition at line 166 of file DXILOpBuilder.cpp.
References DXILOpNamePrefix, and llvm::getTypeName().
Referenced by llvm::dxil::DXILOpBuilder::tryCreateOp().
|
static |
Definition at line 176 of file DXILOpBuilder.cpp.
References assert(), and getOverloadTypeName().
Referenced by getCBufRetType(), and getResRetType().
|
static |
Definition at line 385 of file DXILOpBuilder.cpp.
References llvm::SmallVectorImpl< T >::emplace_back(), llvm::Type::getInt32Ty(), and getTypeFromOpParamType().
|
static |
Definition at line 256 of file DXILOpBuilder.cpp.
References llvm::StructType::create(), llvm::Type::getInt1Ty(), llvm::Type::getInt32Ty(), llvm::StructType::getTypeByName(), and llvm::Int32Ty.
Referenced by getTypeFromOpParamType().
|
static |
Definition at line 204 of file DXILOpBuilder.cpp.
References constructOverloadTypeName(), llvm::Type::getContext(), getOrCreateStructType(), getOverloadKind(), llvm::Type::isDoubleTy(), llvm::Type::isHalfTy(), and llvm::Type::isIntegerTy().
Referenced by getTypeFromOpParamType().
|
static |
Definition at line 264 of file DXILOpBuilder.cpp.
References llvm::Type::getInt32Ty(), getOrCreateStructType(), and llvm::Int32Ty.
Referenced by getTypeFromOpParamType().
|
static |
Get the set of attributes for a given DXIL OpCode and the DXIL version.
Definition at line 442 of file DXILOpBuilder.cpp.
References computeSwitchEnum().
Referenced by getDXILFnAttributeList().
|
static |
Get the attributes to apply to the function for the DXIL operation with the given OpCode and DXIL version.
Definition at line 472 of file DXILOpBuilder.cpp.
References getDXILAttributes(), llvm::MemoryEffectsBase< IRMemLocation >::none(), and llvm::MemoryEffectsBase< IRMemLocation >::readOnly().
Referenced by llvm::dxil::DXILOpBuilder::tryCreateOp().
|
static |
Construct DXIL function type.
This is the type of a function with the following prototype OverloadType dx.op.<opclass>.<return-type>(int opcode, ) <param-types> are constructed from types in Prop.
Definition at line 398 of file DXILOpBuilder.cpp.
References llvm_unreachable.
Referenced by llvm::dxil::DXILOpBuilder::tryCreateOp().
|
static |
Definition at line 270 of file DXILOpBuilder.cpp.
References llvm::Type::getInt32Ty(), getOrCreateStructType(), llvm::StructType::getTypeByName(), and llvm::Int32Ty.
Referenced by getTypeFromOpParamType().
|
static |
Definition at line 227 of file DXILOpBuilder.cpp.
References getOrCreateStructType(), and llvm::PointerType::getUnqual().
Referenced by getTypeFromOpParamType().
|
static |
Definition at line 185 of file DXILOpBuilder.cpp.
References llvm::StructType::create(), and llvm::StructType::getTypeByName().
Referenced by getCBufRetType(), getDimensionsType(), getFouri32sType(), getHandleType(), and getResRetType().
|
static |
Definition at line 83 of file DXILOpBuilder.cpp.
References llvm::cast(), llvm::Type::DoubleTyID, llvm::Type::FloatTyID, llvm::IntegerType::getBitWidth(), getOverloadKind(), llvm::Type::HalfTyID, llvm::Type::IntegerTyID, llvm_unreachable, llvm::Type::PointerTyID, llvm::Type::StructTyID, T, and llvm::Type::VoidTyID.
Referenced by getCBufRetType(), getOverloadKind(), getResRetType(), and llvm::dxil::DXILOpBuilder::tryCreateOp().
Definition at line 55 of file DXILOpBuilder.cpp.
References llvm_unreachable.
Referenced by constructOverloadTypeName(), and getTypeName().
|
static |
Get index of the property from PropList valid for the most recent DXIL version not greater than DXILVer.
PropList is expected to be sorted in ascending order of DXIL version.
Definition at line 418 of file DXILOpBuilder.cpp.
References llvm::ArrayRef< T >::rbegin(), llvm::ArrayRef< T >::rend(), llvm::ArrayRef< T >::size(), and T.
Referenced by llvm::dxil::DXILOpBuilder::tryCreateOp().
|
static |
Definition at line 232 of file DXILOpBuilder.cpp.
References llvm::StructType::create(), llvm::Type::getInt32Ty(), llvm::Type::getInt8Ty(), llvm::StructType::getTypeByName(), and llvm::Int32Ty.
Referenced by llvm::dxil::DXILOpBuilder::getResBind(), and getTypeFromOpParamType().
|
static |
Definition at line 241 of file DXILOpBuilder.cpp.
References llvm::StructType::create(), llvm::Type::getInt32Ty(), llvm::StructType::getTypeByName(), and llvm::Int32Ty.
Referenced by llvm::dxil::DXILOpBuilder::getResProps(), and getTypeFromOpParamType().
|
static |
Definition at line 195 of file DXILOpBuilder.cpp.
References constructOverloadTypeName(), llvm::Type::getContext(), llvm::Type::getInt32Ty(), getOrCreateStructType(), and getOverloadKind().
Referenced by getTypeFromOpParamType().
|
static |
Definition at line 345 of file DXILOpBuilder.cpp.
References llvm::Triple::Amplification, llvm::Triple::AnyHit, llvm::Triple::Callable, llvm::Triple::ClosestHit, llvm::Triple::Compute, llvm::Triple::Domain, llvm::Triple::Geometry, llvm::Triple::Hull, llvm::Triple::Intersection, llvm::Triple::Library, llvm_unreachable, llvm::Triple::Mesh, llvm::Triple::Miss, llvm::Triple::Pixel, llvm::Triple::RayGeneration, and llvm::Triple::Vertex.
Referenced by llvm::dxil::DXILOpBuilder::tryCreateOp().
|
static |
Definition at line 249 of file DXILOpBuilder.cpp.
References llvm::StructType::create(), llvm::Type::getInt32Ty(), llvm::StructType::getTypeByName(), and llvm::Int32Ty.
Referenced by getTypeFromOpParamType().
|
static |
Definition at line 278 of file DXILOpBuilder.cpp.
References getBinaryWithCarryType(), getCBufRetType(), getDimensionsType(), llvm::Type::getDoubleTy(), llvm::Type::getFloatTy(), getFouri32sType(), llvm::Type::getHalfTy(), getHandleType(), llvm::Type::getInt16Ty(), llvm::Type::getInt1Ty(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), llvm::Type::getInt8Ty(), getResBindType(), getResPropsType(), getResRetType(), getSplitDoubleType(), llvm::Type::getVoidTy(), and llvm_unreachable.
Referenced by getArgTypesFromOpParamTypes().
|
static |
Definition at line 129 of file DXILOpBuilder.cpp.
References llvm::cast(), getOverloadTypeName(), and llvm::raw_string_ostream::str().
|
constexpr |
Definition at line 22 of file DXILOpBuilder.cpp.
Referenced by constructOverloadName().