17 #ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUTARGETTRANSFORMINFO_H 18 #define LLVM_LIB_TARGET_AMDGPU_AMDGPUTARGETTRANSFORMINFO_H 35 class AMDGPUTargetLowering;
37 class ScalarEvolution;
58 TargetTriple(TM->getTargetTriple()),
60 TLI(ST->getTargetLowering()) {}
75 bool IsGraphicsShader;
76 bool HasFP32Denormals;
80 AMDGPU::FeatureEnableLoadStoreOpt,
81 AMDGPU::FeatureEnableSIScheduler,
82 AMDGPU::FeatureEnableUnsafeDSOffsetFolding,
83 AMDGPU::FeatureFlatForGlobal,
84 AMDGPU::FeaturePromoteAlloca,
85 AMDGPU::FeatureUnalignedBufferAccess,
86 AMDGPU::FeatureUnalignedScratchAccess,
88 AMDGPU::FeatureAutoWaitcntBeforeBarrier,
91 AMDGPU::FeatureSGPRInitBug,
93 AMDGPU::FeatureTrapHandler,
94 AMDGPU::FeatureCodeObjectV3,
98 AMDGPU::FeatureSRAMECC,
101 AMDGPU::FeatureFastFMAF32,
102 AMDGPU::HalfRate64Ops
108 static inline int getFullRateInstrCost() {
112 static inline int getHalfRateInstrCost() {
118 static inline int getQuarterRateInstrCost() {
124 inline int get64BitInstrCost()
const {
126 getHalfRateInstrCost() : getQuarterRateInstrCost();
133 TLI(ST->getTargetLowering()),
148 unsigned getHardwareNumberOfRegisters(
bool Vector)
const;
153 unsigned ChainSizeInBytes,
156 unsigned ChainSizeInBytes,
160 bool isLegalToVectorizeMemChain(
unsigned ChainSizeInBytes,
162 unsigned AddrSpace)
const;
165 unsigned AddrSpace)
const;
168 unsigned AddrSpace)
const;
175 unsigned Opcode,
Type *Ty,
192 if (IsGraphicsShader)
217 template <
typename T>
223 unsigned ScalarizationCostPassed = UINT_MAX);
247 TLI(ST->getTargetLowering()),
255 unsigned getHardwareNumberOfRegisters(
bool Vec)
const;
260 bool isLegalToVectorizeMemChain(
unsigned ChainSizeInBytes,
unsigned Alignment,
261 unsigned AddrSpace)
const;
264 unsigned AddrSpace)
const;
267 unsigned AddrSpace)
const;
275 #endif // LLVM_LIB_TARGET_AMDGPU_AMDGPUTARGETTRANSFORMINFO_H AMDGPU specific subclass of TargetSubtarget.
This class represents lattice values for constants.
bool collectFlatAddressOperands(SmallVectorImpl< int > &OpIndexes, Intrinsic::ID IID) const
The main scalar evolution driver.
static bool hasFP32Denormals(const MachineFunction &MF)
void getUnrollingPreferences(Loop *L, ScalarEvolution &SE, TTI::UnrollingPreferences &UP)
Base class which can be used to help build a TTI implementation.
unsigned getMaxInterleaveFactor(unsigned VF)
Address space for flat memory.
bool rewriteIntrinsicWithAddressSpace(IntrinsicInst *II, Value *OldV, Value *NewV) const
R600TTIImpl(const AMDGPUTargetMachine *TM, const Function &F)
unsigned getIntrinsicInstrCost(Intrinsic::ID IID, Type *RetTy, ArrayRef< Value * > Args, FastMathFlags FMF, unsigned VF=1)
Get intrinsic cost based on arguments.
unsigned getFlatAddressSpace() const
unsigned getArithmeticReductionCost(unsigned Opcode, Type *Ty, bool IsPairwise)
Try to calculate arithmetic and shuffle op costs for reduction operations.
mir Rename Register Operands
unsigned getRegisterBitWidth(bool Vector) const
bool hasHalfRate64Ops() const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Analysis containing CSE Info
const R600Subtarget * getST() const
Container class for subtarget features.
constexpr bool isPowerOf2_32(uint32_t Value)
Return true if the argument is a power of two > 0.
The instances of the Type class are immutable: once they are created, they are never changed...
unsigned getMinMaxReductionCost(Type *Ty, Type *CondTy, bool IsPairwise, bool)
Try to calculate op costs for min/max reduction operations.
const AMDGPUTargetLowering * getTLI() const
This file provides a helper that implements much of the TTI interface in terms of the target-independ...
The AMDGPU TargetMachine interface definition for hw codgen targets.
Triple - Helper class for working with autoconf configuration names.
This base class for TargetLowering contains the SelectionDAG-independent parts that can be used from ...
unsigned getCFInstrCost(unsigned Opcode)
unsigned getShuffleCost(TTI::ShuffleKind Kind, Type *Tp, int Index, Type *SubTp)
unsigned getArithmeticInstrCost(unsigned Opcode, Type *Ty, TTI::OperandValueKind Opd1Info=TTI::OK_AnyValue, TTI::OperandValueKind Opd2Info=TTI::OK_AnyValue, TTI::OperandValueProperties Opd1PropInfo=TTI::OP_None, TTI::OperandValueProperties Opd2PropInfo=TTI::OP_None, ArrayRef< const Value * > Args=ArrayRef< const Value * >(), const Instruction *CxtI=nullptr)
Class to represent vector types.
amdgpu Simplify well known AMD library false FunctionCallee Callee
bool isShader(CallingConv::ID cc)
bool isAlwaysUniform(const Value *V)
GCNTTIImpl(const AMDGPUTargetMachine *TM, const Function &F)
TargetSubtargetInfo - Generic base class for all target subtargets.
unsigned getVectorSplitCost()
Provides AMDGPU specific target descriptions.
bool hasBranchDivergence()
Represents a single loop in the control flow graph.
unsigned getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index)
int getInlinerVectorBonusPercent()
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
TTI::PopcntSupportKind getPopcntSupport(unsigned TyWidth)
bool isSourceOfDivergence(const Value *V)
LLVM Value Representation.
static const Function * getParent(const Value *V)
unsigned getInliningThresholdMultiplier()
AMDGPUTTIImpl(const AMDGPUTargetMachine *TM, const Function &F)
Convenience struct for specifying and reasoning about fast-math flags.
Information about a load/store intrinsic defined by the target.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
A wrapper class for inspecting calls to intrinsic functions.