LLVM  16.0.0git
SPIRVGlobalRegistry.h
Go to the documentation of this file.
1 //===-- SPIRVGlobalRegistry.h - SPIR-V Global Registry ----------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // SPIRVGlobalRegistry is used to maintain rich type information required for
10 // SPIR-V even after lowering from LLVM IR to GMIR. It can convert an llvm::Type
11 // into an OpTypeXXX instruction, and map it to a virtual register. Also it
12 // builds and supports consistency of constants and global variables.
13 //
14 //===----------------------------------------------------------------------===//
15 
16 #ifndef LLVM_LIB_TARGET_SPIRV_SPIRVTYPEMANAGER_H
17 #define LLVM_LIB_TARGET_SPIRV_SPIRVTYPEMANAGER_H
18 
20 #include "SPIRVDuplicatesTracker.h"
21 #include "SPIRVInstrInfo.h"
23 
24 namespace llvm {
25 using SPIRVType = const MachineInstr;
26 
28  // Registers holding values which have types associated with them.
29  // Initialized upon VReg definition in IRTranslator.
30  // Do not confuse this with DuplicatesTracker as DT maps Type* to <MF, Reg>
31  // where Reg = OpType...
32  // while VRegToTypeMap tracks SPIR-V type assigned to other regs (i.e. not
33  // type-declaring ones).
35  VRegToTypeMap;
36 
38 
40 
41  // Look for an equivalent of the newType in the map. Return the equivalent
42  // if it's found, otherwise insert newType to the map and return the type.
43  const MachineInstr *checkSpecialInstr(const SPIRV::SpecialTypeDescriptor &TD,
44  MachineIRBuilder &MIRBuilder);
45 
46  SmallPtrSet<const Type *, 4> TypesInProcessing;
47  DenseMap<const Type *, SPIRVType *> ForwardPointerTypes;
48 
49  // Number of bits pointers and size_t integers require.
50  const unsigned PointerSize;
51 
52  // Add a new OpTypeXXX instruction without checking for duplicates.
53  SPIRVType *createSPIRVType(const Type *Type, MachineIRBuilder &MIRBuilder,
55  SPIRV::AccessQualifier::ReadWrite,
56  bool EmitIR = true);
57  SPIRVType *findSPIRVType(const Type *Ty, MachineIRBuilder &MIRBuilder,
59  SPIRV::AccessQualifier::ReadWrite,
60  bool EmitIR = true);
61  SPIRVType *
62  restOfCreateSPIRVType(const Type *Type, MachineIRBuilder &MIRBuilder,
64  bool EmitIR);
65 
66 public:
67  SPIRVGlobalRegistry(unsigned PointerSize);
68 
70 
71  void add(const Constant *C, MachineFunction *MF, Register R) {
72  DT.add(C, MF, R);
73  }
74 
75  void add(const GlobalVariable *GV, MachineFunction *MF, Register R) {
76  DT.add(GV, MF, R);
77  }
78 
79  void add(const Function *F, MachineFunction *MF, Register R) {
80  DT.add(F, MF, R);
81  }
82 
83  void add(const Argument *Arg, MachineFunction *MF, Register R) {
84  DT.add(Arg, MF, R);
85  }
86 
88  return DT.find(C, MF);
89  }
90 
92  return DT.find(GV, MF);
93  }
94 
96  return DT.find(F, MF);
97  }
98 
99  void buildDepsGraph(std::vector<SPIRV::DTSortableEntry *> &Graph,
100  MachineModuleInfo *MMI = nullptr) {
101  DT.buildDepsGraph(Graph, MMI);
102  }
103 
104  // Get or create a SPIR-V type corresponding the given LLVM IR type,
105  // and map it to the given VReg by creating an ASSIGN_TYPE instruction.
107  MachineIRBuilder &MIRBuilder,
109  SPIRV::AccessQualifier::ReadWrite,
110  bool EmitIR = true);
112  MachineInstr &I, const SPIRVInstrInfo &TII);
113  SPIRVType *assignVectTypeToVReg(SPIRVType *BaseType, unsigned NumElements,
114  Register VReg, MachineInstr &I,
115  const SPIRVInstrInfo &TII);
116 
117  // In cases where the SPIR-V type is already known, this function can be
118  // used to map it to the given VReg via an ASSIGN_TYPE instruction.
120  MachineFunction &MF);
121 
122  // Either generate a new OpTypeXXX instruction or return an existing one
123  // corresponding to the given LLVM IR type.
124  // EmitIR controls if we emit GMIR or SPV constants (e.g. for array sizes)
125  // because this method may be called from InstructionSelector and we don't
126  // want to emit extra IR instructions there.
128  MachineIRBuilder &MIRBuilder,
130  SPIRV::AccessQualifier::ReadWrite,
131  bool EmitIR = true);
132 
133  const Type *getTypeForSPIRVType(const SPIRVType *Ty) const {
134  auto Res = SPIRVToLLVMType.find(Ty);
135  assert(Res != SPIRVToLLVMType.end());
136  return Res->second;
137  }
138 
139  // Either generate a new OpTypeXXX instruction or return an existing one
140  // corresponding to the given string containing the name of the builtin type.
142  MachineIRBuilder &MIRBuilder);
143 
144  // Return the SPIR-V type instruction corresponding to the given VReg, or
145  // nullptr if no such type instruction exists.
147 
148  // Whether the given VReg has a SPIR-V type mapped to it yet.
149  bool hasSPIRVTypeForVReg(Register VReg) const {
150  return getSPIRVTypeForVReg(VReg) != nullptr;
151  }
152 
153  // Return the VReg holding the result of the given OpTypeXXX instruction.
154  Register getSPIRVTypeID(const SPIRVType *SpirvType) const;
155 
156  void setCurrentFunc(MachineFunction &MF) { CurMF = &MF; }
157 
158  // Whether the given VReg has an OpTypeXXX instruction mapped to it with the
159  // given opcode (e.g. OpTypeFloat).
160  bool isScalarOfType(Register VReg, unsigned TypeOpcode) const;
161 
162  // Return true if the given VReg's assigned SPIR-V type is either a scalar
163  // matching the given opcode, or a vector with an element type matching that
164  // opcode (e.g. OpTypeBool, or OpTypeVector %x 4, where %x is OpTypeBool).
165  bool isScalarOrVectorOfType(Register VReg, unsigned TypeOpcode) const;
166 
167  // For vectors or scalars of ints/floats, return the scalar type's bitwidth.
168  unsigned getScalarOrVectorBitWidth(const SPIRVType *Type) const;
169 
170  // For integer vectors or scalars, return whether the integers are signed.
171  bool isScalarOrVectorSigned(const SPIRVType *Type) const;
172 
173  // Gets the storage class of the pointer type assigned to this vreg.
175 
176  // Return the number of bits SPIR-V pointers and size_t variables require.
177  unsigned getPointerSize() const { return PointerSize; }
178 
179 private:
180  SPIRVType *getOpTypeBool(MachineIRBuilder &MIRBuilder);
181 
182  SPIRVType *getOpTypeInt(uint32_t Width, MachineIRBuilder &MIRBuilder,
183  bool IsSigned = false);
184 
185  SPIRVType *getOpTypeFloat(uint32_t Width, MachineIRBuilder &MIRBuilder);
186 
187  SPIRVType *getOpTypeVoid(MachineIRBuilder &MIRBuilder);
188 
189  SPIRVType *getOpTypeVector(uint32_t NumElems, SPIRVType *ElemType,
190  MachineIRBuilder &MIRBuilder);
191 
192  SPIRVType *getOpTypeArray(uint32_t NumElems, SPIRVType *ElemType,
193  MachineIRBuilder &MIRBuilder, bool EmitIR = true);
194 
195  SPIRVType *getOpTypeOpaque(const StructType *Ty,
196  MachineIRBuilder &MIRBuilder);
197 
198  SPIRVType *getOpTypeStruct(const StructType *Ty, MachineIRBuilder &MIRBuilder,
199  bool EmitIR = true);
200 
202  SPIRVType *ElemType, MachineIRBuilder &MIRBuilder,
203  Register Reg);
204 
205  SPIRVType *getOpTypeForwardPointer(SPIRV::StorageClass::StorageClass SC,
206  MachineIRBuilder &MIRBuilder);
207 
208  SPIRVType *getOpTypeFunction(SPIRVType *RetType,
209  const SmallVectorImpl<SPIRVType *> &ArgTypes,
210  MachineIRBuilder &MIRBuilder);
211 
212  SPIRVType *
213  getOrCreateSpecialType(const Type *Ty, MachineIRBuilder &MIRBuilder,
215 
216  std::tuple<Register, ConstantInt *, bool> getOrCreateConstIntReg(
217  uint64_t Val, SPIRVType *SpvType, MachineIRBuilder *MIRBuilder,
218  MachineInstr *I = nullptr, const SPIRVInstrInfo *TII = nullptr);
219  SPIRVType *finishCreatingSPIRVType(const Type *LLVMTy, SPIRVType *SpirvType);
220  Register getOrCreateIntCompositeOrNull(uint64_t Val, MachineInstr &I,
221  SPIRVType *SpvType,
222  const SPIRVInstrInfo &TII,
223  Constant *CA, unsigned BitWidth,
224  unsigned ElemCnt);
225  Register getOrCreateIntCompositeOrNull(uint64_t Val,
226  MachineIRBuilder &MIRBuilder,
227  SPIRVType *SpvType, bool EmitIR,
228  Constant *CA, unsigned BitWidth,
229  unsigned ElemCnt);
230 
231 public:
233  SPIRVType *SpvType = nullptr, bool EmitIR = true);
235  SPIRVType *SpvType, const SPIRVInstrInfo &TII);
237  SPIRVType *SpvType = nullptr);
239  SPIRVType *SpvType,
240  const SPIRVInstrInfo &TII);
242  SPIRVType *SpvType,
243  const SPIRVInstrInfo &TII);
245  SPIRVType *SpvType, bool EmitIR = true);
247  SPIRVType *SpvType, bool EmitIR = true);
249  SPIRVType *SpvType);
250  Register buildConstantSampler(Register Res, unsigned AddrMode, unsigned Param,
251  unsigned FilerMode,
252  MachineIRBuilder &MIRBuilder,
253  SPIRVType *SpvType);
255  const SPIRVInstrInfo &TII);
257  StringRef Name, const GlobalValue *GV,
259  const MachineInstr *Init, bool IsConst,
260  bool HasLinkageTy,
261  SPIRV::LinkageType::LinkageType LinkageType,
262  MachineIRBuilder &MIRBuilder,
263  bool IsInstSelector);
264 
265  // Convenient helpers for getting types with check for duplicates.
267  MachineIRBuilder &MIRBuilder);
269  const SPIRVInstrInfo &TII);
272  const SPIRVInstrInfo &TII);
274  unsigned NumElements,
275  MachineIRBuilder &MIRBuilder);
277  unsigned NumElements, MachineInstr &I,
278  const SPIRVInstrInfo &TII);
280  unsigned NumElements, MachineInstr &I,
281  const SPIRVInstrInfo &TII);
282 
284  SPIRVType *BaseType, MachineIRBuilder &MIRBuilder,
285  SPIRV::StorageClass::StorageClass SClass = SPIRV::StorageClass::Function);
288  SPIRV::StorageClass::StorageClass SClass = SPIRV::StorageClass::Function);
289 
290  SPIRVType *
291  getOrCreateOpTypeImage(MachineIRBuilder &MIRBuilder, SPIRVType *SampledType,
292  SPIRV::Dim::Dim Dim, uint32_t Depth, uint32_t Arrayed,
293  uint32_t Multisampled, uint32_t Sampled,
294  SPIRV::ImageFormat::ImageFormat ImageFormat,
296 
298 
300  MachineIRBuilder &MIRBuilder);
301 
302  SPIRVType *
307  const Type *Ty, SPIRVType *RetType,
308  const SmallVectorImpl<SPIRVType *> &ArgTypes,
309  MachineIRBuilder &MIRBuilder);
311  MachineIRBuilder &MIRBuilder,
312  unsigned Opcode);
313 };
314 } // end namespace llvm
315 #endif // LLLVM_LIB_TARGET_SPIRV_SPIRVTYPEMANAGER_H
llvm::Argument
This class represents an incoming formal argument to a Function.
Definition: Argument.h:28
llvm::SPIRVGlobalRegistry::find
Register find(const GlobalVariable *GV, MachineFunction *MF)
Definition: SPIRVGlobalRegistry.h:91
llvm::SPIRVGlobalRegistry::getOrCreateOpTypeSampledImage
SPIRVType * getOrCreateOpTypeSampledImage(SPIRVType *ImageType, MachineIRBuilder &MIRBuilder)
Definition: SPIRVGlobalRegistry.cpp:880
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::SPIRVGlobalRegistry::isScalarOrVectorOfType
bool isScalarOrVectorOfType(Register VReg, unsigned TypeOpcode) const
Definition: SPIRVGlobalRegistry.cpp:774
llvm::SPIRVGlobalRegistry::isScalarOfType
bool isScalarOfType(Register VReg, unsigned TypeOpcode) const
Definition: SPIRVGlobalRegistry.cpp:767
llvm::SPIRVGlobalRegistry::SPIRVGlobalRegistry
SPIRVGlobalRegistry(unsigned PointerSize)
Definition: SPIRVGlobalRegistry.cpp:25
llvm::SPIRVGlobalRegistry::getOrCreateOpTypeFunctionWithArgs
SPIRVType * getOrCreateOpTypeFunctionWithArgs(const Type *Ty, SPIRVType *RetType, const SmallVectorImpl< SPIRVType * > &ArgTypes, MachineIRBuilder &MIRBuilder)
Definition: SPIRVGlobalRegistry.cpp:610
llvm::Function
Definition: Function.h:60
llvm::SPIRVGlobalRegistry::getOrCreateSPIRVPointerType
SPIRVType * getOrCreateSPIRVPointerType(SPIRVType *BaseType, MachineIRBuilder &MIRBuilder, SPIRV::StorageClass::StorageClass SClass=SPIRV::StorageClass::Function)
Definition: SPIRVGlobalRegistry.cpp:1045
llvm::SPIRVGlobalRegistry::assignVectTypeToVReg
SPIRVType * assignVectTypeToVReg(SPIRVType *BaseType, unsigned NumElements, Register VReg, MachineInstr &I, const SPIRVInstrInfo &TII)
Definition: SPIRVGlobalRegistry.cpp:37
llvm::SPIRVGlobalRegistry::getScalarOrVectorBitWidth
unsigned getScalarOrVectorBitWidth(const SPIRVType *Type) const
Definition: SPIRVGlobalRegistry.cpp:789
llvm::X86Disassembler::Reg
Reg
All possible values of the reg field in the ModR/M byte.
Definition: X86DisassemblerDecoder.h:462
llvm::GlobalVariable
Definition: GlobalVariable.h:39
llvm::SPIRVGeneralDuplicatesTracker::buildDepsGraph
void buildDepsGraph(std::vector< SPIRV::DTSortableEntry * > &Graph, MachineModuleInfo *MMI)
Definition: SPIRVDuplicatesTracker.cpp:33
llvm::SPIRVGeneralDuplicatesTracker::find
Register find(const Type *T, const MachineFunction *MF)
Definition: SPIRVDuplicatesTracker.h:290
llvm::Depth
@ Depth
Definition: SIMachineScheduler.h:36
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
llvm::SPIRVGlobalRegistry::assignSPIRVTypeToVReg
void assignSPIRVTypeToVReg(SPIRVType *Type, Register VReg, MachineFunction &MF)
Definition: SPIRVGlobalRegistry.cpp:56
llvm::SPIRVGlobalRegistry::getOrCreateOpTypeSampler
SPIRVType * getOrCreateOpTypeSampler(MachineIRBuilder &MIRBuilder)
Definition: SPIRVGlobalRegistry.cpp:848
llvm::SPIRVGlobalRegistry::setCurrentFunc
void setCurrentFunc(MachineFunction &MF)
Definition: SPIRVGlobalRegistry.h:156
llvm::SmallPtrSet
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
Definition: SmallPtrSet.h:450
llvm::SPIRVGlobalRegistry::assignTypeToVReg
SPIRVType * assignTypeToVReg(const Type *Type, Register VReg, MachineIRBuilder &MIRBuilder, SPIRV::AccessQualifier::AccessQualifier AQ=SPIRV::AccessQualifier::ReadWrite, bool EmitIR=true)
Definition: SPIRVGlobalRegistry.cpp:46
MachineIRBuilder.h
BaseType
llvm::SPIRVGlobalRegistry::CurMF
MachineFunction * CurMF
Definition: SPIRVGlobalRegistry.h:69
llvm::SPIRVGlobalRegistry::getSPIRVTypeForVReg
SPIRVType * getSPIRVTypeForVReg(Register VReg) const
Definition: SPIRVGlobalRegistry.cpp:734
F
#define F(x, y, z)
Definition: MD5.cpp:55
llvm::SPIRVGlobalRegistry::getTypeForSPIRVType
const Type * getTypeForSPIRVType(const SPIRVType *Ty) const
Definition: SPIRVGlobalRegistry.h:133
llvm::AMDGPU::HSAMD::AccessQualifier
AccessQualifier
Access qualifiers.
Definition: AMDGPUMetadata.h:58
Arg
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
Definition: AMDGPULibCalls.cpp:187
llvm::SPIRVGlobalRegistry::add
void add(const Argument *Arg, MachineFunction *MF, Register R)
Definition: SPIRVGlobalRegistry.h:83
llvm::SPIRVGlobalRegistry::getOrCreateOpTypeByOpcode
SPIRVType * getOrCreateOpTypeByOpcode(const Type *Ty, MachineIRBuilder &MIRBuilder, unsigned Opcode)
Definition: SPIRVGlobalRegistry.cpp:895
llvm::SPIRVGlobalRegistry::buildConstantFP
Register buildConstantFP(APFloat Val, MachineIRBuilder &MIRBuilder, SPIRVType *SpvType=nullptr)
Definition: SPIRVGlobalRegistry.cpp:223
llvm::PPCISD::SC
@ SC
CHAIN = SC CHAIN, Imm128 - System call.
Definition: PPCISelLowering.h:420
llvm::SPIRVGlobalRegistry::add
void add(const GlobalVariable *GV, MachineFunction *MF, Register R)
Definition: SPIRVGlobalRegistry.h:75
SPIRVBaseInfo.h
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
StorageClass
COFF::SymbolStorageClass StorageClass
Definition: COFFYAML.cpp:361
llvm::AMDGPU::HSAMD::Kernel::Arg::Key::AccQual
constexpr char AccQual[]
Key for Kernel::Arg::Metadata::mAccQual.
Definition: AMDGPUMetadata.h:191
TII
const HexagonInstrInfo * TII
Definition: HexagonCopyToCombine.cpp:125
llvm::SPIRVGlobalRegistry::getOrCreateSPIRVTypeByName
SPIRVType * getOrCreateSPIRVTypeByName(StringRef TypeStr, MachineIRBuilder &MIRBuilder)
Definition: SPIRVGlobalRegistry.cpp:916
llvm::MachineModuleInfo
This class contains meta information specific to a module.
Definition: MachineModuleInfo.h:74
llvm::SPIRVGlobalRegistry::getOrCreateConstNullPtr
Register getOrCreateConstNullPtr(MachineIRBuilder &MIRBuilder, SPIRVType *SpvType)
Definition: SPIRVGlobalRegistry.cpp:394
llvm::SPIRVGlobalRegistry::getOrCreateUndef
Register getOrCreateUndef(MachineInstr &I, SPIRVType *SpvType, const SPIRVInstrInfo &TII)
Definition: SPIRVGlobalRegistry.cpp:1071
llvm::SPIRVGlobalRegistry::getPointerSize
unsigned getPointerSize() const
Definition: SPIRVGlobalRegistry.h:177
llvm::SPIRVGlobalRegistry::getOrCreateSPIRVArrayType
SPIRVType * getOrCreateSPIRVArrayType(SPIRVType *BaseType, unsigned NumElements, MachineInstr &I, const SPIRVInstrInfo &TII)
Definition: SPIRVGlobalRegistry.cpp:1027
llvm::SPIRV::SpecialTypeDescriptor
Definition: SPIRVDuplicatesTracker.h:54
SPIRVInstrInfo.h
llvm::APFloat
Definition: APFloat.h:716
llvm::GlobalValue
Definition: GlobalValue.h:44
llvm::Constant
This is an important base class in LLVM.
Definition: Constant.h:41
llvm::MachineIRBuilder
Helper class to build MachineInstr.
Definition: MachineIRBuilder.h:221
llvm::SPIRVGlobalRegistry::add
void add(const Constant *C, MachineFunction *MF, Register R)
Definition: SPIRVGlobalRegistry.h:71
llvm::MachineInstr
Representation of each machine instruction.
Definition: MachineInstr.h:66
uint64_t
llvm::DenseMap
Definition: DenseMap.h:714
llvm::SPIRVGlobalRegistry::getOrCreateConstInt
Register getOrCreateConstInt(uint64_t Val, MachineInstr &I, SPIRVType *SpvType, const SPIRVInstrInfo &TII)
Definition: SPIRVGlobalRegistry.cpp:146
llvm::SPIRVGlobalRegistry::assignIntTypeToVReg
SPIRVType * assignIntTypeToVReg(unsigned BitWidth, Register VReg, MachineInstr &I, const SPIRVInstrInfo &TII)
Definition: SPIRVGlobalRegistry.cpp:28
I
#define I(x, y, z)
Definition: MD5.cpp:58
llvm::SPIRVGlobalRegistry::getOrCreateConsIntVector
Register getOrCreateConsIntVector(uint64_t Val, MachineInstr &I, SPIRVType *SpvType, const SPIRVInstrInfo &TII)
Definition: SPIRVGlobalRegistry.cpp:290
llvm::SPIRVGlobalRegistry::add
void add(const Function *F, MachineFunction *MF, Register R)
Definition: SPIRVGlobalRegistry.h:79
llvm::DenseMapBase< DenseMap< KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >, KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >::find
iterator find(const_arg_type_t< KeyT > Val)
Definition: DenseMap.h:150
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::SPIRVGlobalRegistry::buildDepsGraph
void buildDepsGraph(std::vector< SPIRV::DTSortableEntry * > &Graph, MachineModuleInfo *MMI=nullptr)
Definition: SPIRVGlobalRegistry.h:99
llvm::SPIRVGlobalRegistry
Definition: SPIRVGlobalRegistry.h:27
SPIRVDuplicatesTracker.h
llvm::MachineFunction
Definition: MachineFunction.h:257
llvm::SPIRVInstrInfo
Definition: SPIRVInstrInfo.h:24
llvm::StructType
Class to represent struct types.
Definition: DerivedTypes.h:213
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
llvm::SPIRVGeneralDuplicatesTracker
Definition: SPIRVDuplicatesTracker.h:241
uint32_t
AddrMode
AddrMode
Definition: MSP430Disassembler.cpp:142
llvm::SPIRVGlobalRegistry::getOrCreateSPIRVBoolType
SPIRVType * getOrCreateSPIRVBoolType(MachineIRBuilder &MIRBuilder)
Definition: SPIRVGlobalRegistry.cpp:984
llvm::SPIRVGlobalRegistry::getSPIRVTypeID
Register getSPIRVTypeID(const SPIRVType *SpirvType) const
Definition: SPIRVGlobalRegistry.cpp:632
llvm::Init
Definition: Record.h:282
llvm::Register
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
llvm::DenseMapBase< DenseMap< KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >, KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >::end
iterator end()
Definition: DenseMap.h:84
llvm::SPIRVGlobalRegistry::getOrCreateSPIRVIntegerType
SPIRVType * getOrCreateSPIRVIntegerType(unsigned BitWidth, MachineIRBuilder &MIRBuilder)
Definition: SPIRVGlobalRegistry.cpp:953
llvm::SPIRVGlobalRegistry::getOrCreateOpTypeDeviceEvent
SPIRVType * getOrCreateOpTypeDeviceEvent(MachineIRBuilder &MIRBuilder)
Definition: SPIRVGlobalRegistry.cpp:870
llvm::SPIRVGlobalRegistry::getOrCreateOpTypePipe
SPIRVType * getOrCreateOpTypePipe(MachineIRBuilder &MIRBuilder, SPIRV::AccessQualifier::AccessQualifier AccQual)
Definition: SPIRVGlobalRegistry.cpp:857
llvm::BitWidth
constexpr unsigned BitWidth
Definition: BitmaskEnum.h:147
llvm::SPIRVGlobalRegistry::find
Register find(const Constant *C, MachineFunction *MF)
Definition: SPIRVGlobalRegistry.h:87
llvm::AMDGPU::Hwreg::Width
Width
Definition: SIDefines.h:436
llvm::SPIRVGlobalRegistry::buildConstantInt
Register buildConstantInt(uint64_t Val, MachineIRBuilder &MIRBuilder, SPIRVType *SpvType=nullptr, bool EmitIR=true)
Definition: SPIRVGlobalRegistry.cpp:177
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:42
llvm::SPIRVGlobalRegistry::getOrCreateConsIntArray
Register getOrCreateConsIntArray(uint64_t Val, MachineInstr &I, SPIRVType *SpvType, const SPIRVInstrInfo &TII)
Definition: SPIRVGlobalRegistry.cpp:306
llvm::SPIRVGlobalRegistry::hasSPIRVTypeForVReg
bool hasSPIRVTypeForVReg(Register VReg) const
Definition: SPIRVGlobalRegistry.h:149
llvm::SPIRVGlobalRegistry::getPointerStorageClass
SPIRV::StorageClass::StorageClass getPointerStorageClass(Register VReg) const
Definition: SPIRVGlobalRegistry.cpp:815
llvm::SPIRVGeneralDuplicatesTracker::add
void add(const Type *T, const MachineFunction *MF, Register R)
Definition: SPIRVDuplicatesTracker.h:265
llvm::SPIRVGlobalRegistry::isScalarOrVectorSigned
bool isScalarOrVectorSigned(const SPIRVType *Type) const
Definition: SPIRVGlobalRegistry.cpp:803
llvm::SPIRVGlobalRegistry::getOrCreateSPIRVVectorType
SPIRVType * getOrCreateSPIRVVectorType(SPIRVType *BaseType, unsigned NumElements, MachineIRBuilder &MIRBuilder)
Definition: SPIRVGlobalRegistry.cpp:1003
llvm::SPIRVGlobalRegistry::find
Register find(const Function *F, MachineFunction *MF)
Definition: SPIRVGlobalRegistry.h:95
llvm::SPIRVGlobalRegistry::buildConstantSampler
Register buildConstantSampler(Register Res, unsigned AddrMode, unsigned Param, unsigned FilerMode, MachineIRBuilder &MIRBuilder, SPIRVType *SpvType)
Definition: SPIRVGlobalRegistry.cpp:413
llvm::SPIRVGlobalRegistry::buildGlobalVariable
Register buildGlobalVariable(Register Reg, SPIRVType *BaseType, StringRef Name, const GlobalValue *GV, SPIRV::StorageClass::StorageClass Storage, const MachineInstr *Init, bool IsConst, bool HasLinkageTy, SPIRV::LinkageType::LinkageType LinkageType, MachineIRBuilder &MIRBuilder, bool IsInstSelector)
Definition: SPIRVGlobalRegistry.cpp:436
llvm::SPIRVGlobalRegistry::getOrCreateOpTypeImage
SPIRVType * getOrCreateOpTypeImage(MachineIRBuilder &MIRBuilder, SPIRVType *SampledType, SPIRV::Dim::Dim Dim, uint32_t Depth, uint32_t Arrayed, uint32_t Multisampled, uint32_t Sampled, SPIRV::ImageFormat::ImageFormat ImageFormat, SPIRV::AccessQualifier::AccessQualifier AccQual)
Definition: SPIRVGlobalRegistry.cpp:823
llvm::SPIRVGlobalRegistry::getOrCreateSPIRVType
SPIRVType * getOrCreateSPIRVType(const Type *Type, MachineIRBuilder &MIRBuilder, SPIRV::AccessQualifier::AccessQualifier AQ=SPIRV::AccessQualifier::ReadWrite, bool EmitIR=true)
Definition: SPIRVGlobalRegistry.cpp:744