LLVM 18.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 | IsEntryFunction = false |
bool | IsModuleEntryFunction = false |
bool | IsChainFunction = 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 22 of file AMDGPUMachineFunction.cpp.
References llvm::CallingConv::AMDGPU_KERNEL, CC, llvm::StringRef::consumeInteger(), llvm::StringRef::empty(), ExplicitKernArgSize, F, GDSSize, llvm::AMDGPU::getIntegerPairAttribute(), llvm::Attribute::getValueAsBool(), llvm::Attribute::getValueAsString(), llvm::Attribute::isStringAttribute(), LDSSize, MaxKernArgAlign, MemoryBound, NoSignedZerosFPMath, llvm::CallingConv::SPIR_KERNEL, StaticGDSSize, StaticLDSSize, and WaveLimiter.
|
inline |
Definition at line 105 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 70 of file AMDGPUMachineFunction.cpp.
References llvm::alignTo(), assert(), DL, GDSSize, llvm::GlobalValue::getAddressSpace(), llvm::GlobalObject::getAlign(), getLDSAbsoluteAddress(), llvm::GlobalValue::getValueType(), isModuleEntryFunction(), LDSSize, llvm::AMDGPUAS::LOCAL_ADDRESS, llvm::Offset, llvm::AMDGPUAS::REGION_ADDRESS, llvm::report_fatal_error(), StaticGDSSize, and StaticLDSSize.
|
inline |
Definition at line 115 of file AMDGPUMachineFunction.h.
References DynLDSAlign.
|
inline |
Definition at line 71 of file AMDGPUMachineFunction.h.
References ExplicitKernArgSize.
Referenced by llvm::AMDGPUTargetLowering::getImplicitParameterOffset().
|
inline |
Definition at line 81 of file AMDGPUMachineFunction.h.
References GDSSize.
|
static |
Definition at line 168 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 152 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 77 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 75 of file AMDGPUMachineFunction.h.
References MaxKernArgAlign.
|
inline |
Definition at line 93 of file AMDGPUMachineFunction.h.
References NoSignedZerosFPMath.
|
inline |
Definition at line 91 of file AMDGPUMachineFunction.h.
References IsChainFunction.
|
inline |
Definition at line 85 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().
|
inline |
Definition at line 97 of file AMDGPUMachineFunction.h.
References MemoryBound.
Referenced by llvm::SIMachineFunctionInfo::getMinAllowedOccupancy().
|
inline |
Definition at line 89 of file AMDGPUMachineFunction.h.
References IsModuleEntryFunction.
Referenced by allocateLDSGlobal(), llvm::AMDGPULegalizerInfo::legalizeGlobalValue(), llvm::AMDGPUTargetLowering::LowerGlobalAddress(), and llvm::AMDGPUAsmPrinter::runOnMachineFunction().
|
inline |
Definition at line 101 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 186 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().
|
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 allocateLDSGlobal(), AMDGPUMachineFunction(), and getGDSSize().
|
protected |
Definition at line 58 of file AMDGPUMachineFunction.h.
Referenced by isChainFunction().
|
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 allocateLDSGlobal(), AMDGPUMachineFunction(), getLDSSize(), and setDynLDSAlign().
|
protected |
Definition at line 32 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), getMaxKernArgAlign(), and llvm::SIMachineFunctionInfo::SIMachineFunctionInfo().
|
protected |
Definition at line 63 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), and isMemoryBound().
|
protected |
Definition at line 60 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), and hasNoSignedZerosFPMath().
|
protected |
Definition at line 41 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 40 of file AMDGPUMachineFunction.h.
Referenced by allocateLDSGlobal(), AMDGPUMachineFunction(), and setDynLDSAlign().
|
protected |
Definition at line 66 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), and needsWaveLimiter().