|
LLVM 24.0.0git
|
#include "Target/AMDGPU/SIRegisterInfo.h"
Classes | |
| struct | SpilledReg |
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 45 of file SIRegisterInfo.h.
| SIRegisterInfo::SIRegisterInfo | ( | const GCNSubtarget & | ST | ) |
Definition at line 348 of file SIRegisterInfo.cpp.
References assert(), llvm::call_once(), EnableSpillSGPRToVGPR, llvm::MCRegister::from(), llvm::AMDGPU::isHi16Reg(), llvm::Offset, Size, llvm::size(), and SubRegFromChannelTableWidthMap.
Referenced by getRegAllocationHints().
| void SIRegisterInfo::addImplicitUsesForBlockCSRLoad | ( | MachineInstrBuilder & | MIB, |
| Register | BlockReg ) const |
Definition at line 2095 of file SIRegisterInfo.cpp.
References llvm::MachineInstrBuilder::addUse(), llvm::MachineFunction::getInfo(), llvm::SIMachineFunctionInfo::getMaskForVGPRBlockOps(), llvm::MachineInstr::getMF(), and llvm::Implicit.
Referenced by buildSpillLoadStore().
| void SIRegisterInfo::buildCFIForBlockCSRStore | ( | MachineBasicBlock & | MBB, |
| MachineBasicBlock::iterator | MBBI, | ||
| Register | BlockReg, | ||
| int64_t | Offset ) const |
Definition at line 2107 of file SIRegisterInfo.cpp.
References assert(), llvm::dwarf_linker::DebugLoc, llvm::MachineFunction::getInfo(), llvm::SIMachineFunctionInfo::getMaskForVGPRBlockOps(), MBB, MBBI, and llvm::Offset.
Referenced by 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, | ||
| bool | NeedsCFI = false ) const |
Definition at line 1585 of file SIRegisterInfo.cpp.
References llvm::Add, llvm::MachineInstrBuilder::addImm(), addImplicitUsesForBlockCSRLoad(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::LiveRegUnits::available(), buildCFIForBlockCSRStore(), llvm::SIFrameLowering::buildCFIForVGPRToVMEMSpill(), llvm::BuildMI(), llvm::commonAlignment(), llvm::MCRegisterClass::contains(), llvm::dwarf_linker::DebugLoc, llvm::Define, DL, llvm::AMDGPU::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::hasRegState(), llvm::Implicit, llvm::ImplicitDefine, isAGPRClass(), llvm::AMDGPUMachineFunctionInfo::isBottomOfStack(), llvm::MachineRegisterInfo::isReserved(), llvm::Kill, MBB, MI, llvm::MOLastUse, llvm::MOThreadPrivate, llvm::Offset, Opc, llvm::AMDGPUAS::PRIVATE_ADDRESS, Register, llvm::MachineInstr::ReloadReuse, llvm::report_fatal_error(), llvm::MachineInstr::setAsmPrinterFlag(), Size, spillVGPRtoAGPR(), llvm::Sub, llvm::AMDGPU::CPol::TH_LU, and TII.
Referenced by buildVGPRSpillLoadStore(), and eliminateFrameIndex().
| void SIRegisterInfo::buildVGPRSpillLoadStore | ( | SGPRSpillBuilder & | SB, |
| int | Index, | ||
| int | Offset, | ||
| bool | IsLoad, | ||
| bool | IsKill = true ) const |
Definition at line 2132 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(), hasBasePointer(), 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.
|
override |
Definition at line 2557 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, emitUnsupportedError(), llvm::AMDGPU::FlatScratch, foldingOffsetChangesCarry(), getBaseRegister(), llvm::AMDGPU::getFlatScratchInstSTfromSS(), llvm::AMDGPU::getFlatScratchInstSVfromSS(), llvm::AMDGPU::getFlatScratchInstSVfromSVS(), llvm::MachineFunction::getFrameInfo(), getFrameRegister(), llvm::MachineFunction::getFunction(), llvm::MachineOperand::getImm(), llvm::MachineFunction::getInfo(), llvm::getKillRegState(), getNumSubRegsForSpillOp(), llvm::MachineInstr::getOpcode(), llvm::DstOp::getReg(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::SIMachineFunctionInfo::getScratchRSrcReg(), llvm::SIMachineFunctionInfo::getSGPRForEXECCopy(), llvm::SIMachineFunctionInfo::getStackPtrOffsetReg(), hasBasePointer(), llvm::AMDGPU::hasNamedOperand(), I, llvm::AMDGPUMachineFunctionInfo::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(), isSCCLiveInto(), isSGPRClass(), llvm::isUInt(), llvm::MachineOperand::isUndef(), llvm::Register::isValid(), isVGPRClass(), llvm::SIInstrInfo::isVOP3(), llvm::Kill, MBB, MI, llvm::Offset, Opc, llvm::AMDGPUAS::PRIVATE_ADDRESS, Register, llvm::Renamable, llvm::report_fatal_error(), restoreSGPR(), llvm::MachineOperand::setImm(), llvm::MachineOperand::setIsKill(), llvm::MachineOperand::setIsRenamable(), llvm::MachineInstrBuilder::setOperandDead(), llvm::MachineOperand::setReg(), llvm::TargetStackID::SGPRSpill, spillSGPR(), std::swap(), and TII.
| 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 2482 of file SIRegisterInfo.cpp.
References llvm_unreachable, MI, restoreSGPR(), and spillSGPR().
|
override |
Definition at line 4418 of file SIRegisterInfo.cpp.
References assert(), llvm::MutableArrayRef< T >::begin(), llvm::dbgs(), llvm::MutableArrayRef< T >::end(), getHWRegIndex(), llvm::RegisterClassInfo::getOrder(), llvm::MachineRegisterInfo::getRegClass(), llvm::MachineFunction::getRegInfo(), llvm::AMDGPU::getTotalNumVGPRs(), hasVectorRegisters(), llvm::MachineRegisterInfo::isPhysRegUsed(), LLVM_DEBUG, Matrix, llvm::none_of(), and shouldApplyAntiHints().
| MachineInstr * SIRegisterInfo::findReachingDef | ( | Register | Reg, |
| unsigned | SubReg, | ||
| MachineInstr & | Use, | ||
| MachineRegisterInfo & | MRI, | ||
| LiveIntervals * | LIS ) const |
Definition at line 4534 of file SIRegisterInfo.cpp.
References assert(), llvm::LiveIntervals::getDomTree(), llvm::LiveIntervals::getInstructionFromIndex(), llvm::LiveIntervals::getInstructionIndex(), llvm::LiveIntervals::getInterval(), llvm::MachineRegisterInfo::getMaxLaneMaskForVReg(), llvm::LiveIntervals::getRegUnit(), llvm::LiveRange::getVNInfoAt(), llvm::LiveIntervals::hasInterval(), llvm::LiveInterval::hasSubRanges(), llvm::SlotIndex::isValid(), and llvm::LiveInterval::subranges().
| 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 4160 of file SIRegisterInfo.cpp.
References llvm::MachineRegisterInfo::isAllocatable(), llvm::MachineRegisterInfo::isPhysRegUsed(), and llvm::reverse().
Definition at line 4587 of file SIRegisterInfo.cpp.
References assert().
| const TargetRegisterClass * SIRegisterInfo::getAGPRClassForBitWidth | ( | unsigned | BitWidth | ) | const |
Definition at line 3946 of file SIRegisterInfo.cpp.
References llvm::BitWidth, getAlignedAGPRClassForBitWidth(), and getAnyAGPRClassForBitWidth().
Referenced by getEquivalentAGPRClass(), getRegClassForSizeOnBank(), and isProperlyAlignedRC().
| 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 589 of file SIRegisterInfo.cpp.
References llvm::alignDown().
Referenced by reservedPrivateSegmentBufferReg().
| const TargetRegisterClass * SIRegisterInfo::getAlignedLo256VGPRClassForBitWidth | ( | unsigned | BitWidth | ) | const |
Definition at line 3848 of file SIRegisterInfo.cpp.
References llvm::BitWidth.
Referenced by getEquivalentVGPRClass().
Definition at line 563 of file SIRegisterInfo.cpp.
Definition at line 571 of file SIRegisterInfo.cpp.
| 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 4622 of file SIRegisterInfo.cpp.
References llvm::ArrayRef().
| 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 4632 of file SIRegisterInfo.cpp.
References llvm::ArrayRef().
| 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 4627 of file SIRegisterInfo.cpp.
References llvm::ArrayRef().
Definition at line 567 of file SIRegisterInfo.cpp.
Definition at line 559 of file SIRegisterInfo.cpp.
| Register SIRegisterInfo::getBaseRegister | ( | ) | const |
Definition at line 557 of file SIRegisterInfo.cpp.
Referenced by buildVGPRSpillLoadStore(), eliminateFrameIndex(), and getReservedRegs().
|
inline |
Definition at line 408 of file SIRegisterInfo.h.
Referenced by llvm::GCNSubtarget::getBoolRC().
|
override |
Definition at line 423 of file SIRegisterInfo.cpp.
References llvm::CallingConv::AMDGPU_CS_ChainPreserve, llvm::CallingConv::AMDGPU_Gfx, llvm::CallingConv::AMDGPU_Gfx_WholeWave, llvm::CallingConv::C, llvm::CallingConv::Cold, llvm::CallingConv::Fast, llvm::Function::getCallingConv(), and llvm::MachineFunction::getFunction().
| const MCPhysReg * SIRegisterInfo::getCalleeSavedRegsViaCopy | ( | const MachineFunction * | MF | ) | const |
Definition at line 447 of file SIRegisterInfo.cpp.
|
override |
Definition at line 451 of file SIRegisterInfo.cpp.
References llvm::CallingConv::AMDGPU_CS_Chain, llvm::CallingConv::AMDGPU_CS_ChainPreserve, llvm::CallingConv::AMDGPU_Gfx, llvm::CallingConv::AMDGPU_Gfx_WholeWave, llvm::CallingConv::C, llvm::CallingConv::Cold, and llvm::CallingConv::Fast.
Definition at line 449 of file SIRegisterInfo.h.
Referenced by expandSGPRCopy().
| 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 4132 of file SIRegisterInfo.cpp.
References llvm::MCRegisterClass::hasSubClassEq().
|
override |
Definition at line 4507 of file SIRegisterInfo.cpp.
References llvm::dyn_cast(), getRegClassForTypeOnBank(), llvm::MachineRegisterInfo::getRegClassOrRegBank(), and llvm::MachineRegisterInfo::getType().
|
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 1150 of file SIRegisterInfo.cpp.
|
inlineoverride |
Definition at line 120 of file SIRegisterInfo.h.
| const TargetRegisterClass * SIRegisterInfo::getDefaultVectorSuperClassForBitWidth | ( | unsigned | BitWidth | ) | const |
Definition at line 4029 of file SIRegisterInfo.cpp.
References llvm::BitWidth, getVectorSuperClassForBitWidth(), and getVGPRClassForBitWidth().
| const TargetRegisterClass * SIRegisterInfo::getEquivalentAGPRClass | ( | const TargetRegisterClass * | SRC | ) | const |
SRC Definition at line 4106 of file SIRegisterInfo.cpp.
References assert(), getAGPRClassForBitWidth(), and Size.
| const TargetRegisterClass * SIRegisterInfo::getEquivalentAVClass | ( | const TargetRegisterClass * | SRC | ) | const |
SRC Definition at line 4114 of file SIRegisterInfo.cpp.
References assert(), getVectorSuperClassForBitWidth(), and Size.
| const TargetRegisterClass * SIRegisterInfo::getEquivalentSGPRClass | ( | const TargetRegisterClass * | VRC | ) | const |
SRC Definition at line 4122 of file SIRegisterInfo.cpp.
References assert(), getSGPRClassForBitWidth(), and Size.
| const TargetRegisterClass * SIRegisterInfo::getEquivalentVGPRClass | ( | const TargetRegisterClass * | SRC | ) | const |
SRC Definition at line 4084 of file SIRegisterInfo.cpp.
References assert(), getAlignedLo256VGPRClassForBitWidth(), llvm::MCRegisterClass::getID(), getVGPRClassForBitWidth(), and Size.
| MCRegister SIRegisterInfo::getExec | ( | ) | const |
Definition at line 4523 of file SIRegisterInfo.cpp.
|
override |
Definition at line 841 of file SIRegisterInfo.cpp.
References assert(), llvm::MachineOperand::getImm(), getScratchInstrOffset(), llvm::SIInstrInfo::isFLATScratch(), llvm::MachineOperand::isImm(), llvm::SIInstrInfo::isMUBUF(), and MI.
|
override |
Definition at line 536 of file SIRegisterInfo.cpp.
References llvm::SIMachineFunctionInfo::getFrameOffsetReg(), llvm::MachineFunction::getInfo(), llvm::SIMachineFunctionInfo::getStackPtrOffsetReg(), llvm::TargetFrameLowering::hasFP(), llvm::AMDGPUMachineFunctionInfo::isBottomOfStack(), and Register.
Referenced by buildVGPRSpillLoadStore(), eliminateFrameIndex(), and llvm::SIFrameLowering::getFrameIndexReference().
| unsigned SIRegisterInfo::getHWRegIndex | ( | MCRegister | Reg | ) | const |
Definition at line 3767 of file SIRegisterInfo.cpp.
References llvm::AMDGPU::HWEncoding::REG_IDX_MASK.
Referenced by filterAndSortForAntiHintedRegs(), getNumUsedPhysRegs(), getReservedRegs(), and indirectCopyToAGPR().
|
override |
Definition at line 482 of file SIRegisterInfo.cpp.
References llvm::TargetRegisterInfo::getLargestLegalSuperClass(), isAGPRClass(), and isVGPRClass().
Definition at line 473 of file SIRegisterInfo.cpp.
Definition at line 454 of file SIRegisterInfo.h.
References getNumCoveredRegs().
|
inlinestatic |
Definition at line 438 of file SIRegisterInfo.h.
References llvm::LaneBitmask::getAsInteger(), llvm::popcount(), and uint64_t.
Referenced by getNumChannelsFromSubReg(), and llvm::GCNRegPressure::inc().
| unsigned SIRegisterInfo::getNumUsedPhysRegs | ( | const MachineRegisterInfo & | MRI, |
| const TargetRegisterClass & | RC, | ||
| bool | IncludeCalls = true ) const |
Definition at line 4652 of file SIRegisterInfo.cpp.
References getHWRegIndex(), llvm::MCRegisterClass::getID(), llvm::MCRegisterClass::getRegisters(), llvm::MachineRegisterInfo::isPhysRegUsed(), Registers, and llvm::reverse().
|
override |
Definition at line 4275 of file SIRegisterInfo.cpp.
References assert(), contains(), llvm::VirtRegMap::getPhys(), llvm::MachineRegisterInfo::getRegAllocationHint(), llvm::TargetRegisterInfo::getRegAllocationHints(), llvm::MachineFunction::getRegInfo(), llvm::VirtRegMap::hasPhys(), llvm::AMDGPU::isHi16Reg(), llvm::Register::isPhysical(), llvm::MachineRegisterInfo::isReserved(), Matrix, llvm::SmallVectorTemplateBase< T, bool >::push_back(), SIRegisterInfo(), llvm::AMDGPURI::Size16, llvm::AMDGPURI::Size32, and TRI.
|
override |
Definition at line 3763 of file SIRegisterInfo.cpp.
References llvm::AMDGPUInstPrinter::getRegisterName().
|
inline |
Definition at line 491 of file SIRegisterInfo.h.
References llvm::RegTupleAlignUnitsMask, and llvm::MCRegisterClass::TSFlags.
Referenced by isRegClassAligned().
|
inline |
Definition at line 190 of file SIRegisterInfo.h.
| const TargetRegisterClass * SIRegisterInfo::getRegClassForOperandReg | ( | const MachineRegisterInfo & | MRI, |
| const MachineOperand & | MO ) const |
Definition at line 4212 of file SIRegisterInfo.cpp.
References llvm::MachineOperand::getReg(), getRegClassForReg(), and llvm::MachineOperand::getSubReg().
| const TargetRegisterClass * SIRegisterInfo::getRegClassForReg | ( | const MachineRegisterInfo & | MRI, |
| Register | Reg ) const |
Definition at line 4206 of file SIRegisterInfo.cpp.
References llvm::MachineRegisterInfo::getRegClass().
Referenced by buildSpillLoadStore(), getRegClassForOperandReg(), isAGPR(), and isVGPR().
| const TargetRegisterClass * SIRegisterInfo::getRegClassForSizeOnBank | ( | unsigned | Size, |
| const RegisterBank & | Bank ) const |
Definition at line 4489 of file SIRegisterInfo.cpp.
References assert(), getAGPRClassForBitWidth(), llvm::RegisterBank::getID(), getSGPRClassForBitWidth(), getVGPRClassForBitWidth(), getWaveMaskRegClass(), llvm_unreachable, and Size.
Referenced by getRegClassForTypeOnBank().
|
inline |
Definition at line 400 of file SIRegisterInfo.h.
References getRegClassForSizeOnBank().
Referenced by getConstrainedRegClassForReg().
|
override |
Definition at line 4233 of file SIRegisterInfo.cpp.
References llvm::SIMachineFunctionInfo::getDynamicVGPRBlockSize(), llvm::MCRegisterClass::getID(), and llvm::MachineFunction::getInfo().
Referenced by getRegPressureSetLimit(), and indirectCopyToAGPR().
|
override |
Definition at line 4251 of file SIRegisterInfo.cpp.
References getRegPressureLimit(), and llvm_unreachable.
| ArrayRef< int16_t > SIRegisterInfo::getRegSplitParts | ( | const TargetRegisterClass * | RC, |
| unsigned | EltSize ) const |
Definition at line 4190 of file SIRegisterInfo.cpp.
References llvm::ArrayRef(), assert(), and llvm::AMDGPU::getRegBitWidth().
Referenced by expandSGPRCopy().
|
override |
Definition at line 4266 of file SIRegisterInfo.cpp.
References DenseMapInfo< LocallyHashedType >::Empty.
|
override |
Definition at line 602 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::getPerLaneVGPRMask(), llvm::SIMachineFunctionInfo::getScratchRSrcReg(), llvm::SIMachineFunctionInfo::getSGPRForEXECCopy(), llvm::SIMachineFunctionInfo::getStackPtrOffsetReg(), llvm::SIMachineFunctionInfo::getVGPRForAGPRCopy(), llvm::SIMachineFunctionInfo::getVGPRSpillAGPRs(), llvm::SIMachineFunctionInfo::getWWMReservedRegs(), hasBasePointer(), isAGPRClass(), isSGPRClass(), isVGPRClass(), llvm::Reserved, StressAGPRLimit, StressSGPRLimit, StressVGPRLimit, and llvm::BitVector::test().
| MCRegister SIRegisterInfo::getReturnAddressReg | ( | const MachineFunction & | MF | ) | const |
Definition at line 4483 of file SIRegisterInfo.cpp.
Referenced by spillSGPR().
| int64_t SIRegisterInfo::getScratchInstrOffset | ( | const MachineInstr * | MI | ) | const |
Definition at line 833 of file SIRegisterInfo.cpp.
References assert(), llvm::SIInstrInfo::isFLATScratch(), llvm::SIInstrInfo::isMUBUF(), and MI.
Referenced by getFrameIndexInstrOffset(), isFrameOffsetLegal(), and needsFrameBaseReg().
|
static |
Definition at line 4040 of file SIRegisterInfo.cpp.
References llvm::BitWidth.
Referenced by getEquivalentSGPRClass(), getRegClassForSizeOnBank(), llvm::SITargetLowering::getRegForInlineAsmConstraint(), isIllegalRegisterType(), moreElementsToNextExistingRegClass(), and llvm::AMDGPUDAGToDAGISel::Select().
|
inlineoverride |
Definition at line 525 of file SIRegisterInfo.h.
| unsigned SIRegisterInfo::getSubRegAlignmentNumBits | ( | const TargetRegisterClass * | RC, |
| unsigned | SubReg ) const |
Definition at line 4637 of file SIRegisterInfo.cpp.
References llvm::HasAGPR, llvm::HasSGPR, llvm::HasVGPR, llvm::RegKindMask, and llvm::MCRegisterClass::TSFlags.
Channel (e.g. getSubRegFromChannel(0) -> AMDGPU::sub0) Definition at line 575 of file SIRegisterInfo.cpp.
References assert(), llvm::size(), and SubRegFromChannelTableWidthMap.
Referenced by llvm::SITargetLowering::AddMemOpInit(), buildRegSequence(), buildSpillLoadStore(), computeIndirectRegAndOffset(), expandSGPRCopy(), and llvm::AMDGPUDAGToDAGISel::SelectBuildVector().
| MCRegister SIRegisterInfo::getVCC | ( | ) | const |
Definition at line 4519 of file SIRegisterInfo.cpp.
| const TargetRegisterClass * SIRegisterInfo::getVectorSuperClassForBitWidth | ( | unsigned | BitWidth | ) | const |
Definition at line 4020 of file SIRegisterInfo.cpp.
References llvm::BitWidth, getAlignedVectorSuperClassForBitWidth(), and getAnyVectorSuperClassForBitWidth().
Referenced by getDefaultVectorSuperClassForBitWidth(), getEquivalentAVClass(), and isProperlyAlignedRC().
| const TargetRegisterClass * SIRegisterInfo::getVGPR64Class | ( | ) | const |
Definition at line 4527 of file SIRegisterInfo.cpp.
| const TargetRegisterClass * SIRegisterInfo::getVGPRClassForBitWidth | ( | unsigned | BitWidth | ) | const |
Definition at line 3836 of file SIRegisterInfo.cpp.
References llvm::BitWidth, getAlignedVGPRClassForBitWidth(), and getAnyVGPRClassForBitWidth().
Referenced by getDefaultVectorSuperClassForBitWidth(), getEquivalentVGPRClass(), getRegClassForSizeOnBank(), and isProperlyAlignedRC().
|
override |
Definition at line 4669 of file SIRegisterInfo.cpp.
References llvm::SIMachineFunctionInfo::checkFlag(), llvm::MachineFunction::getInfo(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::AMDGPU::VirtRegFlag::WWM_REG.
|
inlineoverride |
Definition at line 516 of file SIRegisterInfo.h.
References llvm::AMDGPU::VirtRegFlag::WWM_REG.
|
inline |
Definition at line 413 of file SIRegisterInfo.h.
Referenced by getRegClassForSizeOnBank().
|
inlinestatic |
Definition at line 292 of file SIRegisterInfo.h.
References llvm::HasAGPR, and llvm::MCRegisterClass::TSFlags.
Referenced by hasVectorRegisters(), isAGPRClass(), isSGPRClass(), isVectorSuperClass(), isVGPRClass(), and isVSSuperClass().
| bool SIRegisterInfo::hasBasePointer | ( | const MachineFunction & | MF | ) | const |
Definition at line 551 of file SIRegisterInfo.cpp.
References shouldRealignStack().
Referenced by buildVGPRSpillLoadStore(), eliminateFrameIndex(), and getReservedRegs().
|
inlinestatic |
Definition at line 297 of file SIRegisterInfo.h.
References llvm::HasSGPR, and llvm::MCRegisterClass::TSFlags.
Referenced by isAGPRClass(), isSGPRClass(), isVectorSuperClass(), isVGPRClass(), and isVSSuperClass().
|
inlinestatic |
Definition at line 302 of file SIRegisterInfo.h.
References hasAGPRs(), and hasVGPRs().
Referenced by filterAndSortForAntiHintedRegs().
|
inlinestatic |
Definition at line 287 of file SIRegisterInfo.h.
References llvm::HasVGPR, and llvm::MCRegisterClass::TSFlags.
Referenced by hasVectorRegisters(), isAGPRClass(), isSGPRClass(), isVectorSuperClass(), isVGPRClass(), and isVSSuperClass().
| bool SIRegisterInfo::isAGPR | ( | const MachineRegisterInfo & | MRI, |
| Register | Reg ) const |
Definition at line 4225 of file SIRegisterInfo.cpp.
References getRegClassForReg(), and isAGPRClass().
Referenced by isVectorRegister().
|
inlinestatic |
Definition at line 272 of file SIRegisterInfo.h.
References hasAGPRs(), hasSGPRs(), and hasVGPRs().
Referenced by buildSpillLoadStore(), llvm::SIInstrInfo::expandPostRAPseudo(), getLargestLegalSuperClass(), llvm::SITargetLowering::getRegForInlineAsmConstraint(), getReservedRegs(), isAGPR(), isProperlyAlignedRC(), and llvm::GCNRPTarget::isSaveBeneficial().
|
override |
Definition at line 783 of file SIRegisterInfo.cpp.
References llvm::MachineFunction::getRegInfo(), and llvm::MachineRegisterInfo::isReserved().
| bool SIRegisterInfo::isCFISavedRegsSpillEnabled | ( | ) | const |
Definition at line 584 of file SIRegisterInfo.cpp.
References EnableSpillCFISavedRegs.
Definition at line 477 of file SIRegisterInfo.cpp.
Referenced by llvm::SIMachineFunctionInfo::allocateWWMSpill().
|
inlineoverride |
Definition at line 361 of file SIRegisterInfo.h.
References isSGPRClass().
|
override |
Definition at line 1121 of file SIRegisterInfo.cpp.
References llvm::AMDGPU::FlatScratch, getScratchInstrOffset(), llvm::SIInstrInfo::isFLATScratch(), llvm::AMDGPU::isInlinableIntLiteral(), llvm::SIInstrInfo::isMUBUF(), MI, llvm::Offset, llvm::AMDGPUAS::PRIVATE_ADDRESS, and TII.
| bool SIRegisterInfo::isProperlyAlignedRC | ( | const TargetRegisterClass & | RC | ) | const |
Definition at line 4604 of file SIRegisterInfo.cpp.
References assert(), getAGPRClassForBitWidth(), getVectorSuperClassForBitWidth(), getVGPRClassForBitWidth(), llvm::MCRegisterClass::hasSuperClassEq(), isAGPRClass(), isVectorSuperClass(), and isVGPRClass().
|
inline |
Definition at line 496 of file SIRegisterInfo.h.
References assert(), and getRegClassAlignmentNumBits().
|
inlinestatic |
Definition at line 248 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().
Definition at line 253 of file SIRegisterInfo.h.
References getRegClass(), and isSGPRClass().
Definition at line 258 of file SIRegisterInfo.h.
References isSGPRClass(), and Reg.
| bool SIRegisterInfo::isSGPRReg | ( | const MachineRegisterInfo & | MRI, |
| Register | Reg ) const |
Definition at line 4073 of file SIRegisterInfo.cpp.
References llvm::MachineRegisterInfo::getRegClass(), and isSGPRClass().
Referenced by resolveFrameIndex().
|
override |
Definition at line 4180 of file SIRegisterInfo.cpp.
References llvm::RegisterBankInfo::getRegBank(), and llvm::RegisterBankInfo::isDivergentRegBank().
|
inline |
Definition at line 353 of file SIRegisterInfo.h.
|
inline |
Definition at line 277 of file SIRegisterInfo.h.
References hasAGPRs(), hasSGPRs(), and hasVGPRs().
Referenced by isProperlyAlignedRC().
| bool SIRegisterInfo::isVGPR | ( | const MachineRegisterInfo & | MRI, |
| Register | Reg ) const |
Definition at line 4218 of file SIRegisterInfo.cpp.
References getRegClassForReg(), and isVGPRClass().
Referenced by isVectorRegister().
|
inlinestatic |
Definition at line 267 of file SIRegisterInfo.h.
References hasAGPRs(), hasSGPRs(), and hasVGPRs().
Referenced by eliminateFrameIndex(), getLargestLegalSuperClass(), llvm::SITargetLowering::getRegForInlineAsmConstraint(), getReservedRegs(), isProperlyAlignedRC(), isVGPR(), and isVGPRPhysReg().
Definition at line 262 of file SIRegisterInfo.h.
References isVGPRClass(), and Reg.
|
inline |
Definition at line 282 of file SIRegisterInfo.h.
References hasAGPRs(), hasSGPRs(), and hasVGPRs().
|
override |
Definition at line 940 of file SIRegisterInfo.cpp.
References llvm::MachineInstrBuilder::addFrameIndex(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::MachineRegisterInfo::createVirtualRegister(), DL, llvm::MachineFunction::getRegInfo(), llvm::Kill, MBB, llvm::Offset, llvm::MachineInstrBuilder::setOperandDead(), and TII.
|
override |
Definition at line 891 of file SIRegisterInfo.cpp.
References llvm::AMDGPU::FlatScratch, getScratchInstrOffset(), isFIPlusImmOrVGPR(), llvm::SIInstrInfo::isFLATScratch(), llvm::SIInstrInfo::isMUBUF(), MI, llvm::Offset, llvm::AMDGPUAS::PRIVATE_ADDRESS, and TII.
Definition at line 4141 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.
Definition at line 4150 of file SIRegisterInfo.cpp.
References llvm::AMDGPU::OPERAND_REG_IMM_FIRST, and llvm::AMDGPU::OPERAND_REG_IMM_LAST.
|
override |
Definition at line 821 of file SIRegisterInfo.cpp.
References llvm::MachineFunction::getFrameInfo(), and llvm::MachineFrameInfo::hasStackObjects().
|
override |
Definition at line 812 of file SIRegisterInfo.cpp.
|
override |
Definition at line 801 of file SIRegisterInfo.cpp.
References llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getInfo(), llvm::MachineFrameInfo::hasCalls(), and llvm::MachineFrameInfo::hasStackObjects().
|
override |
Definition at line 827 of file SIRegisterInfo.cpp.
| 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 597 of file SIRegisterInfo.cpp.
References getAlignedHighSGPRForRC().
|
override |
Definition at line 993 of file SIRegisterInfo.cpp.
References llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::MachineOperand::ChangeToRegister(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::AMDGPU::FlatScratch, llvm::MachineOperand::getImm(), llvm::MachineFunction::getRegInfo(), I, llvm::MachineOperand::isFI(), llvm::MachineOperand::isImm(), isSGPRReg(), llvm_unreachable, MBB, MI, llvm::Offset, llvm::AMDGPUAS::PRIVATE_ADDRESS, llvm::MachineOperand::setImm(), std::swap(), and TII.
| bool SIRegisterInfo::restoreSGPR | ( | MachineBasicBlock::iterator | MI, |
| int | FI, | ||
| RegScavenger * | RS, | ||
| SlotIndexes * | Indexes = nullptr, | ||
| LiveIntervals * | LIS = nullptr, | ||
| bool | OnlyToVGPR = false, | ||
| bool | SpillToPhysVGPRLane = false ) const |
Definition at line 2328 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::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, llvm::SGPRSpillBuilder::SuperReg, llvm::SGPRSpillBuilder::TII, and llvm::SGPRSpillBuilder::TmpVGPR.
Referenced by eliminateFrameIndex(), and eliminateSGPRToVGPRSpillFrameIndex().
| bool SIRegisterInfo::shouldApplyAntiHints | ( | const MachineFunction & | MF, |
| unsigned | NumAllocatedVGPRs, | ||
| unsigned & | MaxVGPRsForCurrentOccupancy ) const |
Definition at line 4342 of file SIRegisterInfo.cpp.
References llvm::dbgs(), llvm::SIMachineFunctionInfo::getDynamicVGPRBlockSize(), llvm::MachineFunction::getInfo(), llvm::SIMachineFunctionInfo::getOccupancy(), and LLVM_DEBUG.
Referenced by filterAndSortForAntiHintedRegs().
|
override |
Definition at line 788 of file SIRegisterInfo.cpp.
References llvm::MachineFunction::getInfo(), and llvm::TargetRegisterInfo::shouldRealignStack().
Referenced by hasBasePointer().
| bool SIRegisterInfo::spillEmergencySGPR | ( | MachineBasicBlock::iterator | MI, |
| MachineBasicBlock & | RestoreMBB, | ||
| Register | SGPR, | ||
| RegScavenger * | RS ) const |
Definition at line 2408 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::Implicit, llvm::ImplicitDefine, llvm::SGPRSpillBuilder::IsKill, llvm::Register::isPhysical(), 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, llvm::SGPRSpillBuilder::SuperReg, llvm::SGPRSpillBuilder::TII, llvm::SGPRSpillBuilder::TmpVGPR, and llvm::Undef.
| bool SIRegisterInfo::spillSGPR | ( | MachineBasicBlock::iterator | MI, |
| int | FI, | ||
| RegScavenger * | RS, | ||
| SlotIndexes * | Indexes = nullptr, | ||
| LiveIntervals * | LIS = nullptr, | ||
| bool | OnlyToVGPR = false, | ||
| bool | SpillToPhysVGPRLane = false, | ||
| bool | NeedsCFI = false ) const |
If OnlyToVGPR is true, this will only succeed if this manages to find a free VGPR lane to spill.
Definition at line 2167 of file SIRegisterInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::SIMachineFunctionInfo::addToSpilledSGPRs(), assert(), llvm::SIFrameLowering::buildCFIForSGPRToVGPRSpill(), llvm::SIFrameLowering::buildCFIForSGPRToVMEMSpill(), llvm::BuildMI(), llvm::SGPRSpillBuilder::DL, llvm::SGPRSpillBuilder::EltSize, llvm::ArrayRef< T >::empty(), llvm::MachineFunction::getFrameInfo(), llvm::SIMachineFunctionInfo::getFrameOffsetReg(), llvm::getKillRegState(), llvm::SGPRSpillBuilder::getPerVGPRData(), getReturnAddressReg(), llvm::SIMachineFunctionInfo::getSGPRSpillToPhysicalVGPRLanes(), llvm::SIMachineFunctionInfo::getSGPRSpillToVirtualVGPRLanes(), llvm::SIMachineFunctionInfo::getStackPtrOffsetReg(), llvm::Implicit, llvm::ImplicitDefine, llvm::SlotIndexes::insertMachineInstrInMaps(), llvm::SGPRSpillBuilder::IsKill, llvm::SGPRSpillBuilder::MBB, llvm::SGPRSpillBuilder::MF, 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, llvm::SGPRSpillBuilder::SuperReg, llvm::SGPRSpillBuilder::TII, llvm::SGPRSpillBuilder::TmpVGPR, llvm::SGPRSpillBuilder::TRI, and llvm::Undef.
Referenced by eliminateFrameIndex(), and eliminateSGPRToVGPRSpillFrameIndex().
|
inline |
Definition at line 89 of file SIRegisterInfo.h.