14#ifndef LLVM_LIB_TARGET_SPIRV_SPIRVDUPLICATESTRACKER_H
15#define LLVM_LIB_TARGET_SPIRV_SPIRVDUPLICATESTRACKER_H
38 FlagsTy() : IsFunc(0), IsGV(0) {}
46 bool getIsGV()
const {
return Flags.IsGV; }
92 unsigned Arrayed,
unsigned MS,
unsigned Sampled,
93 unsigned ImageFormat,
unsigned AQ = 0)
97 Attrs.Flags.Dim = Dim;
98 Attrs.Flags.Depth =
Depth;
99 Attrs.Flags.Arrayed = Arrayed;
101 Attrs.Flags.Sampled = Sampled;
102 Attrs.Flags.ImageFormat = ImageFormat;
105 ((Attrs.Val << 8) |
Kind);
196 return getHashValue(
LHS) == getHashValue(
RHS);
217 typename std::remove_const<
218 typename std::remove_pointer<KeyTy>::type>::type>() ||
220 typename std::remove_const<
221 typename std::remove_pointer<KeyTy>::type>::type>())
222 Storage[V].setIsFunc(
true);
224 typename std::remove_const<
225 typename std::remove_pointer<KeyTy>::type>::type>())
226 Storage[V].setIsGV(
true);
230 auto iter = Storage.
find(V);
231 if (iter != Storage.
end()) {
232 auto Map = iter->second;
233 auto iter2 = Map.find(MF);
234 if (iter2 != Map.end())
235 return iter2->second;
275 template <
typename T>
315 return TT.find(
const_cast<Type *
>(Ty), MF);
342 return ST.find(TD, MF);
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file defines the DenseMap class.
This file declares the MachineIRBuilder class.
This file implements a map that provides insertion order iteration.
static bool isValid(const char C)
Returns true if C is a valid mangled character: <0-9a-zA-Z_>.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This class represents an incoming formal argument to a Function.
This is an important base class in LLVM.
Representation of each machine instruction.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
const MachineOperand & getOperand(unsigned i) const
This class contains meta information specific to a module.
This class implements a map that also provides access to all stored values in a deterministic order.
iterator find(const KeyT &Key)
Wrapper class representing virtual and physical registers.
void add(KeyTy V, const MachineFunction *MF, Register R)
Register find(KeyTy V, const MachineFunction *MF) const
MapVector< KeyTy, SPIRV::DTSortableEntry > StorageTy
const StorageTy & getAllUses() const
void add(const GlobalVariable *GV, const MachineFunction *MF, Register R)
Register find(const Function *F, const MachineFunction *MF)
void add(const SPIRV::SpecialTypeDescriptor &TD, const MachineFunction *MF, Register R)
void add(const Type *Ty, const MachineFunction *MF, Register R)
void add(const Function *F, const MachineFunction *MF, Register R)
Register find(const Type *Ty, const MachineFunction *MF)
void buildDepsGraph(std::vector< SPIRV::DTSortableEntry * > &Graph, MachineModuleInfo *MMI)
Register find(const Constant *C, const MachineFunction *MF)
void add(const Type *PointerElementType, unsigned AddressSpace, const MachineFunction *MF, Register R)
Register find(const Argument *Arg, const MachineFunction *MF)
void add(const Argument *Arg, const MachineFunction *MF, Register R)
Register find(const SPIRV::SpecialTypeDescriptor &TD, const MachineFunction *MF)
Register find(const Type *PointerElementType, unsigned AddressSpace, const MachineFunction *MF)
void add(const Constant *C, const MachineFunction *MF, Register R)
const SPIRVDuplicatesTracker< Type > * getTypes()
Register find(const GlobalVariable *GV, const MachineFunction *MF)
const SmallVector< DTSortableEntry *, 2 > & getDeps() const
void addDep(DTSortableEntry *E)
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
The instances of the Type class are immutable: once they are created, they are never changed.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
static SPIRV::SpecialTypeDescriptor getEmptyKey()
static SPIRV::SpecialTypeDescriptor getTombstoneKey()
static bool isEqual(SPIRV::SpecialTypeDescriptor LHS, SPIRV::SpecialTypeDescriptor RHS)
static unsigned getHashValue(SPIRV::SpecialTypeDescriptor Val)
An information struct used to provide DenseMap with the various necessary components for a given valu...
DeviceEventTypeDescriptor()
static bool classof(const SpecialTypeDescriptor *TD)
ImageTypeDescriptor(const Type *SampledTy, unsigned Dim, unsigned Depth, unsigned Arrayed, unsigned MS, unsigned Sampled, unsigned ImageFormat, unsigned AQ=0)
static bool classof(const SpecialTypeDescriptor *TD)
PipeTypeDescriptor(uint8_t AQ)
static bool classof(const SpecialTypeDescriptor *TD)
PointerTypeDescriptor()=delete
PointerTypeDescriptor(const Type *ElementType, unsigned AddressSpace)
static bool classof(const SpecialTypeDescriptor *TD)
static bool classof(const SpecialTypeDescriptor *TD)
SampledImageTypeDescriptor(const Type *SampledTy, const MachineInstr *ImageTy)
static bool classof(const SpecialTypeDescriptor *TD)
SpecialTypeDescriptor()=delete
SpecialTypeDescriptor(SpecialTypeKind K)
virtual ~SpecialTypeDescriptor()
struct llvm::SPIRV::ImageTypeDescriptor::ImageAttrs::BitFlags Flags