LLVM 19.0.0git
Classes | Namespaces | Macros | Typedefs | Functions | Variables
SPIRVModuleAnalysis.cpp File Reference
#include "SPIRVModuleAnalysis.h"
#include "MCTargetDesc/SPIRVBaseInfo.h"
#include "MCTargetDesc/SPIRVMCTargetDesc.h"
#include "SPIRV.h"
#include "SPIRVSubtarget.h"
#include "SPIRVTargetMachine.h"
#include "SPIRVUtils.h"
#include "TargetInfo/SPIRVTargetInfo.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
 Lowers a builtin funtion call using the provided DemangledCall skeleton and external instruction Set.
 

Macros

#define DEBUG_TYPE   "spirv-module-analysis"
 
#define ATOM_FLT_REQ_EXT_MSG(ExtName)
 

Typedefs

using InstrTraces = std::set< InstrSignature >
 

Functions

void llvm::initializeSPIRVModuleAnalysisPass (PassRegistry &)
 
 INITIALIZE_PASS (SPIRVModuleAnalysis, DEBUG_TYPE, "SPIRV module analysis", true, true) static unsigned getMetadataUInt(MDNode *MdNode
 
static InstrSignature instrToSignature (MachineInstr &MI, SPIRV::ModuleAnalysisInfo &MAI)
 
static void collectOtherInstr (MachineInstr &MI, SPIRV::ModuleAnalysisInfo &MAI, SPIRV::ModuleSectionType MSType, InstrTraces &IS, bool Append=true)
 
static void addOpDecorateReqs (const MachineInstr &MI, unsigned DecIndex, SPIRV::RequirementHandler &Reqs, const SPIRVSubtarget &ST)
 
static void addOpTypeImageReqs (const MachineInstr &MI, SPIRV::RequirementHandler &Reqs, const SPIRVSubtarget &ST)
 
static void AddAtomicFloatRequirements (const MachineInstr &MI, SPIRV::RequirementHandler &Reqs, const SPIRVSubtarget &ST)
 
void addInstrRequirements (const MachineInstr &MI, SPIRV::RequirementHandler &Reqs, const SPIRVSubtarget &ST)
 
static void collectReqs (const Module &M, SPIRV::ModuleAnalysisInfo &MAI, MachineModuleInfo *MMI, const SPIRVSubtarget &ST)
 
static unsigned getFastMathFlags (const MachineInstr &I)
 
static void handleMIFlagDecoration (MachineInstr &I, const SPIRVSubtarget &ST, const SPIRVInstrInfo &TII, SPIRV::RequirementHandler &Reqs)
 
static void addDecorations (const Module &M, const SPIRVInstrInfo &TII, MachineModuleInfo *MMI, const SPIRVSubtarget &ST, SPIRV::ModuleAnalysisInfo &MAI)
 

Variables

static cl::opt< boolSPVDumpDeps ("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
 

Macro Definition Documentation

◆ ATOM_FLT_REQ_EXT_MSG

#define ATOM_FLT_REQ_EXT_MSG (   ExtName)
Value:
"The atomic float instruction requires the following SPIR-V " \
"extension: SPV_EXT_shader_atomic_float" ExtName

Definition at line 746 of file SPIRVModuleAnalysis.cpp.

◆ DEBUG_TYPE

#define DEBUG_TYPE   "spirv-module-analysis"

Definition at line 31 of file SPIRVModuleAnalysis.cpp.

Typedef Documentation

◆ InstrTraces

using InstrTraces = std::set<InstrSignature>

Definition at line 356 of file SPIRVModuleAnalysis.cpp.

Function Documentation

◆ AddAtomicFloatRequirements()

static void AddAtomicFloatRequirements ( const MachineInstr MI,
SPIRV::RequirementHandler Reqs,
const SPIRVSubtarget ST 
)
static

◆ addDecorations()

static void addDecorations ( const Module M,
const SPIRVInstrInfo TII,
MachineModuleInfo MMI,
const SPIRVSubtarget ST,
SPIRV::ModuleAnalysisInfo MAI 
)
static

◆ addInstrRequirements()

void addInstrRequirements ( const MachineInstr MI,
SPIRV::RequirementHandler Reqs,
const SPIRVSubtarget ST 
)

◆ addOpDecorateReqs()

static void addOpDecorateReqs ( const MachineInstr MI,
unsigned  DecIndex,
SPIRV::RequirementHandler Reqs,
const SPIRVSubtarget ST 
)
static

◆ addOpTypeImageReqs()

static void addOpTypeImageReqs ( const MachineInstr MI,
SPIRV::RequirementHandler Reqs,
const SPIRVSubtarget ST 
)
static

◆ collectOtherInstr()

static void collectOtherInstr ( MachineInstr MI,
SPIRV::ModuleAnalysisInfo MAI,
SPIRV::ModuleSectionType  MSType,
InstrTraces IS,
bool  Append = true 
)
static

◆ collectReqs()

static void collectReqs ( const Module M,
SPIRV::ModuleAnalysisInfo MAI,
MachineModuleInfo MMI,
const SPIRVSubtarget ST 
)
static

◆ getFastMathFlags()

static unsigned getFastMathFlags ( const MachineInstr I)
static

◆ handleMIFlagDecoration()

static void handleMIFlagDecoration ( MachineInstr I,
const SPIRVSubtarget ST,
const SPIRVInstrInfo TII,
SPIRV::RequirementHandler Reqs 
)
static

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( SPIRVModuleAnalysis  ,
DEBUG_TYPE  ,
"SPIRV module analysis"  ,
true  ,
true   
)

◆ instrToSignature()

static InstrSignature instrToSignature ( MachineInstr MI,
SPIRV::ModuleAnalysisInfo MAI 
)
static

Variable Documentation

◆ AvoidCapabilities

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"))) ( "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"))   
)
static

◆ DefaultVal

unsigned unsigned DefaultVal

Definition at line 65 of file SPIRVModuleAnalysis.cpp.

◆ OpIndex

unsigned OpIndex

◆ SPVDumpDeps

cl::opt< bool > SPVDumpDeps("spv-dump-deps", cl::desc("Dump MIR with SPIR-V dependencies info"), cl::Optional, cl::init(false)) ( "spv-dump-deps"  ,
cl::desc("Dump MIR with SPIR-V dependencies info")  ,
cl::Optional  ,
cl::init(false)   
)
static