LLVM: llvm::BasicTTIImplBase< T > Class Template Reference (original) (raw)

Base class which can be used to help build a TTI implementation. More...

#include "[llvm/CodeGen/BasicTTIImpl.h](BasicTTIImpl%5F8h%5Fsource.html)"

Public Member Functions
Scalar TTI Implementations
bool allowsMisalignedMemoryAccesses (LLVMContext &Context, unsigned BitWidth, unsigned AddressSpace, Align Alignment, unsigned *Fast) const
bool areInlineCompatible (const Function *Caller, const Function *Callee) const
bool hasBranchDivergence (const Function *F=nullptr)
bool isSourceOfDivergence (const Value *V)
bool isAlwaysUniform (const Value *V)
bool isValidAddrSpaceCast (unsigned FromAS, unsigned ToAS) const
bool addrspacesMayAlias (unsigned AS0, unsigned AS1) const
unsigned getFlatAddressSpace ()
bool collectFlatAddressOperands (SmallVectorImpl< int > &OpIndexes, Intrinsic::ID IID) const
bool isNoopAddrSpaceCast (unsigned FromAS, unsigned ToAS) const
unsigned getAssumedAddrSpace (const Value *V) const
bool isSingleThreaded () const
std::pair< const Value *, unsigned > getPredicatedAddrSpace (const Value *V) const
Value * rewriteIntrinsicWithAddressSpace (IntrinsicInst *II, Value *OldV, Value *NewV) const
bool isLegalAddImmediate (int64_t imm)
bool isLegalAddScalableImmediate (int64_t Imm)
bool isLegalICmpImmediate (int64_t imm)
bool isLegalAddressingMode (Type *Ty, GlobalValue *BaseGV, int64_t BaseOffset, bool HasBaseReg, int64_t Scale, unsigned AddrSpace, Instruction *I=nullptr, int64_t ScalableOffset=0)
int64_t getPreferredLargeGEPBaseOffset (int64_t MinOffset, int64_t MaxOffset)
unsigned getStoreMinimumVF (unsigned VF, Type *ScalarMemTy, Type *ScalarValTy) const
bool isIndexedLoadLegal (TTI::MemIndexedMode M, Type *Ty, const DataLayout &DL) const
bool isIndexedStoreLegal (TTI::MemIndexedMode M, Type *Ty, const DataLayout &DL) const
bool isLSRCostLess (TTI::LSRCost C1, TTI::LSRCost C2)
bool isNumRegsMajorCostOfLSR ()
bool shouldDropLSRSolutionIfLessProfitable () const
bool isProfitableLSRChainElement (Instruction *I)
InstructionCost getScalingFactorCost (Type *Ty, GlobalValue *BaseGV, StackOffset BaseOffset, bool HasBaseReg, int64_t Scale, unsigned AddrSpace)
bool isTruncateFree (Type *Ty1, Type *Ty2)
bool isProfitableToHoist (Instruction *I)
bool useAA () const
bool isTypeLegal (Type *Ty)
unsigned getRegUsageForType (Type *Ty)
InstructionCost getGEPCost (Type *PointeeType, const Value *Ptr, ArrayRef< const Value * > Operands, Type *AccessType, TTI::TargetCostKind CostKind)
unsigned getEstimatedNumberOfCaseClusters (const SwitchInst &SI, unsigned &JumpTableSize, ProfileSummaryInfo *PSI, BlockFrequencyInfo *BFI)
bool shouldBuildLookupTables ()
bool shouldBuildRelLookupTables () const
bool haveFastSqrt (Type *Ty)
bool isFCmpOrdCheaperThanFCmpZero (Type *Ty)
InstructionCost getFPOpCost (Type *Ty)
bool preferToKeepConstantsAttached (const Instruction &Inst, const Function &Fn) const
unsigned getInliningThresholdMultiplier () const
unsigned adjustInliningThreshold (const CallBase *CB)
unsigned getCallerAllocaCost (const CallBase *CB, const AllocaInst *AI) const
int getInlinerVectorBonusPercent () const
void getUnrollingPreferences (Loop *L, ScalarEvolution &SE, TTI::UnrollingPreferences &UP, OptimizationRemarkEmitter *ORE)
void getPeelingPreferences (Loop *L, ScalarEvolution &SE, TTI::PeelingPreferences &PP)
bool isHardwareLoopProfitable (Loop *L, ScalarEvolution &SE, AssumptionCache &AC, TargetLibraryInfo *LibInfo, HardwareLoopInfo &HWLoopInfo)
unsigned getEpilogueVectorizationMinVF ()
bool preferPredicateOverEpilogue (TailFoldingInfo *TFI)
TailFoldingStyle getPreferredTailFoldingStyle (bool IVUpdateMayOverflow=true)
std::optional< Instruction * > instCombineIntrinsic (InstCombiner &IC, IntrinsicInst &II)
std::optional< Value * > simplifyDemandedUseBitsIntrinsic (InstCombiner &IC, IntrinsicInst &II, APInt DemandedMask, KnownBits &Known, bool &KnownBitsComputed)
std::optional< Value * > simplifyDemandedVectorEltsIntrinsic (InstCombiner &IC, IntrinsicInst &II, APInt DemandedElts, APInt &UndefElts, APInt &UndefElts2, APInt &UndefElts3, std::function< void(Instruction *, unsigned, APInt, APInt &)> SimplifyAndSetOp)
virtual std::optional< unsigned > getCacheSize (TargetTransformInfo::CacheLevel Level) const
virtual std::optional< unsigned > getCacheAssociativity (TargetTransformInfo::CacheLevel Level) const
virtual unsigned getCacheLineSize () const
virtual unsigned getPrefetchDistance () const
virtual unsigned getMinPrefetchStride (unsigned NumMemAccesses, unsigned NumStridedMemAccesses, unsigned NumPrefetches, bool HasCall) const
virtual unsigned getMaxPrefetchIterationsAhead () const
virtual bool enableWritePrefetching () const
virtual bool shouldPrefetchAddressSpace (unsigned AS) const
Vector TTI Implementations
TypeSize getRegisterBitWidth (TargetTransformInfo::RegisterKind K) const
std::optional< unsigned > getMaxVScale () const
std::optional< unsigned > getVScaleForTuning () const
bool isVScaleKnownToBeAPowerOfTwo () const
InstructionCost getScalarizationOverhead (VectorType *InTy, const APInt &DemandedElts, bool Insert, bool Extract, TTI::TargetCostKind CostKind, ArrayRef< Value * > VL={})
Estimate the overhead of scalarizing an instruction.
bool isTargetIntrinsicTriviallyScalarizable (Intrinsic::ID ID) const
bool isTargetIntrinsicWithScalarOpAtArg (Intrinsic::ID ID, unsigned ScalarOpdIdx) const
bool isTargetIntrinsicWithOverloadTypeAtArg (Intrinsic::ID ID, int OpdIdx) const
bool isTargetIntrinsicWithStructReturnOverloadAtField (Intrinsic::ID ID, int RetIdx) const
InstructionCost getScalarizationOverhead (VectorType *InTy, bool Insert, bool Extract, TTI::TargetCostKind CostKind)
Helper wrapper for the DemandedElts variant of getScalarizationOverhead.
InstructionCost getOperandsScalarizationOverhead (ArrayRef< const Value * > Args, ArrayRef< Type * > Tys, TTI::TargetCostKind CostKind)
Estimate the overhead of scalarizing an instructions unique non-constant operands.
InstructionCost getScalarizationOverhead (VectorType *RetTy, ArrayRef< const Value * > Args, ArrayRef< Type * > Tys, TTI::TargetCostKind CostKind)
Estimate the overhead of scalarizing the inputs and outputs of an instruction, with return type RetTy and arguments Args of type Tys.
std::pair< InstructionCost, MVT > getTypeLegalizationCost (Type *Ty) const
Estimate the cost of type-legalization and the legalized type.
unsigned getMaxInterleaveFactor (ElementCount VF)
InstructionCost getArithmeticInstrCost (unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind, TTI::OperandValueInfo Opd1Info={TTI::OK_AnyValue, TTI::OP_None}, TTI::OperandValueInfo Opd2Info={TTI::OK_AnyValue, TTI::OP_None}, ArrayRef< const Value * > Args={}, const Instruction *CxtI=nullptr)
TTI::ShuffleKind improveShuffleKindFromMask (TTI::ShuffleKind Kind, ArrayRef< int > Mask, VectorType *Ty, int &Index, VectorType *&SubTy) const
InstructionCost getShuffleCost (TTI::ShuffleKind Kind, VectorType *Tp, ArrayRef< int > Mask, TTI::TargetCostKind CostKind, int Index, VectorType *SubTp, ArrayRef< const Value * > Args={}, const Instruction *CxtI=nullptr)
InstructionCost getCastInstrCost (unsigned Opcode, Type *Dst, Type *Src, TTI::CastContextHint CCH, TTI::TargetCostKind CostKind, const Instruction *I=nullptr)
InstructionCost getExtractWithExtendCost (unsigned Opcode, Type *Dst, VectorType *VecTy, unsigned Index)
InstructionCost getCFInstrCost (unsigned Opcode, TTI::TargetCostKind CostKind, const Instruction *I=nullptr)
InstructionCost getCmpSelInstrCost (unsigned Opcode, Type *ValTy, Type *CondTy, CmpInst::Predicate VecPred, TTI::TargetCostKind CostKind, TTI::OperandValueInfo Op1Info={TTI::OK_AnyValue, TTI::OP_None}, TTI::OperandValueInfo Op2Info={TTI::OK_AnyValue, TTI::OP_None}, const Instruction *I=nullptr)
InstructionCost getVectorInstrCost (unsigned Opcode, Type *Val, TTI::TargetCostKind CostKind, unsigned Index, Value *Op0, Value *Op1)
InstructionCost getVectorInstrCost (unsigned Opcode, Type *Val, TTI::TargetCostKind CostKind, unsigned Index, Value *Scalar, ArrayRef< std::tuple< Value *, User *, int > > ScalarUserAndIdx)
InstructionCost getVectorInstrCost (const Instruction &I, Type *Val, TTI::TargetCostKind CostKind, unsigned Index)
InstructionCost getReplicationShuffleCost (Type *EltTy, int ReplicationFactor, int VF, const APInt &DemandedDstElts, TTI::TargetCostKind CostKind)
InstructionCost getMemoryOpCost (unsigned Opcode, Type *Src, MaybeAlign Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind, TTI::OperandValueInfo OpInfo={TTI::OK_AnyValue, TTI::OP_None}, const Instruction *I=nullptr)
InstructionCost getMaskedMemoryOpCost (unsigned Opcode, Type *DataTy, Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind)
InstructionCost getGatherScatterOpCost (unsigned Opcode, Type *DataTy, const Value *Ptr, bool VariableMask, Align Alignment, TTI::TargetCostKind CostKind, const Instruction *I=nullptr)
InstructionCost getStridedMemoryOpCost (unsigned Opcode, Type *DataTy, const Value *Ptr, bool VariableMask, Align Alignment, TTI::TargetCostKind CostKind, const Instruction *I)
InstructionCost getInterleavedMemoryOpCost (unsigned Opcode, Type *VecTy, unsigned Factor, ArrayRef< unsigned > Indices, Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind, bool UseMaskForCond=false, bool UseMaskForGaps=false)
InstructionCost getIntrinsicInstrCost (const IntrinsicCostAttributes &ICA, TTI::TargetCostKind CostKind)
Get intrinsic cost based on arguments.
InstructionCost getTypeBasedIntrinsicInstrCost (const IntrinsicCostAttributes &ICA, TTI::TargetCostKind CostKind)
Get intrinsic cost based on argument types.
InstructionCost getCallInstrCost (Function *F, Type *RetTy, ArrayRef< Type * > Tys, TTI::TargetCostKind CostKind)
Compute a cost of the given call instruction.
unsigned getNumberOfParts (Type *Tp)
InstructionCost getAddressComputationCost (Type *Ty, ScalarEvolution *, const SCEV *)
InstructionCost getTreeReductionCost (unsigned Opcode, VectorType *Ty, TTI::TargetCostKind CostKind)
Try to calculate arithmetic and shuffle op costs for reduction intrinsics.
InstructionCost getOrderedReductionCost (unsigned Opcode, VectorType *Ty, TTI::TargetCostKind CostKind)
Try to calculate the cost of performing strict (in-order) reductions, which involves doing a sequence of floating point additions in lane order, starting with an initial value.
InstructionCost getArithmeticReductionCost (unsigned Opcode, VectorType *Ty, std::optional< FastMathFlags > FMF, TTI::TargetCostKind CostKind)
InstructionCost getMinMaxReductionCost (Intrinsic::ID IID, VectorType *Ty, FastMathFlags FMF, TTI::TargetCostKind CostKind)
Try to calculate op costs for min/max reduction operations.
InstructionCost getExtendedReductionCost (unsigned Opcode, bool IsUnsigned, Type *ResTy, VectorType *Ty, FastMathFlags FMF, TTI::TargetCostKind CostKind)
InstructionCost getMulAccReductionCost (bool IsUnsigned, Type *ResTy, VectorType *Ty, TTI::TargetCostKind CostKind)
InstructionCost getVectorSplitCost ()
- Public Member Functions inherited from llvm::TargetTransformInfoImplCRTPBase< T >
InstructionCost getGEPCost (Type *PointeeType, const Value *Ptr, ArrayRef< const Value * > Operands, Type *AccessType, TTI::TargetCostKind CostKind)
InstructionCost getPointersChainCost (ArrayRef< const Value * > Ptrs, const Value *Base, const TTI::PointersChainInfo &Info, Type *AccessTy, TTI::TargetCostKind CostKind)
InstructionCost getInstructionCost (const User *U, ArrayRef< const Value * > Operands, TTI::TargetCostKind CostKind)
bool isExpensiveToSpeculativelyExecute (const Instruction *I)
bool supportsTailCallFor (const CallBase *CB) const
InstructionCost getGEPCost (Type *PointeeType, const Value *Ptr, ArrayRef< const Value * > Operands, Type *AccessType, TTI::TargetCostKind CostKind) const
- Public Member Functions inherited from llvm::TargetTransformInfoImplBase
TargetTransformInfoImplBase (const TargetTransformInfoImplBase &Arg)=default
TargetTransformInfoImplBase (TargetTransformInfoImplBase &&Arg)
const DataLayout & getDataLayout () const
InstructionCost getGEPCost (Type *PointeeType, const Value *Ptr, ArrayRef< const Value * > Operands, Type *AccessType, TTI::TargetCostKind CostKind) const
unsigned getEstimatedNumberOfCaseClusters (const SwitchInst &SI, unsigned &JTSize, ProfileSummaryInfo *PSI, BlockFrequencyInfo *BFI) const
unsigned getInliningThresholdMultiplier () const
unsigned getInliningCostBenefitAnalysisSavingsMultiplier () const
unsigned getInliningCostBenefitAnalysisProfitableMultiplier () const
int getInliningLastCallToStaticBonus () const
unsigned adjustInliningThreshold (const CallBase *CB) const
unsigned getCallerAllocaCost (const CallBase *CB, const AllocaInst *AI) const
int getInlinerVectorBonusPercent () const
InstructionCost getMemcpyCost (const Instruction *I) const
uint64_t getMaxMemIntrinsicInlineSizeThreshold () const
BranchProbability getPredictableBranchThreshold () const
InstructionCost getBranchMispredictPenalty () const
bool hasBranchDivergence (const Function *F=nullptr) const
bool isSourceOfDivergence (const Value *V) const
bool isAlwaysUniform (const Value *V) const
bool isValidAddrSpaceCast (unsigned FromAS, unsigned ToAS) const
bool addrspacesMayAlias (unsigned AS0, unsigned AS1) const
unsigned getFlatAddressSpace () const
bool collectFlatAddressOperands (SmallVectorImpl< int > &OpIndexes, Intrinsic::ID IID) const
bool isNoopAddrSpaceCast (unsigned, unsigned) const
bool canHaveNonUndefGlobalInitializerInAddressSpace (unsigned AS) const
unsigned getAssumedAddrSpace (const Value *V) const
bool isSingleThreaded () const
std::pair< const Value *, unsigned > getPredicatedAddrSpace (const Value *V) const
Value * rewriteIntrinsicWithAddressSpace (IntrinsicInst *II, Value *OldV, Value *NewV) const
bool isLoweredToCall (const Function *F) const
bool isHardwareLoopProfitable (Loop *L, ScalarEvolution &SE, AssumptionCache &AC, TargetLibraryInfo *LibInfo, HardwareLoopInfo &HWLoopInfo) const
unsigned getEpilogueVectorizationMinVF () const
bool preferPredicateOverEpilogue (TailFoldingInfo *TFI) const
TailFoldingStyle getPreferredTailFoldingStyle (bool IVUpdateMayOverflow=true) const
std::optional< Instruction * > instCombineIntrinsic (InstCombiner &IC, IntrinsicInst &II) const
std::optional< Value * > simplifyDemandedUseBitsIntrinsic (InstCombiner &IC, IntrinsicInst &II, APInt DemandedMask, KnownBits &Known, bool &KnownBitsComputed) const
std::optional< Value * > simplifyDemandedVectorEltsIntrinsic (InstCombiner &IC, IntrinsicInst &II, APInt DemandedElts, APInt &UndefElts, APInt &UndefElts2, APInt &UndefElts3, std::function< void(Instruction *, unsigned, APInt, APInt &)> SimplifyAndSetOp) const
void getUnrollingPreferences (Loop *, ScalarEvolution &, TTI::UnrollingPreferences &, OptimizationRemarkEmitter *) const
void getPeelingPreferences (Loop *, ScalarEvolution &, TTI::PeelingPreferences &) const
bool isLegalAddImmediate (int64_t Imm) const
bool isLegalAddScalableImmediate (int64_t Imm) const
bool isLegalICmpImmediate (int64_t Imm) const
bool isLegalAddressingMode (Type *Ty, GlobalValue *BaseGV, int64_t BaseOffset, bool HasBaseReg, int64_t Scale, unsigned AddrSpace, Instruction *I=nullptr, int64_t ScalableOffset=0) const
bool isLSRCostLess (const TTI::LSRCost &C1, const TTI::LSRCost &C2) const
bool isNumRegsMajorCostOfLSR () const
bool shouldDropLSRSolutionIfLessProfitable () const
bool isProfitableLSRChainElement (Instruction *I) const
bool canMacroFuseCmp () const
bool canSaveCmp (Loop *L, BranchInst **BI, ScalarEvolution *SE, LoopInfo *LI, DominatorTree *DT, AssumptionCache *AC, TargetLibraryInfo *LibInfo) const
TTI::AddressingModeKind getPreferredAddressingMode (const Loop *L, ScalarEvolution *SE) const
bool isLegalMaskedStore (Type *DataType, Align Alignment) const
bool isLegalMaskedLoad (Type *DataType, Align Alignment) const
bool isLegalNTStore (Type *DataType, Align Alignment) const
bool isLegalNTLoad (Type *DataType, Align Alignment) const
bool isLegalBroadcastLoad (Type *ElementTy, ElementCount NumElements) const
bool isLegalMaskedScatter (Type *DataType, Align Alignment) const
bool isLegalMaskedGather (Type *DataType, Align Alignment) const
bool forceScalarizeMaskedGather (VectorType *DataType, Align Alignment) const
bool forceScalarizeMaskedScatter (VectorType *DataType, Align Alignment) const
bool isLegalMaskedCompressStore (Type *DataType, Align Alignment) const
bool isLegalAltInstr (VectorType *VecTy, unsigned Opcode0, unsigned Opcode1, const SmallBitVector &OpcodeMask) const
bool isLegalMaskedExpandLoad (Type *DataType, Align Alignment) const
bool isLegalStridedLoadStore (Type *DataType, Align Alignment) const
bool isLegalInterleavedAccessType (VectorType *VTy, unsigned Factor, Align Alignment, unsigned AddrSpace)
bool isLegalMaskedVectorHistogram (Type *AddrType, Type *DataType) const
bool enableOrderedReductions () const
bool hasDivRemOp (Type *DataType, bool IsSigned) const
bool hasVolatileVariant (Instruction *I, unsigned AddrSpace) const
bool prefersVectorizedAddressing () const
InstructionCost getScalingFactorCost (Type *Ty, GlobalValue *BaseGV, StackOffset BaseOffset, bool HasBaseReg, int64_t Scale, unsigned AddrSpace) const
bool LSRWithInstrQueries () const
bool isTruncateFree (Type *Ty1, Type *Ty2) const
bool isProfitableToHoist (Instruction *I) const
bool useAA () const
bool isTypeLegal (Type *Ty) const
unsigned getRegUsageForType (Type *Ty) const
bool shouldBuildLookupTables () const
bool shouldBuildLookupTablesForConstant (Constant *C) const
bool shouldBuildRelLookupTables () const
bool useColdCCForColdCall (Function &F) const
bool isTargetIntrinsicTriviallyScalarizable (Intrinsic::ID ID) const
bool isTargetIntrinsicWithScalarOpAtArg (Intrinsic::ID ID, unsigned ScalarOpdIdx) const
bool isTargetIntrinsicWithOverloadTypeAtArg (Intrinsic::ID ID, int OpdIdx) const
bool isTargetIntrinsicWithStructReturnOverloadAtField (Intrinsic::ID ID, int RetIdx) const
InstructionCost getScalarizationOverhead (VectorType *Ty, const APInt &DemandedElts, bool Insert, bool Extract, TTI::TargetCostKind CostKind, ArrayRef< Value * > VL={}) const
InstructionCost getOperandsScalarizationOverhead (ArrayRef< const Value * > Args, ArrayRef< Type * > Tys, TTI::TargetCostKind CostKind) const
bool supportsEfficientVectorElementLoadStore () const
bool supportsTailCalls () const
bool enableAggressiveInterleaving (bool LoopHasReductions) const
TTI::MemCmpExpansionOptions enableMemCmpExpansion (bool OptSize, bool IsZeroCmp) const
bool enableSelectOptimize () const
bool shouldTreatInstructionLikeSelect (const Instruction *I)
bool enableInterleavedAccessVectorization () const
bool enableMaskedInterleavedAccessVectorization () const
bool isFPVectorizationPotentiallyUnsafe () const
bool allowsMisalignedMemoryAccesses (LLVMContext &Context, unsigned BitWidth, unsigned AddressSpace, Align Alignment, unsigned *Fast) const
TTI::PopcntSupportKind getPopcntSupport (unsigned IntTyWidthInBit) const
bool haveFastSqrt (Type *Ty) const
bool isExpensiveToSpeculativelyExecute (const Instruction *I)
bool isFCmpOrdCheaperThanFCmpZero (Type *Ty) const
InstructionCost getFPOpCost (Type *Ty) const
InstructionCost getIntImmCodeSizeCost (unsigned Opcode, unsigned Idx, const APInt &Imm, Type *Ty) const
InstructionCost getIntImmCost (const APInt &Imm, Type *Ty, TTI::TargetCostKind CostKind) const
InstructionCost getIntImmCostInst (unsigned Opcode, unsigned Idx, const APInt &Imm, Type *Ty, TTI::TargetCostKind CostKind, Instruction *Inst=nullptr) const
InstructionCost getIntImmCostIntrin (Intrinsic::ID IID, unsigned Idx, const APInt &Imm, Type *Ty, TTI::TargetCostKind CostKind) const
bool preferToKeepConstantsAttached (const Instruction &Inst, const Function &Fn) const
unsigned getNumberOfRegisters (unsigned ClassID) const
bool hasConditionalLoadStoreForType (Type *Ty) const
unsigned getRegisterClassForType (bool Vector, Type *Ty=nullptr) const
const char * getRegisterClassName (unsigned ClassID) const
TypeSize getRegisterBitWidth (TargetTransformInfo::RegisterKind K) const
unsigned getMinVectorRegisterBitWidth () const
std::optional< unsigned > getMaxVScale () const
std::optional< unsigned > getVScaleForTuning () const
bool isVScaleKnownToBeAPowerOfTwo () const
bool shouldMaximizeVectorBandwidth (TargetTransformInfo::RegisterKind K) const
ElementCount getMinimumVF (unsigned ElemWidth, bool IsScalable) const
unsigned getMaximumVF (unsigned ElemWidth, unsigned Opcode) const
unsigned getStoreMinimumVF (unsigned VF, Type *, Type *) const
bool shouldConsiderAddressTypePromotion (const Instruction &I, bool &AllowPromotionWithoutCommonHeader) const
unsigned getCacheLineSize () const
std::optional< unsigned > getCacheSize (TargetTransformInfo::CacheLevel Level) const
std::optional< unsigned > getCacheAssociativity (TargetTransformInfo::CacheLevel Level) const
std::optional< unsigned > getMinPageSize () const
unsigned getPrefetchDistance () const
unsigned getMinPrefetchStride (unsigned NumMemAccesses, unsigned NumStridedMemAccesses, unsigned NumPrefetches, bool HasCall) const
unsigned getMaxPrefetchIterationsAhead () const
bool enableWritePrefetching () const
bool shouldPrefetchAddressSpace (unsigned AS) const
InstructionCost getPartialReductionCost (unsigned Opcode, Type *InputTypeA, Type *InputTypeB, Type *AccumType, ElementCount VF, TTI::PartialReductionExtendKind OpAExtend, TTI::PartialReductionExtendKind OpBExtend, std::optional< unsigned > BinOp=std::nullopt) const
unsigned getMaxInterleaveFactor (ElementCount VF) const
InstructionCost getArithmeticInstrCost (unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind, TTI::OperandValueInfo Opd1Info, TTI::OperandValueInfo Opd2Info, ArrayRef< const Value * > Args, const Instruction *CxtI=nullptr) const
InstructionCost getAltInstrCost (VectorType *VecTy, unsigned Opcode0, unsigned Opcode1, const SmallBitVector &OpcodeMask, TTI::TargetCostKind CostKind) const
InstructionCost getShuffleCost (TTI::ShuffleKind Kind, VectorType *Ty, ArrayRef< int > Mask, TTI::TargetCostKind CostKind, int Index, VectorType *SubTp, ArrayRef< const Value * > Args={}, const Instruction *CxtI=nullptr) const
InstructionCost getCastInstrCost (unsigned Opcode, Type *Dst, Type *Src, TTI::CastContextHint CCH, TTI::TargetCostKind CostKind, const Instruction *I) const
InstructionCost getExtractWithExtendCost (unsigned Opcode, Type *Dst, VectorType *VecTy, unsigned Index) const
InstructionCost getCFInstrCost (unsigned Opcode, TTI::TargetCostKind CostKind, const Instruction *I=nullptr) const
InstructionCost getCmpSelInstrCost (unsigned Opcode, Type *ValTy, Type *CondTy, CmpInst::Predicate VecPred, TTI::TargetCostKind CostKind, TTI::OperandValueInfo Op1Info, TTI::OperandValueInfo Op2Info, const Instruction *I) const
InstructionCost getVectorInstrCost (unsigned Opcode, Type *Val, TTI::TargetCostKind CostKind, unsigned Index, Value *Op0, Value *Op1) const
InstructionCost getVectorInstrCost (unsigned Opcode, Type *Val, TTI::TargetCostKind CostKind, unsigned Index, Value *Scalar, ArrayRef< std::tuple< Value *, User *, int > > ScalarUserAndIdx) const
InstructionCost getVectorInstrCost (const Instruction &I, Type *Val, TTI::TargetCostKind CostKind, unsigned Index) const
unsigned getReplicationShuffleCost (Type *EltTy, int ReplicationFactor, int VF, const APInt &DemandedDstElts, TTI::TargetCostKind CostKind)
InstructionCost getMemoryOpCost (unsigned Opcode, Type *Src, Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind, TTI::OperandValueInfo OpInfo, const Instruction *I) const
InstructionCost getVPMemoryOpCost (unsigned Opcode, Type *Src, Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind, const Instruction *I) const
InstructionCost getMaskedMemoryOpCost (unsigned Opcode, Type *Src, Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind) const
InstructionCost getGatherScatterOpCost (unsigned Opcode, Type *DataTy, const Value *Ptr, bool VariableMask, Align Alignment, TTI::TargetCostKind CostKind, const Instruction *I=nullptr) const
InstructionCost getStridedMemoryOpCost (unsigned Opcode, Type *DataTy, const Value *Ptr, bool VariableMask, Align Alignment, TTI::TargetCostKind CostKind, const Instruction *I=nullptr) const
unsigned getInterleavedMemoryOpCost (unsigned Opcode, Type *VecTy, unsigned Factor, ArrayRef< unsigned > Indices, Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind, bool UseMaskForCond, bool UseMaskForGaps) const
InstructionCost getIntrinsicInstrCost (const IntrinsicCostAttributes &ICA, TTI::TargetCostKind CostKind) const
InstructionCost getCallInstrCost (Function *F, Type *RetTy, ArrayRef< Type * > Tys, TTI::TargetCostKind CostKind) const
unsigned getNumberOfParts (Type *Tp) const
InstructionCost getAddressComputationCost (Type *Tp, ScalarEvolution *, const SCEV *) const
InstructionCost getArithmeticReductionCost (unsigned, VectorType *, std::optional< FastMathFlags > FMF, TTI::TargetCostKind) const
InstructionCost getMinMaxReductionCost (Intrinsic::ID IID, VectorType *, FastMathFlags, TTI::TargetCostKind) const
InstructionCost getExtendedReductionCost (unsigned Opcode, bool IsUnsigned, Type *ResTy, VectorType *Ty, FastMathFlags FMF, TTI::TargetCostKind CostKind) const
InstructionCost getMulAccReductionCost (bool IsUnsigned, Type *ResTy, VectorType *Ty, TTI::TargetCostKind CostKind) const
InstructionCost getCostOfKeepingLiveOverCall (ArrayRef< Type * > Tys) const
bool getTgtMemIntrinsic (IntrinsicInst *Inst, MemIntrinsicInfo &Info) const
unsigned getAtomicMemIntrinsicMaxElementSize () const
Value * getOrCreateResultFromMemIntrinsic (IntrinsicInst *Inst, Type *ExpectedType) const
Type * getMemcpyLoopLoweringType (LLVMContext &Context, Value *Length, unsigned SrcAddrSpace, unsigned DestAddrSpace, Align SrcAlign, Align DestAlign, std::optional< uint32_t > AtomicElementSize) const
void getMemcpyLoopResidualLoweringType (SmallVectorImpl< Type * > &OpsOut, LLVMContext &Context, unsigned RemainingBytes, unsigned SrcAddrSpace, unsigned DestAddrSpace, Align SrcAlign, Align DestAlign, std::optional< uint32_t > AtomicCpySize) const
bool areInlineCompatible (const Function *Caller, const Function *Callee) const
unsigned getInlineCallPenalty (const Function *F, const CallBase &Call, unsigned DefaultCallPenalty) const
bool areTypesABICompatible (const Function *Caller, const Function *Callee, const ArrayRef< Type * > &Types) const
bool isIndexedLoadLegal (TTI::MemIndexedMode Mode, Type *Ty, const DataLayout &DL) const
bool isIndexedStoreLegal (TTI::MemIndexedMode Mode, Type *Ty, const DataLayout &DL) const
unsigned getLoadStoreVecRegBitWidth (unsigned AddrSpace) const
bool isLegalToVectorizeLoad (LoadInst *LI) const
bool isLegalToVectorizeStore (StoreInst *SI) const
bool isLegalToVectorizeLoadChain (unsigned ChainSizeInBytes, Align Alignment, unsigned AddrSpace) const
bool isLegalToVectorizeStoreChain (unsigned ChainSizeInBytes, Align Alignment, unsigned AddrSpace) const
bool isLegalToVectorizeReduction (const RecurrenceDescriptor &RdxDesc, ElementCount VF) const
bool isElementTypeLegalForScalableVector (Type *Ty) const
unsigned getLoadVectorFactor (unsigned VF, unsigned LoadSize, unsigned ChainSizeInBytes, VectorType *VecTy) const
unsigned getStoreVectorFactor (unsigned VF, unsigned StoreSize, unsigned ChainSizeInBytes, VectorType *VecTy) const
bool preferFixedOverScalableIfEqualCost () const
bool preferInLoopReduction (unsigned Opcode, Type *Ty, TTI::ReductionFlags Flags) const
bool preferPredicatedReductionSelect (unsigned Opcode, Type *Ty, TTI::ReductionFlags Flags) const
bool preferEpilogueVectorization () const
bool shouldExpandReduction (const IntrinsicInst *II) const
TTI::ReductionShuffle getPreferredExpandedReductionShuffle (const IntrinsicInst *II) const
unsigned getGISelRematGlobalCost () const
unsigned getMinTripCountTailFoldingThreshold () const
bool supportsScalableVectors () const
bool enableScalableVectorization () const
bool hasActiveVectorLength (unsigned Opcode, Type *DataType, Align Alignment) const
bool isProfitableToSinkOperands (Instruction *I, SmallVectorImpl< Use * > &Ops) const
bool isVectorShiftByScalarCheap (Type *Ty) const
TargetTransformInfo::VPLegalization getVPLegalizationStrategy (const VPIntrinsic &PI) const
bool hasArmWideBranch (bool) const
uint64_t getFeatureMask (const Function &F) const
bool isMultiversionedFunction (const Function &F) const
unsigned getMaxNumArgs () const
unsigned getNumBytesToPadGlobalArray (unsigned Size, Type *ArrayType) const
Protected Member Functions
BasicTTIImplBase (const TargetMachine *TM, const DataLayout &DL)
virtual ~BasicTTIImplBase ()=default
- Protected Member Functions inherited from llvm::TargetTransformInfoImplCRTPBase< T >
TargetTransformInfoImplCRTPBase (const DataLayout &DL)
- Protected Member Functions inherited from llvm::TargetTransformInfoImplBase
TargetTransformInfoImplBase (const DataLayout &DL)
unsigned minRequiredElementSize (const Value *Val, bool &isSigned) const
bool isStridedAccess (const SCEV *Ptr) const
const SCEVConstant * getConstantStrideStep (ScalarEvolution *SE, const SCEV *Ptr) const
bool isConstantStridedAccessLessThan (ScalarEvolution *SE, const SCEV *Ptr, int64_t MergeDistance) const
Protected Attributes
const DataLayout & DL
- Protected Attributes inherited from llvm::TargetTransformInfoImplBase
const DataLayout & DL

