LLVM 20.0.0git
Public Member Functions | Static Public Member Functions | List of all members
llvm::dxil::DXILOpBuilder Class Reference

#include "Target/DirectX/DXILOpBuilder.h"

Public Member Functions

 DXILOpBuilder (Module &M)
 
IRBuildergetIRB ()
 
CallInstcreateOp (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.
 
StructTypegetResRetType (Type *ElementTy)
 Get a dx.types.ResRet type with the given element type.
 
StructTypegetSplitDoubleType (LLVMContext &Context)
 Get the dx.types.splitdouble type.
 
StructTypegetHandleType ()
 Get the dx.types.Handle type.
 
ConstantgetResBind (uint32_t LowerBound, uint32_t UpperBound, uint32_t SpaceID, dxil::ResourceClass RC)
 Get a constant dx.types.ResBind value.
 
ConstantgetResProps (uint32_t Word0, uint32_t Word1)
 Get a constant dx.types.ResourceProperties value.
 

Static Public Member Functions

static const chargetOpCodeName (dxil::OpCode DXILOp)
 Return the name of the given opcode.
 

Detailed Description

Definition at line 33 of file DXILOpBuilder.h.

Constructor & Destructor Documentation

◆ DXILOpBuilder()

llvm::dxil::DXILOpBuilder::DXILOpBuilder ( Module M)

Member Function Documentation

◆ createOp()

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().

◆ getHandleType()

StructType * llvm::dxil::DXILOpBuilder::getHandleType ( )

Get the dx.types.Handle type.

Definition at line 483 of file DXILOpBuilder.cpp.

References llvm::IRBuilderBase::getContext().

◆ getIRB()

IRBuilder & llvm::dxil::DXILOpBuilder::getIRB ( )
inline

Definition at line 37 of file DXILOpBuilder.h.

◆ getOpCodeName()

const char * llvm::dxil::DXILOpBuilder::getOpCodeName ( dxil::OpCode  DXILOp)
static

Return the name of the given opcode.

Definition at line 506 of file DXILOpBuilder.cpp.

◆ getResBind()

Constant * llvm::dxil::DXILOpBuilder::getResBind ( uint32_t  LowerBound,
uint32_t  UpperBound,
uint32_t  SpaceID,
dxil::ResourceClass  RC 
)

◆ getResProps()

Constant * llvm::dxil::DXILOpBuilder::getResProps ( uint32_t  Word0,
uint32_t  Word1 
)

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().

◆ getResRetType()

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.

◆ getSplitDoubleType()

StructType * llvm::dxil::DXILOpBuilder::getSplitDoubleType ( LLVMContext Context)

Get the dx.types.splitdouble type.

Definition at line 479 of file DXILOpBuilder.cpp.

◆ tryCreateOp()

Expected< CallInst * > llvm::dxil::DXILOpBuilder::tryCreateOp ( dxil::OpCode  Op,
ArrayRef< Value * >  Args,
const Twine Name = "",
Type RetTy = nullptr 
)

The documentation for this class was generated from the following files: