9#ifndef LLVM_ANALYSIS_DXILRESOURCE_H
10#define LLVM_ANALYSIS_DXILRESOURCE_H
21 struct ResourceBinding {
28 return std::tie(UniqueID, Space, LowerBound, Size) ==
29 std::tie(
RHS.UniqueID,
RHS.Space,
RHS.LowerBound,
RHS.Size);
32 return !(*
this ==
RHS);
37 bool GloballyCoherent;
42 return std::tie(GloballyCoherent, HasCounter, IsROV) ==
43 std::tie(
RHS.GloballyCoherent,
RHS.HasCounter,
RHS.IsROV);
57 return std::tie(Stride, AlignLog2) == std::tie(
RHS.Stride,
RHS.AlignLog2);
68 std::tie(
RHS.ElementTy,
RHS.ElementCount);
94 ResourceBinding Binding = {};
116 : Symbol(Symbol), Name(Name), RC(RC), Kind(Kind) {}
129 Binding.UniqueID = UniqueID;
130 Binding.Space = Space;
131 Binding.LowerBound = LowerBound;
134 void setUAV(
bool GloballyCoherent,
bool HasCounter,
bool IsROV) {
136 UAVFlags.GloballyCoherent = GloballyCoherent;
148 Struct.AlignLog2 = Alignment ?
Log2(*Alignment) : 0;
152 Typed.ElementTy = ElementTy;
161 MultiSample.Count = Count;
182 bool GloballyCoherent,
bool IsROV,
185 bool GloballyCoherent,
bool IsROV);
188 bool GloballyCoherent,
bool IsROV,
193 bool GloballyCoherent);
198 bool GloballyCoherent);
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This is an important class for using LLVM in a threaded context.
StringRef - Represent a constant reference to a string, i.e.
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
void bind(uint32_t UniqueID, uint32_t Space, uint32_t LowerBound, uint32_t Size)
ResourceInfo(dxil::ResourceClass RC, dxil::ResourceKind Kind, Value *Symbol, StringRef Name)
void setUAV(bool GloballyCoherent, bool HasCounter, bool IsROV)
static ResourceInfo RWTexture2DMS(Value *Symbol, StringRef Name, dxil::ElementType ElementTy, uint32_t ElementCount, uint32_t SampleCount, bool GloballyCoherent)
std::pair< uint32_t, uint32_t > getAnnotateProps() const
bool isMultiSample() const
void setCBuffer(uint32_t Size)
static ResourceInfo RWRawBuffer(Value *Symbol, StringRef Name, bool GloballyCoherent, bool IsROV)
dxil::SamplerType SamplerTy
void setTyped(dxil::ElementType ElementTy, uint32_t ElementCount)
void setMultiSample(uint32_t Count)
void setSampler(dxil::SamplerType Ty)
void setStruct(uint32_t Stride, MaybeAlign Alignment)
static ResourceInfo RWTexture2DMSArray(Value *Symbol, StringRef Name, dxil::ElementType ElementTy, uint32_t ElementCount, uint32_t SampleCount, bool GloballyCoherent)
MDTuple * getAsMetadata(LLVMContext &Ctx) const
void setFeedback(dxil::SamplerFeedbackType Type)
static ResourceInfo RWStructuredBuffer(Value *Symbol, StringRef Name, uint32_t Stride, MaybeAlign Alignment, bool GloballyCoherent, bool IsROV, bool HasCounter)
ResourceBinding getBinding() const
ResourceKind
The kind of resource for an SRV or UAV resource.
ElementType
The element type of an SRV or UAV resource.
This is an optimization pass for GlobalISel generic memory operations.
bool operator!=(uint64_t V1, const APInt &V2)
bool operator==(const AddressRangeValuePair &LHS, const AddressRangeValuePair &RHS)
unsigned Log2(Align A)
Returns the log2 of the alignment.
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.