LLVM 24.0.0git
SIRegisterInfo.cpp File Reference

SI implementation of the TargetRegisterInfo class. More...

Go to the source code of this file.

Classes

struct  llvm::SGPRSpillBuilder
struct  llvm::SGPRSpillBuilder::PerVGPRData

Namespaces

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

Macros

#define DEBUG_TYPE   "amdgpu-si-register-info"
#define GET_REGINFO_TARGET_DESC

Functions

static void emitUnsupportedError (const Function &Fn, const MachineInstr &MI, const Twine &ErrMsg)
static bool isFIPlusImmOrVGPR (const SIRegisterInfo &TRI, const MachineInstr &MI)
static unsigned getNumSubRegsForSpillOp (const MachineInstr &MI, const SIInstrInfo *TII)
static int getOffsetMUBUFStore (unsigned Opc)
static int getOffsetMUBUFLoad (unsigned Opc)
static int getOffenMUBUFStore (unsigned Opc)
static int getOffenMUBUFLoad (unsigned Opc)
static MachineInstrBuilder spillVGPRtoAGPR (const GCNSubtarget &ST, MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, int Index, unsigned Lane, unsigned ValueReg, bool IsKill, bool NeedsCFI)
static bool buildMUBUFOffsetLoadStore (const GCNSubtarget &ST, MachineFrameInfo &MFI, MachineBasicBlock::iterator MI, int Index, int64_t Offset)
static unsigned getFlatScratchSpillOpcode (const SIInstrInfo *TII, unsigned LoadStoreOp, unsigned EltSize)
static bool wrapsAround32 (int64_t LHS, int64_t RHS)
static bool foldingOffsetChangesCarry (const MachineOperand &OtherOp, int64_t Offset, Register FrameReg)
static bool isSCCLiveInto (const RegScavenger &RS, const MachineInstr &MI)
static const TargetRegisterClass * getAnyVGPRClassForBitWidth (unsigned BitWidth)
static const TargetRegisterClass * getAlignedVGPRClassForBitWidth (unsigned BitWidth)
static const TargetRegisterClass * getAnyAGPRClassForBitWidth (unsigned BitWidth)
static const TargetRegisterClass * getAlignedAGPRClassForBitWidth (unsigned BitWidth)
static const TargetRegisterClass * getAnyVectorSuperClassForBitWidth (unsigned BitWidth)
static const TargetRegisterClass * getAlignedVectorSuperClassForBitWidth (unsigned BitWidth)

Variables

static cl::opt< bool > EnableSpillSGPRToVGPR ("amdgpu-spill-sgpr-to-vgpr", cl::desc("Enable spilling SGPRs to VGPRs"), cl::ReallyHidden, cl::init(true))
static cl::opt< bool > EnableSpillCFISavedRegs ("amdgpu-spill-cfi-saved-regs", cl::desc("Enable spilling the registers required for CFI emission"), cl::ReallyHidden, cl::init(false))
static cl::opt< unsigned > StressVGPRLimit ("amdgpu-stress-vgpr", cl::Hidden, cl::init(0), cl::desc("Limit VGPRs to N registers by reserving the rest"))
static cl::opt< unsigned > StressAGPRLimit ("amdgpu-stress-agpr", cl::Hidden, cl::init(0), cl::desc("Limit AGPRs to N registers by reserving the rest"))
static cl::opt< unsigned > StressSGPRLimit ("amdgpu-stress-sgpr", cl::Hidden, cl::init(0), cl::desc("Limit SGPRs to N registers by reserving the rest"))
static const std::array< unsigned, 17 > SubRegFromChannelTableWidthMap

Detailed Description

SI implementation of the TargetRegisterInfo class.

Definition in file SIRegisterInfo.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "amdgpu-si-register-info"

Definition at line 28 of file SIRegisterInfo.cpp.

◆ GET_REGINFO_TARGET_DESC

#define GET_REGINFO_TARGET_DESC

Definition at line 32 of file SIRegisterInfo.cpp.

Function Documentation

◆ buildMUBUFOffsetLoadStore()

◆ emitUnsupportedError()

void emitUnsupportedError ( const Function & Fn,
const MachineInstr & MI,
const Twine & ErrMsg )
static

◆ foldingOffsetChangesCarry()

bool foldingOffsetChangesCarry ( const MachineOperand & OtherOp,
int64_t Offset,
Register FrameReg )
static

◆ getAlignedAGPRClassForBitWidth()

const TargetRegisterClass * getAlignedAGPRClassForBitWidth ( unsigned BitWidth)
static

Definition at line 3879 of file SIRegisterInfo.cpp.

References llvm::BitWidth.

Referenced by llvm::SIRegisterInfo::getAGPRClassForBitWidth().

◆ getAlignedVectorSuperClassForBitWidth()

const TargetRegisterClass * getAlignedVectorSuperClassForBitWidth ( unsigned BitWidth)
static

Definition at line 3953 of file SIRegisterInfo.cpp.

References llvm::BitWidth.

Referenced by llvm::SIRegisterInfo::getVectorSuperClassForBitWidth().

◆ getAlignedVGPRClassForBitWidth()

const TargetRegisterClass * getAlignedVGPRClassForBitWidth ( unsigned BitWidth)
static

Definition at line 3769 of file SIRegisterInfo.cpp.

References llvm::BitWidth.

Referenced by llvm::SIRegisterInfo::getVGPRClassForBitWidth().

◆ getAnyAGPRClassForBitWidth()

