LLVM 22.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) |
![]() | |
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 |
uint32_t | NumNamedBarriers = 0 |
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, 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 125 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::GlobalVariable::getAlign(), getLDSAbsoluteAddress(), llvm::GlobalValue::getValueType(), isModuleEntryFunction(), llvm::AMDGPU::isNamedBarrier(), LDSSize, llvm_unreachable, llvm::AMDGPUAS::LOCAL_ADDRESS, llvm::Offset, recordNumNamedBarriers(), llvm::AMDGPUAS::REGION_ADDRESS, llvm::report_fatal_error(), StaticGDSSize, and StaticLDSSize.
|
inline |
Definition at line 135 of file AMDGPUMachineFunction.h.
References DynLDSAlign.
|
inline |
Definition at line 77 of file AMDGPUMachineFunction.h.
References ExplicitKernArgSize.
Referenced by llvm::AMDGPUTargetLowering::getImplicitParameterOffset().
|
inline |
Definition at line 87 of file AMDGPUMachineFunction.h.
References GDSSize.
|
static |
Definition at line 191 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 175 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 83 of file AMDGPUMachineFunction.h.
References LDSSize.
Referenced by llvm::SITargetLowering::EmitInstrWithCustomInserter(), and llvm::SIMachineFunctionInfo::SIMachineFunctionInfo().
|
inline |
Definition at line 81 of file AMDGPUMachineFunction.h.
References MaxKernArgAlign.
|
inline |
Definition at line 95 of file AMDGPUMachineFunction.h.
References NumNamedBarriers.
Referenced by llvm::AMDGPUResourceUsageAnalysisImpl::analyzeResourceUsage().
|
inline |
Definition at line 122 of file AMDGPUMachineFunction.h.
References HasInitWholeWave.
Referenced by llvm::SIMachineFunctionInfo::allocateWWMSpill().
|
inline |
Definition at line 110 of file AMDGPUMachineFunction.h.
References NoSignedZerosFPMath.
|
inline |
Definition at line 106 of file AMDGPUMachineFunction.h.
References isChainFunction(), and isEntryFunction().
Referenced by llvm::SIRegisterInfo::buildSpillLoadStore(), llvm::SIRegisterInfo::eliminateFrameIndex(), and llvm::SIRegisterInfo::getFrameRegister().
|
inline |
Definition at line 103 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 241 of file AMDGPUMachineFunction.cpp.
References UsesDynamicLDS.
Referenced by llvm::AMDGPU::HSAMD::MetadataStreamerMsgPackV5::emitHiddenKernelArgs().
|
inline |
Definition at line 97 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 114 of file AMDGPUMachineFunction.h.
References MemoryBound.
Referenced by llvm::SIMachineFunctionInfo::getMinAllowedOccupancy().
|
inline |
Definition at line 101 of file AMDGPUMachineFunction.h.
References IsModuleEntryFunction.
Referenced by allocateLDSGlobal(), llvm::AMDGPULegalizerInfo::legalizeGlobalValue(), llvm::AMDGPUTargetLowering::LowerGlobalAddress(), and llvm::AMDGPUAsmPrinter::runOnMachineFunction().
|
inline |
Definition at line 118 of file AMDGPUMachineFunction.h.
References WaveLimiter.
Referenced by llvm::SIMachineFunctionInfo::getMinAllowedOccupancy(), and llvm::AMDGPUAsmPrinter::runOnMachineFunction().
|
inline |
Definition at line 91 of file AMDGPUMachineFunction.h.
References NumNamedBarriers.
Referenced by allocateLDSGlobal(), and llvm::AMDGPUTargetLowering::LowerGlobalAddress().
void AMDGPUMachineFunction::setDynLDSAlign | ( | const Function & | F, |
const GlobalVariable & | GV | ||
) |
Definition at line 209 of file AMDGPUMachineFunction.cpp.
References llvm::alignTo(), assert(), DL, DynLDSAlign, F, llvm::GlobalVariable::getAlign(), getKernelDynLDSGlobalFromFunction(), getLDSAbsoluteAddress(), llvm::GlobalValue::getValueType(), LDSSize, llvm::Offset, llvm::report_fatal_error(), and StaticLDSSize.
Referenced by llvm::AMDGPULegalizerInfo::legalizeGlobalValue().
|
inline |
Definition at line 123 of file AMDGPUMachineFunction.h.
References HasInitWholeWave.
Referenced by llvm::GCNTargetMachine::parseMachineFunctionInfo().
void AMDGPUMachineFunction::setUsesDynamicLDS | ( | bool | DynLDS | ) |
Definition at line 237 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 72 of file AMDGPUMachineFunction.h.
Referenced by hasInitWholeWave(), and setInitWholeWave().
|
protected |
Definition at line 62 of file AMDGPUMachineFunction.h.
Referenced by isChainFunction().
|
protected |
Definition at line 56 of file AMDGPUMachineFunction.h.
Referenced by isEntryFunction().
|
protected |
Definition at line 59 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 67 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), and isMemoryBound().
|
protected |
Definition at line 64 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), and hasNoSignedZerosFPMath().
|
protected |
Definition at line 52 of file AMDGPUMachineFunction.h.
Referenced by getNumNamedBarriers(), and recordNumNamedBarriers().
|
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 70 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), and needsWaveLimiter().