LLVM 22.0.0git
llvm::SIRegisterInfo Class Referencefinal

#include "Target/AMDGPU/SIRegisterInfo.h"

Inheritance diagram for llvm::SIRegisterInfo:
[legend]

Classes

struct  SpilledReg

Public Member Functions

 SIRegisterInfo (const GCNSubtarget &ST)
bool spillSGPRToVGPR () const
MCRegister getAlignedHighSGPRForRC (const MachineFunction &MF, const unsigned Align, const TargetRegisterClass *RC) const
 Return the largest available SGPR aligned to Align for the register class RC.
MCRegister reservedPrivateSegmentBufferReg (const MachineFunction &MF) const
 Return the end register initially reserved for the scratch buffer in case spilling is needed.
BitVector getReservedRegs (const MachineFunction &MF) const override
bool isAsmClobberable (const MachineFunction &MF, MCRegister PhysReg) const override
const MCPhysReggetCalleeSavedRegs (const MachineFunction *MF) const override
const MCPhysReggetCalleeSavedRegsViaCopy (const MachineFunction *MF) const
const uint32_tgetCallPreservedMask (const MachineFunction &MF, CallingConv::ID) const override
const uint32_tgetNoPreservedMask () const override
unsigned getCSRFirstUseCost () const override
void addImplicitUsesForBlockCSRLoad (MachineInstrBuilder &MIB, Register BlockReg) const
const TargetRegisterClassgetLargestLegalSuperClass (const TargetRegisterClass *RC, const MachineFunction &MF) const override
Register getFrameRegister (const MachineFunction &MF) const override
bool hasBasePointer (const MachineFunction &MF) const
Register getBaseRegister () const
bool shouldRealignStack (const MachineFunction &MF) const override
bool requiresRegisterScavenging (const MachineFunction &Fn) const override
bool requiresFrameIndexScavenging (const MachineFunction &MF) const override
bool requiresFrameIndexReplacementScavenging (const MachineFunction &MF) const override
bool requiresVirtualBaseRegisters (const MachineFunction &Fn) const override
int64_t getScratchInstrOffset (const MachineInstr *MI) const
int64_t getFrameIndexInstrOffset (const MachineInstr *MI, int Idx) const override
bool needsFrameBaseReg (MachineInstr *MI, int64_t Offset) const override
Register materializeFrameBaseRegister (MachineBasicBlock *MBB, int FrameIdx, int64_t Offset) const override
void resolveFrameIndex (MachineInstr &MI, Register BaseReg, int64_t Offset) const override
bool isFrameOffsetLegal (const MachineInstr *MI, Register BaseReg, int64_t Offset) const override
const TargetRegisterClassgetPointerRegClass (unsigned Kind=0) const override
const TargetRegisterClassgetCrossCopyRegClass (const TargetRegisterClass *RC) const override
 Returns a legal register class to copy a register in the specified class to or from.
const TargetRegisterClassgetRegClassForBlockOp (const MachineFunction &MF) const
void buildVGPRSpillLoadStore (SGPRSpillBuilder &SB, int Index, int Offset, bool IsLoad, bool IsKill=true) const
bool spillSGPR (MachineBasicBlock::iterator MI, int FI, RegScavenger *RS, SlotIndexes *Indexes=nullptr, LiveIntervals *LIS=nullptr, bool OnlyToVGPR=false, bool SpillToPhysVGPRLane=false) const
 If OnlyToVGPR is true, this will only succeed if this manages to find a free VGPR lane to spill.
bool restoreSGPR (MachineBasicBlock::iterator MI, int FI, RegScavenger *RS, SlotIndexes *Indexes=nullptr, LiveIntervals *LIS=nullptr, bool OnlyToVGPR=false, bool SpillToPhysVGPRLane=false) const
bool spillEmergencySGPR (MachineBasicBlock::iterator MI, MachineBasicBlock &RestoreMBB, Register SGPR, RegScavenger *RS) const
bool eliminateFrameIndex (MachineBasicBlock::iterator MI, int SPAdj, unsigned FIOperandNum, RegScavenger *RS) const override
bool eliminateSGPRToVGPRSpillFrameIndex (MachineBasicBlock::iterator MI, int FI, RegScavenger *RS, SlotIndexes *Indexes=nullptr, LiveIntervals *LIS=nullptr, bool SpillToPhysVGPRLane=false) const
 Special case of eliminateFrameIndex.
StringRef getRegAsmName (MCRegister Reg) const override
unsigned getHWRegIndex (MCRegister Reg) const
LLVM_READONLY const TargetRegisterClassgetVGPRClassForBitWidth (unsigned BitWidth) const
LLVM_READONLY const TargetRegisterClassgetAlignedLo256VGPRClassForBitWidth (unsigned BitWidth) const
LLVM_READONLY const TargetRegisterClassgetAGPRClassForBitWidth (unsigned BitWidth) const
LLVM_READONLY const TargetRegisterClassgetVectorSuperClassForBitWidth (unsigned BitWidth) const
bool isSGPRClassID (unsigned RCID) const
bool isSGPRReg (const MachineRegisterInfo &MRI, Register Reg) const
bool isSGPRPhysReg (Register Reg) const
bool isVGPRPhysReg (Register Reg) const
bool isVectorSuperClass (const TargetRegisterClass *RC) const
bool isVSSuperClass (const TargetRegisterClass *RC) const
const TargetRegisterClassgetEquivalentVGPRClass (const TargetRegisterClass *SRC) const
const TargetRegisterClassgetEquivalentAGPRClass (const TargetRegisterClass *SRC) const
const TargetRegisterClassgetEquivalentSGPRClass (const TargetRegisterClass *VRC) const
const TargetRegisterClassgetCompatibleSubRegClass (const TargetRegisterClass *SuperRC, const TargetRegisterClass *SubRC, unsigned SubIdx) const
 Returns a register class which is compatible with SuperRC, such that a subregister exists with class SubRC with subregister index SubIdx.
