">

LLVM: lib/Target/SPIRV/SPIRVPostLegalizer.cpp File Reference (original) (raw)

#include "[SPIRV.h](SPIRV%5F8h%5Fsource.html)"
#include "[SPIRVSubtarget.h](SPIRVSubtarget%5F8h%5Fsource.html)"
#include "[SPIRVUtils.h](SPIRVUtils%5F8h%5Fsource.html)"
#include "llvm/IR/IntrinsicsSPIRV.h"
#include "[llvm/Support/Debug.h](Support%5F2Debug%5F8h%5Fsource.html)"
#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::updateRegType (Register Reg, Type *Ty, SPIRVType *SpirvTy, SPIRVGlobalRegistry *GR, MachineIRBuilder &MIB, MachineRegisterInfo &MRI)
Helper external function for assigning SPIRVType to a register, ensuring the register class and type are set in MRI.
void llvm::processInstr (MachineInstr &MI, MachineIRBuilder &MIB, MachineRegisterInfo &MRI, SPIRVGlobalRegistry *GR, SPIRVType *KnownResType)
static SPIRVType * deduceIntTypeFromResult (Register ResVReg, MachineIRBuilder &MIB, SPIRVGlobalRegistry *GR)
static bool deduceAndAssignTypeForGUnmerge (MachineInstr *I, MachineFunction &MF, SPIRVGlobalRegistry *GR)
static SPIRVType * deduceTypeFromSingleOperand (MachineInstr *I, MachineIRBuilder &MIB, SPIRVGlobalRegistry *GR, unsigned OpIdx)
static SPIRVType * deduceTypeFromOperandRange (MachineInstr *I, MachineIRBuilder &MIB, SPIRVGlobalRegistry *GR, unsigned StartOp, unsigned EndOp)
static SPIRVType * deduceTypeForResultRegister (MachineInstr *Use, Register UseRegister, SPIRVGlobalRegistry *GR, MachineIRBuilder &MIB)
static SPIRVType * deduceTypeFromUses (Register Reg, MachineFunction &MF, SPIRVGlobalRegistry *GR, MachineIRBuilder &MIB)
static SPIRVType * deduceResultTypeFromOperands (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 bool hasAssignType (Register Reg, MachineRegisterInfo &MRI)
static void generateAssignType (MachineInstr &MI, Register ResultRegister, SPIRVType *ResultType, SPIRVGlobalRegistry *GR, MachineRegisterInfo &MRI)
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)

DEBUG_TYPE

#define DEBUG_TYPE "spirv-postlegalizer"

deduceAndAssignSpirvType()

Definition at line 196 of file SPIRVPostLegalizer.cpp.

References llvm::SPIRVGlobalRegistry::assignSPIRVTypeToVReg(), llvm::SPIRVGlobalRegistry::CurMF, llvm::dbgs(), deduceAndAssignTypeForGUnmerge(), deduceResultTypeFromOperands(), deduceTypeFromUses(), llvm::MachineFunction::getRegInfo(), I, LLVM_DEBUG, MRI, and llvm::setRegClassType().

Referenced by registerSpirvTypeForNewInstructions().

deduceAndAssignTypeForGUnmerge()

Definition at line 53 of file SPIRVPostLegalizer.cpp.

References assert(), llvm::SPIRVSubtarget::getInstrInfo(), llvm::LLT::getNumElements(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVVectorType(), llvm::MachineFunction::getRegInfo(), llvm::SPIRVGlobalRegistry::getScalarOrVectorComponentType(), llvm::SPIRVGlobalRegistry::getSPIRVTypeForVReg(), llvm::MachineFunction::getSubtarget(), I, llvm::LLT::isVector(), MRI, and llvm::setRegClassType().

Referenced by deduceAndAssignSpirvType().

deduceIntTypeFromResult()

deduceResultTypeFromOperands()

deduceTypeForResultRegister()

deduceTypeFromOperandRange()

deduceTypeFromSingleOperand()

deduceTypeFromUses()

ensureAssignTypeForTypeFolding()

Definition at line 364 of file SPIRVPostLegalizer.cpp.

References assert(), llvm::dbgs(), generateAssignType(), llvm::MachineFunction::getName(), llvm::MachineFunction::getRegInfo(), llvm::SPIRVGlobalRegistry::getSPIRVTypeForVReg(), hasAssignType(), llvm::isTypeFoldingSupported(), LLVM_DEBUG, MBB, MI, and MRI.

generateAssignType()

Definition at line 325 of file SPIRVPostLegalizer.cpp.

References llvm::MachineInstrBuilder::addDef(), llvm::MachineInstrBuilder::addUse(), llvm::SPIRVGlobalRegistry::assignSPIRVTypeToVReg(), llvm::MachineIRBuilder::buildInstr(), llvm::dbgs(), E(), llvm::MachineIRBuilder::getMF(), llvm::MachineOperand::getReg(), llvm::SPIRVGlobalRegistry::getRegClass(), llvm::SPIRVGlobalRegistry::getSPIRVTypeID(), I, LLVM_DEBUG, MI, MRI, llvm::printReg(), llvm::MachineInstrBuilder::setMIFlags(), llvm::MachineOperand::setReg(), and llvm::updateRegType().

Referenced by ensureAssignTypeForTypeFolding().

hasAssignType()

registerSpirvTypeForNewInstructions()

Definition at line 257 of file SPIRVPostLegalizer.cpp.

References Changed, llvm::dbgs(), deduceAndAssignSpirvType(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::LLT::getElementType(), llvm::LLT::getNumElements(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVIntegerType(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVVectorType(), llvm::MachineFunction::getRegInfo(), llvm::LLT::getSizeInBits(), I, llvm::LLT::isVector(), LLVM_DEBUG, MBB, MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), requiresSpirvType(), and llvm::setRegClassType().

requiresSpirvType()

visit() [1/2]

visit() [2/2]