LLVM 22.0.0git
Protected Member Functions | Protected Attributes | List of all members
llvm::BasicTTIImplBase< T > Class Template Reference

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

#include "llvm/CodeGen/BasicTTIImpl.h"

Inheritance diagram for llvm::BasicTTIImplBase< T >:
[legend]

Public Member Functions

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

Protected Attributes

const DataLayoutDL
 
- Protected Attributes inherited from llvm::TargetTransformInfoImplBase
const DataLayoutDL
 

Additional Inherited Members

- Protected Types inherited from llvm::TargetTransformInfoImplBase
typedef TargetTransformInfo TTI
 

Detailed Description

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 82 of file BasicTTIImpl.h.

Constructor & Destructor Documentation

◆ BasicTTIImplBase()

template<typename T >
llvm::BasicTTIImplBase< T >::BasicTTIImplBase ( const TargetMachine TM,
const DataLayout DL 
)
inlineexplicitprotected

Definition at line 367 of file BasicTTIImpl.h.

◆ ~BasicTTIImplBase()

template<typename T >
virtual llvm::BasicTTIImplBase< T >::~BasicTTIImplBase ( )
protectedvirtualdefault

Member Function Documentation

◆ addrspacesMayAlias()

template<typename T >
bool llvm::BasicTTIImplBase< T >::addrspacesMayAlias ( unsigned  AS0,
unsigned  AS1 
) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 410 of file BasicTTIImpl.h.

◆ adjustInliningThreshold()

template<typename T >
unsigned llvm::BasicTTIImplBase< T >::adjustInliningThreshold ( const CallBase CB) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 692 of file BasicTTIImpl.h.

◆ allowsMisalignedMemoryAccesses()

template<typename T >
bool llvm::BasicTTIImplBase< T >::allowsMisalignedMemoryAccesses ( LLVMContext Context,
unsigned  BitWidth,
unsigned  AddressSpace,
Align  Alignment,
unsigned Fast 
) const
inlineoverridevirtual

◆ areInlineCompatible()

template<typename T >
bool llvm::BasicTTIImplBase< T >::areInlineCompatible ( const Function Caller,
const Function Callee 
) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 384 of file BasicTTIImpl.h.

References llvm::TargetLoweringBase::getTargetMachine().

◆ collectFlatAddressOperands()

template<typename T >
bool llvm::BasicTTIImplBase< T >::collectFlatAddressOperands ( SmallVectorImpl< int > &  OpIndexes,
Intrinsic::ID  IID 
) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 419 of file BasicTTIImpl.h.

◆ enableWritePrefetching()

template<typename T >
virtual bool llvm::BasicTTIImplBase< T >::enableWritePrefetching ( ) const
inlineoverridevirtual

◆ getAddressComputationCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getAddressComputationCost ( Type PtrTy,
ScalarEvolution ,
const SCEV ,
TTI::TargetCostKind   
) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 3054 of file BasicTTIImpl.h.

◆ getArithmeticInstrCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getArithmeticInstrCost ( unsigned  Opcode,
Type Ty,
TTI::TargetCostKind  CostKind,
TTI::OperandValueInfo  Opd1Info = {TTI::OK_AnyValueTTI::OP_None},
TTI::OperandValueInfo  Opd2Info = {TTI::OK_AnyValueTTI::OP_None},
ArrayRef< const Value * >  Args = {},
const Instruction CxtI = nullptr 
) const
inlineoverridevirtual

◆ getArithmeticReductionCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getArithmeticReductionCost ( unsigned  Opcode,
VectorType Ty,
std::optional< FastMathFlags FMF,
TTI::TargetCostKind  CostKind 
) const
inlineoverridevirtual

◆ getAssumedAddrSpace()

template<typename T >
unsigned llvm::BasicTTIImplBase< T >::getAssumedAddrSpace ( const Value V) const
inlineoverridevirtual

◆ getCacheAssociativity()

template<typename T >
virtual std::optional< unsigned > llvm::BasicTTIImplBase< T >::getCacheAssociativity ( TargetTransformInfo::CacheLevel  Level) const
inlineoverridevirtual

◆ getCacheLineSize()

template<typename T >
virtual unsigned llvm::BasicTTIImplBase< T >::getCacheLineSize ( ) const
inlineoverridevirtual

◆ getCacheSize()

template<typename T >
virtual std::optional< unsigned > llvm::BasicTTIImplBase< T >::getCacheSize ( TargetTransformInfo::CacheLevel  Level) const
inlineoverridevirtual

