9#ifndef LLVM_ANALYSIS_DXILRESOURCE_H
10#define LLVM_ANALYSIS_DXILRESOURCE_H
28 struct ResourceBinding {
35 return std::tie(RecordID, Space, LowerBound, Size) ==
36 std::tie(
RHS.RecordID,
RHS.Space,
RHS.LowerBound,
RHS.Size);
39 return !(*
this ==
RHS);
44 bool GloballyCoherent;
49 return std::tie(GloballyCoherent, HasCounter, IsROV) ==
50 std::tie(
RHS.GloballyCoherent,
RHS.HasCounter,
RHS.IsROV);
64 return std::tie(Stride, AlignLog2) == std::tie(
RHS.Stride,
RHS.AlignLog2);
75 std::tie(
RHS.ElementTy,
RHS.ElementCount);
101 ResourceBinding Binding = {};
123 : Symbol(Symbol), Name(Name), RC(RC), Kind(Kind) {}
136 Binding.RecordID = RecordID;
137 Binding.Space = Space;
138 Binding.LowerBound = LowerBound;
141 void setUAV(
bool GloballyCoherent,
bool HasCounter,
bool IsROV) {
143 UAVFlags.GloballyCoherent = GloballyCoherent;
155 Struct.AlignLog2 = Alignment ?
Log2(*Alignment) : 0;
159 Typed.ElementTy = ElementTy;
168 MultiSample.Count = Count;
189 bool GloballyCoherent,
bool IsROV,
192 bool GloballyCoherent,
bool IsROV);
195 bool GloballyCoherent,
bool IsROV,
200 bool GloballyCoherent);
205 bool GloballyCoherent);
254 std::unique_ptr<DXILResourceMap> ResourceMap;
This file implements a map that provides insertion order iteration.
This header defines various interfaces for pass management in LLVM.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
A container for analyses that lazily runs them and caches their results.
Represent the analysis usage information of a pass.
DXILResourceMap run(Module &M, ModuleAnalysisManager &AM)
Gather resource info for the module M.
Printer pass for the DXILResourceAnalysis results.
DXILResourcePrinterPass(raw_ostream &OS)
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
DXILResourceMap & getResourceMap()
DXILResourceWrapperPass()
bool runOnModule(Module &M) override
runOnModule - Virtual method overriden by subclasses to process the module being operated on.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
~DXILResourceWrapperPass() override
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
const DXILResourceMap & getResourceMap() const
void print(raw_ostream &OS, const Module *M) const override
print - Print out the internal state of the pass.
This is an important class for using LLVM in a threaded context.
This class implements a map that also provides access to all stored values in a deterministic order.
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
A Module instance is used to store all the information related to an LLVM module.
A set of analyses that are preserved following a run of a transformation pass.
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.
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)
void print(raw_ostream &OS) const
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)
void bind(uint32_t RecordID, uint32_t Space, uint32_t LowerBound, uint32_t Size)
static ResourceInfo RWStructuredBuffer(Value *Symbol, StringRef Name, uint32_t Stride, MaybeAlign Alignment, bool GloballyCoherent, bool IsROV, bool HasCounter)
ResourceBinding getBinding() const
This class implements an extremely fast bulk output stream that can only output to a stream.
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)
ModulePass * createDXILResourceWrapperPassPass()
unsigned Log2(Align A)
Returns the log2 of the alignment.
MapVector< CallInst *, dxil::ResourceInfo > DXILResourceMap
A CRTP mix-in that provides informational APIs needed for analysis passes.
A special type used by analysis passes to provide an address that identifies that particular analysis...
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.
A CRTP mix-in to automatically provide informational APIs needed for passes.