template<typename T>
class llvm::BasicTTIImplBase< T >

Base class which can be used to help build a TTI implementation.

This class provides as much implementation of the TTI interface as is possible using the target independent parts of the code generator.

In order to subclass it, your class must implement a getST() method to return the subtarget, and a getTLI() method to return the target lowering. We need these methods implemented in the derived class so that this class doesn't have to duplicate storage for them.

Definition at line 80 of file BasicTTIImpl.h.

~BasicTTIImplBase()

addrspacesMayAlias()

adjustInliningThreshold()

allowsMisalignedMemoryAccesses()

areInlineCompatible()

collectFlatAddressOperands()

enableWritePrefetching()

getAddressComputationCost()

getArithmeticInstrCost()

getArithmeticReductionCost()

getAssumedAddrSpace()

getCacheAssociativity()

getCacheLineSize()

getCacheSize()

getCallerAllocaCost()

getCallInstrCost()

Compute a cost of the given call instruction.

Compute the cost of calling function F with return type RetTy and argument types Tys. F might be nullptr, in this case the cost of an arbitrary call with the specified signature will be returned. This is used, for instance, when we estimate call of a vector counterpart of the given function.

Parameters

F Called function, might be nullptr.
RetTy Return value types.
Tys Argument types.

Returns

The cost of Call instruction.

