LLVM: llvm::SIRegisterInfo Class Reference (original) (raw)
#include "[Target/AMDGPU/SIRegisterInfo.h](SIRegisterInfo%5F8h%5Fsource.html)"
| Static Public Member Functions | |
|---|---|
| static unsigned | getSubRegFromChannel (unsigned Channel, unsigned NumRegs=1) |
| static bool | isChainScratchRegister (Register VGPR) |
| static LLVM_READONLY const TargetRegisterClass * | getSGPRClassForBitWidth (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) |
Definition at line 40 of file SIRegisterInfo.h.
◆ 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 1512 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::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::MachineInstr::setAsmPrinterFlag(), Size, spillVGPRtoAGPR(), llvm::Sub, SubReg, llvm::AMDGPU::CPol::TH_LU, and TII.
Referenced by buildVGPRSpillLoadStore(), and eliminateFrameIndex().
◆ buildVGPRSpillLoadStore()
| void SIRegisterInfo::buildVGPRSpillLoadStore | ( | SGPRSpillBuilder & | SB, |
|---|---|---|---|
| int | Index, | ||
| int | Offset, | ||
| bool | IsLoad, | ||
| bool | IsKill = true ) const |
Definition at line 1964 of file SIRegisterInfo.cpp.
References llvm::SIMachineFunctionInfo::addToSpilledVGPRs(), assert(), buildSpillLoadStore(), llvm::SGPRSpillBuilder::DL, llvm::SGPRSpillBuilder::EltSize, getBaseRegister(), llvm::MachinePointerInfo::getFixedStack(), llvm::MachineFunction::getFrameInfo(), getFrameRegister(), llvm::MachineFunction::getMachineMemOperand(), llvm::MachineFrameInfo::getObjectAlign(), llvm::MachineFrameInfo::getStackID(), hasBasePointer(), llvm::MachineFrameInfo::isFixedObjectIndex(), llvm::SGPRSpillBuilder::MBB, llvm::SGPRSpillBuilder::MF, llvm::SGPRSpillBuilder::MFI, llvm::SGPRSpillBuilder::MI, llvm::MachineMemOperand::MOLoad, llvm::MachineMemOperand::MOStore, llvm::Offset, Opc, llvm::SGPRSpillBuilder::RS, llvm::TargetStackID::SGPRSpill, and llvm::SGPRSpillBuilder::TmpVGPR.
◆ eliminateFrameIndex()
Definition at line 2321 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(), 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::Register::isPhysical(), llvm::MachineOperand::isReg(), llvm::MachineRegisterInfo::isReserved(), isSGPRClass(), llvm::isUInt(), llvm::MachineOperand::isUndef(), llvm::Register::isValid(), isVGPRClass(), llvm::SIInstrInfo::isVOP3(), llvm::RegState::Kill, MBB, MI, llvm::Offset, Opc, llvm::AMDGPUAS::PRIVATE_ADDRESS, llvm::RegState::Renamable, llvm::report_fatal_error(), restoreSGPR(), llvm::MachineOperand::setImm(), llvm::MachineOperand::setIsKill(), llvm::MachineOperand::setIsRenamable(), llvm::MachineInstrBuilder::setOperandDead(), llvm::MachineOperand::setReg(), spillSGPR(), std::swap(), and TII.
◆ eliminateSGPRToVGPRSpillFrameIndex()
◆ findReachingDef()
Definition at line 3919 of file SIRegisterInfo.cpp.
References assert(), llvm::LiveIntervals::getDomTree(), llvm::LiveIntervals::getInstructionFromIndex(), llvm::LiveIntervals::getInstructionIndex(), llvm::LiveIntervals::getInterval(), llvm::LiveIntervals::getRegUnit(), llvm::LiveRange::getVNInfoAt(), llvm::LiveIntervals::hasInterval(), llvm::LiveInterval::hasSubRanges(), llvm::SlotIndex::isValid(), MRI, llvm::LiveInterval::subranges(), and SubReg.
◆ findUnusedRegister()
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 3690 of file SIRegisterInfo.cpp.
References MRI, and llvm::reverse().
◆ get32BitRegister()
◆ getAGPRClassForBitWidth()
◆ getAlignedHighSGPRForRC()
◆ getAlignedLo256VGPRClassForBitWidth()
◆ getAllAGPRRegMask()
◆ getAllAllocatableSRegMask()
| const uint32_t * SIRegisterInfo::getAllAllocatableSRegMask | ( | ) | const |
|---|
◆ getAllSGPR128()
◆ getAllSGPR32()
◆ getAllSGPR64()
◆ getAllVectorRegMask()
◆ getAllVGPRRegMask()
◆ getBaseRegister()
| Register SIRegisterInfo::getBaseRegister | ( | ) | const |
|---|
◆ getBoolRC()
◆ getCalleeSavedRegs()
◆ getCalleeSavedRegsViaCopy()
◆ getCallPreservedMask()
◆ getChannelFromSubReg()
| unsigned llvm::SIRegisterInfo::getChannelFromSubReg ( unsigned SubReg) const | inline |
|---|
◆ getCompatibleSubRegClass()
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 3662 of file SIRegisterInfo.cpp.
References llvm::TargetRegisterClass::hasSubClassEq().
◆ getConstrainedRegClassForOperand()
◆ getCrossCopyRegClass()
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 1123 of file SIRegisterInfo.cpp.
◆ getCSRFirstUseCost()
| unsigned llvm::SIRegisterInfo::getCSRFirstUseCost ( ) const | inlineoverride |
|---|
◆ getDefaultVectorSuperClassForBitWidth()
◆ getEquivalentAGPRClass()
◆ getEquivalentAVClass()
◆ getEquivalentSGPRClass()
◆ getEquivalentVGPRClass()
◆ getExec()
◆ getFrameIndexInstrOffset()
| int64_t SIRegisterInfo::getFrameIndexInstrOffset ( const MachineInstr * MI, int Idx ) const | override |
|---|
◆ getFrameRegister()
◆ getHWRegIndex()
◆ getLargestLegalSuperClass()
◆ getNoPreservedMask()
| const uint32_t * SIRegisterInfo::getNoPreservedMask ( ) const | override |
|---|
◆ getNumChannelsFromSubReg()
| unsigned llvm::SIRegisterInfo::getNumChannelsFromSubReg ( unsigned SubReg) const | inline |
|---|
◆ getNumCoveredRegs()
◆ getNumUsedPhysRegs()
◆ getPointerRegClass()
◆ getRegAllocationHints()
Definition at line 3800 of file SIRegisterInfo.cpp.
References assert(), contains(), llvm::VirtRegMap::getPhys(), llvm::TargetRegisterInfo::getRegAllocationHints(), llvm::MachineFunction::getRegInfo(), llvm::VirtRegMap::hasPhys(), llvm::AMDGPU::isHi16Reg(), llvm::Register::isPhysical(), Matrix, MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), SIRegisterInfo(), llvm::AMDGPURI::Size16, llvm::AMDGPURI::Size32, and TRI.
◆ getRegAsmName()
◆ getRegClassAlignmentNumBits()
◆ getRegClassForBlockOp()
◆ getRegClassForOperandReg()
◆ getRegClassForReg()
◆ getRegClassForSizeOnBank()
◆ getRegClassForTypeOnBank()
◆ getRegPressureLimit()
◆ getRegPressureSetLimit()
◆ getRegSplitParts()
◆ getRegUnitPressureSets()
| const int * SIRegisterInfo::getRegUnitPressureSets ( MCRegUnit RegUnit) const | override |
|---|
◆ getReservedRegs()
Definition at line 578 of file SIRegisterInfo.cpp.
References assert(), llvm::divideCeil(), llvm::BitVector::empty(), llvm::SIMachineFunctionInfo::getAGPRSpillVGPRs(), getBaseRegister(), llvm::SIMachineFunctionInfo::getFrameOffsetReg(), llvm::MachineFunction::getFunction(), getHWRegIndex(), llvm::MachineFunction::getInfo(), llvm::SIMachineFunctionInfo::getLongBranchReservedReg(), llvm::SIMachineFunctionInfo::getNonWWMRegMask(), llvm::SIMachineFunctionInfo::getScratchRSrcReg(), llvm::SIMachineFunctionInfo::getSGPRForEXECCopy(), llvm::SIMachineFunctionInfo::getStackPtrOffsetReg(), llvm::SIMachineFunctionInfo::getVGPRForAGPRCopy(), llvm::SIMachineFunctionInfo::getVGPRSpillAGPRs(), llvm::SIMachineFunctionInfo::getWWMReservedRegs(), hasBasePointer(), isAGPRClass(), isSGPRClass(), isVGPRClass(), llvm::Reserved, and llvm::BitVector::test().
◆ getReturnAddressReg()
◆ getScratchInstrOffset()
◆ getSGPRClassForBitWidth()
◆ getSpillWeightScaleFactor()
◆ getSubRegAlignmentNumBits()
◆ getSubRegFromChannel()
◆ getVCC()
◆ getVectorSuperClassForBitWidth()
◆ getVGPR64Class()
◆ getVGPRClassForBitWidth()
◆ getVRegFlagsOfReg()
◆ getVRegFlagValue()
| std::optional< uint8_t > llvm::SIRegisterInfo::getVRegFlagValue ( StringRef Name) const | inlineoverride |
|---|
◆ getWaveMaskRegClass()
◆ hasAGPRs()
◆ hasBasePointer()
◆ hasSGPRs()
◆ hasVectorRegisters()
◆ hasVGPRs()
◆ isAGPR()
◆ isAGPRClass()
◆ isAsmClobberable()
◆ isChainScratchRegister()
| bool SIRegisterInfo::isChainScratchRegister ( Register VGPR) | static |
|---|
◆ isDivergentRegClass()
◆ isFrameOffsetLegal()
◆ isProperlyAlignedRC()
◆ isRegClassAligned()
◆ isSGPRClass()
Returns
true if this class contains only SGPR registers
Definition at line 226 of file SIRegisterInfo.h.
References hasAGPRs(), hasSGPRs(), and hasVGPRs().
Referenced by eliminateFrameIndex(), llvm::SITargetLowering::getRegForInlineAsmConstraint(), getReservedRegs(), isDivergentRegClass(), llvm::GCNRPTarget::isSaveBeneficial(), isSGPRClassID(), isSGPRPhysReg(), isSGPRReg(), and llvm::SITargetLowering::requiresUniformRegister().
◆ isSGPRClassID()
| bool llvm::SIRegisterInfo::isSGPRClassID ( unsigned RCID) const | inline |
|---|
◆ isSGPRPhysReg()
| bool llvm::SIRegisterInfo::isSGPRPhysReg ( Register Reg) const | inline |
|---|
◆ isSGPRReg()
◆ isUniformReg()
◆ isVectorRegister()
◆ isVectorSuperClass()
◆ isVGPR()
◆ isVGPRClass()
◆ isVGPRPhysReg()
| bool llvm::SIRegisterInfo::isVGPRPhysReg ( Register Reg) const | inline |
|---|
◆ isVSSuperClass()
◆ materializeFrameBaseRegister()
| Register SIRegisterInfo::materializeFrameBaseRegister ( MachineBasicBlock * MBB, int FrameIdx, int64_t Offset ) const | override |
|---|
Definition at line 905 of file SIRegisterInfo.cpp.
References llvm::MachineInstrBuilder::addFrameIndex(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), DL, llvm::MachineFunction::getRegInfo(), llvm::RegState::Kill, MBB, MRI, llvm::Offset, llvm::MachineInstrBuilder::setOperandDead(), and TII.
◆ needsFrameBaseReg()
| bool SIRegisterInfo::needsFrameBaseReg ( MachineInstr * MI, int64_t Offset ) const | override |
|---|
◆ 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 3671 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 |
|---|
◆ requiresFrameIndexReplacementScavenging()
◆ requiresFrameIndexScavenging()
◆ requiresRegisterScavenging()
◆ requiresVirtualBaseRegisters()
◆ reservedPrivateSegmentBufferReg()
◆ resolveFrameIndex()
| void SIRegisterInfo::resolveFrameIndex ( MachineInstr & MI, Register BaseReg, int64_t Offset ) const | override |
|---|
Definition at line 958 of file SIRegisterInfo.cpp.
References llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::MachineOperand::ChangeToRegister(), llvm::SIInstrFlags::FlatScratch, llvm::MachineOperand::getImm(), llvm::MachineFunction::getRegInfo(), I, llvm::MachineOperand::isFI(), llvm::MachineOperand::isImm(), isSGPRReg(), llvm_unreachable, MBB, MI, MRI, llvm::Offset, llvm::AMDGPUAS::PRIVATE_ADDRESS, llvm::MachineOperand::setImm(), std::swap(), and TII.
◆ restoreSGPR()
Definition at line 2128 of file SIRegisterInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::SGPRSpillBuilder::DL, llvm::ArrayRef< T >::empty(), llvm::getKillRegState(), llvm::SGPRSpillBuilder::getPerVGPRData(), llvm::SIMachineFunctionInfo::getSGPRSpillToPhysicalVGPRLanes(), llvm::SIMachineFunctionInfo::getSGPRSpillToVirtualVGPRLanes(), llvm::RegState::ImplicitDefine, llvm::SlotIndexes::insertMachineInstrInMaps(), llvm::SGPRSpillBuilder::MBB, llvm::SGPRSpillBuilder::MFI, MI, llvm::SGPRSpillBuilder::NumSubRegs, llvm::Offset, llvm::SGPRSpillBuilder::prepare(), llvm::SGPRSpillBuilder::readWriteTmpVGPR(), Register, llvm::LiveIntervals::removeAllRegUnitsForPhysReg(), llvm::SlotIndexes::replaceMachineInstrInMaps(), llvm::SGPRSpillBuilder::restore(), llvm::SGPRSpillBuilder::SplitParts, SubReg, llvm::SGPRSpillBuilder::SuperReg, llvm::SGPRSpillBuilder::TII, and llvm::SGPRSpillBuilder::TmpVGPR.
Referenced by eliminateFrameIndex(), and eliminateSGPRToVGPRSpillFrameIndex().
◆ shouldRealignStack()
◆ spillEmergencySGPR()
Definition at line 2208 of file SIRegisterInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::SIMachineFunctionInfo::addToSpilledSGPRs(), assert(), llvm::BuildMI(), llvm::SGPRSpillBuilder::DL, llvm::MachineBasicBlock::end(), llvm::getKillRegState(), llvm::SGPRSpillBuilder::getPerVGPRData(), llvm::RegState::Implicit, llvm::RegState::ImplicitDefine, llvm::SGPRSpillBuilder::IsKill, llvm::SGPRSpillBuilder::MBB, llvm::SGPRSpillBuilder::MFI, MI, llvm::SGPRSpillBuilder::NumSubRegs, llvm::Offset, llvm::SGPRSpillBuilder::prepare(), Register, llvm::SGPRSpillBuilder::restore(), llvm::SGPRSpillBuilder::setMI(), llvm::SGPRSpillBuilder::SplitParts, SubReg, llvm::SGPRSpillBuilder::SuperReg, llvm::SGPRSpillBuilder::TII, llvm::SGPRSpillBuilder::TmpVGPR, and llvm::RegState::Undef.
◆ spillSGPR()
If OnlyToVGPR is true, this will only succeed if this manages to find a free VGPR lane to spill.
Definition at line 1997 of file SIRegisterInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::SIMachineFunctionInfo::addToSpilledSGPRs(), assert(), llvm::BuildMI(), llvm::SGPRSpillBuilder::DL, llvm::ArrayRef< T >::empty(), llvm::SIMachineFunctionInfo::getFrameOffsetReg(), llvm::getKillRegState(), llvm::SGPRSpillBuilder::getPerVGPRData(), llvm::SIMachineFunctionInfo::getSGPRSpillToPhysicalVGPRLanes(), llvm::SIMachineFunctionInfo::getSGPRSpillToVirtualVGPRLanes(), llvm::SIMachineFunctionInfo::getStackPtrOffsetReg(), llvm::RegState::Implicit, llvm::RegState::ImplicitDefine, llvm::SlotIndexes::insertMachineInstrInMaps(), llvm::SGPRSpillBuilder::IsKill, llvm::SGPRSpillBuilder::MBB, llvm::SGPRSpillBuilder::MFI, MI, llvm::SGPRSpillBuilder::NumSubRegs, llvm::Offset, llvm::SGPRSpillBuilder::prepare(), llvm::SGPRSpillBuilder::readWriteTmpVGPR(), Register, llvm::LiveIntervals::removeAllRegUnitsForPhysReg(), llvm::SlotIndexes::replaceMachineInstrInMaps(), llvm::SGPRSpillBuilder::restore(), llvm::ArrayRef< T >::size(), llvm::SGPRSpillBuilder::SplitParts, SubReg, llvm::SGPRSpillBuilder::SuperReg, llvm::SGPRSpillBuilder::TII, llvm::SGPRSpillBuilder::TmpVGPR, and llvm::RegState::Undef.
Referenced by eliminateFrameIndex(), and eliminateSGPRToVGPRSpillFrameIndex().
◆ spillSGPRToVGPR()
| bool llvm::SIRegisterInfo::spillSGPRToVGPR ( ) const | inline |
|---|
The documentation for this class was generated from the following files:
- lib/Target/AMDGPU/SIRegisterInfo.h
- lib/Target/AMDGPU/SIRegisterInfo.cpp