◆ getCallerAllocaCost()

template<typename T >
unsigned llvm::BasicTTIImplBase< T >::getCallerAllocaCost ( const CallBase CB,
const AllocaInst AI 
) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 695 of file BasicTTIImpl.h.

◆ getCallInstrCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getCallInstrCost ( Function F,
Type RetTy,
ArrayRef< Type * >  Tys,
TTI::TargetCostKind  CostKind 
) const
inlineoverridevirtual

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
FCalled function, might be nullptr.
RetTyReturn value types.
TysArgument types.
Returns
The cost of Call instruction.

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 3031 of file BasicTTIImpl.h.

◆ getCastInstrCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getCastInstrCost ( unsigned  Opcode,
Type Dst,
Type Src,
TTI::CastContextHint  CCH,
TTI::TargetCostKind  CostKind,
const Instruction I = nullptr 
) const
inlineoverridevirtual

◆ getCFInstrCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getCFInstrCost ( unsigned  Opcode,
TTI::TargetCostKind  CostKind,
const Instruction I = nullptr 
) const
inlineoverridevirtual

◆ getCmpSelInstrCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getCmpSelInstrCost ( unsigned  Opcode,
Type ValTy,
Type CondTy,
CmpInst::Predicate  VecPred,
TTI::TargetCostKind  CostKind,
TTI::OperandValueInfo  Op1Info = {TTI::OK_AnyValueTTI::OP_None},
TTI::OperandValueInfo  Op2Info = {TTI::OK_AnyValueTTI::OP_None},
const Instruction I = nullptr 
) const
inlineoverridevirtual

◆ getEpilogueVectorizationMinVF()

template<typename T >
unsigned llvm::BasicTTIImplBase< T >::getEpilogueVectorizationMinVF ( ) const
inlineoverridevirtual

◆ getEstimatedNumberOfCaseClusters()

template<typename T >
unsigned llvm::BasicTTIImplBase< T >::getEstimatedNumberOfCaseClusters ( const SwitchInst SI,
unsigned JumpTableSize,
ProfileSummaryInfo PSI,
BlockFrequencyInfo BFI 
) const
inlineoverridevirtual

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).

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 564 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().

◆ getExpandCompressMemoryOpCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getExpandCompressMemoryOpCost ( unsigned  Opcode,
Type DataTy,
bool  VariableMask,
Align  Alignment,
TTI::TargetCostKind  CostKind,
const Instruction I = nullptr 
) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 1567 of file BasicTTIImpl.h.

References CostKind.

◆ getExtendedReductionCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getExtendedReductionCost ( unsigned  Opcode,
bool  IsUnsigned,
Type ResTy,
VectorType Ty,
std::optional< FastMathFlags FMF,
TTI::TargetCostKind  CostKind 
) const
inlineoverridevirtual

◆ getExtractWithExtendCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getExtractWithExtendCost ( unsigned  Opcode,
Type Dst,
VectorType VecTy,
unsigned  Index,
TTI::TargetCostKind  CostKind 
) const
inlineoverridevirtual

◆ getFlatAddressSpace()

template<typename T >
unsigned llvm::BasicTTIImplBase< T >::getFlatAddressSpace ( ) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 414 of file BasicTTIImpl.h.

◆ getFPOpCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getFPOpCost ( Type Ty) const
inlineoverridevirtual

◆ getGatherScatterOpCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getGatherScatterOpCost ( unsigned  Opcode,
Type DataTy,
const Value Ptr,
bool  VariableMask,
Align  Alignment,
TTI::TargetCostKind  CostKind,
const Instruction I = nullptr 
) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 1558 of file BasicTTIImpl.h.

References CostKind.

◆ getGEPCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getGEPCost ( Type PointeeType,
const Value Ptr,
ArrayRef< const Value * >  Operands,
Type AccessType,
TTI::TargetCostKind  CostKind 
) const
inlineoverridevirtual

◆ getIndexedVectorInstrCostFromEnd()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getIndexedVectorInstrCostFromEnd ( unsigned  Opcode,
Type Val,
TTI::TargetCostKind  CostKind,
unsigned  Index 
) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 1457 of file BasicTTIImpl.h.

References assert(), CostKind, getNumElements(), and Index.

◆ getInlinerVectorBonusPercent()

template<typename T >
int llvm::BasicTTIImplBase< T >::getInlinerVectorBonusPercent ( ) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 700 of file BasicTTIImpl.h.

◆ getInliningThresholdMultiplier()

