|
LLVM 23.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 |
| uint32_t | NumNamedBarriers = 0 |
| bool | IsEntryFunction = false |
| bool | IsModuleEntryFunction = false |
| bool | IsChainFunction = 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(), hasLDSKernelArgument(), if(), IsChainFunction, IsEntryFunction, IsModuleEntryFunction, LDSSize, MaxKernArgAlign, MemoryBound, llvm::CallingConv::SPIR_KERNEL, StaticGDSSize, StaticLDSSize, UsesDynamicLDS, and WaveLimiter.
Referenced by llvm::R600MachineFunctionInfo::R600MachineFunctionInfo(), and llvm::SIMachineFunctionInfo::SIMachineFunctionInfo().
|
inline |
Definition at line 119 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 88 of file AMDGPUMachineFunction.cpp.
References llvm::alignTo(), assert(), DL, GDSSize, llvm::GlobalValue::getAddressSpace(), llvm::GlobalVariable::getAlign(), llvm::GlobalVariable::getGlobalSize(), 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 129 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 185 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 169 of file AMDGPUMachineFunction.cpp.
References llvm::mdconst::extract(), F, llvm::MDNode::getNumOperands(), and llvm::MDNode::getOperand().
Referenced by llvm::AMDGPULegalizerInfo::getLDSKernelId(), llvm::AMDGPUCallLowering::passSpecialInputs(), and llvm::SITargetLowering::passSpecialInputs().
|
inline |
Definition at line 81 of file AMDGPUMachineFunction.h.
References LDSSize.
Referenced by llvm::SITargetLowering::EmitInstrWithCustomInserter(), and llvm::SIMachineFunctionInfo::SIMachineFunctionInfo().
|
inline |
Definition at line 79 of file AMDGPUMachineFunction.h.
References MaxKernArgAlign.
|
inline |
Definition at line 93 of file AMDGPUMachineFunction.h.
References NumNamedBarriers.
Referenced by llvm::AMDGPUResourceUsageAnalysisImpl::analyzeResourceUsage().
|
inline |
Definition at line 116 of file AMDGPUMachineFunction.h.
References HasInitWholeWave.
Referenced by llvm::SIMachineFunctionInfo::allocateWWMSpill().
|
inline |
Definition at line 104 of file AMDGPUMachineFunction.h.
References isChainFunction(), and isEntryFunction().
Referenced by llvm::SIRegisterInfo::buildSpillLoadStore(), llvm::SIRegisterInfo::eliminateFrameIndex(), and llvm::SIRegisterInfo::getFrameRegister().
|
inline |
Definition at line 101 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 235 of file AMDGPUMachineFunction.cpp.
References UsesDynamicLDS.
Referenced by llvm::AMDGPU::HSAMD::MetadataStreamerMsgPackV5::emitHiddenKernelArgs().
|
inline |
Definition at line 95 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(), llvm::SIMachineFunctionInfo::SIMachineFunctionInfo(), and llvm::SITargetLowering::supportSplitCSR().
|
inline |
Definition at line 108 of file AMDGPUMachineFunction.h.
References MemoryBound.
Referenced by llvm::SIMachineFunctionInfo::getMinAllowedOccupancy().
|
inline |
Definition at line 99 of file AMDGPUMachineFunction.h.
References IsModuleEntryFunction.
Referenced by allocateLDSGlobal(), llvm::AMDGPULegalizerInfo::legalizeGlobalValue(), llvm::AMDGPUTargetLowering::LowerGlobalAddress(), and llvm::AMDGPUAsmPrinter::runOnMachineFunction().
|
inline |
Definition at line 112 of file AMDGPUMachineFunction.h.
References WaveLimiter.
Referenced by llvm::SIMachineFunctionInfo::getMinAllowedOccupancy(), and llvm::AMDGPUAsmPrinter::runOnMachineFunction().
|
inline |
Definition at line 89 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 203 of file AMDGPUMachineFunction.cpp.
References llvm::alignTo(), assert(), DL, DynLDSAlign, F, llvm::GlobalVariable::getAlign(), llvm::GlobalVariable::getGlobalSize(), getKernelDynLDSGlobalFromFunction(), getLDSAbsoluteAddress(), llvm::GlobalValue::getValueType(), LDSSize, llvm::Offset, llvm::report_fatal_error(), and StaticLDSSize.
Referenced by llvm::AMDGPULegalizerInfo::legalizeGlobalValue().
|
inline |
Definition at line 117 of file AMDGPUMachineFunction.h.
References HasInitWholeWave.
Referenced by llvm::GCNTargetMachine::parseMachineFunctionInfo().
| void AMDGPUMachineFunction::setUsesDynamicLDS | ( | bool | DynLDS | ) |
Definition at line 231 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(), llvm::SIMachineFunctionInfo::initializeBaseYamlFields(), and setDynLDSAlign().
|
protected |
Definition at line 30 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), getExplicitKernArgSize(), and llvm::SIMachineFunctionInfo::initializeBaseYamlFields().
|
protected |
Definition at line 35 of file AMDGPUMachineFunction.h.
Referenced by allocateLDSGlobal(), AMDGPUMachineFunction(), getGDSSize(), and llvm::SIMachineFunctionInfo::initializeBaseYamlFields().
|
protected |
Definition at line 70 of file AMDGPUMachineFunction.h.
Referenced by hasInitWholeWave(), and setInitWholeWave().
|
protected |
Definition at line 62 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), and isChainFunction().
|
protected |
Definition at line 56 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), llvm::SIMachineFunctionInfo::initializeBaseYamlFields(), and isEntryFunction().
|
protected |
Definition at line 59 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), and 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(), llvm::SIMachineFunctionInfo::initializeBaseYamlFields(), and setDynLDSAlign().
|
protected |
Definition at line 31 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), getMaxKernArgAlign(), llvm::SIMachineFunctionInfo::initializeBaseYamlFields(), and llvm::SIMachineFunctionInfo::SIMachineFunctionInfo().
|
protected |
Definition at line 65 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), llvm::SIMachineFunctionInfo::initializeBaseYamlFields(), and isMemoryBound().
|
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 68 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), llvm::SIMachineFunctionInfo::initializeBaseYamlFields(), and needsWaveLimiter().