LLVM
9.0.0svn
|
#include "Target/AMDGPU/AMDGPUSubtarget.h"
Public Types | |
enum | Generation { R600 = 0, R700 = 1, EVERGREEN = 2, NORTHERN_ISLANDS = 3, SOUTHERN_ISLANDS = 4, SEA_ISLANDS = 5, VOLCANIC_ISLANDS = 6, GFX9 = 7 } |
Static Public Member Functions | |
static const AMDGPUSubtarget & | get (const MachineFunction &MF) |
static const AMDGPUSubtarget & | get (const TargetMachine &TM, const Function &F) |
Definition at line 48 of file AMDGPUSubtarget.h.
Enumerator | |
---|---|
R600 | |
R700 | |
EVERGREEN | |
NORTHERN_ISLANDS | |
SOUTHERN_ISLANDS | |
SEA_ISLANDS | |
VOLCANIC_ISLANDS | |
GFX9 |
Definition at line 50 of file AMDGPUSubtarget.h.
Definition at line 135 of file AMDGPUSubtarget.cpp.
|
inlinevirtual |
Definition at line 242 of file AMDGPUSubtarget.h.
|
static |
Definition at line 687 of file AMDGPUSubtarget.cpp.
References llvm::Triple::amdgcn, llvm::Triple::getArch(), llvm::MachineFunction::getSubtarget(), llvm::MachineFunction::getTarget(), and llvm::TargetMachine::getTargetTriple().
Referenced by llvm::AMDGPUMachineFunction::AMDGPUMachineFunction(), llvm::AMDGPUTargetLowering::analyzeFormalArgumentsCompute(), llvm::createSIWholeQuadModePass(), llvm::AMDGPUTargetLowering::getImplicitParameterOffset(), getReassignedChan(), INITIALIZE_PASS(), isCallPromotable(), and readsVCCZ().
|
static |
Definition at line 694 of file AMDGPUSubtarget.cpp.
References llvm::Triple::amdgcn, F(), llvm::Triple::getArch(), llvm::TargetMachine::getSubtarget(), and llvm::TargetMachine::getTargetTriple().
|
inline |
Definition at line 197 of file AMDGPUSubtarget.h.
References isAmdHsaOS().
Referenced by getKernArgSegmentSize(), and llvm::SIMachineFunctionInfo::SIMachineFunctionInfo().
std::pair< unsigned, unsigned > AMDGPUSubtarget::getDefaultFlatWorkGroupSize | ( | CallingConv::ID | CC | ) | const |
Definition at line 261 of file AMDGPUSubtarget.cpp.
References llvm::CallingConv::AMDGPU_CS, llvm::CallingConv::AMDGPU_ES, llvm::CallingConv::AMDGPU_GS, llvm::CallingConv::AMDGPU_HS, llvm::CallingConv::AMDGPU_KERNEL, llvm::CallingConv::AMDGPU_LS, llvm::CallingConv::AMDGPU_PS, llvm::CallingConv::AMDGPU_VS, getWavefrontSize(), and llvm::CallingConv::SPIR_KERNEL.
Referenced by getFlatWorkGroupSizes().
Definition at line 419 of file AMDGPUSubtarget.cpp.
References llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, llvm::alignTo(), llvm::CallingConv::AMDGPU_KERNEL, Arg, llvm::Function::args(), assert(), llvm::Function::getCallingConv(), llvm::Module::getDataLayout(), llvm::GlobalValue::getParent(), llvm::max(), and llvm::CallingConv::SPIR_KERNEL.
Referenced by llvm::AMDGPUMachineFunction::AMDGPUMachineFunction(), getImplicitArgNumBytes(), and getKernArgSegmentSize().
Returns the offset in bytes from the start of the input buffer of the first explicit kernel argument.
Definition at line 203 of file AMDGPUSubtarget.h.
References getMaxFlatWorkGroupSize(), getMaxWavesPerEU(), getMaxWorkGroupsPerCU(), getMinFlatWorkGroupSize(), getMinWavesPerEU(), and isAmdHsaOrMesa().
Referenced by llvm::AMDGPUTargetLowering::analyzeFormalArgumentsCompute(), llvm::AMDGPUTargetLowering::getImplicitParameterOffset(), getKernArgSegmentSize(), and llvm::AMDGPUCallLowering::lowerFormalArguments().
F
, or minimum/maximum flat work group sizes explicitly requested using "amdgpu-flat-work-group-size" attribute attached to function F
.Definition at line 279 of file AMDGPUSubtarget.cpp.
References llvm::Default, llvm::Function::getCallingConv(), getDefaultFlatWorkGroupSize(), llvm::AMDGPU::getIntegerAttribute(), llvm::AMDGPU::getIntegerPairAttribute(), llvm::GCNSubtarget::getMaxFlatWorkGroupSize(), and llvm::GCNSubtarget::getMinFlatWorkGroupSize().
Referenced by getMaxLocalMemSizeWithWaveCount(), getOccupancyWithLocalMemSize(), getWavesPerEU(), isCallPromotable(), makeLIDRangeMetadata(), and llvm::SIMachineFunctionInfo::SIMachineFunctionInfo().
Definition at line 232 of file AMDGPUSubtarget.h.
References F(), getExplicitKernArgSize(), llvm::AMDGPU::getIntegerAttribute(), getKernArgSegmentSize(), and isMesaKernel().
Referenced by getKernArgSegmentSize().
Definition at line 440 of file AMDGPUSubtarget.cpp.
References llvm::alignTo(), getAlignmentForImplicitArgPtr(), getExplicitKernArgSize(), getExplicitKernelArgOffset(), and getImplicitArgNumBytes().
Referenced by getImplicitArgNumBytes().
|
inline |
Definition at line 193 of file AMDGPUSubtarget.h.
References LocalMemorySize.
Referenced by getMaxLocalMemSizeWithWaveCount(), getOccupancyWithLocalMemSize(), hasAnyNonFlatUseOfReg(), and isCallPromotable().
|
pure virtual |
Implemented in llvm::R600Subtarget, and llvm::GCNSubtarget.
Referenced by getExplicitKernelArgOffset().
unsigned AMDGPUSubtarget::getMaxLocalMemSizeWithWaveCount | ( | unsigned | WaveCount, |
const Function & | F | ||
) | const |
Return the amount of LDS that can be used that will not restrict the occupancy lower than WaveCount.
Definition at line 232 of file AMDGPUSubtarget.cpp.
References getFlatWorkGroupSizes(), getLocalMemorySize(), llvm::GCNSubtarget::getMaxWavesPerEU(), and llvm::GCNSubtarget::getMaxWorkGroupsPerCU().
Referenced by llvm::GCNSubtarget::dumpCode(), and isCallPromotable().
|
pure virtual |
FlatWorkGroupSize
. Implemented in llvm::R600Subtarget, and llvm::GCNSubtarget.
Referenced by isCallPromotable().
|
inline |
Definition at line 225 of file AMDGPUSubtarget.h.
References I, and makeLIDRangeMetadata().
Referenced by getExplicitKernelArgOffset().
|
pure virtual |
FlatWorkGroupSize
. Implemented in llvm::R600Subtarget, and llvm::GCNSubtarget.
Referenced by getExplicitKernelArgOffset().
|
pure virtual |
Implemented in llvm::R600Subtarget, and llvm::GCNSubtarget.
Referenced by getExplicitKernelArgOffset().
|
pure virtual |
Implemented in llvm::R600Subtarget, and llvm::GCNSubtarget.
Referenced by getExplicitKernelArgOffset().
Inverse of getMaxLocalMemWithWaveCount.
Return the maximum wavecount if the given LDS memory size is the only constraint.
Definition at line 242 of file AMDGPUSubtarget.cpp.
References getFlatWorkGroupSizes(), getLocalMemorySize(), llvm::GCNSubtarget::getMaxWavesPerEU(), llvm::GCNSubtarget::getMaxWorkGroupsPerCU(), and llvm::max().
Referenced by getOccupancyWithLocalMemSize(), llvm::SIRegisterInfo::getRegPressureLimit(), isCallPromotable(), and llvm::SIMachineFunctionInfo::limitOccupancy().
unsigned AMDGPUSubtarget::getOccupancyWithLocalMemSize | ( | const MachineFunction & | MF | ) | const |
Definition at line 255 of file AMDGPUSubtarget.cpp.
References llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), and getOccupancyWithLocalMemSize().
|
inline |
Definition at line 189 of file AMDGPUSubtarget.h.
References WavefrontSize.
Referenced by llvm::SIMachineFunctionInfo::allocateSGPRSpillToVGPR(), buildMUBUFOffsetLoadStore(), llvm::SIFrameLowering::eliminateCallFramePseudoInstr(), llvm::SIRegisterInfo::eliminateFrameIndex(), llvm::SIFrameLowering::emitEntryFunctionPrologue(), llvm::SIFrameLowering::emitEpilogue(), llvm::SIFrameLowering::emitPrologue(), getDefaultFlatWorkGroupSize(), hasAnyNonFlatUseOfReg(), llvm::SIRegisterInfo::restoreSGPR(), and llvm::SIRegisterInfo::spillSGPR().
F
, or minimum/maximum number of waves per execution unit explicitly requested using "amdgpu-waves-per-eu" attribute attached to function F
.Definition at line 309 of file AMDGPUSubtarget.cpp.
References llvm::Default, getFlatWorkGroupSizes(), llvm::AMDGPU::getIntegerPairAttribute(), llvm::GCNSubtarget::getMaxWavesPerEU(), llvm::GCNSubtarget::getMinWavesPerEU(), and llvm::Function::hasFnAttribute().
Referenced by isCallPromotable(), and llvm::SIMachineFunctionInfo::SIMachineFunctionInfo().
|
inline |
Definition at line 141 of file AMDGPUSubtarget.h.
References Has16BitInsts.
Referenced by llvm::AMDGPULegalizerInfo::AMDGPULegalizerInfo(), fp16SrcZerosHighBits(), getMad64_32(), llvm::SITargetLowering::getNumRegistersForCallingConv(), llvm::SITargetLowering::getRegisterTypeForCallingConv(), getSplatConstantFP(), llvm::SITargetLowering::getVectorTypeBreakdownForCallingConv(), llvm::AMDGPUTargetLowering::isFAbsFree(), llvm::SITargetLowering::isFMAFasterThanFMulAndFAdd(), llvm::AMDGPUTargetLowering::isFNegFree(), llvm::AMDGPUTargetLowering::isFPImmLegal(), llvm::SIInstrInfo::isInlineConstant(), isNegativeOne(), llvm::AMDGPUTargetLowering::isTruncateFree(), llvm::SITargetLowering::isTypeDesirableForOp(), llvm::AMDGPUTargetLowering::isZExtFree(), llvm::AMDGPUTargetLowering::LowerFP_TO_SINT(), llvm::AMDGPUTargetLowering::LowerFP_TO_UINT(), llvm::AMDGPUTargetLowering::LowerSINT_TO_FP(), llvm::AMDGPUTargetLowering::LowerUINT_TO_FP(), llvm::AMDGPUTargetLowering::performFAbsCombine(), llvm::AMDGPUTargetLowering::performMulCombine(), and llvm::SITargetLowering::SITargetLowering().
|
inline |
Definition at line 177 of file AMDGPUSubtarget.h.
References HasFminFmaxLegacy.
Referenced by llvm::AMDGPUTargetLowering::performSelectCombine().
|
inline |
Definition at line 149 of file AMDGPUSubtarget.h.
References FP32Denormals.
Referenced by llvm::SITargetLowering::denormalsEnabledForType(), getFPMode(), getFPTernOp(), getLoadExtOrTrunc(), isClampZeroToOne(), llvm::SITargetLowering::isFMAFasterThanFMulAndFAdd(), llvm::SITargetLowering::isFPExtFoldable(), llvm::AMDGPUTargetLowering::LowerDIVREM24(), llvm::AMDGPUTargetLowering::LowerUDIVREM64(), llvm::R600TargetLowering::R600TargetLowering(), and llvm::SITargetLowering::SITargetLowering().
|
inline |
Definition at line 153 of file AMDGPUSubtarget.h.
References FPExceptions.
Referenced by llvm::SITargetLowering::SITargetLowering().
|
inline |
Definition at line 173 of file AMDGPUSubtarget.h.
References HasInv2PiInlineImm.
Referenced by llvm::SIRegisterInfo::eliminateFrameIndex(), llvm::AMDGPUTargetLowering::isConstantCostlierToNegate(), llvm::SIInstrInfo::isInlineConstant(), and shrinkScalarLogicOp().
|
inline |
Definition at line 145 of file AMDGPUSubtarget.h.
References HasMadMixInsts.
Referenced by llvm::SITargetLowering::isFPExtFoldable().
|
inline |
Definition at line 165 of file AMDGPUSubtarget.h.
References HasMulI24.
Referenced by llvm::AMDGPUTargetLowering::performMulCombine(), and llvm::AMDGPUTargetLowering::performMulhsCombine().
|
inline |
Definition at line 169 of file AMDGPUSubtarget.h.
References HasMulU24.
Referenced by llvm::AMDGPUTargetLowering::performMulCombine(), and llvm::AMDGPUTargetLowering::performMulhuCombine().
|
inline |
Definition at line 157 of file AMDGPUSubtarget.h.
References HasSDWA.
Referenced by findSingleRegDef(), llvm::AMDGPUTargetLowering::PerformDAGCombine(), and llvm::SIInstrInfo::verifyInstruction().
|
inline |
Definition at line 181 of file AMDGPUSubtarget.h.
References HasTrigReducedRange.
Referenced by getFPTernOp().
|
inline |
Definition at line 161 of file AMDGPUSubtarget.h.
References HasVOP3PInsts.
Referenced by llvm::AMDGPULegalizerInfo::AMDGPULegalizerInfo(), findUser(), getSplatConstantFP(), llvm::AMDGPUTargetLowering::isFNegFree(), and llvm::SITargetLowering::SITargetLowering().
Definition at line 137 of file AMDGPUSubtarget.h.
References isAmdHsaOS(), and isMesaKernel().
Referenced by llvm::SIFrameLowering::emitEntryFunctionPrologue(), llvm::AMDGPUAsmPrinter::EmitFunctionBodyStart(), getExplicitKernelArgOffset(), parseTexFail(), reservePrivateMemoryRegs(), and llvm::SIMachineFunctionInfo::SIMachineFunctionInfo().
|
inline |
Definition at line 121 of file AMDGPUSubtarget.h.
References llvm::Triple::AMDHSA, and llvm::Triple::getOS().
Referenced by llvm::AMDGPUAsmPrinter::EmitFunctionBodyStart(), getAlignmentForImplicitArgPtr(), llvm::GCNSubtarget::getTrapHandlerAbi(), hasAnyNonFlatUseOfReg(), llvm::GCNSubtarget::hasCodeObjectV3(), llvm::GCNSubtarget::initializeSubtargetDependencies(), isAmdHsaOrMesa(), llvm::SITargetLowering::LowerFormalArguments(), parseTexFail(), and llvm::AMDGPUAsmPrinter::runOnMachineFunction().
|
inline |
Definition at line 125 of file AMDGPUSubtarget.h.
References llvm::Triple::AMDPAL, and llvm::Triple::getOS().
Referenced by llvm::SIFrameLowering::emitEntryFunctionPrologue(), llvm::SITargetLowering::LowerFormalArguments(), and llvm::AMDGPUAsmPrinter::runOnMachineFunction().
|
inline |
Definition at line 129 of file AMDGPUSubtarget.h.
References llvm::Triple::getOS(), and llvm::Triple::Mesa3D.
Referenced by llvm::GCNSubtarget::isMesaGfxShader(), and isMesaKernel().
Definition at line 133 of file AMDGPUSubtarget.h.
References llvm::Function::getCallingConv(), isMesa3DOS(), and llvm::AMDGPU::isShader().
Referenced by getImplicitArgNumBytes(), and isAmdHsaOrMesa().
|
inline |
Definition at line 185 of file AMDGPUSubtarget.h.
References EnablePromoteAlloca.
bool AMDGPUSubtarget::makeLIDRangeMetadata | ( | Instruction * | I | ) | const |
Creates value range metadata on an workitemid.* inrinsic call or load.
Definition at line 357 of file AMDGPUSubtarget.cpp.
References F(), getFlatWorkGroupSizes(), llvm::Function::getIntrinsicID(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), if(), llvm::CodeModel::Kernel, and LLVM_FALLTHROUGH.
Referenced by getMaxWavesPerEU(), and INITIALIZE_PASS().
|
protected |
Definition at line 75 of file AMDGPUSubtarget.h.
Referenced by isPromoteAllocaEnabled().
|
protected |
Definition at line 67 of file AMDGPUSubtarget.h.
Referenced by hasFP32Denormals(), and llvm::R600Subtarget::initializeSubtargetDependencies().
|
protected |
Definition at line 68 of file AMDGPUSubtarget.h.
Referenced by hasFPExceptions().
|
protected |
Definition at line 65 of file AMDGPUSubtarget.h.
Referenced by has16BitInsts().
|
protected |
Definition at line 74 of file AMDGPUSubtarget.h.
Referenced by hasFminFmaxLegacy(), and llvm::GCNSubtarget::initializeSubtargetDependencies().
|
protected |
Definition at line 73 of file AMDGPUSubtarget.h.
Referenced by hasInv2PiInlineImm().
|
protected |
Definition at line 66 of file AMDGPUSubtarget.h.
Referenced by hasMadMixInsts().
|
protected |
Definition at line 71 of file AMDGPUSubtarget.h.
Referenced by hasMulI24(), and llvm::R600Subtarget::initializeSubtargetDependencies().
|
protected |
Definition at line 72 of file AMDGPUSubtarget.h.
Referenced by hasMulU24(), and llvm::R600Subtarget::initializeSubtargetDependencies().
|
protected |
Definition at line 69 of file AMDGPUSubtarget.h.
Referenced by hasSDWA().
|
protected |
Definition at line 76 of file AMDGPUSubtarget.h.
Referenced by hasTrigReducedRange().
|
protected |
Definition at line 70 of file AMDGPUSubtarget.h.
Referenced by hasVOP3PInsts().
|
protected |
Definition at line 77 of file AMDGPUSubtarget.h.
Referenced by getLocalMemorySize(), and llvm::GCNSubtarget::initializeSubtargetDependencies().
|
protected |
Definition at line 78 of file AMDGPUSubtarget.h.
Referenced by getWavefrontSize(), llvm::GCNSubtarget::getWavefrontSizeLog2(), and llvm::GCNSubtarget::initializeSubtargetDependencies().