15 #ifndef LLVM_LIB_TARGET_AMDGPU_SIREGISTERINFO_H
16 #define LLVM_LIB_TARGET_AMDGPU_SIREGISTERINFO_H
25 class MachineRegisterInfo;
27 class SIMachineFunctionInfo;
38 void reserveRegisterTuples(
BitVector &,
unsigned Reg)
const;
39 void classifyPressureSet(
unsigned PSetID,
unsigned Reg,
45 return SpillSGPRToVGPR;
49 return SpillSGPRToSMEM;
88 int Idx)
const override;
93 unsigned BaseReg,
int FrameIdx,
94 int64_t
Offset)
const override;
97 int64_t
Offset)
const override;
100 int64_t
Offset)
const override;
108 bool OnlyToVGPR =
false)
const;
112 bool OnlyToVGPR =
false)
const;
115 unsigned FIOperandNum,
124 return getEncodingValue(Reg) & 0xff;
165 unsigned SubIdx)
const;
170 unsigned SrcSubReg)
const override;
225 return SGPRPressureSets.
test(SetID) && !VGPRPressureSets.
test(SetID);
228 return VGPRPressureSets.
test(SetID) && !SGPRPressureSets.
test(SetID);
232 unsigned EltSize)
const;
245 unsigned Idx)
const override;
251 return AMDGPU::SGPR30_SGPR31;
256 unsigned LoadStoreOp,
260 unsigned ScratchRsrcReg,
261 unsigned ScratchOffsetReg,
const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const override
void materializeFrameBaseRegister(MachineBasicBlock *MBB, unsigned BaseReg, int FrameIdx, int64_t Offset) const override
bool eliminateSGPRToVGPRSpillFrameIndex(MachineBasicBlock::iterator MI, int FI, RegScavenger *RS) const
Special case of eliminateFrameIndex.
bool requiresRegisterScavenging(const MachineFunction &Fn) const override
unsigned reservedStackPtrOffsetReg(const MachineFunction &MF) const
bool spillSGPRToSMEM() const
SIRegisterInfo(const SISubtarget &ST)
ArrayRef< int16_t > getRegSplitParts(const TargetRegisterClass *RC, unsigned EltSize) const
bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const override
bool opCanUseInlineConstant(unsigned OpType) const
bool isVGPR(const MachineRegisterInfo &MRI, unsigned Reg) const
unsigned getRegPressureLimit(const TargetRegisterClass *RC, MachineFunction &MF) const override
bool isFrameOffsetLegal(const MachineInstr *MI, unsigned BaseReg, int64_t Offset) const override
StringRef getRegAsmName(unsigned Reg) const override
bool isSGPRPressureSet(unsigned SetID) const
const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID) const override
static bool isVirtualRegister(unsigned Reg)
Return true if the specified register number is in the virtual register namespace.
const TargetRegisterClass * getRegClassForReg(const MachineRegisterInfo &MRI, unsigned Reg) const
bool requiresVirtualBaseRegisters(const MachineFunction &Fn) const override
bool isSGPRClass(const TargetRegisterClass *RC) const
int64_t getFrameIndexInstrOffset(const MachineInstr *MI, int Idx) const override
void resolveFrameIndex(MachineInstr &MI, unsigned BaseReg, int64_t Offset) const override
bool spillSGPRToVGPR() const
const TargetRegisterClass * getSubRegClass(const TargetRegisterClass *RC, unsigned SubIdx) const
unsigned getHWRegIndex(unsigned Reg) const
bool requiresFrameIndexScavenging(const MachineFunction &MF) const override
unsigned reservedPrivateSegmentWaveByteOffsetReg(const MachineFunction &MF) const
Return the end register initially reserved for the scratch wave offset in case spilling is needed...
A description of a memory reference used in the backend.
bool needsFrameBaseReg(MachineInstr *MI, int64_t Offset) const override
const TargetRegisterClass * getRegClass(unsigned Reg) const
Return the register class of the specified virtual register.
Reg
All possible values of the reg field in the ModR/M byte.
static int getRegClass(RegisterKind Is, unsigned RegWidth)
bool opCanUseLiteralConstant(unsigned OpType) const
TargetRegisterInfo interface that is implemented by all hw codegen targets.
bool shouldRewriteCopySrc(const TargetRegisterClass *DefRC, unsigned DefSubReg, const TargetRegisterClass *SrcRC, unsigned SrcSubReg) const override
int64_t getMUBUFInstrOffset(const MachineInstr *MI) const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
unsigned getCSRFirstUseCost() const override
bool requiresFrameIndexReplacementScavenging(const MachineFunction &MF) const override
const int * getRegUnitPressureSets(unsigned RegUnit) const override
unsigned getVGPRPressureSet() const
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
bool restoreSGPR(MachineBasicBlock::iterator MI, int FI, RegScavenger *RS, bool OnlyToVGPR=false) const
const TargetRegisterClass * getEquivalentVGPRClass(const TargetRegisterClass *SRC) const
unsigned const MachineRegisterInfo * MRI
unsigned getFrameRegister(const MachineFunction &MF) const override
bool hasVGPRs(const TargetRegisterClass *RC) const
unsigned getPreloadedValue(const MachineFunction &MF, enum PreloadedValue Value) const
Returns the physical register that Value is stored in.
bool shouldCoalesce(MachineInstr *MI, const TargetRegisterClass *SrcRC, unsigned SubReg, const TargetRegisterClass *DstRC, unsigned DstSubReg, const TargetRegisterClass *NewRC) const override
const TargetRegisterClass * getEquivalentSGPRClass(const TargetRegisterClass *VRC) const
bool isSGPRClassID(unsigned RCID) const
void eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj, unsigned FIOperandNum, RegScavenger *RS) const override
BitVector getReservedRegs(const MachineFunction &MF) const override
unsigned getReturnAddressReg(const MachineFunction &MF) const
unsigned getRegPressureSetLimit(const MachineFunction &MF, unsigned Idx) const override
bool test(unsigned Idx) const
bool isSGPRReg(const MachineRegisterInfo &MRI, unsigned Reg) const
const TargetRegisterClass * getPhysRegClass(unsigned Reg) const
Return the 'base' register class for this register.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Provides AMDGPU specific target descriptions.
Representation of each machine instruction.
unsigned findUnusedRegister(const MachineRegisterInfo &MRI, const TargetRegisterClass *RC, const MachineFunction &MF) const
Returns a register that is not used at any point in the function.
const TargetRegisterClass * getPointerRegClass(const MachineFunction &MF, unsigned Kind=0) const override
unsigned getSGPRPressureSet() const
bool isVGPRPressureSet(unsigned SetID) const
bool spillSGPR(MachineBasicBlock::iterator MI, int FI, RegScavenger *RS, bool OnlyToVGPR=false) const
If OnlyToVGPR is true, this will only succeed if this.
LLVM Value Representation.
unsigned reservedPrivateSegmentBufferReg(const MachineFunction &MF) const
Return the end register initially reserved for the scratch buffer in case spilling is needed...
StringRef - Represent a constant reference to a string, i.e.