LLVM
8.0.1
|
#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 49 of file AMDGPUSubtarget.h.
Enumerator | |
---|---|
R600 | |
R700 | |
EVERGREEN | |
NORTHERN_ISLANDS | |
SOUTHERN_ISLANDS | |
SEA_ISLANDS | |
VOLCANIC_ISLANDS | |
GFX9 |
Definition at line 51 of file AMDGPUSubtarget.h.
Definition at line 132 of file AMDGPUSubtarget.cpp.
|
inlinevirtual |
Definition at line 243 of file AMDGPUSubtarget.h.
|
static |
Definition at line 684 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 691 of file AMDGPUSubtarget.cpp.
References llvm::Triple::amdgcn, F(), llvm::Triple::getArch(), llvm::TargetMachine::getSubtarget(), and llvm::TargetMachine::getTargetTriple().
|
inline |
Definition at line 198 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 258 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 416 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::Value::getType(), 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 204 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 276 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 233 of file AMDGPUSubtarget.h.
References F(), getExplicitKernArgSize(), llvm::AMDGPU::getIntegerAttribute(), getKernArgSegmentSize(), and isMesaKernel().
Referenced by getKernArgSegmentSize().
Definition at line 437 of file AMDGPUSubtarget.cpp.
References llvm::alignTo(), getAlignmentForImplicitArgPtr(), getExplicitKernArgSize(), getExplicitKernelArgOffset(), and getImplicitArgNumBytes().
Referenced by getImplicitArgNumBytes().
|
inline |
Definition at line 194 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 229 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 226 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 239 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 252 of file AMDGPUSubtarget.cpp.
References llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), and getOccupancyWithLocalMemSize().
|
inline |
Definition at line 190 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 306 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 142 of file AMDGPUSubtarget.h.
References Has16BitInsts.
Referenced by 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 178 of file AMDGPUSubtarget.h.
References HasFminFmaxLegacy.
Referenced by llvm::AMDGPUTargetLowering::performSelectCombine().
|
inline |
Definition at line 150 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 154 of file AMDGPUSubtarget.h.
References FPExceptions.
Referenced by llvm::SITargetLowering::SITargetLowering().
|
inline |
Definition at line 174 of file AMDGPUSubtarget.h.
References HasInv2PiInlineImm.
Referenced by llvm::SIRegisterInfo::eliminateFrameIndex(), llvm::AMDGPUTargetLowering::isConstantCostlierToNegate(), llvm::SIInstrInfo::isInlineConstant(), and shrinkScalarLogicOp().
|
inline |
Definition at line 146 of file AMDGPUSubtarget.h.
References HasMadMixInsts.
Referenced by llvm::SITargetLowering::isFPExtFoldable().
|
inline |
Definition at line 166 of file AMDGPUSubtarget.h.
References HasMulI24.
Referenced by llvm::AMDGPUTargetLowering::performMulCombine(), and llvm::AMDGPUTargetLowering::performMulhsCombine().
|
inline |
Definition at line 170 of file AMDGPUSubtarget.h.
References HasMulU24.
Referenced by llvm::AMDGPUTargetLowering::performMulCombine(), and llvm::AMDGPUTargetLowering::performMulhuCombine().
|
inline |
Definition at line 158 of file AMDGPUSubtarget.h.
References HasSDWA.
Referenced by findSingleRegDef(), llvm::AMDGPUTargetLowering::PerformDAGCombine(), and llvm::SIInstrInfo::verifyInstruction().
|
inline |
Definition at line 182 of file AMDGPUSubtarget.h.
References HasTrigReducedRange.
Referenced by getFPTernOp().
|
inline |
Definition at line 162 of file AMDGPUSubtarget.h.
References HasVOP3PInsts.
Referenced by findUser(), getSplatConstantFP(), llvm::AMDGPUTargetLowering::isFNegFree(), and llvm::SITargetLowering::SITargetLowering().
Definition at line 138 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 122 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 126 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 130 of file AMDGPUSubtarget.h.
References llvm::Triple::getOS(), and llvm::Triple::Mesa3D.
Referenced by llvm::GCNSubtarget::isMesaGfxShader(), and isMesaKernel().
Definition at line 134 of file AMDGPUSubtarget.h.
References llvm::Function::getCallingConv(), isMesa3DOS(), and llvm::AMDGPU::isShader().
Referenced by getImplicitArgNumBytes(), and isAmdHsaOrMesa().
|
inline |
Definition at line 186 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 354 of file AMDGPUSubtarget.cpp.
References llvm::Intrinsic::amdgcn_workitem_id_x, llvm::Intrinsic::amdgcn_workitem_id_y, llvm::Intrinsic::amdgcn_workitem_id_z, F(), getFlatWorkGroupSizes(), llvm::Function::getIntrinsicID(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), if(), llvm::CodeModel::Kernel, LLVM_FALLTHROUGH, llvm::Intrinsic::r600_read_local_size_x, llvm::Intrinsic::r600_read_local_size_y, llvm::Intrinsic::r600_read_local_size_z, llvm::Intrinsic::r600_read_tidig_x, llvm::Intrinsic::r600_read_tidig_y, and llvm::Intrinsic::r600_read_tidig_z.
Referenced by getMaxWavesPerEU(), and INITIALIZE_PASS().
|
protected |
Definition at line 76 of file AMDGPUSubtarget.h.
Referenced by isPromoteAllocaEnabled().
|
protected |
Definition at line 68 of file AMDGPUSubtarget.h.
Referenced by hasFP32Denormals(), and llvm::R600Subtarget::initializeSubtargetDependencies().
|
protected |
Definition at line 69 of file AMDGPUSubtarget.h.
Referenced by hasFPExceptions().
|
protected |
Definition at line 66 of file AMDGPUSubtarget.h.
Referenced by has16BitInsts().
|
protected |
Definition at line 75 of file AMDGPUSubtarget.h.
Referenced by hasFminFmaxLegacy(), and llvm::GCNSubtarget::initializeSubtargetDependencies().
|
protected |
Definition at line 74 of file AMDGPUSubtarget.h.
Referenced by hasInv2PiInlineImm().
|
protected |
Definition at line 67 of file AMDGPUSubtarget.h.
Referenced by hasMadMixInsts().
|
protected |
Definition at line 72 of file AMDGPUSubtarget.h.
Referenced by hasMulI24(), and llvm::R600Subtarget::initializeSubtargetDependencies().
|
protected |
Definition at line 73 of file AMDGPUSubtarget.h.
Referenced by hasMulU24(), and llvm::R600Subtarget::initializeSubtargetDependencies().
|
protected |
Definition at line 70 of file AMDGPUSubtarget.h.
Referenced by hasSDWA().
|
protected |
Definition at line 77 of file AMDGPUSubtarget.h.
Referenced by hasTrigReducedRange().
|
protected |
Definition at line 71 of file AMDGPUSubtarget.h.
Referenced by hasVOP3PInsts().
|
protected |
Definition at line 78 of file AMDGPUSubtarget.h.
Referenced by getLocalMemorySize(), and llvm::GCNSubtarget::initializeSubtargetDependencies().
|
protected |
Definition at line 79 of file AMDGPUSubtarget.h.
Referenced by getWavefrontSize(), and llvm::GCNSubtarget::getWavefrontSizeLog2().