template<typename T >
unsigned llvm::BasicTTIImplBase< T >::getInliningThresholdMultiplier ( ) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 691 of file BasicTTIImpl.h.

◆ getInterleavedMemoryOpCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getInterleavedMemoryOpCost ( unsigned  Opcode,
Type VecTy,
unsigned  Factor,
ArrayRef< unsigned Indices,
Align  Alignment,
unsigned  AddressSpace,
TTI::TargetCostKind  CostKind,
bool  UseMaskForCond = false,
bool  UseMaskForGaps = false 
) const
inlineoverridevirtual

◆ getIntrinsicInstrCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getIntrinsicInstrCost ( const IntrinsicCostAttributes ICA,
TTI::TargetCostKind  CostKind 
) const
inlineoverridevirtual

Get intrinsic cost based on arguments.

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 1734 of file BasicTTIImpl.h.

References assert(), llvm::CmpInst::BAD_ICMP_PREDICATE, 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::BasicTTIImplBase< T >::getCmpSelInstrCost(), llvm::getContainedTypes(), 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::RTLIB::getMODF(), llvm::TargetTransformInfo::getOperandInfo(), llvm::BasicTTIImplBase< T >::getOperandsScalarizationOverhead(), llvm::IntrinsicCostAttributes::getReturnType(), llvm::BasicTTIImplBase< T >::getScalarizationOverhead(), llvm::EVT::getScalarType(), llvm::RTLIB::getSINCOS(), llvm::RTLIB::getSINCOSPI(), getType(), llvm::BasicTTIImplBase< T >::getTypeBasedIntrinsicInstrCost(), llvm::BasicTTIImplBase< T >::getTypeLegalizationCost(), llvm::TargetLoweringBase::getValueType(), llvm::EVT::getVectorElementCount(), llvm::getVectorizedTypeVF(), llvm::getVScaleRange(), llvm::APInt::getZero(), I, llvm::CmpInst::ICMP_EQ, Index, 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::isVectorizedTy(), llvm::VPBinOpIntrinsic::isVPBinOp(), llvm::VPCastIntrinsic::isVPCast(), llvm::VPCmpIntrinsic::isVPCmp(), llvm::VPIntrinsic::isVPIntrinsic(), llvm::VPReductionIntrinsic::isVPReduction(), llvm::TargetTransformInfo::OperandValueInfo::Kind, llvm_unreachable, llvm::TargetTransformInfo::None, llvm::TargetTransformInfo::OP_None, Ptr, RetTy, llvm::TargetTransformInfo::SK_ExtractSubvector, llvm::TargetTransformInfo::SK_InsertSubvector, llvm::TargetTransformInfo::SK_Splice, llvm::TargetTransformInfo::TCC_Basic, X, and Y.

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

◆ getMaskedMemoryOpCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getMaskedMemoryOpCost ( unsigned  Opcode,
Type DataTy,
Align  Alignment,
unsigned  AddressSpace,
TTI::TargetCostKind  CostKind 
) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 1549 of file BasicTTIImpl.h.

References CostKind.

◆ getMaxInterleaveFactor()

template<typename T >
unsigned llvm::BasicTTIImplBase< T >::getMaxInterleaveFactor ( ElementCount  VF) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 1031 of file BasicTTIImpl.h.

◆ getMaxPrefetchIterationsAhead()

template<typename T >
virtual unsigned llvm::BasicTTIImplBase< T >::getMaxPrefetchIterationsAhead ( ) const
inlineoverridevirtual

◆ getMaxVScale()

template<typename T >
std::optional< unsigned > llvm::BasicTTIImplBase< T >::getMaxVScale ( ) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 879 of file BasicTTIImpl.h.

◆ getMemoryOpCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getMemoryOpCost ( unsigned  Opcode,
Type Src,
Align  Alignment,
unsigned  AddressSpace,
TTI::TargetCostKind  CostKind,
TTI::OperandValueInfo  OpInfo = {TTI::OK_AnyValueTTI::OP_None},
const Instruction I = nullptr 
) const
inlineoverridevirtual

◆ getMinMaxReductionCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getMinMaxReductionCost ( Intrinsic::ID  IID,
VectorType Ty,
FastMathFlags  FMF,
TTI::TargetCostKind  CostKind 
) const
inlineoverridevirtual

◆ getMinPrefetchStride()

template<typename T >
virtual unsigned llvm::BasicTTIImplBase< T >::getMinPrefetchStride ( unsigned  NumMemAccesses,
unsigned  NumStridedMemAccesses,
unsigned  NumPrefetches,
bool  HasCall 
) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Reimplemented in llvm::SystemZTTIImpl.