bool opCanUseLiteralConstant (unsigned OpType) const
bool opCanUseInlineConstant (unsigned OpType) const
MCRegister findUnusedRegister (const MachineRegisterInfo &MRI, const TargetRegisterClass *RC, const MachineFunction &MF, bool ReserveHighestVGPR=false) const
 Returns a lowest register that is not used at any point in the function.
const TargetRegisterClassgetRegClassForReg (const MachineRegisterInfo &MRI, Register Reg) const
const TargetRegisterClassgetRegClassForOperandReg (const MachineRegisterInfo &MRI, const MachineOperand &MO) const
bool isVGPR (const MachineRegisterInfo &MRI, Register Reg) const
bool isAGPR (const MachineRegisterInfo &MRI, Register Reg) const
bool isVectorRegister (const MachineRegisterInfo &MRI, Register Reg) const
bool isDivergentRegClass (const TargetRegisterClass *RC) const override
bool isUniformReg (const MachineRegisterInfo &MRI, const RegisterBankInfo &RBI, Register Reg) const override
ArrayRef< int16_t > getRegSplitParts (const TargetRegisterClass *RC, unsigned EltSize) const
bool shouldCoalesce (MachineInstr *MI, const TargetRegisterClass *SrcRC, unsigned SubReg, const TargetRegisterClass *DstRC, unsigned DstSubReg, const TargetRegisterClass *NewRC, LiveIntervals &LIS) const override
unsigned getRegPressureLimit (const TargetRegisterClass *RC, MachineFunction &MF) const override
unsigned getRegPressureSetLimit (const MachineFunction &MF, unsigned Idx) const override
bool getRegAllocationHints (Register VirtReg, ArrayRef< MCPhysReg > Order, SmallVectorImpl< MCPhysReg > &Hints, const MachineFunction &MF, const VirtRegMap *VRM, const LiveRegMatrix *Matrix) const override
const int * getRegUnitPressureSets (unsigned RegUnit) const override
MCRegister getReturnAddressReg (const MachineFunction &MF) const
const TargetRegisterClassgetRegClassForSizeOnBank (unsigned Size, const RegisterBank &Bank) const
const TargetRegisterClassgetRegClassForTypeOnBank (LLT Ty, const RegisterBank &Bank) const
const TargetRegisterClassgetConstrainedRegClassForOperand (const MachineOperand &MO, const MachineRegisterInfo &MRI) const override
const TargetRegisterClassgetBoolRC () const
const TargetRegisterClassgetWaveMaskRegClass () const
const TargetRegisterClassgetVGPR64Class () const
MCRegister getVCC () const
MCRegister getExec () const
const TargetRegisterClassgetRegClass (unsigned RCID) const
MachineInstrfindReachingDef (Register Reg, unsigned SubReg, MachineInstr &Use, MachineRegisterInfo &MRI, LiveIntervals *LIS) const
const uint32_tgetAllVGPRRegMask () const
const uint32_tgetAllAGPRRegMask () const
const uint32_tgetAllVectorRegMask () const
const uint32_tgetAllAllocatableSRegMask () const
unsigned getChannelFromSubReg (unsigned SubReg) const
unsigned getNumChannelsFromSubReg (unsigned SubReg) const
MCPhysReg get32BitRegister (MCPhysReg Reg) const
bool isProperlyAlignedRC (const TargetRegisterClass &RC) const
const TargetRegisterClassgetProperlyAlignedRC (const TargetRegisterClass *RC) const
ArrayRef< MCPhysReggetAllSGPR128 (const MachineFunction &MF) const
 Return all SGPR128 which satisfy the waves per execution unit requirement of the subtarget.
ArrayRef< MCPhysReggetAllSGPR64 (const MachineFunction &MF) const
 Return all SGPR64 which satisfy the waves per execution unit requirement of the subtarget.
ArrayRef< MCPhysReggetAllSGPR32 (const MachineFunction &MF) const
 Return all SGPR32 which satisfy the waves per execution unit requirement of the subtarget.
void buildSpillLoadStore (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const DebugLoc &DL, unsigned LoadStoreOp, int Index, Register ValueReg, bool ValueIsKill, MCRegister ScratchOffsetReg, int64_t InstrOffset, MachineMemOperand *MMO, RegScavenger *RS, LiveRegUnits *LiveUnits=nullptr) const
unsigned getRegClassAlignmentNumBits (const TargetRegisterClass *RC) const
bool isRegClassAligned (const TargetRegisterClass *RC, unsigned AlignNumBits) const
unsigned getSubRegAlignmentNumBits (const TargetRegisterClass *RC, unsigned SubReg) const
unsigned getNumUsedPhysRegs (const MachineRegisterInfo &MRI, const TargetRegisterClass &RC, bool IncludeCalls=true) const
std::optional< uint8_tgetVRegFlagValue (StringRef Name) const override
SmallVector< StringLiteralgetVRegFlagsOfReg (Register Reg, const MachineFunction &MF) const override

Static Public Member Functions

static unsigned getSubRegFromChannel (unsigned Channel, unsigned NumRegs=1)
static bool isChainScratchRegister (Register VGPR)
static LLVM_READONLY const TargetRegisterClassgetSGPRClassForBitWidth (unsigned BitWidth)
static bool isSGPRClass (const TargetRegisterClass *RC)
static bool isVGPRClass (const TargetRegisterClass *RC)
static bool isAGPRClass (const TargetRegisterClass *RC)
static bool hasVGPRs (const TargetRegisterClass *RC)
static bool hasAGPRs (const TargetRegisterClass *RC)
static bool hasSGPRs (const TargetRegisterClass *RC)
static bool hasVectorRegisters (const TargetRegisterClass *RC)
static unsigned getNumCoveredRegs (LaneBitmask LM)

Detailed Description

Definition at line 40 of file SIRegisterInfo.h.

Constructor & Destructor Documentation

◆ SIRegisterInfo()

Member Function Documentation

◆ addImplicitUsesForBlockCSRLoad()

◆ buildSpillLoadStore()

void SIRegisterInfo::buildSpillLoadStore ( MachineBasicBlock & MBB,
MachineBasicBlock::iterator MI,
const DebugLoc & DL,
unsigned LoadStoreOp,
int Index,
Register ValueReg,
bool ValueIsKill,
MCRegister ScratchOffsetReg,
int64_t InstrOffset,
MachineMemOperand * MMO,
RegScavenger * RS,
LiveRegUnits * LiveUnits = nullptr ) const

Definition at line 1514 of file SIRegisterInfo.cpp.

