LLVM
17.0.0git
|
#include "Target/AMDGPU/AMDGPUMachineFunction.h"
Static Public Member Functions | |
static const Function * | getKernelLDSFunctionFromGlobal (const GlobalVariable &GV) |
static const GlobalVariable * | getKernelLDSGlobalFromFunction (const Function &F) |
static bool | isKnownAddressLDSGlobal (const GlobalVariable &GV) |
static unsigned | calculateKnownAddressOfLDSGlobal (const GlobalVariable &GV) |
static std::optional< uint32_t > | getLDSKernelIdMetadata (const Function &F) |
![]() | |
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 |
Definition at line 25 of file AMDGPUMachineFunction.h.
AMDGPUMachineFunction::AMDGPUMachineFunction | ( | const Function & | F, |
const AMDGPUSubtarget & | ST | ||
) |
Definition at line 19 of file AMDGPUMachineFunction.cpp.
References llvm::CallingConv::AMDGPU_KERNEL, CC, ExplicitKernArgSize, F, GDSSize, llvm::Attribute::getValueAsBool(), llvm::Attribute::getValueAsString(), llvm::Attribute::isStringAttribute(), MaxKernArgAlign, MemoryBound, NoSignedZerosFPMath, S, llvm::CallingConv::SPIR_KERNEL, llvm::ARM_MB::ST, StaticGDSSize, and WaveLimiter.
Definition at line 153 of file AMDGPUMachineFunction.cpp.
References Align, allocateLDSGlobal(), assert(), calculateKnownAddressOfLDSGlobal(), canElideModuleLDS(), F, getDynLDSAlign(), getKernelLDSGlobalFromFunction(), isKnownAddressLDSGlobal(), isModuleEntryFunction(), M, ModuleLDSName, and llvm::Offset.
|
inline |
Definition at line 100 of file AMDGPUMachineFunction.h.
References DL, and DynLDSAlign.
Referenced by allocateKnownAddressLDSGlobal(), llvm::AMDGPULegalizerInfo::legalizeGlobalValue(), and llvm::AMDGPUTargetLowering::LowerGlobalAddress().
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.
|
static |
Definition at line 122 of file AMDGPUMachineFunction.cpp.
References llvm::alignTo(), assert(), canElideModuleLDS(), DL, f(), llvm::GlobalObject::getAlign(), getKernelLDSFunctionFromGlobal(), llvm::Value::getName(), llvm::GlobalValue::getParent(), llvm::GlobalValue::getValueType(), isKnownAddressLDSGlobal(), M, ModuleLDSName, and llvm::Offset.
Referenced by allocateKnownAddressLDSGlobal(), and llvm::AMDGPUAsmPrinter::lowerConstant().
|
inline |
Definition at line 124 of file AMDGPUMachineFunction.h.
References DynLDSAlign.
Referenced by allocateKnownAddressLDSGlobal().
|
inline |
Definition at line 68 of file AMDGPUMachineFunction.h.
References ExplicitKernArgSize.
Referenced by llvm::AMDGPUTargetLowering::getImplicitParameterOffset().
|
inline |
Definition at line 78 of file AMDGPUMachineFunction.h.
References GDSSize.
|
static |
Definition at line 98 of file AMDGPUMachineFunction.cpp.
References llvm::Value::getName(), llvm::GlobalValue::getParent(), M, and N.
Referenced by calculateKnownAddressOfLDSGlobal().
|
static |
Definition at line 109 of file AMDGPUMachineFunction.cpp.
Referenced by allocateKnownAddressLDSGlobal().
|
static |
Definition at line 203 of file AMDGPUMachineFunction.cpp.
References F, and llvm::ConstantInt::getZExtValue().
Referenced by llvm::AMDGPULegalizerInfo::getLDSKernelId(), llvm::AMDGPUCallLowering::passSpecialInputs(), and llvm::SITargetLowering::passSpecialInputs().
|
inline |
Definition at line 74 of file AMDGPUMachineFunction.h.
References LDSSize.
Referenced by llvm::SITargetLowering::EmitInstrWithCustomInserter(), llvm::SIRegisterInfo::getRegPressureLimit(), llvm::PreRARematStage::initGCNSchedStage(), llvm::SIMachineFunctionInfo::limitOccupancy(), llvm::GCNTargetMachine::parseMachineFunctionInfo(), and llvm::SIMachineFunctionInfo::SIMachineFunctionInfo().
|
inline |
Definition at line 72 of file AMDGPUMachineFunction.h.
References MaxKernArgAlign.
|
inline |
Definition at line 88 of file AMDGPUMachineFunction.h.
References NoSignedZerosFPMath.
|
inline |
Definition at line 82 of file AMDGPUMachineFunction.h.
References IsEntryFunction.
Referenced by llvm::SIMachineFunctionInfo::allocateWWMSpill(), llvm::SIRegisterInfo::buildSpillLoadStore(), llvm::SIFrameLowering::determineCalleeSaves(), llvm::SIFrameLowering::determineCalleeSavesSGPR(), llvm::SIRegisterInfo::eliminateFrameIndex(), llvm::SIFrameLowering::emitEntryFunctionPrologue(), llvm::SIFrameLowering::emitEpilogue(), llvm::AMDGPUAsmPrinter::emitFunctionBodyEnd(), llvm::AMDGPUAsmPrinter::emitFunctionBodyStart(), llvm::AMDGPUAsmPrinter::emitFunctionEntryLabel(), llvm::SIFrameLowering::emitPrologue(), llvm::SIRegisterInfo::getFrameRegister(), llvm::SIMachineFunctionInfo::getScavengeFI(), llvm::SIFrameLowering::hasFP(), llvm::AMDGPULegalizerInfo::legalizeImplicitArgPtr(), llvm::AMDGPULegalizerInfo::legalizeLDSKernelId(), llvm::SIFrameLowering::processFunctionBeforeFrameFinalized(), llvm::SIFrameLowering::requiresStackPointerReference(), llvm::AMDGPUAsmPrinter::runOnMachineFunction(), and llvm::SIMachineFunctionInfo::SIMachineFunctionInfo().
|
static |
Definition at line 92 of file AMDGPUMachineFunction.cpp.
References llvm::Value::getName(), ModuleLDSName, and name.
Referenced by allocateKnownAddressLDSGlobal(), calculateKnownAddressOfLDSGlobal(), and llvm::AMDGPUAsmPrinter::lowerConstant().
|
inline |
Definition at line 92 of file AMDGPUMachineFunction.h.
References MemoryBound.
Referenced by llvm::SIMachineFunctionInfo::getMinAllowedOccupancy().
|
inline |
Definition at line 86 of file AMDGPUMachineFunction.h.
References IsModuleEntryFunction.
Referenced by allocateKnownAddressLDSGlobal(), llvm::AMDGPULegalizerInfo::legalizeGlobalValue(), llvm::AMDGPUTargetLowering::LowerGlobalAddress(), and llvm::AMDGPUAsmPrinter::runOnMachineFunction().
|
inline |
Definition at line 96 of file AMDGPUMachineFunction.h.
References WaveLimiter.
Referenced by llvm::SIMachineFunctionInfo::getMinAllowedOccupancy(), and llvm::AMDGPUAsmPrinter::runOnMachineFunction().
void AMDGPUMachineFunction::setDynLDSAlign | ( | const DataLayout & | DL, |
const GlobalVariable & | GV | ||
) |
Definition at line 217 of file AMDGPUMachineFunction.cpp.
References llvm::alignTo(), assert(), DL, DynLDSAlign, llvm::GlobalObject::getAlign(), llvm::GlobalValue::getValueType(), LDSSize, and StaticLDSSize.
Referenced by llvm::AMDGPULegalizerInfo::legalizeGlobalValue().
|
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().
|
protected |
Definition at line 31 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), and getExplicitKernArgSize().
|
protected |
Definition at line 36 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), and getGDSSize().
|
protected |
Definition at line 52 of file AMDGPUMachineFunction.h.
Referenced by isEntryFunction().
|
protected |
Definition at line 55 of file AMDGPUMachineFunction.h.
Referenced by isModuleEntryFunction().
|
protected |
Number of bytes in the LDS that are being used.
Definition at line 35 of file AMDGPUMachineFunction.h.
Referenced by getLDSSize(), and setDynLDSAlign().
|
protected |
Definition at line 32 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), getMaxKernArgAlign(), and llvm::SIMachineFunctionInfo::SIMachineFunctionInfo().
|
protected |
Definition at line 60 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), and isMemoryBound().
|
protected |
Definition at line 57 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), and hasNoSignedZerosFPMath().
|
protected |
Definition at line 41 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction().
|
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().
|
protected |
Definition at line 63 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), and needsWaveLimiter().