LLVM 17.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 | 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 21 of file AMDGPUMachineFunction.cpp.
References llvm::CallingConv::AMDGPU_KERNEL, CC, llvm::StringRef::consumeInteger(), llvm::StringRef::empty(), ExplicitKernArgSize, F, GDSSize, llvm::Attribute::getValueAsBool(), llvm::Attribute::getValueAsString(), llvm::Attribute::isStringAttribute(), MaxKernArgAlign, MemoryBound, NoSignedZerosFPMath, llvm::CallingConv::SPIR_KERNEL, StaticGDSSize, and WaveLimiter.
Definition at line 116 of file AMDGPUMachineFunction.cpp.
References allocateLDSGlobal(), assert(), canElideModuleLDS(), F, getDynLDSAlign(), getKernelDynLDSGlobalFromFunction(), getKernelLDSGlobalFromFunction(), getLDSAbsoluteAddress(), isModuleEntryFunction(), LDSSize, ModuleLDSName, llvm::Offset, llvm::report_fatal_error(), and setDynLDSAlign().
|
inline |
Definition at line 100 of file AMDGPUMachineFunction.h.
References allocateLDSGlobal(), DL, and DynLDSAlign.
Referenced by allocateKnownAddressLDSGlobal(), 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 56 of file AMDGPUMachineFunction.cpp.
References llvm::alignTo(), assert(), DL, GDSSize, llvm::GlobalValue::getAddressSpace(), llvm::GlobalObject::getAlign(), llvm::GlobalValue::getValueType(), LDSSize, llvm::AMDGPUAS::LOCAL_ADDRESS, llvm::Offset, llvm::AMDGPUAS::REGION_ADDRESS, StaticGDSSize, and StaticLDSSize.
|
inline |
Definition at line 112 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 195 of file AMDGPUMachineFunction.cpp.
References llvm::GlobalValue::getAbsoluteSymbolRange(), llvm::GlobalValue::getAddressSpace(), and llvm::AMDGPUAS::LOCAL_ADDRESS.
Referenced by allocateKnownAddressLDSGlobal(), llvm::AMDGPUAsmPrinter::lowerConstant(), llvm::AMDGPUTargetLowering::LowerGlobalAddress(), and setDynLDSAlign().
|
static |
Definition at line 179 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 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::SIFrameLowering::determineCalleeSaves(), llvm::SIFrameLowering::determineCalleeSavesSGPR(), llvm::SIRegisterInfo::eliminateFrameIndex(), llvm::SIFrameLowering::emitEntryFunctionPrologue(), llvm::AMDGPUAsmPrinter::emitFunctionBodyEnd(), llvm::AMDGPUAsmPrinter::emitFunctionBodyStart(), llvm::AMDGPUAsmPrinter::emitFunctionEntryLabel(), llvm::SIMachineFunctionInfo::getScavengeFI(), llvm::SIFrameLowering::hasFP(), llvm::AMDGPULegalizerInfo::legalizeImplicitArgPtr(), llvm::AMDGPULegalizerInfo::legalizeLDSKernelId(), llvm::SIFrameLowering::requiresStackPointerReference(), llvm::AMDGPUAsmPrinter::runOnMachineFunction(), and llvm::SIMachineFunctionInfo::SIMachineFunctionInfo().
|
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 Function & | F, |
const GlobalVariable & | GV | ||
) |
Definition at line 213 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 allocateKnownAddressLDSGlobal(), and 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 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 allocateKnownAddressLDSGlobal(), allocateLDSGlobal(), 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 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(), and setDynLDSAlign().
|
protected |
Definition at line 63 of file AMDGPUMachineFunction.h.
Referenced by AMDGPUMachineFunction(), and needsWaveLimiter().