Definition at line 2661 of file BasicTTIImpl.h.

getCastInstrCost()

Definition at line 1116 of file BasicTTIImpl.h.

References assert(), CostKind, llvm::BasicTTIImplBase< T >::DL, llvm::TargetTransformInfoImplBase::getCastInstrCost(), llvm::TargetTransformInfo::getCastInstrCost(), llvm::EVT::getEVT(), llvm::VectorType::getHalfElementsVectorType(), llvm::InstructionCost::getInvalid(), llvm::BasicTTIImplBase< T >::getScalarizationOverhead(), llvm::TargetLoweringBase::getTypeAction(), llvm::BasicTTIImplBase< T >::getTypeLegalizationCost(), llvm::TargetLoweringBase::getValueType(), I, llvm::TargetLoweringBase::InstructionOpcodeToISD(), llvm::TargetLoweringBase::isFreeAddrSpaceCast(), llvm::TargetLoweringBase::isLoadExtLegal(), llvm::TargetLoweringBase::isOperationExpand(), llvm::TargetLoweringBase::isOperationLegalOrPromote(), llvm::TargetLoweringBase::isTruncateFree(), llvm::TargetLoweringBase::isZExtFree(), llvm_unreachable, llvm::TargetTransformInfo::Normal, llvm::ISD::SEXTLOAD, llvm::TargetLoweringBase::TypeSplitVector, and llvm::ISD::ZEXTLOAD.

