LLVM  7.0.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
llvm::AMDGPUSubtarget Class Reference

#include "Target/AMDGPU/AMDGPUSubtarget.h"

Inheritance diagram for llvm::AMDGPUSubtarget:
[legend]
Collaboration diagram for llvm::AMDGPUSubtarget:
[legend]

Public Types

enum  Generation {
  R600 = 0, R700 = 1, EVERGREEN = 2, NORTHERN_ISLANDS = 3,
  SOUTHERN_ISLANDS = 4, SEA_ISLANDS = 5, VOLCANIC_ISLANDS = 6, GFX9 = 7
}
 

Public Member Functions

 AMDGPUSubtarget (const Triple &TT, const FeatureBitset &FeatureBits)
 
std::pair< unsigned, unsigned > getDefaultFlatWorkGroupSize (CallingConv::ID CC) const
 
std::pair< unsigned, unsigned > getFlatWorkGroupSizes (const Function &F) const
 
std::pair< unsigned, unsigned > getWavesPerEU (const Function &F) const
 
unsigned getMaxLocalMemSizeWithWaveCount (unsigned WaveCount, const Function &) const
 Return the amount of LDS that can be used that will not restrict the occupancy lower than WaveCount. More...
 
unsigned getOccupancyWithLocalMemSize (uint32_t Bytes, const Function &) const
 Inverse of getMaxLocalMemWithWaveCount. More...
 
unsigned getOccupancyWithLocalMemSize (const MachineFunction &MF) const
 
bool isAmdHsaOS () const
 
bool isAmdPalOS () const
 
bool isMesa3DOS () const
 
bool isMesaKernel (const Function &F) const
 
bool isAmdCodeObjectV2 (const Function &F) const
 
bool has16BitInsts () const
 
bool hasMadMixInsts () const
 
bool hasFP32Denormals () const
 
bool hasFPExceptions () const
 
bool hasSDWA () const
 
bool hasVOP3PInsts () const
 
bool hasMulI24 () const
 
bool hasMulU24 () const
 
bool hasFminFmaxLegacy () const
 
bool isPromoteAllocaEnabled () const
 
unsigned getWavefrontSize () const
 
int getLocalMemorySize () const
 
unsigned getAlignmentForImplicitArgPtr () const
 
unsigned getExplicitKernelArgOffset (const Function &F) const
 Returns the offset in bytes from the start of the input buffer of the first explicit kernel argument. More...
 
unsigned getMaxWorkGroupsPerCU (unsigned FlatWorkGroupSize) const
 
unsigned getMinFlatWorkGroupSize () const
 
unsigned getMaxFlatWorkGroupSize () const
 
unsigned getMaxWavesPerEU (unsigned FlatWorkGroupSize) const
 
unsigned getMinWavesPerEU () const
 
unsigned getMaxWavesPerEU () const
 
bool makeLIDRangeMetadata (Instruction *I) const
 Creates value range metadata on an workitemid.* inrinsic call or load. More...
 
unsigned getImplicitArgNumBytes (const Function &F) const
 
uint64_t getExplicitKernArgSize (const Function &F, unsigned &MaxAlign) const
 
unsigned getKernArgSegmentSize (const Function &F, unsigned &MaxAlign) const
 
virtual ~AMDGPUSubtarget ()
 

Static Public Member Functions

static const AMDGPUSubtarget & get (const MachineFunction &MF)
 
static const AMDGPUSubtarget & get (const TargetMachine &TM, const Function &F)
 

Protected Attributes

const FeatureBitset & SubtargetFeatureBits
 
bool Has16BitInsts
 
bool HasMadMixInsts
 
bool FP32Denormals
 
bool FPExceptions
 
bool HasSDWA
 
bool HasVOP3PInsts
 
bool HasMulI24
 
bool HasMulU24
 
bool HasFminFmaxLegacy
 
bool EnablePromoteAlloca
 
int LocalMemorySize
 
unsigned WavefrontSize
 

Detailed Description

Definition at line 49 of file AMDGPUSubtarget.h.

Member Enumeration Documentation

◆ Generation

Enumerator
R600 
R700 
EVERGREEN 
NORTHERN_ISLANDS 
SOUTHERN_ISLANDS 
SEA_ISLANDS 
VOLCANIC_ISLANDS 
GFX9 

Definition at line 51 of file AMDGPUSubtarget.h.

Constructor & Destructor Documentation

◆ AMDGPUSubtarget()

AMDGPUSubtarget::AMDGPUSubtarget ( const Triple &  TT,
const FeatureBitset &  FeatureBits 
)

Definition at line 127 of file AMDGPUSubtarget.cpp.

