LLVM  16.0.0git
Public Member Functions | Public Attributes | List of all members
llvm::SPIRVGlobalRegistry Class Reference

#include "Target/SPIRV/SPIRVGlobalRegistry.h"

Collaboration diagram for llvm::SPIRVGlobalRegistry:
Collaboration graph
[legend]

Public Member Functions

 SPIRVGlobalRegistry (unsigned PointerSize)
 
void add (const Constant *C, MachineFunction *MF, Register R)
 
void add (const GlobalVariable *GV, MachineFunction *MF, Register R)
 
void add (const Function *F, MachineFunction *MF, Register R)
 
void add (const Argument *Arg, MachineFunction *MF, Register R)
 
Register find (const Constant *C, MachineFunction *MF)
 
Register find (const GlobalVariable *GV, MachineFunction *MF)
 
Register find (const Function *F, MachineFunction *MF)
 
void buildDepsGraph (std::vector< SPIRV::DTSortableEntry * > &Graph, MachineModuleInfo *MMI=nullptr)
 
SPIRVTypeassignTypeToVReg (const Type *Type, Register VReg, MachineIRBuilder &MIRBuilder, SPIRV::AccessQualifier::AccessQualifier AQ=SPIRV::AccessQualifier::ReadWrite, bool EmitIR=true)
 
SPIRVTypeassignIntTypeToVReg (unsigned BitWidth, Register VReg, MachineInstr &I, const SPIRVInstrInfo &TII)
 
SPIRVTypeassignVectTypeToVReg (SPIRVType *BaseType, unsigned NumElements, Register VReg, MachineInstr &I, const SPIRVInstrInfo &TII)
 
void assignSPIRVTypeToVReg (SPIRVType *Type, Register VReg, MachineFunction &MF)
 
SPIRVTypegetOrCreateSPIRVType (const Type *Type, MachineIRBuilder &MIRBuilder, SPIRV::AccessQualifier::AccessQualifier AQ=SPIRV::AccessQualifier::ReadWrite, bool EmitIR=true)
 
const TypegetTypeForSPIRVType (const SPIRVType *Ty) const
 
SPIRVTypegetSPIRVTypeForVReg (Register VReg) const
 
bool hasSPIRVTypeForVReg (Register VReg) const
 
Register getSPIRVTypeID (const SPIRVType *SpirvType) const
 
void setCurrentFunc (MachineFunction &MF)
 
bool isScalarOfType (Register VReg, unsigned TypeOpcode) const
 
bool isScalarOrVectorOfType (Register VReg, unsigned TypeOpcode) const
 
unsigned getScalarOrVectorBitWidth (const SPIRVType *Type) const
 
bool isScalarOrVectorSigned (const SPIRVType *Type) const
 
SPIRV::StorageClass::StorageClass getPointerStorageClass (Register VReg) const
 
unsigned getPointerSize () const
 
Register buildConstantInt (uint64_t Val, MachineIRBuilder &MIRBuilder, SPIRVType *SpvType=nullptr, bool EmitIR=true)
 
Register getOrCreateConstInt (uint64_t Val, MachineInstr &I, SPIRVType *SpvType, const SPIRVInstrInfo &TII)
 
Register buildConstantFP (APFloat Val, MachineIRBuilder &MIRBuilder, SPIRVType *SpvType=nullptr)
 
Register getOrCreateConsIntVector (uint64_t Val, MachineInstr &I, SPIRVType *SpvType, const SPIRVInstrInfo &TII)
 
Register getOrCreateUndef (MachineInstr &I, SPIRVType *SpvType, const SPIRVInstrInfo &TII)
 
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)
 
SPIRVTypegetOrCreateSPIRVIntegerType (unsigned BitWidth, MachineIRBuilder &MIRBuilder)
 
SPIRVTypegetOrCreateSPIRVIntegerType (unsigned BitWidth, MachineInstr &I, const SPIRVInstrInfo &TII)
 
