LLVM  10.0.0
Enumerations | Functions
llvm::AMDGPU::IsaInfo Namespace Reference

Enumerations

enum  { FIXED_NUM_SGPRS_FOR_INIT_BUG = 96, TRAP_NUM_SGPRS = 16 }
 

Functions

void streamIsaVersion (const MCSubtargetInfo *STI, raw_ostream &Stream)
 Streams isa version string for given subtarget STI into Stream. More...
 
bool hasCodeObjectV3 (const MCSubtargetInfo *STI)
 
unsigned getWavefrontSize (const MCSubtargetInfo *STI)
 
unsigned getLocalMemorySize (const MCSubtargetInfo *STI)
 
unsigned getEUsPerCU (const MCSubtargetInfo *STI)
 
unsigned getMaxWorkGroupsPerCU (const MCSubtargetInfo *STI, unsigned FlatWorkGroupSize)
 
unsigned getMaxWavesPerCU (const MCSubtargetInfo *STI)
 
unsigned getMaxWavesPerCU (const MCSubtargetInfo *STI, unsigned FlatWorkGroupSize)
 
unsigned getMinWavesPerEU (const MCSubtargetInfo *STI)
 
unsigned getMaxWavesPerEU (const MCSubtargetInfo *STI)
 
unsigned getMaxWavesPerEU (const MCSubtargetInfo *STI, unsigned FlatWorkGroupSize)
 
unsigned getMinFlatWorkGroupSize (const MCSubtargetInfo *STI)
 
unsigned getMaxFlatWorkGroupSize (const MCSubtargetInfo *STI)
 
unsigned getWavesPerWorkGroup (const MCSubtargetInfo *STI, unsigned FlatWorkGroupSize)
 
unsigned getSGPRAllocGranule (const MCSubtargetInfo *STI)
 
unsigned getSGPREncodingGranule (const MCSubtargetInfo *STI)
 
unsigned getTotalNumSGPRs (const MCSubtargetInfo *STI)
 
unsigned getAddressableNumSGPRs (const MCSubtargetInfo *STI)
 
unsigned getMinNumSGPRs (const MCSubtargetInfo *STI, unsigned WavesPerEU)
 
unsigned getMaxNumSGPRs (const MCSubtargetInfo *STI, unsigned WavesPerEU, bool Addressable)
 
unsigned getNumExtraSGPRs (const MCSubtargetInfo *STI, bool VCCUsed, bool FlatScrUsed, bool XNACKUsed)
 
unsigned getNumExtraSGPRs (const MCSubtargetInfo *STI, bool VCCUsed, bool FlatScrUsed)
 
unsigned getNumSGPRBlocks (const MCSubtargetInfo *STI, unsigned NumSGPRs)
 
unsigned getVGPRAllocGranule (const MCSubtargetInfo *STI, Optional< bool > EnableWavefrontSize32)
 
unsigned getVGPREncodingGranule (const MCSubtargetInfo *STI, Optional< bool > EnableWavefrontSize32)
 
unsigned getTotalNumVGPRs (const MCSubtargetInfo *STI)
 
unsigned getAddressableNumVGPRs (const MCSubtargetInfo *STI)
 
unsigned getMinNumVGPRs (const MCSubtargetInfo *STI, unsigned WavesPerEU)
 
unsigned getMaxNumVGPRs (const MCSubtargetInfo *STI, unsigned WavesPerEU)
 
unsigned getNumVGPRBlocks (const MCSubtargetInfo *STI, unsigned NumVGPRs, Optional< bool > EnableWavefrontSize32)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
FIXED_NUM_SGPRS_FOR_INIT_BUG 
TRAP_NUM_SGPRS 

Definition at line 61 of file AMDGPUBaseInfo.h.

Function Documentation

◆ getAddressableNumSGPRs()

unsigned llvm::AMDGPU::IsaInfo::getAddressableNumSGPRs ( const MCSubtargetInfo *  STI)

◆ getAddressableNumVGPRs()

unsigned llvm::AMDGPU::IsaInfo::getAddressableNumVGPRs ( const MCSubtargetInfo *  STI)
Returns
Addressable number of VGPRs for given subtarget STI.

Definition at line 448 of file AMDGPUBaseInfo.cpp.

Referenced by llvm::GCNSubtarget::getAddressableNumVGPRs(), getMaxNumVGPRs(), getMinNumVGPRs(), and llvm::GCNScheduleDAGMILive::schedule().

◆ getEUsPerCU()

unsigned llvm::AMDGPU::IsaInfo::getEUsPerCU ( const MCSubtargetInfo *  STI)
Returns
Number of execution units per compute unit for given subtarget STI.

Definition at line 270 of file AMDGPUBaseInfo.cpp.

Referenced by llvm::GCNSubtarget::getEUsPerCU(), getMaxWavesPerCU(), and getMaxWavesPerEU().

◆ getLocalMemorySize()

unsigned llvm::AMDGPU::IsaInfo::getLocalMemorySize ( const MCSubtargetInfo *  STI)
Returns
Local memory size in bytes for given subtarget STI.

Definition at line 261 of file AMDGPUBaseInfo.cpp.

References llvm::MCSubtargetInfo::getFeatureBits(), and llvm::FeatureBitset::test().

◆ getMaxFlatWorkGroupSize()

unsigned llvm::AMDGPU::IsaInfo::getMaxFlatWorkGroupSize ( const MCSubtargetInfo *  STI)
Returns
Maximum flat work group size for given subtarget STI.

Definition at line 316 of file AMDGPUBaseInfo.cpp.

Referenced by llvm::GCNSubtarget::getMaxFlatWorkGroupSize(), and llvm::R600Subtarget::getMaxFlatWorkGroupSize().

◆ getMaxNumSGPRs()

unsigned llvm::AMDGPU::IsaInfo::getMaxNumSGPRs ( const MCSubtargetInfo *  STI,
unsigned  WavesPerEU,
bool  Addressable 
)

◆ getMaxNumVGPRs()

unsigned llvm::AMDGPU::IsaInfo::getMaxNumVGPRs ( const MCSubtargetInfo *  STI,
unsigned  WavesPerEU 
)
Returns
Maximum number of VGPRs that meets given number of waves per execution unit requirement for given subtarget STI.

Definition at line 463 of file AMDGPUBaseInfo.cpp.

References llvm::alignDown(), assert(), getAddressableNumVGPRs(), getTotalNumVGPRs(), and getVGPRAllocGranule().

Referenced by llvm::GCNSubtarget::getMaxNumVGPRs().

◆ getMaxWavesPerCU() [1/2]

unsigned llvm::AMDGPU::IsaInfo::getMaxWavesPerCU ( const MCSubtargetInfo *  STI)
Returns
Maximum number of waves per compute unit for given subtarget STI without any kind of limitation.

Definition at line 286 of file AMDGPUBaseInfo.cpp.

References getEUsPerCU(), and getMaxWavesPerEU().

Referenced by llvm::GCNSubtarget::getMaxWavesPerCU().

◆ getMaxWavesPerCU() [2/2]

unsigned llvm::AMDGPU::IsaInfo::getMaxWavesPerCU ( const MCSubtargetInfo *  STI,
unsigned  FlatWorkGroupSize 
)
Returns
Maximum number of waves per compute unit for given subtarget STI and limited by given FlatWorkGroupSize.

Definition at line 290 of file AMDGPUBaseInfo.cpp.

References getWavesPerWorkGroup().

Referenced by getMaxWavesPerEU().

◆ getMaxWavesPerEU() [1/2]

unsigned llvm::AMDGPU::IsaInfo::getMaxWavesPerEU ( const MCSubtargetInfo *  STI)
Returns
Maximum number of waves per execution unit for given subtarget STI without any kind of limitation.

Definition at line 299 of file AMDGPUBaseInfo.cpp.

References llvm::AMDGPU::isGFX10().

Referenced by llvm::GCNSubtarget::GCNSubtarget(), llvm::GCNSubtarget::getMaxWavesPerEU(), and llvm::R600Subtarget::getMaxWavesPerEU().

◆ getMaxWavesPerEU() [2/2]

unsigned llvm::AMDGPU::IsaInfo::getMaxWavesPerEU ( const MCSubtargetInfo *  STI,
unsigned  FlatWorkGroupSize 
)
Returns
Maximum number of waves per execution unit for given subtarget STI and limited by given FlatWorkGroupSize.

Definition at line 306 of file AMDGPUBaseInfo.cpp.

References llvm::alignTo(), getEUsPerCU(), and getMaxWavesPerCU().

Referenced by getMaxWavesPerCU(), getMinNumSGPRs(), and getMinNumVGPRs().

◆ getMaxWorkGroupsPerCU()

unsigned llvm::AMDGPU::IsaInfo::getMaxWorkGroupsPerCU ( const MCSubtargetInfo *  STI,
unsigned  FlatWorkGroupSize 
)
Returns
Maximum number of work groups per compute unit for given subtarget STI and limited by given FlatWorkGroupSize.

Definition at line 274 of file AMDGPUBaseInfo.cpp.

References llvm::Triple::amdgcn, assert(), llvm::Triple::getArch(), llvm::MCSubtargetInfo::getTargetTriple(), getWavesPerWorkGroup(), and N.

Referenced by llvm::GCNSubtarget::getMaxWorkGroupsPerCU(), and llvm::R600Subtarget::getMaxWorkGroupsPerCU().

◆ getMinFlatWorkGroupSize()

unsigned llvm::AMDGPU::IsaInfo::getMinFlatWorkGroupSize ( const MCSubtargetInfo *  STI)
Returns
Minimum flat work group size for given subtarget STI.

Definition at line 312 of file AMDGPUBaseInfo.cpp.

Referenced by llvm::GCNSubtarget::getMinFlatWorkGroupSize(), and llvm::R600Subtarget::getMinFlatWorkGroupSize().

◆ getMinNumSGPRs()

unsigned llvm::AMDGPU::IsaInfo::getMinNumSGPRs ( const MCSubtargetInfo *  STI,
unsigned  WavesPerEU 
)

◆ getMinNumVGPRs()

unsigned llvm::AMDGPU::IsaInfo::getMinNumVGPRs ( const MCSubtargetInfo *  STI,
unsigned  WavesPerEU 
)
Returns
Minimum number of VGPRs that meets given number of waves per execution unit requirement for given subtarget STI.

Definition at line 452 of file AMDGPUBaseInfo.cpp.

References llvm::alignDown(), assert(), getAddressableNumVGPRs(), getMaxWavesPerEU(), getTotalNumVGPRs(), and getVGPRAllocGranule().

Referenced by llvm::GCNSubtarget::getMaxNumVGPRs(), and llvm::GCNSubtarget::getMinNumVGPRs().

◆ getMinWavesPerEU()

unsigned llvm::AMDGPU::IsaInfo::getMinWavesPerEU ( const MCSubtargetInfo *  STI)
Returns
Minimum number of waves per execution unit for given subtarget STI.

Definition at line 295 of file AMDGPUBaseInfo.cpp.

Referenced by llvm::GCNSubtarget::getMinWavesPerEU(), and llvm::R600Subtarget::getMinWavesPerEU().

◆ getNumExtraSGPRs() [1/2]

unsigned llvm::AMDGPU::IsaInfo::getNumExtraSGPRs ( const MCSubtargetInfo *  STI,
bool  VCCUsed,
bool  FlatScrUsed,
bool  XNACKUsed 
)
Returns
Number of extra SGPRs implicitly required by given subtarget STI when the given special registers are used.

Definition at line 393 of file AMDGPUBaseInfo.cpp.

References llvm::MCSubtargetInfo::getCPU(), llvm::AMDGPU::getIsaVersion(), llvm::AMDGPU::IsaVersion::Major, and llvm::IndexedInstrProf::Version.

Referenced by llvm::AMDGPUAsmPrinter::EmitFunctionBodyEnd(), hasAnyNonFlatUseOfReg(), and IsRevOpcode().

◆ getNumExtraSGPRs() [2/2]

unsigned llvm::AMDGPU::IsaInfo::getNumExtraSGPRs ( const MCSubtargetInfo *  STI,
bool  VCCUsed,
bool  FlatScrUsed 
)
Returns
Number of extra SGPRs implicitly required by given subtarget STI when the given special registers are used. XNACK is inferred from STI.

Definition at line 417 of file AMDGPUBaseInfo.cpp.

References llvm::MCSubtargetInfo::getFeatureBits(), and llvm::FeatureBitset::test().

◆ getNumSGPRBlocks()

unsigned llvm::AMDGPU::IsaInfo::getNumSGPRBlocks ( const MCSubtargetInfo *  STI,
unsigned  NumSGPRs 
)
Returns
Number of SGPR blocks needed for given subtarget STI when NumSGPRs are used. NumSGPRs should already include any special register counts.

Definition at line 423 of file AMDGPUBaseInfo.cpp.

References llvm::alignTo(), getSGPREncodingGranule(), and llvm::max().

Referenced by hasAnyNonFlatUseOfReg(), and IsRevOpcode().

◆ getNumVGPRBlocks()

unsigned llvm::AMDGPU::IsaInfo::getNumVGPRBlocks ( const MCSubtargetInfo *  STI,
unsigned  NumSGPRs,
Optional< bool >  EnableWavefrontSize32 = None 
)
Returns
Number of VGPR blocks needed for given subtarget STI when NumVGPRs are used.

For subtargets which support it, EnableWavefrontSize32 should match the ENABLE_WAVEFRONT_SIZE32 kernel descriptor field.

Definition at line 472 of file AMDGPUBaseInfo.cpp.

References llvm::alignTo(), getVGPREncodingGranule(), and llvm::max().

Referenced by hasAnyNonFlatUseOfReg(), and IsRevOpcode().

◆ getSGPRAllocGranule()

unsigned llvm::AMDGPU::IsaInfo::getSGPRAllocGranule ( const MCSubtargetInfo *  STI)

◆ getSGPREncodingGranule()

unsigned llvm::AMDGPU::IsaInfo::getSGPREncodingGranule ( const MCSubtargetInfo *  STI)
Returns
SGPR encoding granularity for given subtarget STI.

Definition at line 336 of file AMDGPUBaseInfo.cpp.

Referenced by getNumSGPRBlocks(), and llvm::GCNSubtarget::getSGPREncodingGranule().

◆ getTotalNumSGPRs()

unsigned llvm::AMDGPU::IsaInfo::getTotalNumSGPRs ( const MCSubtargetInfo *  STI)

◆ getTotalNumVGPRs()

unsigned llvm::AMDGPU::IsaInfo::getTotalNumVGPRs ( const MCSubtargetInfo *  STI)

◆ getVGPRAllocGranule()

unsigned llvm::AMDGPU::IsaInfo::getVGPRAllocGranule ( const MCSubtargetInfo *  STI,
Optional< bool >  EnableWavefrontSize32 = None 
)
Returns
VGPR allocation granularity for given subtarget STI.

For subtargets which support it, EnableWavefrontSize32 should match the ENABLE_WAVEFRONT_SIZE32 kernel descriptor field.

Definition at line 429 of file AMDGPUBaseInfo.cpp.

References llvm::MCSubtargetInfo::getFeatureBits(), and llvm::FeatureBitset::test().

Referenced by getMaxNumVGPRs(), getMinNumVGPRs(), llvm::GCNSubtarget::getOccupancyWithNumVGPRs(), llvm::GCNSubtarget::getVGPRAllocGranule(), and getVGPREncodingGranule().

◆ getVGPREncodingGranule()

unsigned llvm::AMDGPU::IsaInfo::getVGPREncodingGranule ( const MCSubtargetInfo *  STI,
Optional< bool >  EnableWavefrontSize32 = None 
)
Returns
VGPR encoding granularity for given subtarget STI.

For subtargets which support it, EnableWavefrontSize32 should match the ENABLE_WAVEFRONT_SIZE32 kernel descriptor field.

Definition at line 437 of file AMDGPUBaseInfo.cpp.

References getVGPRAllocGranule().

Referenced by getNumVGPRBlocks(), and llvm::GCNSubtarget::getVGPREncodingGranule().

◆ getWavefrontSize()

unsigned llvm::AMDGPU::IsaInfo::getWavefrontSize ( const MCSubtargetInfo *  STI)
Returns
Wavefront size for given subtarget STI.

Definition at line 252 of file AMDGPUBaseInfo.cpp.

References llvm::MCSubtargetInfo::getFeatureBits(), and llvm::FeatureBitset::test().

Referenced by llvm::SITargetLowering::EmitInstrWithCustomInserter(), and getWavesPerWorkGroup().

◆ getWavesPerWorkGroup()

unsigned llvm::AMDGPU::IsaInfo::getWavesPerWorkGroup ( const MCSubtargetInfo *  STI,
unsigned  FlatWorkGroupSize 
)
Returns
Number of waves per work group for given subtarget STI and limited by given FlatWorkGroupSize.

Definition at line 321 of file AMDGPUBaseInfo.cpp.

References llvm::alignTo(), and getWavefrontSize().

Referenced by getMaxWavesPerCU(), getMaxWorkGroupsPerCU(), and llvm::GCNSubtarget::getWavesPerWorkGroup().

◆ hasCodeObjectV3()

bool llvm::AMDGPU::IsaInfo::hasCodeObjectV3 ( const MCSubtargetInfo *  STI)

◆ streamIsaVersion()

void llvm::AMDGPU::IsaInfo::streamIsaVersion ( const MCSubtargetInfo *  STI,
raw_ostream &  Stream 
)