LLVM  15.0.0git
Namespaces | Functions
SPIRVUtils.h File Reference
#include "MCTargetDesc/SPIRVBaseInfo.h"
#include "llvm/IR/IRBuilder.h"
#include <string>
Include dependency graph for SPIRVUtils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 llvm
 This is an optimization pass for GlobalISel generic memory operations.
 

Functions

void addStringImm (const llvm::StringRef &Str, llvm::MachineInstrBuilder &MIB)
 
void addStringImm (const llvm::StringRef &Str, llvm::IRBuilder<> &B, std::vector< llvm::Value * > &Args)
 
std::string getStringImm (const llvm::MachineInstr &MI, unsigned StartIndex)
 
void addNumImm (const llvm::APInt &Imm, llvm::MachineInstrBuilder &MIB)
 
void buildOpName (llvm::Register Target, const llvm::StringRef &Name, llvm::MachineIRBuilder &MIRBuilder)
 
void buildOpDecorate (llvm::Register Reg, llvm::MachineIRBuilder &MIRBuilder, llvm::SPIRV::Decoration Dec, const std::vector< uint32_t > &DecArgs, llvm::StringRef StrImm="")
 
void buildOpDecorate (llvm::Register Reg, llvm::MachineInstr &I, const llvm::SPIRVInstrInfo &TII, llvm::SPIRV::Decoration Dec, const std::vector< uint32_t > &DecArgs, llvm::StringRef StrImm="")
 
unsigned storageClassToAddressSpace (llvm::SPIRV::StorageClass SC)
 
llvm::SPIRV::StorageClass addressSpaceToStorageClass (unsigned AddrSpace)
 
llvm::SPIRV::MemorySemantics getMemSemanticsForStorageClass (llvm::SPIRV::StorageClass SC)
 
llvm::MachineInstrgetDefInstrMaybeConstant (llvm::Register &ConstReg, const llvm::MachineRegisterInfo *MRI)
 
uint64_t getIConstVal (llvm::Register ConstReg, const llvm::MachineRegisterInfo *MRI)
 
llvm::TypegetMDOperandAsType (const llvm::MDNode *N, unsigned I)
 

Function Documentation

◆ addNumImm()

void addNumImm ( const llvm::APInt Imm,
llvm::MachineInstrBuilder MIB 
)

◆ addressSpaceToStorageClass()

llvm::SPIRV::StorageClass addressSpaceToStorageClass ( unsigned  AddrSpace)

◆ addStringImm() [1/2]

void addStringImm ( const llvm::StringRef Str,
llvm::IRBuilder<> &  B,
std::vector< llvm::Value * > &  Args 
)

◆ addStringImm() [2/2]

void addStringImm ( const llvm::StringRef Str,
llvm::MachineInstrBuilder MIB 
)

◆ buildOpDecorate() [1/2]

void buildOpDecorate ( llvm::Register  Reg,
llvm::MachineInstr I,
const llvm::SPIRVInstrInfo TII,
llvm::SPIRV::Decoration  Dec,
const std::vector< uint32_t > &  DecArgs,
llvm::StringRef  StrImm = "" 
)

◆ buildOpDecorate() [2/2]

void buildOpDecorate ( llvm::Register  Reg,
llvm::MachineIRBuilder MIRBuilder,
llvm::SPIRV::Decoration  Dec,
const std::vector< uint32_t > &  DecArgs,
llvm::StringRef  StrImm = "" 
)

◆ buildOpName()

void buildOpName ( llvm::Register  Target,
const llvm::StringRef Name,
llvm::MachineIRBuilder MIRBuilder 
)

◆ getDefInstrMaybeConstant()

llvm::MachineInstr* getDefInstrMaybeConstant ( llvm::Register ConstReg,
const llvm::MachineRegisterInfo MRI 
)

◆ getIConstVal()

uint64_t getIConstVal ( llvm::Register  ConstReg,
const llvm::MachineRegisterInfo MRI 
)

Definition at line 199 of file SPIRVUtils.cpp.

References assert(), getDefInstrMaybeConstant(), MI, and MRI.

Referenced by processSwitches().

◆ getMDOperandAsType()

llvm::Type* getMDOperandAsType ( const llvm::MDNode N,
unsigned  I 
)

Definition at line 205 of file SPIRVUtils.cpp.

References I, and N.

Referenced by generateAssignInstrs().

◆ getMemSemanticsForStorageClass()

llvm::SPIRV::MemorySemantics getMemSemanticsForStorageClass ( llvm::SPIRV::StorageClass  SC)

◆ getStringImm()

std::string getStringImm ( const llvm::MachineInstr MI,
unsigned  StartIndex 
)

Definition at line 65 of file SPIRVUtils.cpp.

References getSPIRVStringOperand(), and MI.

◆ storageClassToAddressSpace()

unsigned storageClassToAddressSpace ( llvm::SPIRV::StorageClass  SC)