◆ ~AMDGPUSubtarget()

virtual llvm::AMDGPUSubtarget::~AMDGPUSubtarget ( )
inlinevirtual

Definition at line 246 of file AMDGPUSubtarget.h.

Member Function Documentation

◆ get() [1/2]

const AMDGPUSubtarget & AMDGPUSubtarget::get ( const MachineFunction &  MF)
static

◆ get() [2/2]

const AMDGPUSubtarget & AMDGPUSubtarget::get ( const TargetMachine &  TM,
const Function &  F 
)
static

◆ getAlignmentForImplicitArgPtr()

unsigned llvm::AMDGPUSubtarget::getAlignmentForImplicitArgPtr ( ) const
inline

◆ getDefaultFlatWorkGroupSize()

std::pair< unsigned, unsigned > AMDGPUSubtarget::getDefaultFlatWorkGroupSize ( CallingConv::ID  CC) const

◆ getExplicitKernArgSize()

uint64_t AMDGPUSubtarget::getExplicitKernArgSize ( const Function &  F,
unsigned &  MaxAlign 
) const

◆ getExplicitKernelArgOffset()

unsigned llvm::AMDGPUSubtarget::getExplicitKernelArgOffset ( const Function &  F) const
inline

Returns the offset in bytes from the start of the input buffer of the first explicit kernel argument.

Definition at line 195 of file AMDGPUSubtarget.h.

References isAmdCodeObjectV2().

Referenced by llvm::AMDGPUTargetLowering::analyzeFormalArgumentsCompute(), llvm::AMDGPUTargetLowering::getImplicitParameterOffset(), getKernArgSegmentSize(), and llvm::AMDGPUCallLowering::lowerFormalArguments().

◆ getFlatWorkGroupSizes()

std::pair< unsigned, unsigned > AMDGPUSubtarget::getFlatWorkGroupSizes ( const Function &  F) const
Returns
Subtarget's default pair of minimum/maximum flat work group sizes for function F, or minimum/maximum flat work group sizes explicitly requested using "amdgpu-flat-work-group-size" attribute attached to function F.
Subtarget's default values if explicitly requested values cannot be converted to integer, or violate subtarget's specifications.

Definition at line 269 of file AMDGPUSubtarget.cpp.

References llvm::Default, llvm::Function::getCallingConv(), getDefaultFlatWorkGroupSize(), llvm::AMDGPU::getIntegerAttribute(), llvm::AMDGPU::getIntegerPairAttribute(), getMaxFlatWorkGroupSize(), and getMinFlatWorkGroupSize().

Referenced by getMaxLocalMemSizeWithWaveCount(), getOccupancyWithLocalMemSize(), getWavesPerEU(), isCallPromotable(), makeLIDRangeMetadata(), parseCachePolicy(), and llvm::SIMachineFunctionInfo::SIMachineFunctionInfo().

◆ getImplicitArgNumBytes()

unsigned llvm::AMDGPUSubtarget::getImplicitArgNumBytes ( const Function &  F) const
inline
Returns
Number of bytes of arguments that are passed to a shader or kernel in addition to the explicit ones declared for the function.

Definition at line 236 of file AMDGPUSubtarget.h.

References F(), getExplicitKernArgSize(), llvm::AMDGPU::getIntegerAttribute(), getKernArgSegmentSize(), and isMesaKernel().

Referenced by getKernArgSegmentSize().

◆ getKernArgSegmentSize()

unsigned AMDGPUSubtarget::getKernArgSegmentSize ( const Function &  F,
unsigned &  MaxAlign 
) const

◆ getLocalMemorySize()

int llvm::AMDGPUSubtarget::getLocalMemorySize ( ) const
inline

◆ getMaxFlatWorkGroupSize()

unsigned llvm::AMDGPUSubtarget::getMaxFlatWorkGroupSize ( ) const
inline
Returns
Maximum flat work group size supported by the subtarget.

Definition at line 212 of file AMDGPUSubtarget.h.

References llvm::AMDGPU::IsaInfo::getMaxFlatWorkGroupSize().

Referenced by getFlatWorkGroupSizes().

◆ getMaxLocalMemSizeWithWaveCount()

unsigned AMDGPUSubtarget::getMaxLocalMemSizeWithWaveCount ( unsigned  WaveCount,
const Function &  F 
) const

Return the amount of LDS that can be used that will not restrict the occupancy lower than WaveCount.

Definition at line 222 of file AMDGPUSubtarget.cpp.

References getFlatWorkGroupSizes(), getLocalMemorySize(), llvm::GCNSubtarget::getMaxWavesPerEU(), and getMaxWorkGroupsPerCU().