SPIRVTypegetOrCreateSPIRVBoolType (MachineIRBuilder &MIRBuilder)
 
SPIRVTypegetOrCreateSPIRVBoolType (MachineInstr &I, const SPIRVInstrInfo &TII)
 
SPIRVTypegetOrCreateSPIRVVectorType (SPIRVType *BaseType, unsigned NumElements, MachineIRBuilder &MIRBuilder)
 
SPIRVTypegetOrCreateSPIRVVectorType (SPIRVType *BaseType, unsigned NumElements, MachineInstr &I, const SPIRVInstrInfo &TII)
 
SPIRVTypegetOrCreateSPIRVPointerType (SPIRVType *BaseType, MachineIRBuilder &MIRBuilder, SPIRV::StorageClass::StorageClass SClass=SPIRV::StorageClass::Function)
 
SPIRVTypegetOrCreateSPIRVPointerType (SPIRVType *BaseType, MachineInstr &I, const SPIRVInstrInfo &TII, SPIRV::StorageClass::StorageClass SClass=SPIRV::StorageClass::Function)
 
SPIRVTypegetOrCreateOpTypeFunctionWithArgs (const Type *Ty, SPIRVType *RetType, const SmallVectorImpl< SPIRVType * > &ArgTypes, MachineIRBuilder &MIRBuilder)
 

Public Attributes

MachineFunctionCurMF
 

Detailed Description

Definition at line 27 of file SPIRVGlobalRegistry.h.

Constructor & Destructor Documentation

◆ SPIRVGlobalRegistry()

SPIRVGlobalRegistry::SPIRVGlobalRegistry ( unsigned  PointerSize)

Definition at line 24 of file SPIRVGlobalRegistry.cpp.

Member Function Documentation

◆ add() [1/4]

void llvm::SPIRVGlobalRegistry::add ( const Argument Arg,
MachineFunction MF,
Register  R 
)
inline

Definition at line 78 of file SPIRVGlobalRegistry.h.

References llvm::SPIRVGeneralDuplicatesTracker::add(), and Arg.

◆ add() [2/4]

void llvm::SPIRVGlobalRegistry::add ( const Constant C,
MachineFunction MF,
Register  R 
)
inline

Definition at line 66 of file SPIRVGlobalRegistry.h.

References llvm::SPIRVGeneralDuplicatesTracker::add().

Referenced by addConstantsToTrack().

◆ add() [3/4]

void llvm::SPIRVGlobalRegistry::add ( const Function F,
MachineFunction MF,
Register  R 
)
inline

Definition at line 74 of file SPIRVGlobalRegistry.h.

References llvm::SPIRVGeneralDuplicatesTracker::add(), and F.

◆ add() [4/4]

void llvm::SPIRVGlobalRegistry::add ( const GlobalVariable GV,
MachineFunction MF,
Register  R 
)
inline

Definition at line 70 of file SPIRVGlobalRegistry.h.

References llvm::SPIRVGeneralDuplicatesTracker::add().

◆ assignIntTypeToVReg()

SPIRVType * SPIRVGlobalRegistry::assignIntTypeToVReg ( unsigned  BitWidth,
Register  VReg,
MachineInstr I,
const SPIRVInstrInfo TII 
)

◆ assignSPIRVTypeToVReg()

void SPIRVGlobalRegistry::assignSPIRVTypeToVReg ( SPIRVType Type,
Register  VReg,
MachineFunction MF 
)

◆ assignTypeToVReg()

SPIRVType * SPIRVGlobalRegistry::assignTypeToVReg ( const Type Type,
Register  VReg,
MachineIRBuilder MIRBuilder,
SPIRV::AccessQualifier::AccessQualifier  AQ = SPIRV::AccessQualifier::ReadWrite,
bool  EmitIR = true 
)

◆ assignVectTypeToVReg()

SPIRVType * SPIRVGlobalRegistry::assignVectTypeToVReg ( SPIRVType BaseType,
unsigned  NumElements,
Register  VReg,
MachineInstr I,
const SPIRVInstrInfo TII 
)

◆ buildConstantFP()

Register SPIRVGlobalRegistry::buildConstantFP ( APFloat  Val,
MachineIRBuilder MIRBuilder,
SPIRVType SpvType = nullptr 
)

◆ buildConstantInt()

Register SPIRVGlobalRegistry::buildConstantInt ( uint64_t  Val,
MachineIRBuilder MIRBuilder,
SPIRVType SpvType = nullptr,
bool  EmitIR = true 
)

◆ buildDepsGraph()

void llvm::SPIRVGlobalRegistry::buildDepsGraph ( std::vector< SPIRV::DTSortableEntry * > &  Graph,
MachineModuleInfo MMI = nullptr 
)
inline

◆ buildGlobalVariable()

Register SPIRVGlobalRegistry::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 
)

◆ find() [1/3]

Register llvm::SPIRVGlobalRegistry::find ( const Constant C,
MachineFunction MF 
)
inline

◆ find() [2/3]

Register llvm::SPIRVGlobalRegistry::find ( const Function F,
MachineFunction MF 
)
inline

Definition at line 90 of file SPIRVGlobalRegistry.h.

References F, and llvm::SPIRVGeneralDuplicatesTracker::find().

◆ find() [3/3]

Register llvm::SPIRVGlobalRegistry::find ( const GlobalVariable GV,
MachineFunction MF 
)
inline

Definition at line 86 of file SPIRVGlobalRegistry.h.

References llvm::SPIRVGeneralDuplicatesTracker::find().

◆ getOrCreateConsIntVector()

Register SPIRVGlobalRegistry::getOrCreateConsIntVector ( uint64_t  Val,
MachineInstr I,
SPIRVType SpvType,
const SPIRVInstrInfo TII 
)

◆ getOrCreateConstInt()

Register SPIRVGlobalRegistry::getOrCreateConstInt ( uint64_t  Val,
MachineInstr I,
SPIRVType SpvType,
const SPIRVInstrInfo TII 
)

◆ getOrCreateOpTypeFunctionWithArgs()

SPIRVType * SPIRVGlobalRegistry::getOrCreateOpTypeFunctionWithArgs ( const Type Ty,
SPIRVType RetType,
const SmallVectorImpl< SPIRVType * > &  ArgTypes,
MachineIRBuilder MIRBuilder 
)

◆ getOrCreateSPIRVBoolType() [1/2]

SPIRVType * SPIRVGlobalRegistry::getOrCreateSPIRVBoolType ( MachineInstr I,
const SPIRVInstrInfo TII 
)

◆ getOrCreateSPIRVBoolType() [2/2]

SPIRVType * SPIRVGlobalRegistry::getOrCreateSPIRVBoolType ( MachineIRBuilder MIRBuilder)

◆ getOrCreateSPIRVIntegerType() [1/2]

SPIRVType * SPIRVGlobalRegistry::getOrCreateSPIRVIntegerType ( unsigned  BitWidth,
MachineInstr I,
const SPIRVInstrInfo TII 
)

◆ getOrCreateSPIRVIntegerType() [2/2]

SPIRVType * SPIRVGlobalRegistry::getOrCreateSPIRVIntegerType ( unsigned  BitWidth,
MachineIRBuilder MIRBuilder 
)

◆ getOrCreateSPIRVPointerType() [1/2]

SPIRVType * SPIRVGlobalRegistry::getOrCreateSPIRVPointerType ( SPIRVType BaseType,
MachineInstr I,
const SPIRVInstrInfo TII,
SPIRV::StorageClass::StorageClass  SClass = SPIRV::StorageClass::Function 
)

◆ getOrCreateSPIRVPointerType() [2/2]

