LLVM 20.0.0git
|
#include "SPIRVModuleAnalysis.h"
#include "MCTargetDesc/SPIRVBaseInfo.h"
#include "MCTargetDesc/SPIRVMCTargetDesc.h"
#include "SPIRV.h"
#include "SPIRVSubtarget.h"
#include "SPIRVTargetMachine.h"
#include "SPIRVUtils.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/TargetPassConfig.h"
Go to the source code of this file.
Classes | |
struct | AvoidCapabilitiesSet |
Namespaces | |
namespace | llvm |
This is an optimization pass for GlobalISel generic memory operations. | |
namespace | llvm::SPIRV |
Macros | |
#define | DEBUG_TYPE "spirv-module-analysis" |
#define | ATOM_FLT_REQ_EXT_MSG(ExtName) |
Typedefs | |
using | InstrTraces = std::set< InstrSignature > |
Variables | |
static cl::opt< bool > | SPVDumpDeps ("spv-dump-deps", cl::desc("Dump MIR with SPIR-V dependencies info"), cl::Optional, cl::init(false)) |
static cl::list< SPIRV::Capability::Capability > | AvoidCapabilities ("avoid-spirv-capabilities", cl::desc("SPIR-V capabilities to avoid if there are " "other options enabling a feature"), cl::ZeroOrMore, cl::Hidden, cl::values(clEnumValN(SPIRV::Capability::Shader, "Shader", "SPIR-V Shader capability"))) |
unsigned | OpIndex |
unsigned unsigned | DefaultVal |
#define ATOM_FLT_REQ_EXT_MSG | ( | ExtName | ) |
Definition at line 828 of file SPIRVModuleAnalysis.cpp.
#define DEBUG_TYPE "spirv-module-analysis" |
Definition at line 30 of file SPIRVModuleAnalysis.cpp.
using InstrTraces = std::set<InstrSignature> |
Definition at line 372 of file SPIRVModuleAnalysis.cpp.
|
static |
Definition at line 831 of file SPIRVModuleAnalysis.cpp.
References llvm::SPIRV::RequirementHandler::addCapability(), llvm::SPIRV::RequirementHandler::addExtension(), assert(), ATOM_FLT_REQ_EXT_MSG, llvm::BitWidth, llvm::MachineOperand::getImm(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), MI, and llvm::report_fatal_error().
Referenced by addInstrRequirements().
|
static |
Definition at line 1756 of file SPIRVModuleAnalysis.cpp.
References F, llvm::MachineModuleInfo::getMachineFunction(), handleMIFlagDecoration(), MBB, MI, llvm::SPIRV::ModuleAnalysisInfo::Reqs, and TII.
Referenced by llvm::SPIRVModuleAnalysis::runOnModule().
|
static |
Definition at line 1025 of file SPIRVModuleAnalysis.cpp.
References llvm::SPIRV::RequirementHandler::addCapability(), llvm::SPIRV::RequirementHandler::addExtension(), assert(), llvm::MachineOperand::getImm(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isReg(), MI, and MRI.
Referenced by addInstrRequirements().
void addInstrRequirements | ( | const MachineInstr & | MI, |
SPIRV::RequirementHandler & | Reqs, | ||
const SPIRVSubtarget & | ST | ||
) |
Definition at line 1057 of file SPIRVModuleAnalysis.cpp.
References AddAtomicFloatRequirements(), llvm::SPIRV::RequirementHandler::addCapability(), AddDotProductRequirements(), llvm::SPIRV::RequirementHandler::addExtension(), addOpAccessChainReqs(), addOpDecorateReqs(), addOpTypeImageReqs(), Addr, assert(), llvm::BitWidth, llvm::SPIRV::RequirementHandler::getAndAddRequirements(), llvm::MachineOperand::getImm(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), isImageTypeWithUnknownFormat(), llvm::MachineOperand::isReg(), MI, MRI, llvm::SPIRV::RequirementHandler::removeCapabilityIf(), and llvm::report_fatal_error().
Referenced by collectReqs().
|
static |
Definition at line 1769 of file SPIRVModuleAnalysis.cpp.
References llvm::buildOpName(), llvm::MachineBasicBlock::empty(), llvm::MachineBasicBlock::end(), F, llvm::MachineModuleInfo::getMachineFunction(), llvm::MachineBasicBlock::getName(), llvm::SPIRV::ModuleAnalysisInfo::getOrCreateMBBRegister(), llvm::MachineFunction::getRegInfo(), llvm::MachineBasicBlock::hasName(), MBB, MRI, llvm::LLT::scalar(), llvm::SPIRV::ModuleAnalysisInfo::setRegisterAlias(), and TII.
Referenced by llvm::SPIRVModuleAnalysis::runOnModule().
void addOpAccessChainReqs | ( | const MachineInstr & | Instr, |
SPIRV::RequirementHandler & | Handler, | ||
const SPIRVSubtarget & | Subtarget | ||
) |
Definition at line 950 of file SPIRVModuleAnalysis.cpp.
References llvm::SPIRV::RequirementHandler::addRequirements(), assert(), llvm::MachineOperand::getImm(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), hasNonUniformDecoration(), isCombinedImageSampler(), isInputAttachment(), isSampledImage(), isStorageImage(), isStorageTexelBuffer(), isUniformTexelBuffer(), and MRI.
Referenced by addInstrRequirements().
|
static |
Definition at line 739 of file SPIRVModuleAnalysis.cpp.
References llvm::SPIRV::RequirementHandler::addExtension(), llvm::SPIRV::RequirementHandler::addRequirements(), and MI.
Referenced by addInstrRequirements().
|
static |
Definition at line 773 of file SPIRVModuleAnalysis.cpp.
References llvm::SPIRV::RequirementHandler::addRequirements(), assert(), llvm::SPIRV::RequirementHandler::getAndAddRequirements(), and MI.
Referenced by addInstrRequirements().
|
static |
Definition at line 400 of file SPIRVModuleAnalysis.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorImpl< T >::insert(), instrToSignature(), MI, llvm::SPIRV::ModuleAnalysisInfo::MS, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::SPIRV::ModuleAnalysisInfo::setSkipEmission().
|
static |
Definition at line 1615 of file SPIRVModuleAnalysis.cpp.
References llvm::SPIRV::RequirementHandler::addCapability(), llvm::SPIRV::RequirementHandler::addExtension(), addInstrRequirements(), llvm::CallingConv::C, F, llvm::SPIRV::RequirementHandler::getAndAddRequirements(), llvm::MachineModuleInfo::getMachineFunction(), llvm::MDNode::getOperand(), MBB, MI, and llvm::SPIRV::ModuleAnalysisInfo::Reqs.
Referenced by llvm::SPIRVModuleAnalysis::runOnModule().
|
static |
Definition at line 1713 of file SPIRVModuleAnalysis.cpp.
References llvm::MachineInstr::FmArcp, llvm::MachineInstr::FmNoInfs, llvm::MachineInstr::FmNoNans, llvm::MachineInstr::FmNsz, llvm::MachineInstr::FmReassoc, and I.
Referenced by CreateAdd(), CreateMul(), handleMIFlagDecoration(), and instCombineSVEVectorFuseMulAddSub().
|
static |
Definition at line 1728 of file SPIRVModuleAnalysis.cpp.
References llvm::buildOpDecorate(), getFastMathFlags(), I, llvm::MachineInstr::NoSWrap, llvm::MachineInstr::NoUWrap, and TII.
Referenced by addDecorations().
bool hasNonUniformDecoration | ( | Register | Reg, |
const MachineRegisterInfo & | MRI | ||
) |
Definition at line 938 of file SPIRVModuleAnalysis.cpp.
Referenced by addOpAccessChainReqs().
INITIALIZE_PASS | ( | SPIRVModuleAnalysis | , |
DEBUG_TYPE | , | ||
"SPIRV module analysis" | , | ||
true | , | ||
true | |||
) |
|
static |
Definition at line 378 of file SPIRVModuleAnalysis.cpp.
References llvm::MachineOperand::getReg(), llvm::SPIRV::ModuleAnalysisInfo::getRegisterAlias(), llvm::MachineOperand::getSubReg(), llvm::MachineOperand::getType(), llvm::hash_combine(), llvm::hash_value(), llvm::MachineOperand::isDef(), llvm::MachineOperand::isReg(), and MI.
Referenced by collectOtherInstr().
bool isCombinedImageSampler | ( | MachineInstr * | SampledImageInst | ) |
Definition at line 928 of file SPIRVModuleAnalysis.cpp.
References llvm::MachineInstr::getMF(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), isSampledImage(), and MRI.
Referenced by addOpAccessChainReqs().
Definition at line 1018 of file SPIRVModuleAnalysis.cpp.
References assert(), llvm::MachineOperand::getImm(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), and llvm::MachineOperand::isImm().
Referenced by addInstrRequirements().
bool isInputAttachment | ( | MachineInstr * | ImageInst | ) |
Definition at line 912 of file SPIRVModuleAnalysis.cpp.
References llvm::MachineOperand::getImm(), llvm::MachineInstr::getOpcode(), and llvm::MachineInstr::getOperand().
Referenced by addOpAccessChainReqs().
bool isSampledImage | ( | MachineInstr * | ImageInst | ) |
Definition at line 904 of file SPIRVModuleAnalysis.cpp.
References llvm::MachineOperand::getImm(), llvm::MachineInstr::getOpcode(), and llvm::MachineInstr::getOperand().
Referenced by addOpAccessChainReqs(), and isCombinedImageSampler().
bool isStorageImage | ( | MachineInstr * | ImageInst | ) |
Definition at line 920 of file SPIRVModuleAnalysis.cpp.
References llvm::MachineOperand::getImm(), llvm::MachineInstr::getOpcode(), and llvm::MachineInstr::getOperand().
Referenced by addOpAccessChainReqs().
bool isStorageTexelBuffer | ( | MachineInstr * | ImageInst | ) |
Definition at line 896 of file SPIRVModuleAnalysis.cpp.
References llvm::MachineOperand::getImm(), llvm::MachineInstr::getOpcode(), and llvm::MachineInstr::getOperand().
Referenced by addOpAccessChainReqs().
bool isUniformTexelBuffer | ( | MachineInstr * | ImageInst | ) |
Definition at line 888 of file SPIRVModuleAnalysis.cpp.
References llvm::MachineOperand::getImm(), llvm::MachineInstr::getOpcode(), and llvm::MachineInstr::getOperand().
Referenced by addOpAccessChainReqs().
|
static |
Definition at line 1791 of file SPIRVModuleAnalysis.cpp.
References F, llvm::MachineModuleInfo::getMachineFunction(), llvm::SPIRVGlobalRegistry::getSPIRVTypeForVReg(), llvm::SPIRVGlobalRegistry::getSPIRVTypeID(), MBB, MI, and TII.
Referenced by llvm::SPIRVModuleAnalysis::runOnModule().
|
static |
Referenced by AvoidCapabilitiesSet::AvoidCapabilitiesSet().
Definition at line 64 of file SPIRVModuleAnalysis.cpp.
Referenced by llvm::AMDGPU::getIntegerVecAttribute().
unsigned OpIndex |
Definition at line 63 of file SPIRVModuleAnalysis.cpp.
Referenced by combineX86ShuffleChain(), llvm::DWARFDebugLine::Row::dump(), llvm::MipsELFStreamer::emitInstruction(), llvm::InstCombinerImpl::foldOpIntoPhi(), lowerV4X128Shuffle(), llvm::AArch64FrameLowering::orderFrameObjects(), and llvm::DWARFDebugLine::Row::reset().
|
static |