LLVM 20.0.0git
|
#include "Target/DirectX/DXILOpBuilder.h"
Public Member Functions | |
DXILOpBuilder (Module &M) | |
IRBuilder & | getIRB () |
CallInst * | createOp (dxil::OpCode Op, ArrayRef< Value * > Args, const Twine &Name="", Type *RetTy=nullptr) |
Create a call instruction for the given DXIL op. | |
Expected< CallInst * > | tryCreateOp (dxil::OpCode Op, ArrayRef< Value * > Args, const Twine &Name="", Type *RetTy=nullptr) |
Try to create a call instruction for the given DXIL op. | |
StructType * | getResRetType (Type *ElementTy) |
Get a dx.types.ResRet type with the given element type. | |
StructType * | getSplitDoubleType (LLVMContext &Context) |
Get the dx.types.splitdouble type. | |
StructType * | getHandleType () |
Get the dx.types.Handle type. | |
Constant * | getResBind (uint32_t LowerBound, uint32_t UpperBound, uint32_t SpaceID, dxil::ResourceClass RC) |
Get a constant dx.types.ResBind value. | |
Constant * | getResProps (uint32_t Word0, uint32_t Word1) |
Get a constant dx.types.ResourceProperties value. | |
Static Public Member Functions | |
static const char * | getOpCodeName (dxil::OpCode DXILOp) |
Return the name of the given opcode. | |
Definition at line 33 of file DXILOpBuilder.h.
llvm::dxil::DXILOpBuilder::DXILOpBuilder | ( | Module & | M | ) |
Definition at line 377 of file DXILOpBuilder.cpp.
References llvm::VersionTuple::getAsString(), llvm::report_fatal_error(), and llvm::Triple::UnknownEnvironment.
CallInst * llvm::dxil::DXILOpBuilder::createOp | ( | dxil::OpCode | Op, |
ArrayRef< Value * > | Args, | ||
const Twine & | Name = "" , |
||
Type * | RetTy = nullptr |
||
) |
Create a call instruction for the given DXIL op.
The arguments must be valid for an overload of the operation.
Definition at line 467 of file DXILOpBuilder.cpp.
References llvm_unreachable, Name, RetTy, and tryCreateOp().
StructType * llvm::dxil::DXILOpBuilder::getHandleType | ( | ) |
Get the dx.types.Handle
type.
Definition at line 483 of file DXILOpBuilder.cpp.
References llvm::IRBuilderBase::getContext().
|
inline |
Definition at line 37 of file DXILOpBuilder.h.
|
static |
Return the name of the given opcode.
Definition at line 506 of file DXILOpBuilder.cpp.
Constant * llvm::dxil::DXILOpBuilder::getResBind | ( | uint32_t | LowerBound, |
uint32_t | UpperBound, | ||
uint32_t | SpaceID, | ||
dxil::ResourceClass | RC | ||
) |
Get a constant dx.types.ResBind
value.
Definition at line 487 of file DXILOpBuilder.cpp.
References llvm::ConstantStruct::get(), llvm::IRBuilderBase::getContext(), llvm::IRBuilderBase::getInt32Ty(), llvm::IRBuilderBase::getInt8Ty(), and getResBindType().
Get a constant dx.types.ResourceProperties
value.
Definition at line 499 of file DXILOpBuilder.cpp.
References llvm::ConstantStruct::get(), llvm::IRBuilderBase::getContext(), llvm::IRBuilderBase::getInt32Ty(), and getResPropsType().
StructType * llvm::dxil::DXILOpBuilder::getResRetType | ( | Type * | ElementTy | ) |
Get a dx.types.ResRet
type with the given element type.
Definition at line 475 of file DXILOpBuilder.cpp.
StructType * llvm::dxil::DXILOpBuilder::getSplitDoubleType | ( | LLVMContext & | Context | ) |
Get the dx.types.splitdouble
type.
Definition at line 479 of file DXILOpBuilder.cpp.
Expected< CallInst * > llvm::dxil::DXILOpBuilder::tryCreateOp | ( | dxil::OpCode | Op, |
ArrayRef< Value * > | Args, | ||
const Twine & | Name = "" , |
||
Type * | RetTy = nullptr |
||
) |
Try to create a call instruction for the given DXIL op.
Fails if the overload is invalid.
Definition at line 396 of file DXILOpBuilder.cpp.
References llvm::SmallVectorImpl< T >::append(), constructOverloadName(), llvm::IRBuilderBase::CreateCall(), llvm::VersionTuple::getAsString(), llvm::Module::getContext(), getDXILOpFunctionType(), llvm::IRBuilderBase::getInt32(), llvm::Module::getOrInsertFunction(), getOverloadKind(), getPropIndex(), getShaderKindEnum(), llvm::dxil::makeOpError(), Name, OpCodeProperty::OverloadParamIndex, OpCodeProperty::Overloads, llvm::SmallVectorTemplateBase< T, bool >::push_back(), RetTy, OpCodeProperty::Stages, and llvm::to_underlying().
Referenced by createOp().