Referenced by llvm::GCNSubtarget::dumpCode(), and isCallPromotable().

◆ getMaxWavesPerEU() [1/2]

unsigned llvm::AMDGPUSubtarget::getMaxWavesPerEU ( unsigned  FlatWorkGroupSize) const
inline
Returns
Maximum number of waves per execution unit supported by the subtarget and limited by given FlatWorkGroupSize.

Definition at line 218 of file AMDGPUSubtarget.h.

References llvm::AMDGPU::IsaInfo::getMaxWavesPerEU().

Referenced by isCallPromotable().

◆ getMaxWavesPerEU() [2/2]

unsigned llvm::AMDGPUSubtarget::getMaxWavesPerEU ( ) const
inline

Definition at line 229 of file AMDGPUSubtarget.h.

References I, and makeLIDRangeMetadata().

◆ getMaxWorkGroupsPerCU()

unsigned llvm::AMDGPUSubtarget::getMaxWorkGroupsPerCU ( unsigned  FlatWorkGroupSize) const
inline
Returns
Maximum number of work groups per compute unit supported by the subtarget and limited by given FlatWorkGroupSize.

Definition at line 201 of file AMDGPUSubtarget.h.

References llvm::AMDGPU::IsaInfo::getMaxWorkGroupsPerCU().

Referenced by getMaxLocalMemSizeWithWaveCount(), and getOccupancyWithLocalMemSize().

◆ getMinFlatWorkGroupSize()

unsigned llvm::AMDGPUSubtarget::getMinFlatWorkGroupSize ( ) const
inline
Returns
Minimum flat work group size supported by the subtarget.

Definition at line 207 of file AMDGPUSubtarget.h.

References llvm::AMDGPU::IsaInfo::getMinFlatWorkGroupSize().

Referenced by getFlatWorkGroupSizes().

◆ getMinWavesPerEU()

unsigned llvm::AMDGPUSubtarget::getMinWavesPerEU ( ) const
inline
Returns
Minimum number of waves per execution unit supported by the subtarget.

Definition at line 225 of file AMDGPUSubtarget.h.

References llvm::AMDGPU::IsaInfo::getMinWavesPerEU().

Referenced by getWavesPerEU().

◆ getOccupancyWithLocalMemSize() [1/2]

unsigned AMDGPUSubtarget::getOccupancyWithLocalMemSize ( uint32_t  Bytes,
const Function &  F 
) const

Inverse of getMaxLocalMemWithWaveCount.

Return the maximum wavecount if the given LDS memory size is the only constraint.

Definition at line 232 of file AMDGPUSubtarget.cpp.

References getFlatWorkGroupSizes(), getLocalMemorySize(), llvm::GCNSubtarget::getMaxWavesPerEU(), getMaxWorkGroupsPerCU(), and llvm::max().

Referenced by getOccupancyWithLocalMemSize(), llvm::SIRegisterInfo::getRegPressureLimit(), isCallPromotable(), and llvm::SIMachineFunctionInfo::limitOccupancy().

◆ getOccupancyWithLocalMemSize() [2/2]

unsigned AMDGPUSubtarget::getOccupancyWithLocalMemSize ( const MachineFunction &  MF) const

◆ getWavefrontSize()

unsigned llvm::AMDGPUSubtarget::getWavefrontSize ( ) const
inline

◆ getWavesPerEU()

std::pair< unsigned, unsigned > AMDGPUSubtarget::getWavesPerEU ( const Function &  F) const
Returns
Subtarget's default pair of minimum/maximum number of waves per execution unit for function F, or minimum/maximum number of waves per execution unit explicitly requested using "amdgpu-waves-per-eu" attribute attached to function F.
Subtarget's default values if explicitly requested values cannot be converted to integer, violate subtarget's specifications, or are not compatible with minimum/maximum number of waves limited by flat work group size, register usage, and/or lds usage.

Definition at line 299 of file AMDGPUSubtarget.cpp.

References llvm::Default, getFlatWorkGroupSizes(), llvm::AMDGPU::getIntegerPairAttribute(), llvm::GCNSubtarget::getMaxWavesPerEU(), getMinWavesPerEU(), and llvm::Function::hasFnAttribute().

Referenced by isCallPromotable(), and llvm::SIMachineFunctionInfo::SIMachineFunctionInfo().

◆ has16BitInsts()

bool llvm::AMDGPUSubtarget::has16BitInsts ( ) const
inline

◆ hasFminFmaxLegacy()

bool llvm::AMDGPUSubtarget::hasFminFmaxLegacy ( ) const
inline

Definition at line 173 of file AMDGPUSubtarget.h.

