LLVM 20.0.0git
Namespaces | Macros | Functions
SPIRVPreLegalizer.cpp File Reference
#include "SPIRV.h"
#include "SPIRVSubtarget.h"
#include "SPIRVUtils.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/Analysis/OptimizationRemarkEmitter.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/IntrinsicsSPIRV.h"
#include "llvm/Target/TargetIntrinsicInfo.h"

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-prelegalizer"
 

Functions

static void addConstantsToTrack (MachineFunction &MF, SPIRVGlobalRegistry *GR, const SPIRVSubtarget &STI, DenseMap< MachineInstr *, Type * > &TargetExtConstTypes, SmallSet< Register, 4 > &TrackedConstRegs)
 
static void foldConstantsIntoIntrinsics (MachineFunction &MF, const SmallSet< Register, 4 > &TrackedConstRegs)
 
static MachineInstrfindAssignTypeInstr (Register Reg, MachineRegisterInfo *MRI)
 
static void insertBitcasts (MachineFunction &MF, SPIRVGlobalRegistry *GR, MachineIRBuilder MIB)
 
static SPIRVTypepropagateSPIRVType (MachineInstr *MI, SPIRVGlobalRegistry *GR, MachineRegisterInfo &MRI, MachineIRBuilder &MIB)
 
static void widenScalarLLTNextPow2 (Register Reg, MachineRegisterInfo &MRI)
 
bool getIsFloat (SPIRVType *SpvType, const SPIRVGlobalRegistry &GR)
 
static const TargetRegisterClassgetRegClass (SPIRVType *SpvType, const SPIRVGlobalRegistry &GR)
 
static std::pair< Register, unsignedcreateNewIdReg (SPIRVType *SpvType, Register SrcReg, MachineRegisterInfo &MRI, const SPIRVGlobalRegistry &GR)
 
Register 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)
 
static void generateAssignInstrs (MachineFunction &MF, SPIRVGlobalRegistry *GR, MachineIRBuilder MIB, DenseMap< MachineInstr *, Type * > &TargetExtConstTypes)
 
bool isTypeFoldingSupported (unsigned Opcode)
 
static void processInstrsWithTypeFolding (MachineFunction &MF, SPIRVGlobalRegistry *GR, MachineIRBuilder MIB)
 
static void insertInlineAsmProcess (MachineFunction &MF, SPIRVGlobalRegistry *GR, const SPIRVSubtarget &ST, MachineIRBuilder MIRBuilder, const SmallVector< MachineInstr * > &ToProcess)
 
static void insertInlineAsm (MachineFunction &MF, SPIRVGlobalRegistry *GR, const SPIRVSubtarget &ST, MachineIRBuilder MIRBuilder)
 
static void insertSpirvDecorations (MachineFunction &MF, MachineIRBuilder MIB)
 
static void processSwitches (MachineFunction &MF, SPIRVGlobalRegistry *GR, MachineIRBuilder MIB)
 
static bool isImplicitFallthrough (MachineBasicBlock &MBB)
 
static void removeImplicitFallthroughs (MachineFunction &MF, MachineIRBuilder MIB)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "spirv-prelegalizer"

Definition at line 26 of file SPIRVPreLegalizer.cpp.

Function Documentation

◆ addConstantsToTrack()

static void addConstantsToTrack ( MachineFunction MF,
SPIRVGlobalRegistry GR,
const SPIRVSubtarget STI,
DenseMap< MachineInstr *, Type * > &  TargetExtConstTypes,
SmallSet< Register, 4 > &  TrackedConstRegs 
)
static

◆ createNewIdReg()

static std::pair< Register, unsigned > createNewIdReg ( SPIRVType SpvType,
Register  SrcReg,
MachineRegisterInfo MRI,
const SPIRVGlobalRegistry GR 
)
static

◆ findAssignTypeInstr()

static MachineInstr * findAssignTypeInstr ( Register  Reg,
MachineRegisterInfo MRI 
)
static

◆ foldConstantsIntoIntrinsics()

static void foldConstantsIntoIntrinsics ( MachineFunction MF,
const SmallSet< Register, 4 > &  TrackedConstRegs 
)
static

◆ generateAssignInstrs()

static void generateAssignInstrs ( MachineFunction MF,
SPIRVGlobalRegistry GR,
MachineIRBuilder  MIB,
DenseMap< MachineInstr *, Type * > &  TargetExtConstTypes 
)
static

◆ getIsFloat()

bool getIsFloat ( SPIRVType SpvType,
const SPIRVGlobalRegistry GR 
)
inline

◆ getRegClass()

static const TargetRegisterClass * getRegClass ( SPIRVType SpvType,
const SPIRVGlobalRegistry GR 
)
static

◆ insertBitcasts()

static void insertBitcasts ( MachineFunction MF,
SPIRVGlobalRegistry GR,
MachineIRBuilder  MIB 
)
static

◆ insertInlineAsm()

static void insertInlineAsm ( MachineFunction MF,
SPIRVGlobalRegistry GR,
const SPIRVSubtarget ST,
MachineIRBuilder  MIRBuilder 
)
static

◆ insertInlineAsmProcess()

static void insertInlineAsmProcess ( MachineFunction MF,
SPIRVGlobalRegistry GR,
const SPIRVSubtarget ST,
MachineIRBuilder  MIRBuilder,
const SmallVector< MachineInstr * > &  ToProcess 
)
static

◆ insertSpirvDecorations()

static void insertSpirvDecorations ( MachineFunction MF,
MachineIRBuilder  MIB 
)
static

◆ isImplicitFallthrough()

static bool isImplicitFallthrough ( MachineBasicBlock MBB)
static

◆ isTypeFoldingSupported()

bool isTypeFoldingSupported ( unsigned  Opcode)

Definition at line 53 of file SPIRVLegalizerInfo.cpp.

Referenced by processInstrsWithTypeFolding().

◆ processInstrsWithTypeFolding()

static void processInstrsWithTypeFolding ( MachineFunction MF,
SPIRVGlobalRegistry GR,
MachineIRBuilder  MIB 
)
static

◆ processSwitches()

static void processSwitches ( MachineFunction MF,
SPIRVGlobalRegistry GR,
MachineIRBuilder  MIB 
)
static

◆ propagateSPIRVType()

static SPIRVType * propagateSPIRVType ( MachineInstr MI,
SPIRVGlobalRegistry GR,
MachineRegisterInfo MRI,
MachineIRBuilder MIB 
)
static

◆ removeImplicitFallthroughs()

static void removeImplicitFallthroughs ( MachineFunction MF,
MachineIRBuilder  MIB 
)
static

◆ widenScalarLLTNextPow2()

static void widenScalarLLTNextPow2 ( Register  Reg,
MachineRegisterInfo MRI 
)
static