LLVM 20.0.0git
Namespaces | Macros | Typedefs | Functions
SPIRVInstructionSelector.cpp File Reference
#include "MCTargetDesc/SPIRVBaseInfo.h"
#include "MCTargetDesc/SPIRVMCTargetDesc.h"
#include "SPIRV.h"
#include "SPIRVGlobalRegistry.h"
#include "SPIRVInstrInfo.h"
#include "SPIRVRegisterBankInfo.h"
#include "SPIRVRegisterInfo.h"
#include "SPIRVTargetMachine.h"
#include "SPIRVUtils.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/CodeGen/GlobalISel/GIMatchTableExecutorImpl.h"
#include "llvm/CodeGen/GlobalISel/GenericMachineInstrs.h"
#include "llvm/CodeGen/GlobalISel/InstructionSelector.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineModuleInfoImpls.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/Register.h"
#include "llvm/CodeGen/TargetOpcodes.h"
#include "llvm/IR/IntrinsicsSPIRV.h"
#include "llvm/Support/Debug.h"
#include "SPIRVGenGlobalISel.inc"

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-isel"
 
#define GET_GLOBALISEL_PREDICATE_BITSET
 
#define GET_GLOBALISEL_PREDICATES_DECL
 
#define GET_GLOBALISEL_TEMPORARIES_DECL
 
#define GET_GLOBALISEL_IMPL
 
#define GET_GLOBALISEL_PREDICATES_INIT
 
#define GET_GLOBALISEL_TEMPORARIES_INIT
 

Typedefs

using ExtInstList = std::vector< std::pair< SPIRV::InstructionSet::InstructionSet, uint32_t > >
 

Functions

static bool isImm (const MachineOperand &MO, MachineRegisterInfo *MRI)
 
bool isTypeFoldingSupported (unsigned Opcode)
 
bool isDead (const MachineInstr &MI, const MachineRegisterInfo &MRI)
 
static bool mayApplyGenericSelection (unsigned Opcode)
 
static void addMemoryOperands (MachineMemOperand *MemOp, MachineInstrBuilder &MIB)
 
static void addMemoryOperands (uint64_t Flags, MachineInstrBuilder &MIB)
 
static bool isGenericCastablePtr (SPIRV::StorageClass::StorageClass SC)
 
static bool isUSMStorageClass (SPIRV::StorageClass::StorageClass SC)
 
static bool isASCastInGVar (MachineRegisterInfo *MRI, Register ResVReg)
 
static unsigned getFCmpOpcode (unsigned PredNum)
 
static unsigned getICmpOpcode (unsigned PredNum)
 
static unsigned getPtrCmpOpcode (unsigned Pred)
 
static unsigned getBoolCmpOpcode (unsigned PredNum)
 
static APFloat getZeroFP (const Type *LLVMFloatTy)
 
static APFloat getOneFP (const Type *LLVMFloatTy)
 
static unsigned getArrayComponentCount (MachineRegisterInfo *MRI, const SPIRVType *ResType)
 
static bool isConstReg (MachineRegisterInfo *MRI, SPIRVType *OpDef, SmallPtrSet< SPIRVType *, 4 > &Visited)
 
static bool isConstReg (MachineRegisterInfo *MRI, Register OpReg)
 
static int64_t foldImm (const MachineOperand &MO, MachineRegisterInfo *MRI)
 
InstructionSelectorllvm::createSPIRVInstructionSelector (const SPIRVTargetMachine &TM, const SPIRVSubtarget &Subtarget, const RegisterBankInfo &RBI)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "spirv-isel"

Definition at line 37 of file SPIRVInstructionSelector.cpp.

◆ GET_GLOBALISEL_IMPL

#define GET_GLOBALISEL_IMPL

Definition at line 318 of file SPIRVInstructionSelector.cpp.

◆ GET_GLOBALISEL_PREDICATE_BITSET

#define GET_GLOBALISEL_PREDICATE_BITSET

Definition at line 48 of file SPIRVInstructionSelector.cpp.

◆ GET_GLOBALISEL_PREDICATES_DECL

#define GET_GLOBALISEL_PREDICATES_DECL

Definition at line 77 of file SPIRVInstructionSelector.cpp.

◆ GET_GLOBALISEL_PREDICATES_INIT

#define GET_GLOBALISEL_PREDICATES_INIT

◆ GET_GLOBALISEL_TEMPORARIES_DECL

#define GET_GLOBALISEL_TEMPORARIES_DECL

Definition at line 81 of file SPIRVInstructionSelector.cpp.

◆ GET_GLOBALISEL_TEMPORARIES_INIT

#define GET_GLOBALISEL_TEMPORARIES_INIT

Typedef Documentation

◆ ExtInstList

using ExtInstList = std::vector<std::pair<SPIRV::InstructionSet::InstructionSet, uint32_t> >

Definition at line 43 of file SPIRVInstructionSelector.cpp.

Function Documentation

◆ addMemoryOperands() [1/2]

static void addMemoryOperands ( MachineMemOperand MemOp,
MachineInstrBuilder MIB 
)
static

Definition at line 988 of file SPIRVInstructionSelector.cpp.

References llvm::MachineInstrBuilder::addImm().

◆ addMemoryOperands() [2/2]

static void addMemoryOperands ( uint64_t  Flags,
MachineInstrBuilder MIB 
)
static

◆ foldImm()

static int64_t foldImm ( const MachineOperand MO,
MachineRegisterInfo MRI 
)
static

◆ getArrayComponentCount()

static unsigned getArrayComponentCount ( MachineRegisterInfo MRI,
const SPIRVType ResType 
)
static

◆ getBoolCmpOpcode()

static unsigned getBoolCmpOpcode ( unsigned  PredNum)
static

◆ getFCmpOpcode()

static unsigned getFCmpOpcode ( unsigned  PredNum)
static

◆ getICmpOpcode()

static unsigned getICmpOpcode ( unsigned  PredNum)
static

◆ getOneFP()

static APFloat getOneFP ( const Type LLVMFloatTy)
static

◆ getPtrCmpOpcode()

static unsigned getPtrCmpOpcode ( unsigned  Pred)
static

◆ getZeroFP()

static APFloat getZeroFP ( const Type LLVMFloatTy)
static

◆ isASCastInGVar()

static bool isASCastInGVar ( MachineRegisterInfo MRI,
Register  ResVReg 
)
static

Definition at line 1399 of file SPIRVInstructionSelector.cpp.

References MRI.

◆ isConstReg() [1/2]

static bool isConstReg ( MachineRegisterInfo MRI,
Register  OpReg 
)
static

Definition at line 2170 of file SPIRVInstructionSelector.cpp.

References isConstReg(), and MRI.

◆ isConstReg() [2/2]

static bool isConstReg ( MachineRegisterInfo MRI,
SPIRVType OpDef,
SmallPtrSet< SPIRVType *, 4 > &  Visited 
)
static

◆ isDead()

bool isDead ( const MachineInstr MI,
const MachineRegisterInfo MRI 
)

◆ isGenericCastablePtr()

static bool isGenericCastablePtr ( SPIRV::StorageClass::StorageClass  SC)
static

Definition at line 1377 of file SPIRVInstructionSelector.cpp.

◆ isImm()

static bool isImm ( const MachineOperand MO,
MachineRegisterInfo MRI 
)
static

◆ isTypeFoldingSupported()

bool isTypeFoldingSupported ( unsigned  Opcode)

◆ isUSMStorageClass()

static bool isUSMStorageClass ( SPIRV::StorageClass::StorageClass  SC)
static

Definition at line 1388 of file SPIRVInstructionSelector.cpp.

◆ mayApplyGenericSelection()

static bool mayApplyGenericSelection ( unsigned  Opcode)
static

Definition at line 476 of file SPIRVInstructionSelector.cpp.

References isTypeFoldingSupported().