SPIRVType * SPIRVGlobalRegistry::getOrCreateSPIRVPointerType ( SPIRVType BaseType,
MachineIRBuilder MIRBuilder,
SPIRV::StorageClass::StorageClass  SClass = SPIRV::StorageClass::Function 
)

◆ getOrCreateSPIRVType()

SPIRVType * SPIRVGlobalRegistry::getOrCreateSPIRVType ( const Type Type,
MachineIRBuilder MIRBuilder,
SPIRV::AccessQualifier::AccessQualifier  AQ = SPIRV::AccessQualifier::ReadWrite,
bool  EmitIR = true 
)

◆ getOrCreateSPIRVVectorType() [1/2]

SPIRVType * SPIRVGlobalRegistry::getOrCreateSPIRVVectorType ( SPIRVType BaseType,
unsigned  NumElements,
MachineInstr I,
const SPIRVInstrInfo TII 
)

◆ getOrCreateSPIRVVectorType() [2/2]

SPIRVType * SPIRVGlobalRegistry::getOrCreateSPIRVVectorType ( SPIRVType BaseType,
unsigned  NumElements,
MachineIRBuilder MIRBuilder 
)

◆ getOrCreateUndef()

Register SPIRVGlobalRegistry::getOrCreateUndef ( MachineInstr I,
SPIRVType SpvType,
const SPIRVInstrInfo TII 
)

◆ getPointerSize()

unsigned llvm::SPIRVGlobalRegistry::getPointerSize ( ) const
inline

Definition at line 167 of file SPIRVGlobalRegistry.h.

◆ getPointerStorageClass()

SPIRV::StorageClass::StorageClass SPIRVGlobalRegistry::getPointerStorageClass ( Register  VReg) const

Definition at line 675 of file SPIRVGlobalRegistry.cpp.

References assert(), getSPIRVTypeForVReg(), and StorageClass.

◆ getScalarOrVectorBitWidth()

unsigned SPIRVGlobalRegistry::getScalarOrVectorBitWidth ( const SPIRVType Type) const

◆ getSPIRVTypeForVReg()

SPIRVType * SPIRVGlobalRegistry::getSPIRVTypeForVReg ( Register  VReg) const

◆ getSPIRVTypeID()

Register SPIRVGlobalRegistry::getSPIRVTypeID ( const SPIRVType SpirvType) const

◆ getTypeForSPIRVType()

const Type* llvm::SPIRVGlobalRegistry::getTypeForSPIRVType ( const SPIRVType Ty) const
inline

◆ hasSPIRVTypeForVReg()

bool llvm::SPIRVGlobalRegistry::hasSPIRVTypeForVReg ( Register  VReg) const
inline

Definition at line 139 of file SPIRVGlobalRegistry.h.

References getSPIRVTypeForVReg().

◆ isScalarOfType()

bool SPIRVGlobalRegistry::isScalarOfType ( Register  VReg,
unsigned  TypeOpcode 
) const

Definition at line 627 of file SPIRVGlobalRegistry.cpp.

References assert(), and getSPIRVTypeForVReg().

◆ isScalarOrVectorOfType()

bool SPIRVGlobalRegistry::isScalarOrVectorOfType ( Register  VReg,
unsigned  TypeOpcode 
) const

◆ isScalarOrVectorSigned()

bool SPIRVGlobalRegistry::isScalarOrVectorSigned ( const SPIRVType Type) const

Definition at line 663 of file SPIRVGlobalRegistry.cpp.

References assert(), getSPIRVTypeForVReg(), and llvm_unreachable.

◆ setCurrentFunc()

void llvm::SPIRVGlobalRegistry::setCurrentFunc ( MachineFunction MF)
inline

Member Data Documentation

◆ CurMF

MachineFunction* llvm::SPIRVGlobalRegistry::CurMF

The documentation for this class was generated from the following files: