Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Target/AMDGPU/SIRegisterInfo.h
Show All 21 Lines | |||||
namespace llvm { | namespace llvm { | ||||
class GCNSubtarget; | class GCNSubtarget; | ||||
class LiveIntervals; | class LiveIntervals; | ||||
class LivePhysRegs; | class LivePhysRegs; | ||||
class RegisterBank; | class RegisterBank; | ||||
struct SGPRSpillBuilder; | struct SGPRSpillBuilder; | ||||
// A CSR SGPR value can be preserved inside a callee using one of the following | |||||
// methods. | |||||
// 1. Copy to an unused scratch SGPR. | |||||
// 2. Spill to a VGPR lane. | |||||
// 3. Spill to memory via. a scratch VGPR. | |||||
// class CustomSGPRSaveInfo represents the save/restore method used for an SGPR | |||||
// at function prolog/epilog. | |||||
enum class SGPRSaveKind : uint8_t { | |||||
arsenm: Don't see why this needs to pollute SIRegisterInfo. Belongs in MFI or maybe FrameLowering | |||||
COPY_TO_SCRATCH_SGPR, | |||||
Not Done ReplyInline ActionsWhy not make this an enum class RegSaveKind? sebastian-ne: Why not make this an `enum class RegSaveKind`? | |||||
Will do. cdevadas: Will do. | |||||
SPILL_TO_VGPR_LANE, | |||||
SPILL_TO_MEM | |||||
}; | |||||
class CustomSGPRSaveInfo { | |||||
SGPRSaveKind Kind; | |||||
union { | |||||
int Index; | |||||
Register Reg; | |||||
}; | |||||
public: | |||||
CustomSGPRSaveInfo(SGPRSaveKind K, int I) : Kind(K), Index(I) {} | |||||
CustomSGPRSaveInfo(SGPRSaveKind K, Register R) : Kind(K), Reg(R) {} | |||||
Register getReg() const { return Reg; } | |||||
int getIndex() const { return Index; } | |||||
SGPRSaveKind getKind() const { return Kind; } | |||||
}; | |||||
class SIRegisterInfo final : public AMDGPUGenRegisterInfo { | class SIRegisterInfo final : public AMDGPUGenRegisterInfo { | ||||
private: | private: | ||||
const GCNSubtarget &ST; | const GCNSubtarget &ST; | ||||
bool SpillSGPRToVGPR; | bool SpillSGPRToVGPR; | ||||
bool isWave32; | bool isWave32; | ||||
BitVector RegPressureIgnoredUnits; | BitVector RegPressureIgnoredUnits; | ||||
/// Sub reg indexes for getRegSplitParts. | /// Sub reg indexes for getRegSplitParts. | ||||
▲ Show 20 Lines • Show All 386 Lines • Show Last 20 Lines |
Don't see why this needs to pollute SIRegisterInfo. Belongs in MFI or maybe FrameLowering