References HasFminFmaxLegacy.

Referenced by llvm::AMDGPUTargetLowering::performSelectCombine().

◆ hasFP32Denormals()

bool llvm::AMDGPUSubtarget::hasFP32Denormals ( ) const
inline

◆ hasFPExceptions()

bool llvm::AMDGPUSubtarget::hasFPExceptions ( ) const
inline

Definition at line 153 of file AMDGPUSubtarget.h.

References FPExceptions.

Referenced by llvm::SITargetLowering::SITargetLowering().

◆ hasMadMixInsts()

bool llvm::AMDGPUSubtarget::hasMadMixInsts ( ) const
inline

Definition at line 145 of file AMDGPUSubtarget.h.

References HasMadMixInsts.

Referenced by llvm::SITargetLowering::isFPExtFoldable().

◆ hasMulI24()

bool llvm::AMDGPUSubtarget::hasMulI24 ( ) const
inline

◆ hasMulU24()

bool llvm::AMDGPUSubtarget::hasMulU24 ( ) const
inline

◆ hasSDWA()

bool llvm::AMDGPUSubtarget::hasSDWA ( ) const
inline

◆ hasVOP3PInsts()

bool llvm::AMDGPUSubtarget::hasVOP3PInsts ( ) const
inline

◆ isAmdCodeObjectV2()

bool llvm::AMDGPUSubtarget::isAmdCodeObjectV2 ( const Function &  F) const
inline

◆ isAmdHsaOS()

bool llvm::AMDGPUSubtarget::isAmdHsaOS ( ) const
inline

◆ isAmdPalOS()

bool llvm::AMDGPUSubtarget::isAmdPalOS ( ) const
inline

◆ isMesa3DOS()

bool llvm::AMDGPUSubtarget::isMesa3DOS ( ) const
inline

◆ isMesaKernel()

bool llvm::AMDGPUSubtarget::isMesaKernel ( const Function &  F) const
inline

◆ isPromoteAllocaEnabled()

bool llvm::AMDGPUSubtarget::isPromoteAllocaEnabled ( ) const
inline

Definition at line 177 of file AMDGPUSubtarget.h.

References EnablePromoteAlloca.

◆ makeLIDRangeMetadata()

bool AMDGPUSubtarget::makeLIDRangeMetadata ( Instruction *  I) const

Member Data Documentation

◆ EnablePromoteAlloca

bool llvm::AMDGPUSubtarget::EnablePromoteAlloca
protected

Definition at line 76 of file AMDGPUSubtarget.h.

Referenced by isPromoteAllocaEnabled().

◆ FP32Denormals

bool llvm::AMDGPUSubtarget::FP32Denormals
protected

◆ FPExceptions

bool llvm::AMDGPUSubtarget::FPExceptions
protected

Definition at line 70 of file AMDGPUSubtarget.h.

Referenced by hasFPExceptions().

◆ Has16BitInsts

bool llvm::AMDGPUSubtarget::Has16BitInsts
protected

Definition at line 67 of file AMDGPUSubtarget.h.

Referenced by has16BitInsts().

◆ HasFminFmaxLegacy

bool llvm::AMDGPUSubtarget::HasFminFmaxLegacy
protected

◆ HasMadMixInsts

bool llvm::AMDGPUSubtarget::HasMadMixInsts
protected

Definition at line 68 of file AMDGPUSubtarget.h.

Referenced by hasMadMixInsts().

◆ HasMulI24

bool llvm::AMDGPUSubtarget::HasMulI24
protected

◆ HasMulU24

bool llvm::AMDGPUSubtarget::HasMulU24
protected

◆ HasSDWA

bool llvm::AMDGPUSubtarget::HasSDWA
protected

Definition at line 71 of file AMDGPUSubtarget.h.

Referenced by hasSDWA().

◆ HasVOP3PInsts

bool llvm::AMDGPUSubtarget::HasVOP3PInsts
protected

Definition at line 72 of file AMDGPUSubtarget.h.

Referenced by hasVOP3PInsts().

◆ LocalMemorySize

int llvm::AMDGPUSubtarget::LocalMemorySize
protected

◆ SubtargetFeatureBits

const FeatureBitset& llvm::AMDGPUSubtarget::SubtargetFeatureBits
protected

Definition at line 66 of file AMDGPUSubtarget.h.

◆ WavefrontSize

unsigned llvm::AMDGPUSubtarget::WavefrontSize
protected

Definition at line 78 of file AMDGPUSubtarget.h.

Referenced by getWavefrontSize(), and llvm::GCNSubtarget::getWavefrontSizeLog2().


The documentation for this class was generated from the following files: