LLVM
15.0.0git
|
#include "SPIRVUtils.h"
#include "MCTargetDesc/SPIRVBaseInfo.h"
#include "SPIRV.h"
#include "SPIRVInstrInfo.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/IR/IntrinsicsSPIRV.h"
Go to the source code of this file.
void addNumImm | ( | const APInt & | Imm, |
MachineInstrBuilder & | MIB | ||
) |
Definition at line 69 of file SPIRVUtils.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::RISCVMatInt::Imm, and llvm::report_fatal_error().
SPIRV::StorageClass addressSpaceToStorageClass | ( | unsigned | AddrSpace | ) |
Definition at line 148 of file SPIRVUtils.cpp.
References llvm::SPIRV::CrossWorkgroup, llvm::SPIRV::Function, llvm::SPIRV::Generic, llvm::SPIRV::Input, llvm_unreachable, llvm::SPIRV::UniformConstant, and llvm::SPIRV::Workgroup.
Definition at line 56 of file SPIRVUtils.cpp.
References llvm::AMDGPU::HSAMD::Kernel::Key::Args, B, convertCharsToWord(), getPaddedLen(), and i.
void addStringImm | ( | const StringRef & | Str, |
MachineInstrBuilder & | MIB | ||
) |
Definition at line 48 of file SPIRVUtils.cpp.
References llvm::MachineInstrBuilder::addImm(), convertCharsToWord(), getPaddedLen(), and i.
Referenced by buildOpName(), finishBuildOpDecorate(), and llvm::SPIRVCallLowering::lowerFormalArguments().
void buildOpDecorate | ( | Register | Reg, |
MachineInstr & | I, | ||
const SPIRVInstrInfo & | TII, | ||
llvm::SPIRV::Decoration | Dec, | ||
const std::vector< uint32_t > & | DecArgs, | ||
StringRef | StrImm | ||
) |
Definition at line 117 of file SPIRVUtils.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addUse(), llvm::BuildMI(), finishBuildOpDecorate(), I, MBB, and TII.
void buildOpDecorate | ( | Register | Reg, |
MachineIRBuilder & | MIRBuilder, | ||
llvm::SPIRV::Decoration | Dec, | ||
const std::vector< uint32_t > & | DecArgs, | ||
StringRef | StrImm | ||
) |
Definition at line 108 of file SPIRVUtils.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addUse(), llvm::MachineIRBuilder::buildInstr(), and finishBuildOpDecorate().
Referenced by llvm::SPIRVGlobalRegistry::buildGlobalVariable(), and llvm::SPIRVCallLowering::lowerFormalArguments().
void buildOpName | ( | Register | Target, |
const StringRef & | Name, | ||
MachineIRBuilder & | MIRBuilder | ||
) |
Definition at line 91 of file SPIRVUtils.cpp.
References addStringImm(), llvm::MachineInstrBuilder::addUse(), and llvm::MachineIRBuilder::buildInstr().
Referenced by llvm::SPIRVGlobalRegistry::buildGlobalVariable(), and llvm::SPIRVCallLowering::lowerFormalArguments().
|
static |
Definition at line 99 of file SPIRVUtils.cpp.
References llvm::MachineInstrBuilder::addImm(), addStringImm(), and llvm::StringRef::empty().
Referenced by buildOpDecorate().
MachineInstr* getDefInstrMaybeConstant | ( | Register & | ConstReg, |
const MachineRegisterInfo * | MRI | ||
) |
Definition at line 185 of file SPIRVUtils.cpp.
References llvm::MachineInstr::getIntrinsicID(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getVRegDef(), and MRI.
Referenced by getIConstVal(), and processSwitches().
uint64_t getIConstVal | ( | Register | ConstReg, |
const MachineRegisterInfo * | MRI | ||
) |
Definition at line 199 of file SPIRVUtils.cpp.
References assert(), getDefInstrMaybeConstant(), MI, and MRI.
Referenced by processSwitches().
Definition at line 205 of file SPIRVUtils.cpp.
Referenced by generateAssignInstrs().
SPIRV::MemorySemantics getMemSemanticsForStorageClass | ( | SPIRV::StorageClass | SC | ) |
Definition at line 167 of file SPIRVUtils.cpp.
References llvm::SPIRV::AtomicCounter, llvm::SPIRV::AtomicCounterMemory, llvm::SPIRV::CrossWorkgroup, llvm::SPIRV::CrossWorkgroupMemory, llvm::SPIRV::Image, llvm::SPIRV::ImageMemory, llvm::SPIRV::None, llvm::PPCISD::SC, llvm::SPIRV::StorageBuffer, llvm::SPIRV::Uniform, llvm::SPIRV::UniformMemory, llvm::SPIRV::Workgroup, and llvm::SPIRV::WorkgroupMemory.
Definition at line 43 of file SPIRVUtils.cpp.
Referenced by addStringImm().
std::string getStringImm | ( | const MachineInstr & | MI, |
unsigned | StartIndex | ||
) |
Definition at line 65 of file SPIRVUtils.cpp.
References getSPIRVStringOperand(), and MI.
unsigned storageClassToAddressSpace | ( | SPIRV::StorageClass | SC | ) |
Definition at line 129 of file SPIRVUtils.cpp.
References llvm::SPIRV::CrossWorkgroup, llvm::SPIRV::Function, llvm::SPIRV::Generic, llvm::SPIRV::Input, llvm_unreachable, llvm::PPCISD::SC, llvm::SPIRV::UniformConstant, and llvm::SPIRV::Workgroup.
Referenced by llvm::SPIRVGlobalRegistry::getOrCreateSPIRVPointerType().