LLVM  17.0.0git
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
llvm::AMDGPUMachineFunction Class Reference

#include "Target/AMDGPU/AMDGPUMachineFunction.h"

Inheritance diagram for llvm::AMDGPUMachineFunction:
Inheritance graph
[legend]
Collaboration diagram for llvm::AMDGPUMachineFunction:
Collaboration graph
[legend]

Public Member Functions

 AMDGPUMachineFunction (const Function &F, const AMDGPUSubtarget &ST)
 
uint64_t getExplicitKernArgSize () const
 
Align getMaxKernArgAlign () const
 
uint32_t getLDSSize () const
 
uint32_t getGDSSize () const
 
bool isEntryFunction () const
 
bool isModuleEntryFunction () const
 
bool hasNoSignedZerosFPMath () const
 
bool isMemoryBound () const
 
bool needsWaveLimiter () const
 
unsigned allocateLDSGlobal (const DataLayout &DL, const GlobalVariable &GV)
 
unsigned allocateLDSGlobal (const DataLayout &DL, const GlobalVariable &GV, Align Trailing)
 
void allocateKnownAddressLDSGlobal (const Function &F)
 
Align getDynLDSAlign () const
 
void setDynLDSAlign (const DataLayout &DL, const GlobalVariable &GV)
 
- Public Member Functions inherited from llvm::MachineFunctionInfo
virtual ~MachineFunctionInfo ()
 
virtual MachineFunctionInfoclone (BumpPtrAllocator &Allocator, MachineFunction &DestMF, const DenseMap< MachineBasicBlock *, MachineBasicBlock * > &Src2DstMBB) const
 Make a functionally equivalent copy of this MachineFunctionInfo in MF. More...
 

Static Public Member Functions

static const FunctiongetKernelLDSFunctionFromGlobal (const GlobalVariable &GV)
 
static const GlobalVariablegetKernelLDSGlobalFromFunction (const Function &F)
 
static bool isKnownAddressLDSGlobal (const GlobalVariable &GV)
 
static unsigned calculateKnownAddressOfLDSGlobal (const GlobalVariable &GV)
 
static std::optional< uint32_tgetLDSKernelIdMetadata (const Function &F)
 
- Static Public Member Functions inherited from llvm::MachineFunctionInfo
template<typename FuncInfoTy , typename SubtargetTy = TargetSubtargetInfo>
static FuncInfoTy * create (BumpPtrAllocator &Allocator, const Function &F, const SubtargetTy *STI)
 Factory function: default behavior is to call new using the supplied allocator. More...
 
template<typename Ty >
static Ty * create (BumpPtrAllocator &Allocator, const Ty &MFI)
 

Protected Attributes

uint64_t ExplicitKernArgSize = 0
 
Align MaxKernArgAlign
 
uint32_t LDSSize = 0
 Number of bytes in the LDS that are being used. More...
 
uint32_t GDSSize = 0
 
uint32_t StaticLDSSize = 0
 Number of bytes in the LDS allocated statically. More...
 
uint32_t StaticGDSSize = 0
 
Align DynLDSAlign
 Align for dynamic shared memory if any. More...
 
bool IsEntryFunction = false
 
bool IsModuleEntryFunction = false
 
bool NoSignedZerosFPMath = false
 
bool MemoryBound = false
 
bool WaveLimiter = false
 

Detailed Description

Definition at line 25 of file AMDGPUMachineFunction.h.

Constructor & Destructor Documentation

◆ AMDGPUMachineFunction()

AMDGPUMachineFunction::AMDGPUMachineFunction ( const Function F,
const AMDGPUSubtarget ST 
)

Member Function Documentation

◆ allocateKnownAddressLDSGlobal()

void AMDGPUMachineFunction::allocateKnownAddressLDSGlobal ( const Function F)

◆ allocateLDSGlobal() [1/2]

unsigned llvm::AMDGPUMachineFunction::allocateLDSGlobal ( const DataLayout DL,
const GlobalVariable GV 
)
inline

◆ allocateLDSGlobal() [2/2]

unsigned AMDGPUMachineFunction::allocateLDSGlobal ( const DataLayout DL,
const GlobalVariable GV,
Align  Trailing 
)

TODO: We should sort these to minimize wasted space due to alignment padding. Currently the padding is decided by the first encountered use during lowering.

Definition at line 54 of file AMDGPUMachineFunction.cpp.

◆ calculateKnownAddressOfLDSGlobal()

unsigned AMDGPUMachineFunction::calculateKnownAddressOfLDSGlobal ( const GlobalVariable GV)
static

◆ getDynLDSAlign()

Align llvm::AMDGPUMachineFunction::getDynLDSAlign ( ) const
inline

Definition at line 124 of file AMDGPUMachineFunction.h.

References DynLDSAlign.

Referenced by allocateKnownAddressLDSGlobal().

◆ getExplicitKernArgSize()

uint64_t llvm::AMDGPUMachineFunction::getExplicitKernArgSize ( ) const
inline

◆ getGDSSize()

uint32_t llvm::AMDGPUMachineFunction::getGDSSize ( ) const
inline

Definition at line 78 of file AMDGPUMachineFunction.h.

References GDSSize.

◆ getKernelLDSFunctionFromGlobal()

const Function * AMDGPUMachineFunction::getKernelLDSFunctionFromGlobal ( const GlobalVariable GV)
static

◆ getKernelLDSGlobalFromFunction()

const GlobalVariable * AMDGPUMachineFunction::getKernelLDSGlobalFromFunction ( const Function F)
static

Definition at line 109 of file AMDGPUMachineFunction.cpp.

References F, and M.

Referenced by allocateKnownAddressLDSGlobal().

◆ getLDSKernelIdMetadata()

std::optional< uint32_t > AMDGPUMachineFunction::getLDSKernelIdMetadata ( const Function F)
static

◆ getLDSSize()

uint32_t llvm::AMDGPUMachineFunction::getLDSSize ( ) const
inline

◆ getMaxKernArgAlign()

Align llvm::AMDGPUMachineFunction::getMaxKernArgAlign ( ) const
inline

Definition at line 72 of file AMDGPUMachineFunction.h.

References MaxKernArgAlign.

◆ hasNoSignedZerosFPMath()

bool llvm::AMDGPUMachineFunction::hasNoSignedZerosFPMath ( ) const
inline

Definition at line 88 of file AMDGPUMachineFunction.h.

References NoSignedZerosFPMath.

◆ isEntryFunction()

bool llvm::AMDGPUMachineFunction::isEntryFunction ( ) const
inline

◆ isKnownAddressLDSGlobal()

bool AMDGPUMachineFunction::isKnownAddressLDSGlobal ( const GlobalVariable GV)
static

◆ isMemoryBound()

bool llvm::AMDGPUMachineFunction::isMemoryBound ( ) const
inline

Definition at line 92 of file AMDGPUMachineFunction.h.

References MemoryBound.

Referenced by llvm::SIMachineFunctionInfo::getMinAllowedOccupancy().

◆ isModuleEntryFunction()

bool llvm::AMDGPUMachineFunction::isModuleEntryFunction ( ) const
inline

◆ needsWaveLimiter()

bool llvm::AMDGPUMachineFunction::needsWaveLimiter ( ) const
inline

◆ setDynLDSAlign()

void AMDGPUMachineFunction::setDynLDSAlign ( const DataLayout DL,
const GlobalVariable GV 
)

Member Data Documentation

◆ DynLDSAlign

Align llvm::AMDGPUMachineFunction::DynLDSAlign
protected

Align for dynamic shared memory if any.

Dynamic shared memory is allocated directly after the static one, i.e., LDSSize. Need to pad LDSSize to ensure that dynamic one is aligned accordingly. The maximal alignment is updated during IR translation or lowering stages.

Definition at line 48 of file AMDGPUMachineFunction.h.

Referenced by allocateLDSGlobal(), getDynLDSAlign(), and setDynLDSAlign().

◆ ExplicitKernArgSize

uint64_t llvm::AMDGPUMachineFunction::ExplicitKernArgSize = 0
protected

Definition at line 31 of file AMDGPUMachineFunction.h.

Referenced by AMDGPUMachineFunction(), and getExplicitKernArgSize().

◆ GDSSize

uint32_t llvm::AMDGPUMachineFunction::GDSSize = 0
protected

Definition at line 36 of file AMDGPUMachineFunction.h.

Referenced by AMDGPUMachineFunction(), and getGDSSize().

◆ IsEntryFunction

bool llvm::AMDGPUMachineFunction::IsEntryFunction = false
protected

Definition at line 52 of file AMDGPUMachineFunction.h.

Referenced by isEntryFunction().

◆ IsModuleEntryFunction

bool llvm::AMDGPUMachineFunction::IsModuleEntryFunction = false
protected

Definition at line 55 of file AMDGPUMachineFunction.h.

Referenced by isModuleEntryFunction().

◆ LDSSize

uint32_t llvm::AMDGPUMachineFunction::LDSSize = 0
protected

Number of bytes in the LDS that are being used.

Definition at line 35 of file AMDGPUMachineFunction.h.

Referenced by getLDSSize(), and setDynLDSAlign().

◆ MaxKernArgAlign

Align llvm::AMDGPUMachineFunction::MaxKernArgAlign
protected

◆ MemoryBound

bool llvm::AMDGPUMachineFunction::MemoryBound = false
protected

Definition at line 60 of file AMDGPUMachineFunction.h.

Referenced by AMDGPUMachineFunction(), and isMemoryBound().

◆ NoSignedZerosFPMath

bool llvm::AMDGPUMachineFunction::NoSignedZerosFPMath = false
protected

Definition at line 57 of file AMDGPUMachineFunction.h.

Referenced by AMDGPUMachineFunction(), and hasNoSignedZerosFPMath().

◆ StaticGDSSize

uint32_t llvm::AMDGPUMachineFunction::StaticGDSSize = 0
protected

Definition at line 41 of file AMDGPUMachineFunction.h.

Referenced by AMDGPUMachineFunction().

◆ StaticLDSSize

uint32_t llvm::AMDGPUMachineFunction::StaticLDSSize = 0
protected

Number of bytes in the LDS allocated statically.

This field is only used in the instruction selector and not part of the machine function info.

Definition at line 40 of file AMDGPUMachineFunction.h.

Referenced by setDynLDSAlign().

◆ WaveLimiter

bool llvm::AMDGPUMachineFunction::WaveLimiter = false
protected

Definition at line 63 of file AMDGPUMachineFunction.h.

Referenced by AMDGPUMachineFunction(), and needsWaveLimiter().


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