20 assert(HandleTy->getName().ends_with(
".CBuffer") &&
"Not a cbuffer type");
21 assert(HandleTy->getNumTypeParameters() == 1 &&
"Expected layout type");
24 assert(LayoutTy->getName().ends_with(
".Layout") &&
"Not a layout type");
27 size_t ParamIndex = Index + 1;
28 assert(LayoutTy->getNumIntParameters() > ParamIndex &&
29 "Not enough parameters");
31 return LayoutTy->getIntParameter(ParamIndex);
35 NamedMDNode *CBufMD = M.getNamedMetadata(
"hlsl.cbs");
39 std::optional<CBufferMetadata> Result({CBufMD});
42 assert(MD->getNumOperands() &&
"Invalid cbuffer metadata");
48 for (
int I = 1, E = MD->getNumOperands();
I < E; ++
I) {
63 MD->eraseFromParent();
68 int64_t
TypeSize =
DL.getTypeSizeInBits(Ty->getElementType()) / 8;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static size_t getMemberOffset(GlobalVariable *Handle, size_t Index)
Module.h This file contains the declarations for the Module class.
Class for arbitrary precision integers.
Class to represent array types.
A parsed version of the target data layout string in and methods for querying it.
Type * getValueType() const
A Module instance is used to store all the information related to an LLVM module.
iterator_range< op_iterator > operands()
const unsigned CBufferRowSizeInBytes
APInt translateCBufArrayOffset(const DataLayout &DL, APInt Offset, ArrayType *Ty)
This is an optimization pass for GlobalISel generic memory operations.
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
This struct is a compact representation of a valid (non-zero power of two) alignment.
SmallVector< CBufferMember > Members