14#ifndef LLVM_LIB_TARGET_SPIRV_SPIRVDUPLICATESTRACKER_H
15#define LLVM_LIB_TARGET_SPIRV_SPIRVDUPLICATESTRACKER_H
38 FlagsTy() : IsFunc(0), IsGV(0) {}
91 unsigned Arrayed,
unsigned MS,
unsigned Sampled,
92 unsigned ImageFormat,
unsigned AQ = 0)
96 Attrs.Flags.Dim = Dim;
97 Attrs.Flags.Depth =
Depth;
98 Attrs.Flags.Arrayed = Arrayed;
100 Attrs.Flags.Sampled = Sampled;
101 Attrs.Flags.ImageFormat = ImageFormat;
104 ((Attrs.Val << 8) |
Kind);
178 return getHashValue(
LHS) == getHashValue(
RHS);
199 typename std::remove_const<
200 typename std::remove_pointer<KeyTy>::type>::type>() ||
202 typename std::remove_const<
203 typename std::remove_pointer<KeyTy>::type>::type>())
204 Storage[V].setIsFunc(
true);
206 typename std::remove_const<
207 typename std::remove_pointer<KeyTy>::type>::type>())
208 Storage[V].setIsGV(
true);
212 auto iter = Storage.
find(V);
213 if (iter != Storage.
end()) {
214 auto Map = iter->second;
215 auto iter2 = Map.find(MF);
216 if (iter2 != Map.end())
217 return iter2->second;
257 template <
typename T>
291 return TT.find(
const_cast<Type *
>(
T), MF);
312 return ST.find(TD, MF);
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
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 Function *F, const MachineFunction *MF, Register R)
void buildDepsGraph(std::vector< SPIRV::DTSortableEntry * > &Graph, MachineModuleInfo *MMI)
Register find(const Constant *C, const MachineFunction *MF)
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)
void add(const Constant *C, const MachineFunction *MF, Register R)
const SPIRVDuplicatesTracker< Type > * getTypes()
void add(const Type *T, const MachineFunction *MF, Register R)
Register find(const GlobalVariable *GV, const MachineFunction *MF)
Register find(const Type *T, 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)
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