getCFInstrCost()

getCmpSelInstrCost()

getEpilogueVectorizationMinVF()

getEstimatedNumberOfCaseClusters()

Try to find the estimated number of clusters. Note that the number of clusters identified in this function could be different from the actual numbers found in lowering. This function ignore switches that are lowered with a mix of jump table / bit test / BTree. This function was initially intended to be used when estimating the cost of switch in inline cost heuristic, but it's a generic cost model to be used in other places (e.g., in loop unrolling).

Definition at line 484 of file BasicTTIImpl.h.

References llvm::TargetLoweringBase::areJTsAllowed(), llvm::BasicTTIImplBase< T >::DL, llvm::TargetTransformInfoImplBase::getDataLayout(), llvm::DataLayout::getIndexSizeInBits(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::TargetLoweringBase::isSuitableForBitTests(), llvm::TargetLoweringBase::isSuitableForJumpTable(), N, Range, llvm::APInt::sgt(), llvm::SmallPtrSetImplBase::size(), and llvm::APInt::slt().

getExtendedReductionCost()

getExtractWithExtendCost()

getFlatAddressSpace()

getFPOpCost()

getGatherScatterOpCost()

getGEPCost()

getInlinerVectorBonusPercent()

getInliningThresholdMultiplier()

getInterleavedMemoryOpCost()

Definition at line 1483 of file BasicTTIImpl.h.

References assert(), CostKind, llvm::BitVector::count(), llvm::divideCeil(), llvm::FixedVectorType::get(), llvm::APInt::getAllOnes(), llvm::Type::getInt8Ty(), llvm::InstructionCost::getInvalid(), llvm::MVT::getStoreSize(), llvm::BasicTTIImplBase< T >::getTypeLegalizationCost(), llvm::InstructionCost::getValue(), llvm::APInt::getZero(), Index, llvm::InstructionCost::isValid(), llvm::BitVector::set(), llvm::APInt::setBit(), and llvm::ArrayRef< T >::size().

getIntrinsicInstrCost()

Get intrinsic cost based on arguments.

Definition at line 1627 of file BasicTTIImpl.h.

References assert(), CostKind, llvm::Data, llvm::BasicTTIImplBase< T >::DL, llvm::ArrayRef< T >::drop_back(), llvm::ArrayRef< T >::drop_front(), llvm::Exponent, llvm::VectorType::get(), llvm::DataLayout::getABITypeAlign(), llvm::IntrinsicCostAttributes::getArgs(), llvm::IntrinsicCostAttributes::getArgTypes(), llvm::TargetLoweringBase::getBitWidthForCttzElements(), llvm::ElementCount::getFixed(), llvm::IntrinsicCostAttributes::getFlags(), llvm::VPIntrinsic::getFunctionalIntrinsicIDForVP(), llvm::VPIntrinsic::getFunctionalOpcodeForVP(), llvm::IntrinsicCostAttributes::getID(), llvm::IntrinsicCostAttributes::getInst(), llvm::Type::getIntNTy(), llvm::TargetTransformInfoImplBase::getIntrinsicInstrCost(), llvm::InstructionCost::getInvalid(), llvm::TargetTransformInfo::getOperandInfo(), llvm::BasicTTIImplBase< T >::getOperandsScalarizationOverhead(), llvm::IntrinsicCostAttributes::getReturnType(), llvm::BasicTTIImplBase< T >::getScalarizationOverhead(), getType(), llvm::BasicTTIImplBase< T >::getTypeBasedIntrinsicInstrCost(), llvm::BasicTTIImplBase< T >::getTypeLegalizationCost(), llvm::TargetLoweringBase::getValueType(), llvm::EVT::getVectorElementCount(), llvm::getVScaleRange(), llvm::APInt::getZero(), I, llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_ULT, Index, llvm::TargetLoweringBase::isBeneficialToExpandPowI(), llvm::TargetLoweringBase::isCheapToSpeculateCtlz(), llvm::TargetLoweringBase::isCheapToSpeculateCttz(), llvm::TargetTransformInfo::OperandValueInfo::isConstant(), llvm::isPowerOf2_32(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isScalable(), llvm::ElementCount::isScalar(), llvm::Intrinsic::isTargetIntrinsic(), llvm::IntrinsicCostAttributes::isTypeBasedOnly(), llvm::ElementCount::isVector(), llvm::VPBinOpIntrinsic::isVPBinOp(), llvm::VPCastIntrinsic::isVPCast(), llvm::VPCmpIntrinsic::isVPCmp(), llvm::VPIntrinsic::isVPIntrinsic(), llvm::VPReductionIntrinsic::isVPReduction(), llvm::TargetTransformInfo::OperandValueInfo::Kind, llvm::TargetTransformInfo::None, llvm::TargetTransformInfo::OK_UniformConstantValue, llvm::TargetTransformInfo::OP_None, llvm::TargetTransformInfo::OP_PowerOf2, Ptr, RetTy, llvm::TargetTransformInfo::SK_ExtractSubvector, llvm::TargetTransformInfo::SK_InsertSubvector, llvm::TargetTransformInfo::SK_Reverse, llvm::TargetTransformInfo::SK_Splice, llvm::TargetTransformInfo::TCC_Basic, X, and Y.

Referenced by llvm::BasicTTIImplBase< T >::getMinMaxReductionCost().

getMaskedMemoryOpCost()

getMaxInterleaveFactor()

getMaxPrefetchIterationsAhead()

getMaxVScale()

getMemoryOpCost()

getMinMaxReductionCost()

getMinPrefetchStride()

getMulAccReductionCost()

getNumberOfParts()

getOperandsScalarizationOverhead()

Estimate the overhead of scalarizing an instructions unique non-constant operands.

The (potentially vector) types to use for each of argument are passes via Tys.

Definition at line 875 of file BasicTTIImpl.h.

References A, assert(), CostKind, E, llvm::BasicTTIImplBase< T >::getScalarizationOverhead(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::Type::isFPOrFPVectorTy(), llvm::Type::isIntOrIntVectorTy(), and llvm::Type::isPtrOrPtrVectorTy().

Referenced by llvm::BasicTTIImplBase< T >::getIntrinsicInstrCost(), and llvm::BasicTTIImplBase< T >::getScalarizationOverhead().

getOrderedReductionCost()

Try to calculate the cost of performing strict (in-order) reductions, which involves doing a sequence of floating point additions in lane order, starting with an initial value.

For example, consider a scalar initial value 'InitVal' of type float and a vector of type <4 x float>:

Vector = <float v0, float v1, float v2, float v3>

add1 = InitVal + v0 add2 = add1 + v1 add3 = add2 + v2 add4 = add3 + v3

As a simple estimate we can say the cost of such a reduction is 4 times the cost of a scalar FP addition. We can only estimate the costs for fixed-width vectors here because for scalable vectors we do not know the runtime number of operations.

Definition at line 2786 of file BasicTTIImpl.h.

References CostKind, llvm::VectorType::getElementType(), llvm::InstructionCost::getInvalid(), llvm::FixedVectorType::getNumElements(), and llvm::BasicTTIImplBase< T >::getScalarizationOverhead().

Referenced by llvm::BasicTTIImplBase< T >::getArithmeticReductionCost().

getPeelingPreferences()

getPredicatedAddrSpace()

getPreferredLargeGEPBaseOffset()

template<typename T >

int64_t llvm::BasicTTIImplBase< T >::getPreferredLargeGEPBaseOffset ( int64_t MinOffset, int64_t MaxOffset ) inline

getPreferredTailFoldingStyle()

getPrefetchDistance()

getRegisterBitWidth()

getRegUsageForType()

getReplicationShuffleCost()

getScalarizationOverhead() [1/3]

getScalarizationOverhead() [2/3]

getScalarizationOverhead() [3/3]

getScalingFactorCost()

getShuffleCost()

getStoreMinimumVF()

getStridedMemoryOpCost()

getTreeReductionCost()

Try to calculate arithmetic and shuffle op costs for reduction intrinsics.

We're assuming that reduction operation are performing the following way:

val1 = shufflevector val, undef, <i32 n/2, i32 n/2 + 1, ..., i32 n, i32 undef, ..., i32 undef> -------------—v----------—/ -------—v---------—/ n/2 elements n/2 elements red1 = op val, val1 After this operation we have a vector red1 where only the first n/2 elements are meaningful, the second n/2 elements are undefined and can be dropped. All other operations are actually working with the vector of length n/2, not n, though the real vector length is still n. val2 = shufflevector red1, undef, <i32 n/4, i32 n/4 + 1, ..., i32 n/2, i32 undef, ..., i32 undef> -------------—v----------—/ -------—v---------—/ n/4 elements 3*n/4 elements red2 = op red1, val2 - working with the vector of length n/2, the resulting vector has length n/4 etc.

The cost model should take into account that the actual length of the vector is reduced on each iteration.

Definition at line 2710 of file BasicTTIImpl.h.

References llvm::CmpInst::BAD_ICMP_PREDICATE, CostKind, llvm::IntegerType::get(), llvm::FixedVectorType::get(), llvm::Type::getContext(), llvm::VectorType::getElementType(), llvm::Type::getInt1Ty(), llvm::InstructionCost::getInvalid(), llvm::Log2_32(), llvm::CmpInst::makeCmpResultType(), llvm::TargetTransformInfo::None, llvm::TargetTransformInfo::SK_ExtractSubvector, and llvm::TargetTransformInfo::SK_PermuteSingleSrc.

Referenced by llvm::BasicTTIImplBase< T >::getArithmeticReductionCost().

getTypeBasedIntrinsicInstrCost()

Get intrinsic cost based on argument types.

If ScalarizationCostPassed is std::numeric_limits::max(), the cost of scalarizing the arguments and the return value will be computed based on types.

Definition at line 2000 of file BasicTTIImpl.h.

References llvm::ISD::ABS, llvm::any_of(), assert(), llvm::CmpInst::BAD_ICMP_PREDICATE, llvm::ISD::BITREVERSE, llvm::ISD::BSWAP, CostKind, llvm::StructType::create(), llvm::ISD::CTLZ, llvm::ISD::CTPOP, llvm::ISD::CTTZ, llvm::BasicTTIImplBase< T >::DL, llvm::ISD::FABS, llvm::ISD::FACOS, llvm::ISD::FASIN, llvm::ISD::FATAN, llvm::ISD::FATAN2, llvm::ISD::FCANONICALIZE, llvm::ISD::FCEIL, llvm::CmpInst::FCMP_UNO, llvm::ISD::FCOPYSIGN, llvm::ISD::FCOS, llvm::ISD::FCOSH, llvm::ISD::FEXP, llvm::ISD::FEXP10, llvm::ISD::FEXP2, llvm::ISD::FFLOOR, llvm::ISD::FLOG, llvm::ISD::FLOG10, llvm::ISD::FLOG2, llvm::ISD::FMA, llvm::ISD::FMAXIMUM, llvm::ISD::FMAXIMUMNUM, llvm::ISD::FMAXNUM, llvm::ISD::FMINIMUM, llvm::ISD::FMINIMUMNUM, llvm::ISD::FMINNUM, llvm::ISD::FNEARBYINT, llvm::ISD::FP_TO_SINT_SAT, llvm::ISD::FP_TO_UINT_SAT, llvm::ISD::FPOW, llvm::ISD::FRINT, llvm::ISD::FROUND, llvm::ISD::FROUNDEVEN, llvm::ISD::FSIN, llvm::ISD::FSINCOS, llvm::ISD::FSINH, llvm::ISD::FSQRT, llvm::ISD::FTAN, llvm::ISD::FTANH, llvm::ISD::FTRUNC, llvm::IntrinsicCostAttributes::getArgTypes(), llvm::getArithmeticReductionInstruction(), llvm::IntrinsicCostAttributes::getFlags(), llvm::CmpIntrinsic::getGTPredicate(), llvm::IntrinsicCostAttributes::getID(), llvm::InstructionCost::getInvalid(), llvm::CmpIntrinsic::getLTPredicate(), llvm::getMinMaxReductionIntrinsicOp(), getNumElements(), llvm::IntrinsicCostAttributes::getReturnType(), llvm::IntrinsicCostAttributes::getScalarizationCost(), llvm::BasicTTIImplBase< T >::getScalarizationOverhead(), llvm::Type::getScalarSizeInBits(), llvm::Type::getScalarType(), llvm::BasicTTIImplBase< T >::getTypeLegalizationCost(), llvm::TargetLoweringBase::getValueType(), llvm::Type::getWithNewBitWidth(), llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_NE, llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_UGT, llvm::CmpInst::ICMP_ULT, llvm::TargetLoweringBase::isFAbsFree(), llvm::TargetLoweringBase::isOperationExpand(), llvm::TargetLoweringBase::isOperationLegalOrPromote(), llvm::Type::isVectorTy(), llvm::ISD::LLRINT, llvm::ISD::LRINT, llvm::TargetTransformInfo::None, llvm::TargetTransformInfo::OK_AnyValue, llvm::TargetTransformInfo::OK_UniformConstantValue, llvm::TargetTransformInfo::OP_None, llvm::SmallVectorTemplateBase< T, bool >::push_back(), RetTy, llvm::ISD::SADDO, llvm::ISD::SADDSAT, llvm::ISD::SCMP, llvm::TargetLoweringBase::shouldExpandCmpUsingSelects(), llvm::TargetTransformInfo::SK_Broadcast, llvm::IntrinsicCostAttributes::skipScalarizationCost(), llvm::ISD::SMAX, llvm::ISD::SMIN, llvm::ISD::SMULFIX, llvm::ISD::SMULO, llvm::ISD::SSUBO, llvm::ISD::SSUBSAT, llvm::ISD::STRICT_FMA, llvm::TargetTransformInfo::TCC_Expensive, llvm::TargetTransformInfo::TCK_CodeSize, llvm::ISD::UADDO, llvm::ISD::UADDSAT, llvm::ISD::UCMP, llvm::ISD::UMAX, llvm::ISD::UMIN, llvm::ISD::UMULFIX, llvm::ISD::UMULO, llvm::ISD::USUBO, and llvm::ISD::USUBSAT.

Referenced by llvm::BasicTTIImplBase< T >::getIntrinsicInstrCost().

getTypeLegalizationCost()

Estimate the cost of type-legalization and the legalized type.

Definition at line 922 of file BasicTTIImpl.h.

References llvm::CallingConv::C, llvm::BasicTTIImplBase< T >::DL, llvm::Type::getContext(), llvm::InstructionCost::getInvalid(), llvm::EVT::getSimpleVT(), llvm::TargetLoweringBase::getTypeConversion(), llvm::TargetLoweringBase::getValueType(), llvm::EVT::isSimple(), llvm::TargetLoweringBase::TypeExpandInteger, llvm::TargetLoweringBase::TypeLegal, llvm::TargetLoweringBase::TypeScalarizeScalableVector, and llvm::TargetLoweringBase::TypeSplitVector.

Referenced by llvm::BasicTTIImplBase< T >::getCastInstrCost(), llvm::BasicTTIImplBase< T >::getInterleavedMemoryOpCost(), llvm::BasicTTIImplBase< T >::getIntrinsicInstrCost(), llvm::BasicTTIImplBase< T >::getNumberOfParts(), and llvm::BasicTTIImplBase< T >::getTypeBasedIntrinsicInstrCost().

getUnrollingPreferences()

Definition at line 622 of file BasicTTIImpl.h.

References llvm::TargetTransformInfo::UnrollingPreferences::BEInsns, llvm::OptimizationRemarkEmitter::emit(), F, getCalledFunction(), I, llvm::TargetTransformInfoImplBase::isLoweredToCall(), llvm::TargetTransformInfo::UnrollingPreferences::OptSizeThreshold, llvm::TargetTransformInfo::UnrollingPreferences::Partial, llvm::TargetTransformInfo::UnrollingPreferences::PartialOptSizeThreshold, llvm::TargetTransformInfo::UnrollingPreferences::PartialThreshold, llvm::PartialUnrollingThreshold, llvm::TargetTransformInfo::UnrollingPreferences::Runtime, and llvm::TargetTransformInfo::UnrollingPreferences::UpperBound.

Referenced by llvm::ARMTTIImpl::getUnrollingPreferences(), and llvm::RISCVTTIImpl::getUnrollingPreferences().

getVectorInstrCost() [1/3]

getVectorInstrCost() [2/3]

getVectorInstrCost() [3/3]

getVectorSplitCost()

getVScaleForTuning()

hasBranchDivergence()

haveFastSqrt()

improveShuffleKindFromMask()

Definition at line 1035 of file BasicTTIImpl.h.

References llvm::FixedVectorType::get(), llvm::VectorType::getElementCount(), llvm::VectorType::getElementType(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getKnownMinValue(), Index, llvm::ShuffleVectorInst::isExtractSubvectorMask(), llvm::ShuffleVectorInst::isInsertSubvectorMask(), llvm::ShuffleVectorInst::isReverseMask(), llvm::ShuffleVectorInst::isSelectMask(), llvm::ShuffleVectorInst::isSpliceMask(), llvm::ShuffleVectorInst::isTransposeMask(), llvm::ShuffleVectorInst::isZeroEltSplatMask(), llvm::TargetTransformInfo::SK_Broadcast, llvm::TargetTransformInfo::SK_ExtractSubvector, llvm::TargetTransformInfo::SK_InsertSubvector, llvm::TargetTransformInfo::SK_PermuteSingleSrc, llvm::TargetTransformInfo::SK_PermuteTwoSrc, llvm::TargetTransformInfo::SK_Reverse, llvm::TargetTransformInfo::SK_Select, llvm::TargetTransformInfo::SK_Splice, and llvm::TargetTransformInfo::SK_Transpose.

instCombineIntrinsic()

isAlwaysUniform()

isFCmpOrdCheaperThanFCmpZero()

isHardwareLoopProfitable()

isIndexedLoadLegal()

isIndexedStoreLegal()

isLegalAddImmediate()

isLegalAddressingMode()

isLegalAddScalableImmediate()

isLegalICmpImmediate()

isLSRCostLess()

isNoopAddrSpaceCast()

isNumRegsMajorCostOfLSR()

isProfitableLSRChainElement()

isProfitableToHoist()

isSingleThreaded()

isSourceOfDivergence()

isTargetIntrinsicTriviallyScalarizable()

isTargetIntrinsicWithOverloadTypeAtArg()

isTargetIntrinsicWithScalarOpAtArg()

isTargetIntrinsicWithStructReturnOverloadAtField()

isTruncateFree()

isTypeLegal()

isValidAddrSpaceCast()

isVScaleKnownToBeAPowerOfTwo()

preferPredicateOverEpilogue()

preferToKeepConstantsAttached()

rewriteIntrinsicWithAddressSpace()

shouldBuildLookupTables()

shouldBuildRelLookupTables()

shouldDropLSRSolutionIfLessProfitable()

shouldPrefetchAddressSpace()

simplifyDemandedUseBitsIntrinsic()

simplifyDemandedVectorEltsIntrinsic()

useAA()

DL

Definition at line 39 of file TargetTransformInfoImpl.h.

Referenced by llvm::BasicTTIImplBase< T >::getCastInstrCost(), llvm::BasicTTIImplBase< T >::getEstimatedNumberOfCaseClusters(), llvm::BasicTTIImplBase< T >::getFPOpCost(), llvm::BasicTTIImplBase< T >::getIntrinsicInstrCost(), llvm::BasicTTIImplBase< T >::getRegUsageForType(), llvm::BasicTTIImplBase< T >::getScalingFactorCost(), llvm::BasicTTIImplBase< T >::getStoreMinimumVF(), llvm::BasicTTIImplBase< T >::getTypeBasedIntrinsicInstrCost(), llvm::BasicTTIImplBase< T >::getTypeLegalizationCost(), llvm::BasicTTIImplBase< T >::haveFastSqrt(), llvm::BasicTTIImplBase< T >::isIndexedLoadLegal(), llvm::BasicTTIImplBase< T >::isIndexedStoreLegal(), llvm::BasicTTIImplBase< T >::isLegalAddressingMode(), llvm::BasicTTIImplBase< T >::isTypeLegal(), and llvm::BasicTTIImplBase< T >::preferToKeepConstantsAttached().


The documentation for this class was generated from the following file: