LLVM  7.0.0svn
Classes | Enumerations | Functions
llvm::AMDGPU::IsaInfo Namespace Reference

Classes

struct  IsaVersion
 Instruction set architecture version. More...
 

Enumerations

enum  { FIXED_NUM_SGPRS_FOR_INIT_BUG = 96, TRAP_NUM_SGPRS = 16 }
 

Functions

IsaVersion getIsaVersion (const FeatureBitset &Features)
 
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 FeatureBitset &Features)
 
unsigned getLocalMemorySize (const FeatureBitset &Features)
 
unsigned getEUsPerCU (const FeatureBitset &Features)
 
unsigned getMaxWorkGroupsPerCU (const FeatureBitset &Features, unsigned FlatWorkGroupSize)
 
unsigned getMaxWavesPerCU (const FeatureBitset &Features)
 
unsigned getMaxWavesPerCU (const FeatureBitset &Features, unsigned FlatWorkGroupSize)
 
unsigned getMinWavesPerEU (const FeatureBitset &Features)
 
unsigned getMaxWavesPerEU (const FeatureBitset &Features)
 
unsigned getMaxWavesPerEU (const FeatureBitset &Features, unsigned FlatWorkGroupSize)
 
unsigned getMinFlatWorkGroupSize (const FeatureBitset &Features)
 
unsigned getMaxFlatWorkGroupSize (const FeatureBitset &Features)
 
unsigned getWavesPerWorkGroup (const FeatureBitset &Features, unsigned FlatWorkGroupSize)
 
unsigned getSGPRAllocGranule (const FeatureBitset &Features)
 
unsigned getSGPREncodingGranule (const FeatureBitset &Features)
 
unsigned getTotalNumSGPRs (const FeatureBitset &Features)
 
unsigned getAddressableNumSGPRs (const FeatureBitset &Features)
 
unsigned getMinNumSGPRs (const FeatureBitset &Features, unsigned WavesPerEU)
 
unsigned getMaxNumSGPRs (const FeatureBitset &Features, unsigned WavesPerEU, bool Addressable)
 
unsigned getNumExtraSGPRs (const FeatureBitset &Features, bool VCCUsed, bool FlatScrUsed, bool XNACKUsed)
 
unsigned getNumExtraSGPRs (const FeatureBitset &Features, bool VCCUsed, bool FlatScrUsed)
 
unsigned getNumSGPRBlocks (const FeatureBitset &Features, unsigned NumSGPRs)
 
unsigned getVGPRAllocGranule (const FeatureBitset &Features)
 
unsigned getVGPREncodingGranule (const FeatureBitset &Features)
 
unsigned getTotalNumVGPRs (const FeatureBitset &Features)
 
unsigned getAddressableNumVGPRs (const FeatureBitset &Features)
 
unsigned getMinNumVGPRs (const FeatureBitset &Features, unsigned WavesPerEU)
 
unsigned getMaxNumVGPRs (const FeatureBitset &Features, unsigned WavesPerEU)
 
unsigned getNumVGPRBlocks (const FeatureBitset &Features, unsigned NumVGPRs)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
FIXED_NUM_SGPRS_FOR_INIT_BUG 
TRAP_NUM_SGPRS 

Definition at line 49 of file AMDGPUBaseInfo.h.

Function Documentation

◆ getAddressableNumSGPRs()

unsigned llvm::AMDGPU::IsaInfo::getAddressableNumSGPRs ( const FeatureBitset Features)

◆ getAddressableNumVGPRs()

unsigned llvm::AMDGPU::IsaInfo::getAddressableNumVGPRs ( const FeatureBitset Features)
Returns
Addressable number of VGPRs for given subtarget Features.

Definition at line 386 of file AMDGPUBaseInfo.cpp.

References getTotalNumVGPRs().

Referenced by llvm::SISubtarget::getAddressableNumVGPRs(), getMaxNumVGPRs(), and getMinNumVGPRs().

◆ getEUsPerCU()

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

Definition at line 230 of file AMDGPUBaseInfo.cpp.

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

◆ getIsaVersion()

IsaVersion llvm::AMDGPU::IsaInfo::getIsaVersion ( const FeatureBitset Features)

◆ getLocalMemorySize()

unsigned llvm::AMDGPU::IsaInfo::getLocalMemorySize ( const FeatureBitset Features)
Returns
Local memory size in bytes for given subtarget Features.

Definition at line 221 of file AMDGPUBaseInfo.cpp.

◆ getMaxFlatWorkGroupSize()

unsigned llvm::AMDGPU::IsaInfo::getMaxFlatWorkGroupSize ( const FeatureBitset Features)
Returns
Maximum flat work group size for given subtarget Features.

Definition at line 275 of file AMDGPUBaseInfo.cpp.

Referenced by llvm::AMDGPUSubtarget::getMaxFlatWorkGroupSize().

◆ getMaxNumSGPRs()

unsigned llvm::AMDGPU::IsaInfo::getMaxNumSGPRs ( const FeatureBitset Features,
unsigned  WavesPerEU,
bool  Addressable 
)
Returns
Maximum number of SGPRs that meets the given number of waves per execution unit requirement for given subtarget Features.

Definition at line 326 of file AMDGPUBaseInfo.cpp.

References llvm::alignDown(), assert(), getAddressableNumSGPRs(), getIsaVersion(), getSGPRAllocGranule(), getTotalNumSGPRs(), llvm::AMDGPU::IsaInfo::IsaVersion::Major, TRAP_NUM_SGPRS, and llvm::IndexedInstrProf::Version.

Referenced by llvm::SISubtarget::getMaxNumSGPRs().

◆ getMaxNumVGPRs()

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

Definition at line 401 of file AMDGPUBaseInfo.cpp.

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

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

◆ getMaxWavesPerCU() [1/2]

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

Definition at line 245 of file AMDGPUBaseInfo.cpp.

References getEUsPerCU(), and getMaxWavesPerEU().

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

◆ getMaxWavesPerCU() [2/2]

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

Definition at line 249 of file AMDGPUBaseInfo.cpp.

References getWavesPerWorkGroup().

Referenced by getMaxWavesPerEU().

◆ getMaxWavesPerEU() [1/2]

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

Definition at line 258 of file AMDGPUBaseInfo.cpp.

Referenced by llvm::AMDGPUSubtarget::getMaxWavesPerEU().

◆ getMaxWavesPerEU() [2/2]

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

Definition at line 265 of file AMDGPUBaseInfo.cpp.

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

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

◆ getMaxWorkGroupsPerCU()

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

Definition at line 234 of file AMDGPUBaseInfo.cpp.

References getWavesPerWorkGroup(), and N.

Referenced by llvm::AMDGPUSubtarget::getMaxWorkGroupsPerCU().

◆ getMinFlatWorkGroupSize()

unsigned llvm::AMDGPU::IsaInfo::getMinFlatWorkGroupSize ( const FeatureBitset Features)
Returns
Minimum flat work group size for given subtarget Features.

Definition at line 271 of file AMDGPUBaseInfo.cpp.

Referenced by llvm::AMDGPUSubtarget::getMinFlatWorkGroupSize().

◆ getMinNumSGPRs()

unsigned llvm::AMDGPU::IsaInfo::getMinNumSGPRs ( const FeatureBitset Features,
unsigned  WavesPerEU 
)
Returns
Minimum number of SGPRs that meets the given number of waves per execution unit requirement for given subtarget Features.

Definition at line 313 of file AMDGPUBaseInfo.cpp.

References llvm::alignDown(), assert(), getAddressableNumSGPRs(), getMaxWavesPerEU(), getSGPRAllocGranule(), getTotalNumSGPRs(), and TRAP_NUM_SGPRS.

Referenced by llvm::SISubtarget::getMinNumSGPRs().

◆ getMinNumVGPRs()

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

Definition at line 390 of file AMDGPUBaseInfo.cpp.

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

Referenced by llvm::SISubtarget::getMinNumVGPRs().

◆ getMinWavesPerEU()

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

Definition at line 254 of file AMDGPUBaseInfo.cpp.

Referenced by llvm::AMDGPUSubtarget::getMinWavesPerEU().

◆ getNumExtraSGPRs() [1/2]

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

Definition at line 341 of file AMDGPUBaseInfo.cpp.

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

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

◆ getNumExtraSGPRs() [2/2]

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

Definition at line 362 of file AMDGPUBaseInfo.cpp.

◆ getNumSGPRBlocks()

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

Definition at line 368 of file AMDGPUBaseInfo.cpp.

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

Referenced by getSpecialRegForName(), and hasAnyNonFlatUseOfReg().

◆ getNumVGPRBlocks()

unsigned llvm::AMDGPU::IsaInfo::getNumVGPRBlocks ( const FeatureBitset Features,
unsigned  NumSGPRs 
)
Returns
Number of VGPR blocks needed for given subtarget Features when NumVGPRs are used.

Definition at line 410 of file AMDGPUBaseInfo.cpp.

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

Referenced by getSpecialRegForName(), and hasAnyNonFlatUseOfReg().

◆ getSGPRAllocGranule()

unsigned llvm::AMDGPU::IsaInfo::getSGPRAllocGranule ( const FeatureBitset Features)
Returns
SGPR allocation granularity for given subtarget Features.

Definition at line 285 of file AMDGPUBaseInfo.cpp.

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

Referenced by getMaxNumSGPRs(), getMinNumSGPRs(), and llvm::SISubtarget::getSGPRAllocGranule().

◆ getSGPREncodingGranule()

unsigned llvm::AMDGPU::IsaInfo::getSGPREncodingGranule ( const FeatureBitset Features)
Returns
SGPR encoding granularity for given subtarget Features.

Definition at line 292 of file AMDGPUBaseInfo.cpp.

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

◆ getTotalNumSGPRs()

unsigned llvm::AMDGPU::IsaInfo::getTotalNumSGPRs ( const FeatureBitset Features)
Returns
Total number of SGPRs for given subtarget Features.

Definition at line 296 of file AMDGPUBaseInfo.cpp.

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

Referenced by getMaxNumSGPRs(), getMinNumSGPRs(), llvm::SISubtarget::getTotalNumSGPRs(), and hasAnyNonFlatUseOfReg().

◆ getTotalNumVGPRs()

unsigned llvm::AMDGPU::IsaInfo::getTotalNumVGPRs ( const FeatureBitset Features)
Returns
Total number of VGPRs for given subtarget Features.

Definition at line 382 of file AMDGPUBaseInfo.cpp.

Referenced by getAddressableNumVGPRs(), getMaxNumVGPRs(), getMinNumVGPRs(), and llvm::SISubtarget::getTotalNumVGPRs().

◆ getVGPRAllocGranule()

unsigned llvm::AMDGPU::IsaInfo::getVGPRAllocGranule ( const FeatureBitset Features)
Returns
VGPR allocation granularity for given subtarget Features.

Definition at line 374 of file AMDGPUBaseInfo.cpp.

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

◆ getVGPREncodingGranule()

unsigned llvm::AMDGPU::IsaInfo::getVGPREncodingGranule ( const FeatureBitset Features)
Returns
VGPR encoding granularity for given subtarget Features.

Definition at line 378 of file AMDGPUBaseInfo.cpp.

References getVGPRAllocGranule().

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

◆ getWavefrontSize()

unsigned llvm::AMDGPU::IsaInfo::getWavefrontSize ( const FeatureBitset Features)
Returns
Wavefront size for given subtarget Features.

Definition at line 212 of file AMDGPUBaseInfo.cpp.

Referenced by getWavesPerWorkGroup().

◆ getWavesPerWorkGroup()

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

Definition at line 279 of file AMDGPUBaseInfo.cpp.

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

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

◆ hasCodeObjectV3()

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

◆ streamIsaVersion()

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