Definition at line 849 of file BasicTTIImpl.h.

References llvm::MCSubtargetInfo::getMinPrefetchStride().

◆ getMulAccReductionCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getMulAccReductionCost ( bool  IsUnsigned,
Type ResTy,
VectorType Ty,
TTI::TargetCostKind  CostKind 
) const
inlineoverridevirtual

◆ getNumberOfParts()

template<typename T >
unsigned llvm::BasicTTIImplBase< T >::getNumberOfParts ( Type Tp) const
inlineoverridevirtual

◆ getOperandsScalarizationOverhead()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getOperandsScalarizationOverhead ( ArrayRef< Type * >  Tys,
TTI::TargetCostKind  CostKind 
) const
inlineoverridevirtual

Estimate the overhead of scalarizing an instruction's operands.

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

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 957 of file BasicTTIImpl.h.

References CostKind, and llvm::BasicTTIImplBase< T >::getScalarizationOverhead().

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

◆ getOrderedReductionCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getOrderedReductionCost ( unsigned  Opcode,
VectorType Ty,
TTI::TargetCostKind  CostKind 
) const
inline

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 3156 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()

template<typename T >
void llvm::BasicTTIImplBase< T >::getPeelingPreferences ( Loop L,
ScalarEvolution SE,
TTI::PeelingPreferences PP 
) const
inlineoverridevirtual

◆ getPredicatedAddrSpace()

template<typename T >
std::pair< const Value *, unsigned > llvm::BasicTTIImplBase< T >::getPredicatedAddrSpace ( const Value V) const
inlineoverridevirtual

◆ getPreferredLargeGEPBaseOffset()

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

◆ getPreferredTailFoldingStyle()

template<typename T >
TailFoldingStyle llvm::BasicTTIImplBase< T >::getPreferredTailFoldingStyle ( bool  IVUpdateMayOverflow = true) const
inlineoverridevirtual

◆ getPrefetchDistance()

template<typename T >
virtual unsigned llvm::BasicTTIImplBase< T >::getPrefetchDistance ( ) const
inlineoverridevirtual

◆ getRegisterBitWidth()

template<typename T >
TypeSize llvm::BasicTTIImplBase< T >::getRegisterBitWidth ( TargetTransformInfo::RegisterKind  K) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 875 of file BasicTTIImpl.h.

References llvm::TypeSize::getFixed().

◆ getRegUsageForType()

template<typename T >
unsigned llvm::BasicTTIImplBase< T >::getRegUsageForType ( Type Ty) const
inlineoverridevirtual

◆ getReplicationShuffleCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getReplicationShuffleCost ( Type EltTy,
int  ReplicationFactor,
int  VF,
const APInt DemandedDstElts,
TTI::TargetCostKind  CostKind 
) const
inlineoverridevirtual

◆ getScalarizationOverhead() [1/3]

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getScalarizationOverhead ( VectorType InTy,
bool  Insert,
bool  Extract,
TTI::TargetCostKind  CostKind 
) const
inline

Helper wrapper for the DemandedElts variant of getScalarizationOverhead.

Definition at line 942 of file BasicTTIImpl.h.

References CostKind, llvm::APInt::getAllOnes(), and llvm::InstructionCost::getInvalid().

◆ getScalarizationOverhead() [2/3]

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getScalarizationOverhead ( VectorType InTy,
const APInt DemandedElts,
bool  Insert,
bool  Extract,
TTI::TargetCostKind  CostKind,
bool  ForPoisonSrc = true,
ArrayRef< Value * >  VL = {} 
) const
inlineoverridevirtual

Estimate the overhead of scalarizing an instruction.

Insert and Extract are set if the demanded result elements need to be inserted and/or extracted from vectors.

FIXME: a bitfield is not a reasonable abstraction for talking about which elements are needed from a scalable vector

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 888 of file BasicTTIImpl.h.

Referenced by llvm::BasicTTIImplBase< T >::getCastInstrCost(), llvm::BasicTTIImplBase< T >::getIntrinsicInstrCost(), llvm::BasicTTIImplBase< T >::getOperandsScalarizationOverhead(), llvm::BasicTTIImplBase< T >::getOrderedReductionCost(), llvm::BasicTTIImplBase< T >::getScalarizationOverhead(), and llvm::BasicTTIImplBase< T >::getTypeBasedIntrinsicInstrCost().

◆ getScalarizationOverhead() [3/3]

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getScalarizationOverhead ( VectorType RetTy,
ArrayRef< const Value * >  Args,
ArrayRef< Type * >  Tys,
TTI::TargetCostKind  CostKind 
) const
inline

Estimate the overhead of scalarizing the inputs and outputs of an instruction, with return type RetTy and arguments Args of type Tys.

If Args are unknown (empty), then the cost associated with one argument is added as a heuristic.

Definition at line 978 of file BasicTTIImpl.h.

References CostKind, llvm::BasicTTIImplBase< T >::getOperandsScalarizationOverhead(), llvm::BasicTTIImplBase< T >::getScalarizationOverhead(), and RetTy.

◆ getScalingFactorCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getScalingFactorCost ( Type Ty,
GlobalValue BaseGV,
StackOffset  BaseOffset,
bool  HasBaseReg,
int64_t  Scale,
unsigned  AddrSpace 
) const
inlineoverridevirtual

◆ getShuffleCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getShuffleCost ( TTI::ShuffleKind  Kind,
VectorType DstTy,
VectorType SrcTy,
ArrayRef< int >  Mask,
TTI::TargetCostKind  CostKind,
int  Index,
VectorType SubTp,
ArrayRef< const Value * >  Args = {},
const Instruction CxtI = nullptr 
) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 1167 of file BasicTTIImpl.h.

◆ getStoreMinimumVF()

template<typename T >
unsigned llvm::BasicTTIImplBase< T >::getStoreMinimumVF ( unsigned  VF,
Type ScalarMemTy,
Type ScalarValTy 
) const
inlineoverridevirtual

◆ getStridedMemoryOpCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getStridedMemoryOpCost ( unsigned  Opcode,
Type DataTy,
const Value Ptr,
bool  VariableMask,
Align  Alignment,
TTI::TargetCostKind  CostKind,
const Instruction I 
) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 1577 of file BasicTTIImpl.h.

References CostKind, I, and Ptr.

◆ getTreeReductionCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getTreeReductionCost ( unsigned  Opcode,
VectorType Ty,
TTI::TargetCostKind  CostKind 
) const
inline

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

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

val1 = shufflevector<n x t> val, <n x t> undef, <n x i32> <i32 n/2, i32 n/2 + 1, ..., i32 n, i32 undef, ..., i32 undef> -------------—v----------—/ -------—v---------—/ n/2 elements n/2 elements red1 = op <n x t> val, <n x t> 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<n x t> red1, <n x t> undef, <n x i32> <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 <n x t> red1, <n x t> 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 3080 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()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getTypeBasedIntrinsicInstrCost ( const IntrinsicCostAttributes ICA,
TTI::TargetCostKind  CostKind 
) const
inline

Get intrinsic cost based on argument types.

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

Definition at line 2197 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::SmallVectorBase< Size_T >::empty(), 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::FLDEXP, llvm::ISD::FLOG, llvm::ISD::FLOG10, llvm::ISD::FLOG2, llvm::ISD::FMA, llvm::ISD::FMAXIMUM, llvm::ISD::FMAXIMUMNUM, llvm::ISD::FMAXNUM, llvm::ISD::FMAXNUM_IEEE, llvm::ISD::FMINIMUM, llvm::ISD::FMINIMUMNUM, llvm::ISD::FMINNUM, llvm::ISD::FMINNUM_IEEE, llvm::ISD::FMODF, 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::FSHL, llvm::ISD::FSHR, llvm::ISD::FSIN, llvm::ISD::FSINCOS, llvm::ISD::FSINCOSPI, llvm::ISD::FSINH, llvm::ISD::FSQRT, llvm::ISD::FTAN, llvm::ISD::FTANH, llvm::ISD::FTRUNC, llvm::VectorType::get(), llvm::IntrinsicCostAttributes::getArgTypes(), llvm::getArithmeticReductionInstruction(), llvm::getContainedTypes(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getFixedValue(), llvm::IntrinsicCostAttributes::getFlags(), llvm::CmpIntrinsic::getGTPredicate(), llvm::IntrinsicCostAttributes::getID(), llvm::IntrinsicCostAttributes::getInst(), llvm::InstructionCost::getInvalid(), llvm::CmpIntrinsic::getLTPredicate(), llvm::getMinMaxReductionIntrinsicOp(), llvm::FixedVectorType::getNumElements(), 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::getVectorizedTypeVF(), 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::isOperationCustom(), llvm::TargetLoweringBase::isOperationLegal(), llvm::TargetLoweringBase::isOperationLegalOrPromote(), llvm::isPowerOf2_32(), llvm::isVectorizedTy(), llvm::Type::isVectorTy(), llvm::ISD::LLRINT, llvm::ISD::LLROUND, llvm_unreachable, llvm::ISD::LRINT, llvm::ISD::LROUND, 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::SmallVectorBase< Size_T >::size(), llvm::TargetTransformInfo::SK_Broadcast, llvm::TargetTransformInfo::SK_Reverse, 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_Basic, llvm::TargetTransformInfo::TCC_Expensive, llvm::TargetTransformInfo::TCK_CodeSize, llvm::toScalarizedTy(), llvm::ISD::UADDO, llvm::ISD::UADDSAT, llvm::ISD::UCMP, llvm::UMax, llvm::ISD::UMAX, llvm::UMin, llvm::ISD::UMIN, llvm::ISD::UMULFIX, llvm::ISD::UMULO, llvm::ISD::USUBO, and llvm::ISD::USUBSAT.

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

◆ getTypeLegalizationCost()

template<typename T >
std::pair< InstructionCost, MVT > llvm::BasicTTIImplBase< T >::getTypeLegalizationCost ( Type Ty) const
inline

◆ getUnrollingPreferences()

template<typename T >
void llvm::BasicTTIImplBase< T >::getUnrollingPreferences ( Loop L,
ScalarEvolution SE,
TTI::UnrollingPreferences UP,
OptimizationRemarkEmitter ORE 
) const
inlineoverridevirtual

◆ getVectorInstrCost() [1/3]

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getVectorInstrCost ( const Instruction I,
Type Val,
TTI::TargetCostKind  CostKind,
unsigned  Index 
) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 1443 of file BasicTTIImpl.h.

References CostKind, I, and Index.

◆ getVectorInstrCost() [2/3]

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getVectorInstrCost ( unsigned  Opcode,
Type Val,
TTI::TargetCostKind  CostKind,
unsigned  Index,
const Value Op0,
const Value Op1 
) const
inlineoverridevirtual

◆ getVectorInstrCost() [3/3]

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getVectorInstrCost ( unsigned  Opcode,
Type Val,
TTI::TargetCostKind  CostKind,
unsigned  Index,
Value Scalar,
ArrayRef< std::tuple< Value *, User *, int > >  ScalarUserAndIdx 
) const
inlineoverridevirtual
Parameters
ScalarUserAndIdxencodes the information about extracts from a vector with 'Scalar' being the value being extracted,'User' being the user of the extract(nullptr if user is not known before vectorization) and 'Idx' being the extract lane.

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 1434 of file BasicTTIImpl.h.

References CostKind, and Index.

◆ getVectorSplitCost()

template<typename T >
InstructionCost llvm::BasicTTIImplBase< T >::getVectorSplitCost ( ) const
inline

Definition at line 3281 of file BasicTTIImpl.h.

◆ getVScaleForTuning()

template<typename T >
std::optional< unsigned > llvm::BasicTTIImplBase< T >::getVScaleForTuning ( ) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 880 of file BasicTTIImpl.h.

◆ hasBranchDivergence()

template<typename T >
bool llvm::BasicTTIImplBase< T >::hasBranchDivergence ( const Function F = nullptr) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 398 of file BasicTTIImpl.h.

◆ haveFastSqrt()

template<typename T >
bool llvm::BasicTTIImplBase< T >::haveFastSqrt ( Type Ty) const
inlineoverridevirtual

◆ improveShuffleKindFromMask()

template<typename T >
TTI::ShuffleKind llvm::BasicTTIImplBase< T >::improveShuffleKindFromMask ( TTI::ShuffleKind  Kind,
ArrayRef< int >  Mask,
VectorType SrcTy,
int &  Index,
VectorType *&  SubTy 
) const
inline

◆ instCombineIntrinsic()

template<typename T >
std::optional< Instruction * > llvm::BasicTTIImplBase< T >::instCombineIntrinsic ( InstCombiner IC,
IntrinsicInst II 
) const
inlineoverridevirtual

◆ isAlwaysUniform()

template<typename T >
bool llvm::BasicTTIImplBase< T >::isAlwaysUniform ( const Value V) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 404 of file BasicTTIImpl.h.

◆ isFCmpOrdCheaperThanFCmpZero()

template<typename T >
bool llvm::BasicTTIImplBase< T >::isFCmpOrdCheaperThanFCmpZero ( Type Ty) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 660 of file BasicTTIImpl.h.

◆ isHardwareLoopProfitable()

template<typename T >
bool llvm::BasicTTIImplBase< T >::isHardwareLoopProfitable ( Loop L,
ScalarEvolution SE,
AssumptionCache AC,
TargetLibraryInfo LibInfo,
HardwareLoopInfo HWLoopInfo 
) const
inlineoverridevirtual

◆ isIndexedLoadLegal()

template<typename T >
bool llvm::BasicTTIImplBase< T >::isIndexedLoadLegal ( TTI::MemIndexedMode  M,
Type Ty 
) const
inlineoverridevirtual

◆ isIndexedStoreLegal()

template<typename T >
bool llvm::BasicTTIImplBase< T >::isIndexedStoreLegal ( TTI::MemIndexedMode  M,
Type Ty 
) const
inlineoverridevirtual

◆ isLegalAddImmediate()

template<typename T >
bool llvm::BasicTTIImplBase< T >::isLegalAddImmediate ( int64_t  imm) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 447 of file BasicTTIImpl.h.

References llvm::TargetLoweringBase::isLegalAddImmediate().

◆ isLegalAddressingMode()

template<typename T >
bool llvm::BasicTTIImplBase< T >::isLegalAddressingMode ( Type Ty,
GlobalValue BaseGV,
int64_t  BaseOffset,
bool  HasBaseReg,
int64_t  Scale,
unsigned  AddrSpace,
Instruction I = nullptr,
int64_t  ScalableOffset = 0 
) const
inlineoverridevirtual

◆ isLegalAddScalableImmediate()

template<typename T >
bool llvm::BasicTTIImplBase< T >::isLegalAddScalableImmediate ( int64_t  Imm) const
inlineoverridevirtual

◆ isLegalICmpImmediate()

template<typename T >
bool llvm::BasicTTIImplBase< T >::isLegalICmpImmediate ( int64_t  imm) const
inlineoverridevirtual

◆ isLSRCostLess()

template<typename T >
bool llvm::BasicTTIImplBase< T >::isLSRCostLess ( const TTI::LSRCost C1,
const TTI::LSRCost C2 
) const
inlineoverridevirtual

◆ isNoopAddrSpaceCast()

template<typename T >
bool llvm::BasicTTIImplBase< T >::isNoopAddrSpaceCast ( unsigned  FromAS,
unsigned  ToAS 
) const
inlineoverridevirtual

◆ isNumRegsMajorCostOfLSR()

template<typename T >
bool llvm::BasicTTIImplBase< T >::isNumRegsMajorCostOfLSR ( ) const
inlineoverridevirtual

◆ isProfitableLSRChainElement()

template<typename T >
bool llvm::BasicTTIImplBase< T >::isProfitableLSRChainElement ( Instruction I) const
inlineoverridevirtual

◆ isProfitableToHoist()

template<typename T >
bool llvm::BasicTTIImplBase< T >::isProfitableToHoist ( Instruction I) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 542 of file BasicTTIImpl.h.

References I, and llvm::TargetLoweringBase::isProfitableToHoist().

◆ isSingleThreaded()

template<typename T >
bool llvm::BasicTTIImplBase< T >::isSingleThreaded ( ) const
inlineoverridevirtual

◆ isSourceOfDivergence()

template<typename T >
bool llvm::BasicTTIImplBase< T >::isSourceOfDivergence ( const Value V) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 402 of file BasicTTIImpl.h.

◆ isTargetIntrinsicTriviallyScalarizable()

template<typename T >
bool llvm::BasicTTIImplBase< T >::isTargetIntrinsicTriviallyScalarizable ( Intrinsic::ID  ID) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 920 of file BasicTTIImpl.h.

◆ isTargetIntrinsicWithOverloadTypeAtArg()

template<typename T >
bool llvm::BasicTTIImplBase< T >::isTargetIntrinsicWithOverloadTypeAtArg ( Intrinsic::ID  ID,
int  OpdIdx 
) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 930 of file BasicTTIImpl.h.

◆ isTargetIntrinsicWithScalarOpAtArg()

template<typename T >
bool llvm::BasicTTIImplBase< T >::isTargetIntrinsicWithScalarOpAtArg ( Intrinsic::ID  ID,
unsigned  ScalarOpdIdx 
) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 925 of file BasicTTIImpl.h.

◆ isTargetIntrinsicWithStructReturnOverloadAtField()

template<typename T >
bool llvm::BasicTTIImplBase< T >::isTargetIntrinsicWithStructReturnOverloadAtField ( Intrinsic::ID  ID,
int  RetIdx 
) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 936 of file BasicTTIImpl.h.

◆ isTruncateFree()

template<typename T >
bool llvm::BasicTTIImplBase< T >::isTruncateFree ( Type Ty1,
Type Ty2 
) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 538 of file BasicTTIImpl.h.

References llvm::TargetLoweringBase::isTruncateFree().

◆ isTypeLegal()

template<typename T >
bool llvm::BasicTTIImplBase< T >::isTypeLegal ( Type Ty) const
inlineoverridevirtual

◆ isValidAddrSpaceCast()

template<typename T >
bool llvm::BasicTTIImplBase< T >::isValidAddrSpaceCast ( unsigned  FromAS,
unsigned  ToAS 
) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 406 of file BasicTTIImpl.h.

◆ isVScaleKnownToBeAPowerOfTwo()

template<typename T >
bool llvm::BasicTTIImplBase< T >::isVScaleKnownToBeAPowerOfTwo ( ) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 883 of file BasicTTIImpl.h.

◆ preferPredicateOverEpilogue()

template<typename T >
bool llvm::BasicTTIImplBase< T >::preferPredicateOverEpilogue ( TailFoldingInfo TFI) const
inlineoverridevirtual

◆ preferToKeepConstantsAttached()

template<typename T >
bool llvm::BasicTTIImplBase< T >::preferToKeepConstantsAttached ( const Instruction Inst,
const Function Fn 
) const
inlineoverridevirtual

◆ rewriteIntrinsicWithAddressSpace()

template<typename T >
Value * llvm::BasicTTIImplBase< T >::rewriteIntrinsicWithAddressSpace ( IntrinsicInst II,
Value OldV,
Value NewV 
) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 442 of file BasicTTIImpl.h.

◆ shouldBuildLookupTables()

template<typename T >
bool llvm::BasicTTIImplBase< T >::shouldBuildLookupTables ( ) const
inlineoverridevirtual

◆ shouldBuildRelLookupTables()

template<typename T >
bool llvm::BasicTTIImplBase< T >::shouldBuildRelLookupTables ( ) const
inlineoverridevirtual

Relative lookup table entries consist of 32-bit offsets. Do not generate relative lookup tables for large code models in 64-bit achitectures where 32-bit offsets might not be enough.

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 628 of file BasicTTIImpl.h.

References llvm::Triple::aarch64, llvm::Triple::getArch(), llvm::TargetLoweringBase::getTargetMachine(), llvm::Triple::isArch64Bit(), llvm::Triple::isOSDarwin(), llvm::CodeModel::Large, and llvm::CodeModel::Medium.

◆ shouldDropLSRSolutionIfLessProfitable()

template<typename T >
bool llvm::BasicTTIImplBase< T >::shouldDropLSRSolutionIfLessProfitable ( ) const
inlineoverridevirtual

◆ shouldPrefetchAddressSpace()

template<typename T >
virtual bool llvm::BasicTTIImplBase< T >::shouldPrefetchAddressSpace ( unsigned  AS) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Reimplemented in llvm::GCNTTIImpl.

Definition at line 865 of file BasicTTIImpl.h.

References llvm::MCSubtargetInfo::shouldPrefetchAddressSpace().

◆ simplifyDemandedUseBitsIntrinsic()

template<typename T >
std::optional< Value * > llvm::BasicTTIImplBase< T >::simplifyDemandedUseBitsIntrinsic ( InstCombiner IC,
IntrinsicInst II,
APInt  DemandedMask,
KnownBits Known,
bool KnownBitsComputed 
) const
inlineoverridevirtual

◆ simplifyDemandedVectorEltsIntrinsic()

template<typename T >
std::optional< Value * > llvm::BasicTTIImplBase< T >::simplifyDemandedVectorEltsIntrinsic ( InstCombiner IC,
IntrinsicInst II,
APInt  DemandedElts,
APInt UndefElts,
APInt UndefElts2,
APInt UndefElts3,
std::function< void(Instruction *, unsigned, APInt, APInt &)>  SimplifyAndSetOp 
) const
inlineoverridevirtual

◆ useAA()

template<typename T >
bool llvm::BasicTTIImplBase< T >::useAA ( ) const
inlineoverridevirtual

Reimplemented from llvm::TargetTransformInfoImplBase.

Definition at line 546 of file BasicTTIImpl.h.

References llvm::TargetSubtargetInfo::useAA().

Member Data Documentation

◆ DL

template<typename T >
const DataLayout& llvm::TargetTransformInfoImplBase::DL
protected

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