References llvm::Add, llvm::MachineInstrBuilder::addImm(), addImplicitUsesForBlockCSRLoad(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::LiveRegUnits::available(), llvm::BuildMI(), llvm::commonAlignment(), llvm::RegState::Define, DL, llvm::SIInstrFlags::FlatScratch, llvm::getDefRegState(), llvm::MachineMemOperand::getFlags(), llvm::AMDGPU::getFlatScratchInstSTfromSS(), llvm::AMDGPU::getFlatScratchInstSVfromSS(), getFlatScratchSpillOpcode(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getInfo(), llvm::getKillRegState(), llvm::MachineFunction::getMachineMemOperand(), llvm::MachineFrameInfo::getObjectAlign(), llvm::MachineFrameInfo::getObjectOffset(), getOffenMUBUFLoad(), getOffenMUBUFStore(), llvm::MachineMemOperand::getPointerInfo(), llvm::AMDGPU::getRegBitWidth(), getRegClassForReg(), llvm::MachineFunction::getRegInfo(), llvm::SIMachineFunctionInfo::getScratchRSrcReg(), llvm::SIMachineFunctionInfo::getStackPtrOffsetReg(), getSubRegFromChannel(), llvm::SIMachineFunctionInfo::getVGPRForAGPRCopy(), llvm::MachinePointerInfo::getWithOffset(), llvm::RegState::Implicit, llvm::RegState::ImplicitDefine, isAGPRClass(), llvm::AMDGPUMachineFunction::isBottomOfStack(), llvm::RegScavenger::isRegUsed(), llvm::MachineRegisterInfo::isReserved(), llvm::RegState::Kill, MBB, MI, llvm::MOLastUse, llvm::Offset, Opc, llvm::AMDGPUAS::PRIVATE_ADDRESS, Register, llvm::MachineInstr::ReloadReuse, llvm::report_fatal_error(), llvm::RegScavenger::scavengeRegisterBackwards(), llvm::MachineInstr::setAsmPrinterFlag(), llvm::RegScavenger::setRegUsed(), Size, spillVGPRtoAGPR(), llvm::Sub, SubReg, llvm::AMDGPU::CPol::TH_LU, and TII.

Referenced by buildVGPRSpillLoadStore(), and eliminateFrameIndex().

◆ buildVGPRSpillLoadStore()

◆ eliminateFrameIndex()

bool SIRegisterInfo::eliminateFrameIndex ( MachineBasicBlock::iterator MI,
int SPAdj,
unsigned FIOperandNum,
RegScavenger * RS ) const
override

Definition at line 2299 of file SIRegisterInfo.cpp.

References AbstractManglingParser< Derived, Alloc >::NumOps, llvm::Add, llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addDef(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::SIMachineFunctionInfo::addToSpilledVGPRs(), assert(), llvm::BuildMI(), buildMUBUFOffsetLoadStore(), buildSpillLoadStore(), llvm::MachineOperand::ChangeToImmediate(), llvm::MachineOperand::ChangeToRegister(), llvm::MachineRegisterInfo::constrainRegClass(), DL, llvm::SIInstrFlags::FlatScratch, getBaseRegister(), llvm::AMDGPU::getFlatScratchInstSTfromSS(), llvm::AMDGPU::getFlatScratchInstSVfromSVS(), llvm::MachineFunction::getFrameInfo(), getFrameRegister(), llvm::MachineOperand::getImm(), llvm::MachineFunction::getInfo(), getNumSubRegsForSpillOp(), llvm::MachineInstr::getOpcode(), llvm::DstOp::getReg(), llvm::MachineInstrBuilder::getReg(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::SIMachineFunctionInfo::getScratchRSrcReg(), llvm::SIMachineFunctionInfo::getSGPRForEXECCopy(), llvm::SIMachineFunctionInfo::getStackPtrOffsetReg(), hasBasePointer(), llvm::AMDGPU::hasNamedOperand(), I, llvm::AMDGPUMachineFunction::isBottomOfStack(), llvm::MachineOperand::isDead(), llvm::MachineOperand::isFI(), llvm::MachineOperand::isImm(), llvm::AMDGPU::isInlinableIntLiteral(), llvm::AMDGPU::isInlinableLiteral32(), llvm::MachineOperand::isKill(), llvm::MachineOperand::isReg(), llvm::RegScavenger::isRegUsed(), llvm::MachineRegisterInfo::isReserved(), isSGPRClass(), llvm::isUInt(), llvm::MachineOperand::isUndef(), llvm::Register::isValid(), isVGPRClass(), llvm::SIInstrInfo::isVOP3(), llvm::RegState::Kill, LLVM_FALLTHROUGH, MBB, MI, llvm::Offset, Opc, llvm::AMDGPUAS::PRIVATE_ADDRESS, llvm::RegState::Renamable, llvm::report_fatal_error(), restoreSGPR(), llvm::RegScavenger::scavengeRegisterBackwards(), llvm::MachineOperand::setImm(), llvm::MachineOperand::setIsKill(), llvm::MachineOperand::setIsRenamable(), llvm::MachineInstrBuilder::setOperandDead(), llvm::MachineOperand::setReg(), spillSGPR(), std::swap(), and TII.

◆ eliminateSGPRToVGPRSpillFrameIndex()

bool SIRegisterInfo::eliminateSGPRToVGPRSpillFrameIndex ( MachineBasicBlock::iterator MI,
int FI,
RegScavenger * RS,
SlotIndexes * Indexes = nullptr,
LiveIntervals * LIS = nullptr,
bool SpillToPhysVGPRLane = false ) const

Special case of eliminateFrameIndex.

Returns true if the SGPR was spilled to a VGPR and the stack slot can be safely eliminated when all other users are handled.

Definition at line 2260 of file SIRegisterInfo.cpp.

References llvm_unreachable, MI, restoreSGPR(), and spillSGPR().

◆ findReachingDef()

◆ findUnusedRegister()

MCRegister SIRegisterInfo::findUnusedRegister ( const MachineRegisterInfo & MRI,
const TargetRegisterClass * RC,
const MachineFunction & MF,
bool ReserveHighestRegister = false ) const

Returns a lowest register that is not used at any point in the function.

If all registers are used, then this function will return AMDGPU::NoRegister. If ReserveHighestRegister = true, then return highest unused register.

Definition at line 3650 of file SIRegisterInfo.cpp.

References MRI, and llvm::reverse().

◆ get32BitRegister()

MCPhysReg SIRegisterInfo::get32BitRegister ( MCPhysReg Reg) const

Definition at line 3967 of file SIRegisterInfo.cpp.

References assert().

◆ getAGPRClassForBitWidth()

const TargetRegisterClass * SIRegisterInfo::getAGPRClassForBitWidth ( unsigned BitWidth) const

◆ getAlignedHighSGPRForRC()

MCRegister SIRegisterInfo::getAlignedHighSGPRForRC ( const MachineFunction & MF,
const unsigned Align,
const TargetRegisterClass * RC ) const

Return the largest available SGPR aligned to Align for the register class RC.

Definition at line 562 of file SIRegisterInfo.cpp.

References llvm::alignDown().

Referenced by reservedPrivateSegmentBufferReg().

◆ getAlignedLo256VGPRClassForBitWidth()

const TargetRegisterClass * SIRegisterInfo::getAlignedLo256VGPRClassForBitWidth ( unsigned BitWidth) const

Definition at line 3361 of file SIRegisterInfo.cpp.

References llvm::BitWidth.

Referenced by getEquivalentVGPRClass().

◆ getAllAGPRRegMask()

const uint32_t * SIRegisterInfo::getAllAGPRRegMask ( ) const

Definition at line 540 of file SIRegisterInfo.cpp.

◆ getAllAllocatableSRegMask()

const uint32_t * SIRegisterInfo::getAllAllocatableSRegMask ( ) const

Definition at line 548 of file SIRegisterInfo.cpp.

◆ getAllSGPR128()

ArrayRef< MCPhysReg > SIRegisterInfo::getAllSGPR128 ( const MachineFunction & MF) const

Return all SGPR128 which satisfy the waves per execution unit requirement of the subtarget.

Definition at line 4024 of file SIRegisterInfo.cpp.

References llvm::ArrayRef().

◆ getAllSGPR32()

ArrayRef< MCPhysReg > SIRegisterInfo::getAllSGPR32 ( const MachineFunction & MF) const

Return all SGPR32 which satisfy the waves per execution unit requirement of the subtarget.

Definition at line 4034 of file SIRegisterInfo.cpp.

References llvm::ArrayRef().

◆ getAllSGPR64()

ArrayRef< MCPhysReg > SIRegisterInfo::getAllSGPR64 ( const MachineFunction & MF) const

Return all SGPR64 which satisfy the waves per execution unit requirement of the subtarget.

Definition at line 4029 of file SIRegisterInfo.cpp.

References llvm::ArrayRef().

◆ getAllVectorRegMask()

const uint32_t * SIRegisterInfo::getAllVectorRegMask ( ) const

Definition at line 544 of file SIRegisterInfo.cpp.

◆ getAllVGPRRegMask()

const uint32_t * SIRegisterInfo::getAllVGPRRegMask ( ) const

Definition at line 536 of file SIRegisterInfo.cpp.

◆ getBaseRegister()

Register SIRegisterInfo::getBaseRegister ( ) const

◆ getBoolRC()

const TargetRegisterClass * llvm::SIRegisterInfo::getBoolRC ( ) const
inline

Definition at line 376 of file SIRegisterInfo.h.

Referenced by llvm::GCNSubtarget::getBoolRC(), and getRegClass().

◆ getCalleeSavedRegs()

◆ getCalleeSavedRegsViaCopy()

const MCPhysReg * SIRegisterInfo::getCalleeSavedRegsViaCopy ( const MachineFunction * MF) const

Definition at line 424 of file SIRegisterInfo.cpp.

◆ getCallPreservedMask()

◆ getChannelFromSubReg()

unsigned llvm::SIRegisterInfo::getChannelFromSubReg ( unsigned SubReg) const
inline

Definition at line 419 of file SIRegisterInfo.h.

References SubReg.

Referenced by expandSGPRCopy().

◆ getCompatibleSubRegClass()

const TargetRegisterClass * SIRegisterInfo::getCompatibleSubRegClass ( const TargetRegisterClass * SuperRC,
const TargetRegisterClass * SubRC,
unsigned SubIdx ) const

Returns a register class which is compatible with SuperRC, such that a subregister exists with class SubRC with subregister index SubIdx.

If this is impossible (e.g., an unaligned subregister index within a register tuple), return null.

Definition at line 3622 of file SIRegisterInfo.cpp.

References llvm::TargetRegisterClass::hasSubClassEq().

◆ getConstrainedRegClassForOperand()

const TargetRegisterClass * SIRegisterInfo::getConstrainedRegClassForOperand ( const MachineOperand & MO,
const MachineRegisterInfo & MRI ) const
override

◆ getCrossCopyRegClass()

const TargetRegisterClass * SIRegisterInfo::getCrossCopyRegClass ( const TargetRegisterClass * RC) const
override

Returns a legal register class to copy a register in the specified class to or from.

If it is possible to copy the register directly without using a cross register class copy, return the specified RC. Returns NULL if it is not possible to copy between two registers of the specified class.

Definition at line 1120 of file SIRegisterInfo.cpp.

References getEquivalentVGPRClass(), getWaveMaskRegClass(), and isAGPRClass().

◆ getCSRFirstUseCost()

unsigned llvm::SIRegisterInfo::getCSRFirstUseCost ( ) const
inlineoverride

Definition at line 110 of file SIRegisterInfo.h.

◆ getEquivalentAGPRClass()

const TargetRegisterClass * SIRegisterInfo::getEquivalentAGPRClass ( const TargetRegisterClass * SRC) const
Returns
An AGPR reg class with the same width as SRC

Definition at line 3604 of file SIRegisterInfo.cpp.

References assert(), getAGPRClassForBitWidth(), and Size.

◆ getEquivalentSGPRClass()

const TargetRegisterClass * SIRegisterInfo::getEquivalentSGPRClass ( const TargetRegisterClass * VRC) const
Returns
A SGPR reg class with the same width as SRC

Definition at line 3612 of file SIRegisterInfo.cpp.

References assert(), getSGPRClassForBitWidth(), and Size.

◆ getEquivalentVGPRClass()

const TargetRegisterClass * SIRegisterInfo::getEquivalentVGPRClass ( const TargetRegisterClass * SRC) const
Returns
A VGPR reg class with the same width as SRC

Definition at line 3586 of file SIRegisterInfo.cpp.

References assert(), getAlignedLo256VGPRClassForBitWidth(), llvm::TargetRegisterClass::getID(), getVGPRClassForBitWidth(), and Size.

Referenced by getCrossCopyRegClass().

◆ getExec()

MCRegister SIRegisterInfo::getExec ( ) const

Definition at line 3889 of file SIRegisterInfo.cpp.

◆ getFrameIndexInstrOffset()

int64_t SIRegisterInfo::getFrameIndexInstrOffset ( const MachineInstr * MI,
int Idx ) const
override

◆ getFrameRegister()

◆ getHWRegIndex()

unsigned SIRegisterInfo::getHWRegIndex ( MCRegister Reg) const

◆ getLargestLegalSuperClass()

const TargetRegisterClass * SIRegisterInfo::getLargestLegalSuperClass ( const TargetRegisterClass * RC,
const MachineFunction & MF ) const
override

◆ getNoPreservedMask()

const uint32_t * SIRegisterInfo::getNoPreservedMask ( ) const
override

Definition at line 450 of file SIRegisterInfo.cpp.

◆ getNumChannelsFromSubReg()

unsigned llvm::SIRegisterInfo::getNumChannelsFromSubReg ( unsigned SubReg) const
inline

Definition at line 424 of file SIRegisterInfo.h.

References getNumCoveredRegs(), and SubReg.

◆ getNumCoveredRegs()

unsigned llvm::SIRegisterInfo::getNumCoveredRegs ( LaneBitmask LM)
inlinestatic

◆ getNumUsedPhysRegs()

unsigned SIRegisterInfo::getNumUsedPhysRegs ( const MachineRegisterInfo & MRI,
const TargetRegisterClass & RC,
bool IncludeCalls = true ) const

◆ getPointerRegClass()

const TargetRegisterClass * SIRegisterInfo::getPointerRegClass ( unsigned Kind = 0) const
override

Definition at line 1112 of file SIRegisterInfo.cpp.

◆ getProperlyAlignedRC()

◆ getRegAllocationHints()

◆ getRegAsmName()

StringRef SIRegisterInfo::getRegAsmName ( MCRegister Reg) const
override

Definition at line 3272 of file SIRegisterInfo.cpp.

References llvm::AMDGPUInstPrinter::getRegisterName().

◆ getRegClass()

const TargetRegisterClass * SIRegisterInfo::getRegClass ( unsigned RCID) const

Definition at line 3900 of file SIRegisterInfo.cpp.

References getBoolRC(), and getWaveMaskRegClass().

Referenced by adjustAllocatableRegClass(), and isSGPRClassID().

◆ getRegClassAlignmentNumBits()

unsigned llvm::SIRegisterInfo::getRegClassAlignmentNumBits ( const TargetRegisterClass * RC) const
inline

◆ getRegClassForBlockOp()

const TargetRegisterClass * llvm::SIRegisterInfo::getRegClassForBlockOp ( const MachineFunction & MF) const
inline

◆ getRegClassForOperandReg()

const TargetRegisterClass * SIRegisterInfo::getRegClassForOperandReg ( const MachineRegisterInfo & MRI,
const MachineOperand & MO ) const

◆ getRegClassForReg()

const TargetRegisterClass * SIRegisterInfo::getRegClassForReg ( const MachineRegisterInfo & MRI,
Register Reg ) const

Definition at line 3691 of file SIRegisterInfo.cpp.

References MRI.

Referenced by buildSpillLoadStore(), getRegClassForOperandReg(), isAGPR(), and isVGPR().

◆ getRegClassForSizeOnBank()

◆ getRegClassForTypeOnBank()

const TargetRegisterClass * llvm::SIRegisterInfo::getRegClassForTypeOnBank ( LLT Ty,
const RegisterBank & Bank ) const
inline

Definition at line 368 of file SIRegisterInfo.h.

References getRegClassForSizeOnBank().

Referenced by getConstrainedRegClassForOperand().

◆ getRegPressureLimit()

◆ getRegPressureSetLimit()

unsigned SIRegisterInfo::getRegPressureSetLimit ( const MachineFunction & MF,
unsigned Idx ) const
override

Definition at line 3757 of file SIRegisterInfo.cpp.

References getRegPressureLimit(), and llvm_unreachable.

◆ getRegSplitParts()

ArrayRef< int16_t > SIRegisterInfo::getRegSplitParts ( const TargetRegisterClass * RC,
unsigned EltSize ) const

Definition at line 3675 of file SIRegisterInfo.cpp.

References llvm::ArrayRef(), assert(), and llvm::AMDGPU::getRegBitWidth().

Referenced by expandSGPRCopy().

◆ getRegUnitPressureSets()

const int * SIRegisterInfo::getRegUnitPressureSets ( unsigned RegUnit) const
override

Definition at line 3772 of file SIRegisterInfo.cpp.

References DenseMapInfo< LocallyHashedType >::Empty.

◆ getReservedRegs()

◆ getReturnAddressReg()

MCRegister SIRegisterInfo::getReturnAddressReg ( const MachineFunction & MF) const

Definition at line 3848 of file SIRegisterInfo.cpp.

◆ getScratchInstrOffset()

int64_t SIRegisterInfo::getScratchInstrOffset ( const MachineInstr * MI) const

◆ getSGPRClassForBitWidth()

◆ getSubRegAlignmentNumBits()

unsigned SIRegisterInfo::getSubRegAlignmentNumBits ( const TargetRegisterClass * RC,
unsigned SubReg ) const

◆ getSubRegFromChannel()

unsigned SIRegisterInfo::getSubRegFromChannel ( unsigned Channel,
unsigned NumRegs = 1 )
static
Returns
the sub reg enum value for the given Channel (e.g. getSubRegFromChannel(0) -> AMDGPU::sub0)

Definition at line 552 of file SIRegisterInfo.cpp.

References assert(), llvm::size(), and SubRegFromChannelTableWidthMap.

Referenced by llvm::SITargetLowering::AddMemOpInit(), buildRegSequence(), buildRegSequence32(), buildSpillLoadStore(), computeIndirectRegAndOffset(), expandSGPRCopy(), and llvm::AMDGPUDAGToDAGISel::SelectBuildVector().

◆ getVCC()

MCRegister SIRegisterInfo::getVCC ( ) const

Definition at line 3885 of file SIRegisterInfo.cpp.

◆ getVectorSuperClassForBitWidth()

const TargetRegisterClass * SIRegisterInfo::getVectorSuperClassForBitWidth ( unsigned BitWidth) const

◆ getVGPR64Class()

const TargetRegisterClass * SIRegisterInfo::getVGPR64Class ( ) const

Definition at line 3893 of file SIRegisterInfo.cpp.

◆ getVGPRClassForBitWidth()

const TargetRegisterClass * SIRegisterInfo::getVGPRClassForBitWidth ( unsigned BitWidth) const

◆ getVRegFlagsOfReg()

◆ getVRegFlagValue()

std::optional< uint8_t > llvm::SIRegisterInfo::getVRegFlagValue ( StringRef Name) const
inlineoverride

Definition at line 491 of file SIRegisterInfo.h.

References llvm::AMDGPU::VirtRegFlag::WWM_REG.

◆ getWaveMaskRegClass()

const TargetRegisterClass * llvm::SIRegisterInfo::getWaveMaskRegClass ( ) const
inline

Definition at line 381 of file SIRegisterInfo.h.

Referenced by getCrossCopyRegClass(), getRegClass(), and getRegClassForSizeOnBank().

◆ hasAGPRs()

bool llvm::SIRegisterInfo::hasAGPRs ( const TargetRegisterClass * RC)
inlinestatic
Returns
true if this class contains AGPR registers.

Definition at line 266 of file SIRegisterInfo.h.

References llvm::HasAGPR, and llvm::TargetRegisterClass::TSFlags.

Referenced by hasVectorRegisters(), isAGPRClass(), isSGPRClass(), isVectorSuperClass(), isVGPRClass(), and isVSSuperClass().

◆ hasBasePointer()

bool SIRegisterInfo::hasBasePointer ( const MachineFunction & MF) const

◆ hasSGPRs()

bool llvm::SIRegisterInfo::hasSGPRs ( const TargetRegisterClass * RC)
inlinestatic
Returns
true if this class contains SGPR registers.

Definition at line 271 of file SIRegisterInfo.h.

References llvm::HasSGPR, and llvm::TargetRegisterClass::TSFlags.

Referenced by isAGPRClass(), isSGPRClass(), isVectorSuperClass(), isVGPRClass(), and isVSSuperClass().

◆ hasVectorRegisters()

bool llvm::SIRegisterInfo::hasVectorRegisters ( const TargetRegisterClass * RC)
inlinestatic
Returns
true if this class contains any vector registers.

Definition at line 276 of file SIRegisterInfo.h.

References hasAGPRs(), and hasVGPRs().

◆ hasVGPRs()

bool llvm::SIRegisterInfo::hasVGPRs ( const TargetRegisterClass * RC)
inlinestatic
Returns
true if this class contains VGPR registers.

Definition at line 261 of file SIRegisterInfo.h.

References llvm::HasVGPR, and llvm::TargetRegisterClass::TSFlags.

Referenced by hasVectorRegisters(), isAGPRClass(), isSGPRClass(), isVectorSuperClass(), isVGPRClass(), and isVSSuperClass().

◆ isAGPR()

bool SIRegisterInfo::isAGPR ( const MachineRegisterInfo & MRI,
Register Reg ) const

Definition at line 3710 of file SIRegisterInfo.cpp.

References getRegClassForReg(), isAGPRClass(), and MRI.

Referenced by isVectorRegister().

◆ isAGPRClass()

◆ isAsmClobberable()

bool SIRegisterInfo::isAsmClobberable ( const MachineFunction & MF,
MCRegister PhysReg ) const
override

◆ isChainScratchRegister()

bool SIRegisterInfo::isChainScratchRegister ( Register VGPR)
static

Definition at line 454 of file SIRegisterInfo.cpp.

Referenced by llvm::SIMachineFunctionInfo::allocateWWMSpill().

◆ isDivergentRegClass()

bool llvm::SIRegisterInfo::isDivergentRegClass ( const TargetRegisterClass * RC) const
inlineoverride

Definition at line 331 of file SIRegisterInfo.h.

References isSGPRClass().

◆ isFrameOffsetLegal()

◆ isProperlyAlignedRC()

◆ isRegClassAligned()

bool llvm::SIRegisterInfo::isRegClassAligned ( const TargetRegisterClass * RC,
unsigned AlignNumBits ) const
inline

Definition at line 471 of file SIRegisterInfo.h.

References assert(), and getRegClassAlignmentNumBits().

◆ isSGPRClass()

◆ isSGPRClassID()

bool llvm::SIRegisterInfo::isSGPRClassID ( unsigned RCID) const
inline
Returns
true if this class ID contains only SGPR registers

Definition at line 227 of file SIRegisterInfo.h.

References getRegClass(), and isSGPRClass().

◆ isSGPRPhysReg()

bool llvm::SIRegisterInfo::isSGPRPhysReg ( Register Reg) const
inline

Definition at line 232 of file SIRegisterInfo.h.

References isSGPRClass(), and Reg.

◆ isSGPRReg()

bool SIRegisterInfo::isSGPRReg ( const MachineRegisterInfo & MRI,
Register Reg ) const

Definition at line 3575 of file SIRegisterInfo.cpp.

References isSGPRClass(), and MRI.

Referenced by resolveFrameIndex().

◆ isUniformReg()

bool SIRegisterInfo::isUniformReg ( const MachineRegisterInfo & MRI,
const RegisterBankInfo & RBI,
Register Reg ) const
override

◆ isVectorRegister()

bool llvm::SIRegisterInfo::isVectorRegister ( const MachineRegisterInfo & MRI,
Register Reg ) const
inline

Definition at line 323 of file SIRegisterInfo.h.

References isAGPR(), isVGPR(), MRI, and Reg.

◆ isVectorSuperClass()

bool llvm::SIRegisterInfo::isVectorSuperClass ( const TargetRegisterClass * RC) const
inline
Returns
true only if this class contains both VGPR and AGPR registers

Definition at line 251 of file SIRegisterInfo.h.

References hasAGPRs(), hasSGPRs(), and hasVGPRs().

Referenced by getProperlyAlignedRC(), and isProperlyAlignedRC().

◆ isVGPR()

bool SIRegisterInfo::isVGPR ( const MachineRegisterInfo & MRI,
Register Reg ) const

Definition at line 3703 of file SIRegisterInfo.cpp.

References getRegClassForReg(), isVGPRClass(), and MRI.

Referenced by isVectorRegister().

◆ isVGPRClass()

bool llvm::SIRegisterInfo::isVGPRClass ( const TargetRegisterClass * RC)
inlinestatic

◆ isVGPRPhysReg()

bool llvm::SIRegisterInfo::isVGPRPhysReg ( Register Reg) const
inline

Definition at line 236 of file SIRegisterInfo.h.

References isVGPRClass(), and Reg.

◆ isVSSuperClass()

bool llvm::SIRegisterInfo::isVSSuperClass ( const TargetRegisterClass * RC) const
inline
Returns
true only if this class contains both VGPR and SGPR registers

Definition at line 256 of file SIRegisterInfo.h.

References hasAGPRs(), hasSGPRs(), and hasVGPRs().

◆ materializeFrameBaseRegister()

◆ needsFrameBaseReg()

◆ opCanUseInlineConstant()

bool SIRegisterInfo::opCanUseInlineConstant ( unsigned OpType) const
Returns
True if operands defined with this operand type can accept an inline constant. i.e. An integer value in the range (-16, 64) or -4.0f, -2.0f, -1.0f, -0.5f, 0.0f, 0.5f, 1.0f, 2.0f, 4.0f.

Definition at line 3631 of file SIRegisterInfo.cpp.

References llvm::AMDGPU::OPERAND_REG_INLINE_AC_FIRST, llvm::AMDGPU::OPERAND_REG_INLINE_AC_LAST, llvm::AMDGPU::OPERAND_SRC_FIRST, and llvm::AMDGPU::OPERAND_SRC_LAST.

◆ opCanUseLiteralConstant()

bool SIRegisterInfo::opCanUseLiteralConstant ( unsigned OpType) const
Returns
True if operands defined with this operand type can accept a literal constant (i.e. any 32-bit immediate).

Definition at line 3640 of file SIRegisterInfo.cpp.

References llvm::AMDGPU::OPERAND_REG_IMM_FIRST, and llvm::AMDGPU::OPERAND_REG_IMM_LAST.

◆ requiresFrameIndexReplacementScavenging()

bool SIRegisterInfo::requiresFrameIndexReplacementScavenging ( const MachineFunction & MF) const
override

◆ requiresFrameIndexScavenging()

bool SIRegisterInfo::requiresFrameIndexScavenging ( const MachineFunction & MF) const
override

Definition at line 775 of file SIRegisterInfo.cpp.

◆ requiresRegisterScavenging()

◆ requiresVirtualBaseRegisters()

bool SIRegisterInfo::requiresVirtualBaseRegisters ( const MachineFunction & Fn) const
override

Definition at line 790 of file SIRegisterInfo.cpp.

◆ reservedPrivateSegmentBufferReg()

MCRegister SIRegisterInfo::reservedPrivateSegmentBufferReg ( const MachineFunction & MF) const

Return the end register initially reserved for the scratch buffer in case spilling is needed.

Definition at line 570 of file SIRegisterInfo.cpp.

References getAlignedHighSGPRForRC().

◆ resolveFrameIndex()

◆ restoreSGPR()

◆ shouldCoalesce()

bool SIRegisterInfo::shouldCoalesce ( MachineInstr * MI,
const TargetRegisterClass * SrcRC,
unsigned SubReg,
const TargetRegisterClass * DstRC,
unsigned DstSubReg,
const TargetRegisterClass * NewRC,
LiveIntervals & LIS ) const
override

Definition at line 3718 of file SIRegisterInfo.cpp.

References MI, and SubReg.

◆ shouldRealignStack()

bool SIRegisterInfo::shouldRealignStack ( const MachineFunction & MF) const
override

◆ spillEmergencySGPR()

◆ spillSGPR()

bool SIRegisterInfo::spillSGPR ( MachineBasicBlock::iterator MI,
int FI,
RegScavenger * RS,
SlotIndexes * Indexes = nullptr,
LiveIntervals * LIS = nullptr,
bool OnlyToVGPR = false,
bool SpillToPhysVGPRLane = false ) const

◆ spillSGPRToVGPR()

bool llvm::SIRegisterInfo::spillSGPRToVGPR ( ) const
inline

Definition at line 79 of file SIRegisterInfo.h.


The documentation for this class was generated from the following files: