LLVM 22.0.0git
SPIRVPostLegalizer.cpp File Reference
#include "SPIRV.h"
#include "SPIRVSubtarget.h"
#include "SPIRVUtils.h"
#include "llvm/IR/IntrinsicsSPIRV.h"
#include "llvm/Support/Debug.h"
#include <stack>

Go to the source code of this file.

Namespaces

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

Macros

#define DEBUG_TYPE   "spirv-postlegalizer"

Functions

void llvm::insertAssignInstr (Register Reg, Type *Ty, SPIRVType *SpirvTy, SPIRVGlobalRegistry *GR, MachineIRBuilder &MIB, MachineRegisterInfo &MRI)
 Helper external function for inserting ASSIGN_TYPE instuction between Reg and its definition, set the new register as a destination of the definition, assign SPIRVType to both registers.
void llvm::processInstr (MachineInstr &MI, MachineIRBuilder &MIB, MachineRegisterInfo &MRI, SPIRVGlobalRegistry *GR, SPIRVType *KnownResType)
static SPIRVTypededuceIntTypeFromResult (Register ResVReg, MachineIRBuilder &MIB, SPIRVGlobalRegistry *GR)
static bool deduceAndAssignTypeForGUnmerge (MachineInstr *I, MachineFunction &MF, SPIRVGlobalRegistry *GR)
static SPIRVTypededuceTypeFromSingleOperand (MachineInstr *I, MachineIRBuilder &MIB, SPIRVGlobalRegistry *GR, unsigned OpIdx)
static SPIRVTypededuceTypeFromOperandRange (MachineInstr *I, MachineIRBuilder &MIB, SPIRVGlobalRegistry *GR, unsigned StartOp, unsigned EndOp)
static SPIRVTypededuceTypeForResultRegister (MachineInstr *Use, Register UseRegister, SPIRVGlobalRegistry *GR, MachineIRBuilder &MIB)
static SPIRVTypededuceTypeFromUses (Register Reg, MachineFunction &MF, SPIRVGlobalRegistry *GR, MachineIRBuilder &MIB)
static SPIRVTypededuceResultTypeFromOperands (MachineInstr *I, SPIRVGlobalRegistry *GR, MachineIRBuilder &MIB)
static bool deduceAndAssignSpirvType (MachineInstr *I, MachineFunction &MF, SPIRVGlobalRegistry *GR, MachineIRBuilder &MIB)
static bool requiresSpirvType (MachineInstr &I, SPIRVGlobalRegistry *GR, MachineRegisterInfo &MRI)
static void registerSpirvTypeForNewInstructions (MachineFunction &MF, SPIRVGlobalRegistry *GR)
static void ensureAssignTypeForTypeFolding (MachineFunction &MF, SPIRVGlobalRegistry *GR)
void visit (MachineFunction &MF, MachineBasicBlock &Start, std::function< void(MachineBasicBlock *)> op)
void visit (MachineFunction &MF, std::function< void(MachineBasicBlock *)> op)

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "spirv-postlegalizer"

Definition at line 24 of file SPIRVPostLegalizer.cpp.

Function Documentation

◆ deduceAndAssignSpirvType()

◆ deduceAndAssignTypeForGUnmerge()

◆ deduceIntTypeFromResult()

◆ deduceResultTypeFromOperands()

SPIRVType * deduceResultTypeFromOperands ( MachineInstr * I,
SPIRVGlobalRegistry * GR,
MachineIRBuilder & MIB )
static

◆ deduceTypeForResultRegister()

◆ deduceTypeFromOperandRange()

SPIRVType * deduceTypeFromOperandRange ( MachineInstr * I,
MachineIRBuilder & MIB,
SPIRVGlobalRegistry * GR,
unsigned StartOp,
unsigned EndOp )
static

Definition at line 119 of file SPIRVPostLegalizer.cpp.

References assert(), deduceTypeFromSingleOperand(), and I.

Referenced by deduceResultTypeFromOperands().

◆ deduceTypeFromSingleOperand()

◆ deduceTypeFromUses()

◆ ensureAssignTypeForTypeFolding()

◆ registerSpirvTypeForNewInstructions()

◆ requiresSpirvType()

◆ visit() [1/2]

◆ visit() [2/2]

void visit ( MachineFunction & MF,
std::function< void(MachineBasicBlock *)> op )

Definition at line 385 of file SPIRVPostLegalizer.cpp.

References llvm::MachineFunction::begin(), op, and visit().