36 UserDefineType = 1 << 9,
44 case OverloadKind::HALF:
46 case OverloadKind::FLOAT:
48 case OverloadKind::DOUBLE:
50 case OverloadKind::I1:
52 case OverloadKind::I8:
54 case OverloadKind::I16:
56 case OverloadKind::I32:
58 case OverloadKind::I64:
60 case OverloadKind::VOID:
61 case OverloadKind::ObjectType:
62 case OverloadKind::UserDefineType:
73 return OverloadKind::VOID;
75 return OverloadKind::HALF;
77 return OverloadKind::FLOAT;
79 return OverloadKind::DOUBLE;
85 return OverloadKind::I1;
87 return OverloadKind::I8;
89 return OverloadKind::I16;
91 return OverloadKind::I32;
93 return OverloadKind::I64;
96 return OverloadKind::VOID;
100 return OverloadKind::UserDefineType;
102 return OverloadKind::ObjectType;
105 return OverloadKind::VOID;
110 if (Kind < OverloadKind::UserDefineType) {
112 }
else if (Kind == OverloadKind::UserDefineType) {
114 return ST->getStructName().str();
115 }
else if (Kind == OverloadKind::ObjectType) {
117 return ST->getStructName().str();
144#define DXIL_OP_OPERATION_TABLE
145#include "DXILOperation.inc"
146#undef DXIL_OP_OPERATION_TABLE
150 if (Kind == OverloadKind::VOID) {
160 if (Kind == OverloadKind::VOID)
161 return TypeName.str();
163 assert(Kind < OverloadKind::UserDefineType &&
"invalid overload kind");
180 Type *FieldTypes[5] = {OverloadTy, OverloadTy, OverloadTy, OverloadTy,
193 case ParameterKind::Void:
195 case ParameterKind::Half:
197 case ParameterKind::Float:
199 case ParameterKind::Double:
201 case ParameterKind::I1:
203 case ParameterKind::I8:
205 case ParameterKind::I16:
207 case ParameterKind::I32:
209 case ParameterKind::I64:
211 case ParameterKind::Overload:
213 case ParameterKind::ResourceRet:
215 case ParameterKind::DXILHandle:
235 auto ParamKinds = getOpCodeParameterKind(*Prop);
248 return FunctionType::get(
287 case OverloadKind::VOID:
289 case OverloadKind::HALF:
291 case OverloadKind::FLOAT:
293 case OverloadKind::DOUBLE:
295 case OverloadKind::I1:
297 case OverloadKind::I8:
299 case OverloadKind::I16:
301 case OverloadKind::I32:
303 case OverloadKind::I64:
318 auto ParamKinds = getOpCodeParameterKind(*Prop);
323 auto *ST = cast<StructType>(OverloadType);
324 OverloadType = ST->getElementType(0);
330 return ::getOpCodeName(DXILOp);
static StructType * getResRetType(Type *OverloadTy, LLVMContext &Ctx)
static const char * getOverloadTypeName(OverloadKind Kind)
static OverloadKind getOverloadKind(Type *Ty)
static StructType * getOrCreateStructType(StringRef Name, ArrayRef< Type * > EltTys, LLVMContext &Ctx)
static StructType * getHandleType(LLVMContext &Ctx)
static FunctionType * getDXILOpFunctionType(const OpCodeProperty *Prop, Type *ReturnTy, Type *OverloadTy)
Construct DXIL function type.
static std::string constructOverloadName(OverloadKind Kind, Type *Ty, const OpCodeProperty &Prop)
constexpr StringLiteral DXILOpNamePrefix
static std::string constructOverloadTypeName(OverloadKind Kind, StringRef TypeName)
static Type * getTypeFromParameterKind(ParameterKind Kind, Type *OverloadTy)
Module.h This file contains the declarations for the Module class.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
AttrKind
This enumeration lists the attributes that can be associated with parameters, function results,...
This class represents a function call, abstracting a target machine's calling convention.
A handy container for a FunctionType+Callee-pointer pair, which can be passed around as a single enti...
Class to represent function types.
Type * getParamType(unsigned i) const
Parameter type accessors.
Type * getReturnType() const
CallInst * CreateCall(FunctionType *FTy, Value *Callee, ArrayRef< Value * > Args=std::nullopt, const Twine &Name="", MDNode *FPMathTag=nullptr)
Class to represent integer types.
unsigned getBitWidth() const
Get the number of bits in this IntegerType.
This is an important class for using LLVM in a threaded context.
Function * getFunction(StringRef Name) const
Look up the specified function in the module symbol table.
FunctionCallee getOrInsertFunction(StringRef Name, FunctionType *T, AttributeList AttributeList)
Look up the specified function in the module symbol table.
reference emplace_back(ArgTypes &&... Args)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
StringRef - Represent a constant reference to a string, i.e.
Class to represent struct types.
static StructType * getTypeByName(LLVMContext &C, StringRef Name)
Return the type with the specified name, or null if there is none by that name.
static StructType * create(LLVMContext &Context, StringRef Name)
This creates an identified struct.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
The instances of the Type class are immutable: once they are created, they are never changed.
static Type * getHalfTy(LLVMContext &C)
static Type * getDoubleTy(LLVMContext &C)
static IntegerType * getInt1Ty(LLVMContext &C)
TypeID
Definitions of all of the base types for the Type system.
@ HalfTyID
16-bit floating point type
@ VoidTyID
type with no size
@ FloatTyID
32-bit floating point type
@ IntegerTyID
Arbitrary bit width integers.
@ DoubleTyID
64-bit floating point type
void print(raw_ostream &O, bool IsForDebug=false, bool NoDetails=false) const
Print the current type.
static Type * getVoidTy(LLVMContext &C)
static IntegerType * getInt16Ty(LLVMContext &C)
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
static IntegerType * getInt8Ty(LLVMContext &C)
static IntegerType * getInt32Ty(LLVMContext &C)
static IntegerType * getInt64Ty(LLVMContext &C)
static Type * getFloatTy(LLVMContext &C)
TypeID getTypeID() const
Return the type id for the type.
Type * getOverloadTy(dxil::OpCode OpCode, FunctionType *FT)
CallInst * createDXILOpCall(dxil::OpCode OpCode, Type *ReturnTy, Type *OverloadTy, SmallVector< Value * > Args)
Create an instruction that calls DXIL Op with return type, specified opcode, and call arguments.
static const char * getOpCodeName(dxil::OpCode DXILOp)
A raw_ostream that writes to an std::string.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
StringRef getTypeName()
We provide a function which tries to compute the (demangled) name of a type statically.
dxil::OpCodeClass OpCodeClass
unsigned OpCodeNameOffset
unsigned OpCodeClassNameOffset
unsigned ParameterTableOffset
llvm::Attribute::AttrKind FuncAttr