const TargetRegisterClass * getAnyAGPRClassForBitWidth ( unsigned BitWidth)
static

Definition at line 3847 of file SIRegisterInfo.cpp.

References llvm::BitWidth.

Referenced by llvm::SIRegisterInfo::getAGPRClassForBitWidth().

◆ getAnyVectorSuperClassForBitWidth()

const TargetRegisterClass * getAnyVectorSuperClassForBitWidth ( unsigned BitWidth)
static

Definition at line 3921 of file SIRegisterInfo.cpp.

References llvm::BitWidth.

Referenced by llvm::SIRegisterInfo::getVectorSuperClassForBitWidth().

◆ getAnyVGPRClassForBitWidth()

const TargetRegisterClass * getAnyVGPRClassForBitWidth ( unsigned BitWidth)
static

Definition at line 3737 of file SIRegisterInfo.cpp.

References llvm::BitWidth.

Referenced by llvm::SIRegisterInfo::getVGPRClassForBitWidth().

◆ getFlatScratchSpillOpcode()

◆ getNumSubRegsForSpillOp()

unsigned getNumSubRegsForSpillOp ( const MachineInstr & MI,
const SIInstrInfo * TII )
static

◆ getOffenMUBUFLoad()

int getOffenMUBUFLoad ( unsigned Opc)
static

Definition at line 1424 of file SIRegisterInfo.cpp.

References Opc.

Referenced by llvm::SIRegisterInfo::buildSpillLoadStore().

◆ getOffenMUBUFStore()

int getOffenMUBUFStore ( unsigned Opc)
static

Definition at line 1401 of file SIRegisterInfo.cpp.

References Opc.

Referenced by llvm::SIRegisterInfo::buildSpillLoadStore().

◆ getOffsetMUBUFLoad()

int getOffsetMUBUFLoad ( unsigned Opc)
static

Definition at line 1366 of file SIRegisterInfo.cpp.

References Opc.

Referenced by buildMUBUFOffsetLoadStore().

◆ getOffsetMUBUFStore()

int getOffsetMUBUFStore ( unsigned Opc)
static

Definition at line 1343 of file SIRegisterInfo.cpp.

References Opc.

Referenced by buildMUBUFOffsetLoadStore().

◆ isFIPlusImmOrVGPR()

◆ isSCCLiveInto()

bool isSCCLiveInto ( const RegScavenger & RS,
const MachineInstr & MI )
static

Definition at line 2551 of file SIRegisterInfo.cpp.

References MI.

Referenced by llvm::SIRegisterInfo::eliminateFrameIndex().

◆ spillVGPRtoAGPR()

◆ wrapsAround32()

bool wrapsAround32 ( int64_t LHS,
int64_t RHS )
static

Definition at line 2536 of file SIRegisterInfo.cpp.

References LHS, RHS, and uint64_t.

Referenced by foldingOffsetChangesCarry().

Variable Documentation

◆ EnableSpillCFISavedRegs

cl::opt< bool > EnableSpillCFISavedRegs("amdgpu-spill-cfi-saved-regs", cl::desc("Enable spilling the registers required for CFI emission"), cl::ReallyHidden, cl::init(false)) ( "amdgpu-spill-cfi-saved-regs" ,
cl::desc("Enable spilling the registers required for CFI emission") ,
cl::ReallyHidden ,
cl::init(false)  )
static

◆ EnableSpillSGPRToVGPR

cl::opt< bool > EnableSpillSGPRToVGPR("amdgpu-spill-sgpr-to-vgpr", cl::desc("Enable spilling SGPRs to VGPRs"), cl::ReallyHidden, cl::init(true)) ( "amdgpu-spill-sgpr-to-vgpr" ,
cl::desc("Enable spilling SGPRs to VGPRs") ,
cl::ReallyHidden ,
cl::init(true)  )
static

◆ StressAGPRLimit

cl::opt< unsigned > StressAGPRLimit("amdgpu-stress-agpr", cl::Hidden, cl::init(0), cl::desc("Limit AGPRs to N registers by reserving the rest")) ( "amdgpu-stress-agpr" ,
cl::Hidden ,
cl::init(0) ,
cl::desc("Limit AGPRs to N registers by reserving the rest")  )
static

◆ StressSGPRLimit

cl::opt< unsigned > StressSGPRLimit("amdgpu-stress-sgpr", cl::Hidden, cl::init(0), cl::desc("Limit SGPRs to N registers by reserving the rest")) ( "amdgpu-stress-sgpr" ,
cl::Hidden ,
cl::init(0) ,
cl::desc("Limit SGPRs to N registers by reserving the rest")  )
static

◆ StressVGPRLimit

cl::opt< unsigned > StressVGPRLimit("amdgpu-stress-vgpr", cl::Hidden, cl::init(0), cl::desc("Limit VGPRs to N registers by reserving the rest")) ( "amdgpu-stress-vgpr" ,
cl::Hidden ,
cl::init(0) ,
cl::desc("Limit VGPRs to N registers by reserving the rest")  )
static

◆ SubRegFromChannelTableWidthMap

const std::array<unsigned, 17> SubRegFromChannelTableWidthMap
static
Initial value:
= {
0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 0, 0, 0, 0, 0, 0, 9}

Definition at line 65 of file SIRegisterInfo.cpp.

Referenced by llvm::SIRegisterInfo::getSubRegFromChannel(), and llvm::SIRegisterInfo::SIRegisterInfo().