LLVM 20.0.0git
|
#include "Target/AMDGPU/AMDGPUMachineFunction.h"
Static Public Member Functions | |
static std::optional< uint32_t > | getLDSKernelIdMetadata (const Function &F) |
static std::optional< uint32_t > | getLDSAbsoluteAddress (const GlobalValue &GV) |
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. | |
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. | |
uint32_t | GDSSize = 0 |
uint32_t | StaticLDSSize = 0 |
Number of bytes in the LDS allocated statically. | |
uint32_t | StaticGDSSize = 0 |
Align | DynLDSAlign |
Align for dynamic shared memory if any. | |
bool | UsesDynamicLDS = false |
bool | IsEntryFunction = false |
bool | IsModuleEntryFunction = false |
bool | IsChainFunction = false |
bool | NoSignedZerosFPMath = false |
bool | MemoryBound = false |
bool | WaveLimiter = false |
bool | HasInitWholeWave = false |
Definition at line 24 of file AMDGPUMachineFunction.h.
AMDGPUMachineFunction::AMDGPUMachineFunction | ( | const Function & | F, |
const AMDGPUSubtarget & | ST | ||
) |
Definition at line 42 of file AMDGPUMachineFunction.cpp.
References llvm::CallingConv::AMDGPU_KERNEL, CC, llvm::StringRef::consumeInteger(), llvm::StringRef::empty(), ExplicitKernArgSize, F, GDSSize, llvm::AMDGPU::getIntegerPairAttribute(), getKernelDynLDSGlobalFromFunction(), llvm::Attribute::getValueAsBool(), llvm::Attribute::getValueAsString(), hasLDSKernelArgument(), llvm::Attribute::isStringAttribute(), LDSSize, MaxKernArgAlign, MemoryBound, NoSignedZerosFPMath, llvm::CallingConv::SPIR_KERNEL, StaticGDSSize, StaticLDSSize, UsesDynamicLDS, and WaveLimiter.
|
inline |
Definition at line 117 of file AMDGPUMachineFunction.h.
References allocateLDSGlobal(), DL, and DynLDSAlign.
Referenced by allocateLDSGlobal(), 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 93 of file AMDGPUMachineFunction.cpp.
References llvm::alignTo(), assert(), DL, GDSSize, llvm::GlobalValue::getAddressSpace(), llvm::GlobalObject::getAlign(), getLDSAbsoluteAddress(), llvm::GlobalValue::getValueType(), isModuleEntryFunction(), llvm::AMDGPU::isNamedBarrier(), LDSSize, llvm_unreachable, llvm::AMDGPUAS::LOCAL_ADDRESS, llvm::Offset, llvm::AMDGPUAS::REGION_ADDRESS, llvm::report_fatal_error(), StaticGDSSize, and StaticLDSSize.
|
inline |
Definition at line 127 of file AMDGPUMachineFunction.h.
References DynLDSAlign.
|
inline |
Definition at line 75 of file AMDGPUMachineFunction.h.
References ExplicitKernArgSize.
Referenced by llvm::AMDGPUTargetLowering::getImplicitParameterOffset().
|
inline |
Definition at line 85 of file AMDGPUMachineFunction.h.
References GDSSize.
|
static |
Definition at line 189 of file AMDGPUMachineFunction.cpp.
References llvm::GlobalValue::getAbsoluteSymbolRange(), llvm::GlobalValue::getAddressSpace(), and llvm::AMDGPUAS::LOCAL_ADDRESS.
Referenced by allocateLDSGlobal(), llvm::AMDGPUAsmPrinter::lowerConstant(), llvm::AMDGPUTargetLowering::LowerGlobalAddress(), and setDynLDSAlign().
|
static |
Definition at line 173 of file AMDGPUMachineFunction.cpp.
References F, llvm::MDNode::getNumOperands(), and llvm::MDNode::getOperand().
Referenced by llvm::AMDGPULegalizerInfo::getLDSKernelId(), llvm::SITargetLowering::passSpecialInputs(), and llvm::AMDGPUCallLowering::passSpecialInputs().
|
inline |
Definition at line 81 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 79 of file AMDGPUMachineFunction.h.
References MaxKernArgAlign.
|
inline |
Definition at line 114 of file AMDGPUMachineFunction.h.
References HasInitWholeWave.
Referenced by llvm::SIMachineFunctionInfo::allocateWWMSpill().
|
inline |
Definition at line 102 of file AMDGPUMachineFunction.h.
References NoSignedZerosFPMath.
|
inline |
Definition at line 98 of file AMDGPUMachineFunction.h.
References isChainFunction(), and isEntryFunction().
Referenced by llvm::SIRegisterInfo::buildSpillLoadStore(), llvm::SIRegisterInfo::eliminateFrameIndex(), and llvm::SIRegisterInfo::getFrameRegister().
|
inline |
Definition at line 95 of file AMDGPUMachineFunction.h.
References IsChainFunction.
Referenced by llvm::SIMachineFunctionInfo::allocateWWMSpill(), llvm::SIFrameLowering::determineCalleeSaves(), llvm::SIFrameLowering::emitEpilogue(), llvm::SIFrameLowering::emitPrologue(), llvm::SIFrameLowering::hasFPImpl(), isBottomOfStack(), and llvm::SIFrameLowering::requiresStackPointerReference().
bool AMDGPUMachineFunction::isDynamicLDSUsed | ( | ) | const |
Definition at line 239 of file AMDGPUMachineFunction.cpp.
References UsesDynamicLDS.
Referenced by llvm::AMDGPU::HSAMD::MetadataStreamerMsgPackV5::emitHiddenKernelArgs().
|
inline |
Definition at line 89 of file AMDGPUMachineFunction.h.
References IsEntryFunction.
Referenced by llvm::SIMachineFunctionInfo::allocateWWMSpill(), llvm::SIFrameLowering::determineCalleeSaves(), llvm::SIFrameLowering::determineCalleeSavesSGPR(), llvm::SIFrameLowering::emitEntryFunctionPrologue(), llvm::SIFrameLowering::emitEpilogue(), llvm::AMDGPUAsmPrinter::emitFunctionBodyEnd(), llvm::AMDGPUAsmPrinter::emitFunctionBodyStart(), llvm::AMDGPUAsmPrinter::emitFunctionEntryLabel(), llvm::SIFrameLowering::emitPrologue(), llvm::SIFrameLowering::hasFPImpl(), isBottomOfStack(), llvm::AMDGPULegalizerInfo::legalizeImplicitArgPtr(), llvm::AMDGPULegalizerInfo::legalizeLDSKernelId(), llvm::SIFrameLowering::requiresStackPointerReference(), llvm::AMDGPUAsmPrinter::runOnMachineFunction(), and llvm::SIMachineFunctionInfo::SIMachineFunctionInfo().
|
inline |
Definition at line 106 of file AMDGPUMachineFunction.h.
References MemoryBound.
Referenced by llvm::SIMachineFunctionInfo::getMinAllowedOccupancy().
|
inline |
Definition at line 93 of file AMDGPUMachineFunction.h.
References IsModuleEntryFunction.
Referenced by allocateLDSGlobal(), llvm::AMDGPULegalizerInfo::legalizeGlobalValue(), llvm::AMDGPUTargetLowering::LowerGlobalAddress(), and llvm::AMDGPUAsmPrinter::runOnMachineFunction().
|
inline |
Definition at line 110 of file AMDGPUMachineFunction.h.
References WaveLimiter.
Referenced by llvm::SIMachineFunctionInfo::getMinAllowedOccupancy(), and llvm::AMDGPUAsmPrinter::runOnMachineFunction().
void AMDGPUMachineFunction::setDynLDSAlign | ( | const Function & | F, |
const GlobalVariable & | GV | ||
) |
Definition at line 207 of file AMDGPUMachineFunction.cpp.
References llvm::alignTo(), assert(), DL, DynLDSAlign, F, llvm::GlobalObject::getAlign(), getKernelDynLDSGlobalFromFunction(), getLDSAbsoluteAddress(), llvm::GlobalValue::getValueType(), LDSSize, llvm::Offset, llvm::report_fatal_error(), and StaticLDSSize.
Referenced by llvm::AMDGPULegalizerInfo::legalizeGlobalValue().
|
inline |
Definition at line 115 of file AMDGPUMachineFunction.h.
References HasInitWholeWave.
Referenced by llvm::GCNTargetMachine::parseMachineFunctionInfo().
void AMDGPUMachineFunction::setUsesDynamicLDS | ( | bool | DynLDS | ) |
Definition at line 235 of file AMDGPUMachineFunction.cpp.
References UsesDynamicLDS.
|
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 47 of file AMDGPUMachineFunction.h.
Referenced by allocateLDSGlobal(), getDynLDSAlign(), and setDynLDSAlign().
|
protected |
Definition at line 30 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), and getExplicitKernArgSize().
|
protected |
Definition at line 35 of file AMDGPUMachineFunction.h.
Referenced by allocateLDSGlobal(), AMDGPUMachineFunction(), and getGDSSize().
|
protected |
Definition at line 70 of file AMDGPUMachineFunction.h.
Referenced by hasInitWholeWave(), and setInitWholeWave().
|
protected |
Definition at line 60 of file AMDGPUMachineFunction.h.
Referenced by isChainFunction().
|
protected |
Definition at line 54 of file AMDGPUMachineFunction.h.
Referenced by isEntryFunction().
|
protected |
Definition at line 57 of file AMDGPUMachineFunction.h.
Referenced by isModuleEntryFunction().
|
protected |
Number of bytes in the LDS that are being used.
Definition at line 34 of file AMDGPUMachineFunction.h.
Referenced by allocateLDSGlobal(), AMDGPUMachineFunction(), getLDSSize(), and setDynLDSAlign().
|
protected |
Definition at line 31 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), getMaxKernArgAlign(), and llvm::SIMachineFunctionInfo::SIMachineFunctionInfo().
|
protected |
Definition at line 65 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), and isMemoryBound().
|
protected |
Definition at line 62 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), and hasNoSignedZerosFPMath().
|
protected |
Definition at line 40 of file AMDGPUMachineFunction.h.
Referenced by allocateLDSGlobal(), and 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 39 of file AMDGPUMachineFunction.h.
Referenced by allocateLDSGlobal(), AMDGPUMachineFunction(), and setDynLDSAlign().
|
protected |
Definition at line 50 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), isDynamicLDSUsed(), and setUsesDynamicLDS().
|
protected |
Definition at line 68 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), and needsWaveLimiter().