LLVM 19.0.0git
Classes | Namespaces | Macros | Functions | Variables
DXILOpBuilder.cpp File Reference
#include "DXILOpBuilder.h"
#include "DXILConstants.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/DXILABI.h"
#include "llvm/Support/ErrorHandling.h"
#include "DXILOperation.inc"

Go to the source code of this file.

Classes

struct  OpCodeProperty
 

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 
namespace  llvm::dxil
 

Macros

#define DXIL_OP_OPERATION_TABLE
 

Functions

static const chargetOverloadTypeName (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 StructTypegetOrCreateStructType (StringRef Name, ArrayRef< Type * > EltTys, LLVMContext &Ctx)
 
static StructTypegetResRetType (Type *OverloadTy, LLVMContext &Ctx)
 
static StructTypegetHandleType (LLVMContext &Ctx)
 
static TypegetTypeFromParameterKind (ParameterKind Kind, Type *OverloadTy)
 
static FunctionTypegetDXILOpFunctionType (const OpCodeProperty *Prop, Type *ReturnTy, Type *OverloadTy)
 Construct DXIL function type.
 

Variables

constexpr StringLiteral DXILOpNamePrefix = "dx.op."
 

Macro Definition Documentation

◆ DXIL_OP_OPERATION_TABLE

#define DXIL_OP_OPERATION_TABLE

Definition at line 144 of file DXILOpBuilder.cpp.

Function Documentation

◆ constructOverloadName()

static std::string constructOverloadName ( OverloadKind  Kind,
Type Ty,
const OpCodeProperty Prop 
)
static

◆ constructOverloadTypeName()

static std::string constructOverloadTypeName ( OverloadKind  Kind,
StringRef  TypeName 
)
static

Definition at line 158 of file DXILOpBuilder.cpp.

References assert(), and getOverloadTypeName().

Referenced by getResRetType().

◆ getDXILOpFunctionType()

static FunctionType * getDXILOpFunctionType ( const OpCodeProperty Prop,
Type ReturnTy,
Type OverloadTy 
)
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.

Parameters
PropStructure containing DXIL Operation properties based on its specification in DXIL.td.
OverloadTyReturn type to be used to construct DXIL function type.

Definition at line 231 of file DXILOpBuilder.cpp.

References llvm::SmallVectorImpl< T >::emplace_back(), llvm::Type::getContext(), llvm::Type::getInt32Ty(), getTypeFromParameterKind(), I, OpCodeProperty::NumOfParameters, and llvm::SmallVectorBase< Size_T >::size().

Referenced by llvm::dxil::DXILOpBuilder::createDXILOpCall().

◆ getHandleType()

static StructType * getHandleType ( LLVMContext Ctx)
static

Definition at line 185 of file DXILOpBuilder.cpp.

References getOrCreateStructType().

Referenced by getTypeFromParameterKind().

◆ getOrCreateStructType()

static StructType * getOrCreateStructType ( StringRef  Name,
ArrayRef< Type * >  EltTys,
LLVMContext Ctx 
)
static

◆ getOverloadKind()

static OverloadKind getOverloadKind ( Type Ty)
static

◆ getOverloadTypeName()

static const char * getOverloadTypeName ( OverloadKind  Kind)
static

Definition at line 42 of file DXILOpBuilder.cpp.

References llvm_unreachable.

Referenced by constructOverloadTypeName(), and getTypeName().

◆ getResRetType()

static StructType * getResRetType ( Type OverloadTy,
LLVMContext Ctx 
)
static

◆ getTypeFromParameterKind()

static Type * getTypeFromParameterKind ( ParameterKind  Kind,
Type OverloadTy 
)
static

◆ getTypeName()

static std::string getTypeName ( OverloadKind  Kind,
Type Ty 
)
static

Definition at line 109 of file DXILOpBuilder.cpp.

References getOverloadTypeName(), OS, and llvm::Type::print().

Variable Documentation

◆ DXILOpNamePrefix

constexpr StringLiteral DXILOpNamePrefix = "dx.op."
constexpr

Definition at line 22 of file DXILOpBuilder.cpp.

Referenced by constructOverloadName().