LLVM 20.0.0git
Public Member Functions | List of all members
llvm::RISCVTTIImpl Class Reference

#include "Target/RISCV/RISCVTargetTransformInfo.h"

Inheritance diagram for llvm::RISCVTTIImpl:
Inheritance graph
[legend]

Public Member Functions

 RISCVTTIImpl (const RISCVTargetMachine *TM, const Function &F)
 
InstructionCost getStoreImmCost (Type *VecTy, TTI::OperandValueInfo OpInfo, TTI::TargetCostKind CostKind)
 Return the cost of materializing an immediate for a value operand of a store instruction.
 
InstructionCost getIntImmCost (const APInt &Imm, Type *Ty, TTI::TargetCostKind CostKind)
 
InstructionCost getIntImmCostInst (unsigned Opcode, unsigned Idx, const APInt &Imm, Type *Ty, TTI::TargetCostKind CostKind, Instruction *Inst=nullptr)
 
InstructionCost getIntImmCostIntrin (Intrinsic::ID IID, unsigned Idx, const APInt &Imm, Type *Ty, TTI::TargetCostKind CostKind)
 
- Public Member Functions inherited from llvm::BasicTTIImplBase< RISCVTTIImpl >
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 *, unsignedgetPredicatedAddrSpace (const Value *V) const
 
ValuerewriteIntrinsicWithAddressSpace (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< unsignedgetCacheSize (TargetTransformInfo::CacheLevel Level) const
 
virtual std::optional< unsignedgetCacheAssociativity (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
 
TypeSize getRegisterBitWidth (TargetTransformInfo::RegisterKind K) const
 
std::optional< unsignedgetMaxVScale () const
 
std::optional< unsignedgetVScaleForTuning () 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.
 
InstructionCost getScalarizationOverhead (VectorType *InTy, bool Insert, bool Extract, TTI::TargetCostKind CostKind)
 Helper wrapper for the DemandedElts variant of getScalarizationOverhead.
 
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.
 
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 getOperandsScalarizationOverhead (ArrayRef< const Value * > Args, ArrayRef< Type * > Tys, TTI::TargetCostKind CostKind)
 Estimate the overhead of scalarizing an instructions unique non-constant operands.
 
std::pair< InstructionCost, MVTgetTypeLegalizationCost (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 DataLayoutgetDataLayout () 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 *, unsignedgetPredicatedAddrSpace (const Value *V) const
 
ValuerewriteIntrinsicWithAddressSpace (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 chargetRegisterClassName (unsigned ClassID) const
 
TypeSize getRegisterBitWidth (TargetTransformInfo::RegisterKind K) const
 
unsigned getMinVectorRegisterBitWidth () const
 
std::optional< unsignedgetMaxVScale () const
 
std::optional< unsignedgetVScaleForTuning () 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< unsignedgetCacheSize (TargetTransformInfo::CacheLevel Level) const
 
std::optional< unsignedgetCacheAssociativity (TargetTransformInfo::CacheLevel Level) const
 
std::optional< unsignedgetMinPageSize () 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
 
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
 
ValuegetOrCreateResultFromMemIntrinsic (IntrinsicInst *Inst, Type *ExpectedType) const
 
TypegetMemcpyLoopLoweringType (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
 
unsigned getMaxNumArgs () const
 
unsigned getNumBytesToPadGlobalArray (unsigned Size, Type *ArrayType) const
 

EVL Support for predicated vectorization.

Whether the target supports the evl parameter of VP intrinsic efficiently in hardware, for the given opcode and type/alignment.

(see LLVM Language Reference - "Vector Predication Intrinsics", https://llvm.org/docs/LangRef.html#vector-predication-intrinsics and "IR-level VP intrinsics", https://llvm.org/docs/Proposals/VectorPredication.html#ir-level-vp-intrinsics).

Parameters
Opcodethe opcode of the instruction checked for predicated version support.
DataTypethe type of the instruction with the Opcode checked for prediction support.
Alignmentthe alignment for memory access operation checked for predicated version support.
enum  RISCVRegisterClass { GPRRC , FPRRC , VRRC }
 
bool hasActiveVectorLength (unsigned Opcode, Type *DataType, Align Alignment) const
 
TargetTransformInfo::PopcntSupportKind getPopcntSupport (unsigned TyWidth)
 
bool shouldExpandReduction (const IntrinsicInst *II) const
 
bool supportsScalableVectors () const
 
bool enableOrderedReductions () const
 
bool enableScalableVectorization () const
 
TailFoldingStyle getPreferredTailFoldingStyle (bool IVUpdateMayOverflow) const
 
std::optional< unsignedgetMaxVScale () const
 
std::optional< unsignedgetVScaleForTuning () const
 
TypeSize getRegisterBitWidth (TargetTransformInfo::RegisterKind K) const
 
unsigned getRegUsageForType (Type *Ty)
 
unsigned getMaximumVF (unsigned ElemWidth, unsigned Opcode) const
 
bool preferEpilogueVectorization () const
 
InstructionCost getMaskedMemoryOpCost (unsigned Opcode, Type *Src, Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind)
 
InstructionCost getPointersChainCost (ArrayRef< const Value * > Ptrs, const Value *Base, const TTI::PointersChainInfo &Info, Type *AccessTy, TTI::TargetCostKind CostKind)
 
void getUnrollingPreferences (Loop *L, ScalarEvolution &SE, TTI::UnrollingPreferences &UP, OptimizationRemarkEmitter *ORE)
 
void getPeelingPreferences (Loop *L, ScalarEvolution &SE, TTI::PeelingPreferences &PP)
 
unsigned getMinVectorRegisterBitWidth () 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 getScalarizationOverhead (VectorType *Ty, const APInt &DemandedElts, bool Insert, bool Extract, TTI::TargetCostKind CostKind, ArrayRef< Value * > VL={})
 
InstructionCost getIntrinsicInstrCost (const IntrinsicCostAttributes &ICA, TTI::TargetCostKind CostKind)
 
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 getGatherScatterOpCost (unsigned Opcode, Type *DataTy, const Value *Ptr, bool VariableMask, Align Alignment, TTI::TargetCostKind CostKind, const Instruction *I)
 
InstructionCost getStridedMemoryOpCost (unsigned Opcode, Type *DataTy, const Value *Ptr, bool VariableMask, Align Alignment, TTI::TargetCostKind CostKind, const Instruction *I)
 
InstructionCost getCostOfKeepingLiveOverCall (ArrayRef< Type * > Tys)
 
InstructionCost getCastInstrCost (unsigned Opcode, Type *Dst, Type *Src, TTI::CastContextHint CCH, TTI::TargetCostKind CostKind, const Instruction *I=nullptr)
 
InstructionCost getMinMaxReductionCost (Intrinsic::ID IID, VectorType *Ty, FastMathFlags FMF, TTI::TargetCostKind CostKind)
 
InstructionCost getArithmeticReductionCost (unsigned Opcode, VectorType *Ty, std::optional< FastMathFlags > FMF, TTI::TargetCostKind CostKind)
 
InstructionCost getExtendedReductionCost (unsigned Opcode, bool IsUnsigned, Type *ResTy, VectorType *ValTy, FastMathFlags FMF, TTI::TargetCostKind CostKind)
 
InstructionCost getMemoryOpCost (unsigned Opcode, Type *Src, MaybeAlign Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind, TTI::OperandValueInfo OpdInfo={TTI::OK_AnyValue, TTI::OP_None}, 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 getCFInstrCost (unsigned Opcode, TTI::TargetCostKind CostKind, const Instruction *I=nullptr)
 
InstructionCost getVectorInstrCost (unsigned Opcode, Type *Val, TTI::TargetCostKind CostKind, unsigned Index, Value *Op0, Value *Op1)
 
InstructionCost getArithmeticInstrCost (unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind, TTI::OperandValueInfo Op1Info={TTI::OK_AnyValue, TTI::OP_None}, TTI::OperandValueInfo Op2Info={TTI::OK_AnyValue, TTI::OP_None}, ArrayRef< const Value * > Args={}, const Instruction *CxtI=nullptr)
 
bool isElementTypeLegalForScalableVector (Type *Ty) const
 
bool isLegalMaskedLoadStore (Type *DataType, Align Alignment)
 
bool isLegalMaskedLoad (Type *DataType, Align Alignment)
 
bool isLegalMaskedStore (Type *DataType, Align Alignment)
 
bool isLegalMaskedGatherScatter (Type *DataType, Align Alignment)
 
bool isLegalMaskedGather (Type *DataType, Align Alignment)
 
bool isLegalMaskedScatter (Type *DataType, Align Alignment)
 
bool forceScalarizeMaskedGather (VectorType *VTy, Align Alignment)
 
bool forceScalarizeMaskedScatter (VectorType *VTy, Align Alignment)
 
bool isLegalStridedLoadStore (Type *DataType, Align Alignment)
 
bool isLegalInterleavedAccessType (VectorType *VTy, unsigned Factor, Align Alignment, unsigned AddrSpace)
 
bool isLegalMaskedExpandLoad (Type *DataType, Align Alignment)
 
bool isLegalMaskedCompressStore (Type *DataTy, Align Alignment)
 
bool isVScaleKnownToBeAPowerOfTwo () const
 
TargetTransformInfo::VPLegalization getVPLegalizationStrategy (const VPIntrinsic &PI) const
 
bool isLegalToVectorizeReduction (const RecurrenceDescriptor &RdxDesc, ElementCount VF) const
 
unsigned getMaxInterleaveFactor (ElementCount VF)
 
bool enableInterleavedAccessVectorization ()
 
unsigned getNumberOfRegisters (unsigned ClassID) const
 
unsigned getRegisterClassForType (bool Vector, Type *Ty=nullptr) const
 
const chargetRegisterClassName (unsigned ClassID) const
 
bool isLSRCostLess (const TargetTransformInfo::LSRCost &C1, const TargetTransformInfo::LSRCost &C2)
 
bool shouldConsiderAddressTypePromotion (const Instruction &I, bool &AllowPromotionWithoutCommonHeader)
 See if I should be considered for address type promotion.
 
std::optional< unsignedgetMinPageSize () const
 
bool canSplatOperand (Instruction *I, int Operand) const
 Return true if the (vector) instruction I will be lowered to an instruction with a scalar splat operand for the given Operand number.
 
bool canSplatOperand (unsigned Opcode, int Operand) const
 Return true if a vector instruction will lower to a target instruction able to splat the given operand.
 
bool isProfitableToSinkOperands (Instruction *I, SmallVectorImpl< Use * > &Ops) const
 Check if sinking I's operands to I's basic block is profitable, because the operands can be folded into a target instruction, e.g.
 
TTI::MemCmpExpansionOptions enableMemCmpExpansion (bool OptSize, bool IsZeroCmp) const
 

Additional Inherited Members

- Protected Types inherited from llvm::TargetTransformInfoImplBase
typedef TargetTransformInfo TTI
 
- Protected Member Functions inherited from llvm::BasicTTIImplBase< RISCVTTIImpl >
 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 inherited from llvm::BasicTTIImplBase< RISCVTTIImpl >
const DataLayoutDL
 
- Protected Attributes inherited from llvm::TargetTransformInfoImplBase
const DataLayoutDL
 

Detailed Description

Definition at line 29 of file RISCVTargetTransformInfo.h.

Member Enumeration Documentation

◆ RISCVRegisterClass

Enumerator
GPRRC 
FPRRC 
VRRC 

Definition at line 370 of file RISCVTargetTransformInfo.h.

Constructor & Destructor Documentation

◆ RISCVTTIImpl()

llvm::RISCVTTIImpl::RISCVTTIImpl ( const RISCVTargetMachine TM,
const Function F 
)
inlineexplicit

Definition at line 59 of file RISCVTargetTransformInfo.h.

Member Function Documentation

◆ canSplatOperand() [1/2]

bool RISCVTTIImpl::canSplatOperand ( Instruction I,
int  Operand 
) const

Return true if the (vector) instruction I will be lowered to an instruction with a scalar splat operand for the given Operand number.

Definition at line 2435 of file RISCVTargetTransformInfo.cpp.

References canSplatOperand(), llvm::RISCVSubtarget::hasVInstructions(), I, and II.

Referenced by canSplatOperand(), getArithmeticInstrCost(), and isProfitableToSinkOperands().

◆ canSplatOperand() [2/2]

bool RISCVTTIImpl::canSplatOperand ( unsigned  Opcode,
int  Operand 
) const

Return true if a vector instruction will lower to a target instruction able to splat the given operand.

Definition at line 2406 of file RISCVTargetTransformInfo.cpp.

◆ enableInterleavedAccessVectorization()

bool llvm::RISCVTTIImpl::enableInterleavedAccessVectorization ( )
inline

Definition at line 368 of file RISCVTargetTransformInfo.h.

◆ enableMemCmpExpansion()

RISCVTTIImpl::TTI::MemCmpExpansionOptions RISCVTTIImpl::enableMemCmpExpansion ( bool  OptSize,
bool  IsZeroCmp 
) const

◆ enableOrderedReductions()

bool llvm::RISCVTTIImpl::enableOrderedReductions ( ) const
inline

Definition at line 98 of file RISCVTargetTransformInfo.h.

◆ enableScalableVectorization()

bool llvm::RISCVTTIImpl::enableScalableVectorization ( ) const
inline

Definition at line 99 of file RISCVTargetTransformInfo.h.

◆ forceScalarizeMaskedGather()

bool llvm::RISCVTTIImpl::forceScalarizeMaskedGather ( VectorType VTy,
Align  Alignment 
)
inline

Definition at line 280 of file RISCVTargetTransformInfo.h.

◆ forceScalarizeMaskedScatter()

bool llvm::RISCVTTIImpl::forceScalarizeMaskedScatter ( VectorType VTy,
Align  Alignment 
)
inline

Definition at line 285 of file RISCVTargetTransformInfo.h.

◆ getArithmeticInstrCost()

InstructionCost RISCVTTIImpl::getArithmeticInstrCost ( unsigned  Opcode,
Type Ty,
TTI::TargetCostKind  CostKind,
TTI::OperandValueInfo  Op1Info = {TTI::OK_AnyValueTTI::OP_None},
TTI::OperandValueInfo  Op2Info = {TTI::OK_AnyValueTTI::OP_None},
ArrayRef< const Value * >  Args = {},
const Instruction CxtI = nullptr 
)

◆ getArithmeticReductionCost()

InstructionCost RISCVTTIImpl::getArithmeticReductionCost ( unsigned  Opcode,
VectorType Ty,
std::optional< FastMathFlags FMF,
TTI::TargetCostKind  CostKind 
)

◆ getCastInstrCost()

InstructionCost RISCVTTIImpl::getCastInstrCost ( unsigned  Opcode,
Type Dst,
Type Src,
TTI::CastContextHint  CCH,
TTI::TargetCostKind  CostKind,
const Instruction I = nullptr 
)

◆ getCFInstrCost()

InstructionCost RISCVTTIImpl::getCFInstrCost ( unsigned  Opcode,
TTI::TargetCostKind  CostKind,
const Instruction I = nullptr 
)

◆ getCmpSelInstrCost()

InstructionCost RISCVTTIImpl::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 
)

◆ getCostOfKeepingLiveOverCall()

InstructionCost RISCVTTIImpl::getCostOfKeepingLiveOverCall ( ArrayRef< Type * >  Tys)

◆ getExtendedReductionCost()

InstructionCost RISCVTTIImpl::getExtendedReductionCost ( unsigned  Opcode,
bool  IsUnsigned,
Type ResTy,
VectorType ValTy,
FastMathFlags  FMF,
TTI::TargetCostKind  CostKind 
)

◆ getGatherScatterOpCost()

InstructionCost RISCVTTIImpl::getGatherScatterOpCost ( unsigned  Opcode,
Type DataTy,
const Value Ptr,
bool  VariableMask,
Align  Alignment,
TTI::TargetCostKind  CostKind,
const Instruction I 
)

◆ getInterleavedMemoryOpCost()

InstructionCost RISCVTTIImpl::getInterleavedMemoryOpCost ( unsigned  Opcode,
Type VecTy,
unsigned  Factor,
ArrayRef< unsigned Indices,
Align  Alignment,
unsigned  AddressSpace,
TTI::TargetCostKind  CostKind,
bool  UseMaskForCond = false,
bool  UseMaskForGaps = false 
)

◆ getIntImmCost()

InstructionCost RISCVTTIImpl::getIntImmCost ( const APInt Imm,
Type Ty,
TTI::TargetCostKind  CostKind 
)

◆ getIntImmCostInst()

InstructionCost RISCVTTIImpl::getIntImmCostInst ( unsigned  Opcode,
unsigned  Idx,
const APInt Imm,
Type Ty,
TTI::TargetCostKind  CostKind,
Instruction Inst = nullptr 
)

◆ getIntImmCostIntrin()

InstructionCost RISCVTTIImpl::getIntImmCostIntrin ( Intrinsic::ID  IID,
unsigned  Idx,
const APInt Imm,
Type Ty,
TTI::TargetCostKind  CostKind 
)

Definition at line 269 of file RISCVTargetTransformInfo.cpp.

References llvm::TargetTransformInfo::TCC_Free.

◆ getIntrinsicInstrCost()

InstructionCost RISCVTTIImpl::getIntrinsicInstrCost ( const IntrinsicCostAttributes ICA,
TTI::TargetCostKind  CostKind 
)

◆ getMaskedMemoryOpCost()

InstructionCost RISCVTTIImpl::getMaskedMemoryOpCost ( unsigned  Opcode,
Type Src,
Align  Alignment,
unsigned  AddressSpace,
TTI::TargetCostKind  CostKind 
)

◆ getMaximumVF()

unsigned RISCVTTIImpl::getMaximumVF ( unsigned  ElemWidth,
unsigned  Opcode 
) const

◆ getMaxInterleaveFactor()

unsigned llvm::RISCVTTIImpl::getMaxInterleaveFactor ( ElementCount  VF)
inline

◆ getMaxVScale()

std::optional< unsigned > RISCVTTIImpl::getMaxVScale ( ) const

◆ getMemoryOpCost()

InstructionCost RISCVTTIImpl::getMemoryOpCost ( unsigned  Opcode,
Type Src,
MaybeAlign  Alignment,
unsigned  AddressSpace,
TTI::TargetCostKind  CostKind,
TTI::OperandValueInfo  OpdInfo = {TTI::OK_AnyValueTTI::OP_None},
const Instruction I = nullptr 
)

◆ getMinMaxReductionCost()

InstructionCost RISCVTTIImpl::getMinMaxReductionCost ( Intrinsic::ID  IID,
VectorType Ty,
FastMathFlags  FMF,
TTI::TargetCostKind  CostKind 
)

◆ getMinPageSize()

std::optional< unsigned > llvm::RISCVTTIImpl::getMinPageSize ( ) const
inline

Definition at line 425 of file RISCVTargetTransformInfo.h.

◆ getMinVectorRegisterBitWidth()

unsigned llvm::RISCVTTIImpl::getMinVectorRegisterBitWidth ( ) const
inline

Definition at line 138 of file RISCVTargetTransformInfo.h.

◆ getNumberOfRegisters()

unsigned llvm::RISCVTTIImpl::getNumberOfRegisters ( unsigned  ClassID) const
inline

Definition at line 371 of file RISCVTargetTransformInfo.h.

References FPRRC, GPRRC, llvm_unreachable, and VRRC.

◆ getPeelingPreferences()

void RISCVTTIImpl::getPeelingPreferences ( Loop L,
ScalarEvolution SE,
TTI::PeelingPreferences PP 
)

◆ getPointersChainCost()

InstructionCost RISCVTTIImpl::getPointersChainCost ( ArrayRef< const Value * >  Ptrs,
const Value Base,
const TTI::PointersChainInfo Info,
Type AccessTy,
TTI::TargetCostKind  CostKind 
)

◆ getPopcntSupport()

TargetTransformInfo::PopcntSupportKind RISCVTTIImpl::getPopcntSupport ( unsigned  TyWidth)

◆ getPreferredTailFoldingStyle()

TailFoldingStyle llvm::RISCVTTIImpl::getPreferredTailFoldingStyle ( bool  IVUpdateMayOverflow) const
inline

Definition at line 101 of file RISCVTargetTransformInfo.h.

References llvm::Data, and llvm::DataWithoutLaneMask.

◆ getRegisterBitWidth()

TypeSize RISCVTTIImpl::getRegisterBitWidth ( TargetTransformInfo::RegisterKind  K) const

◆ getRegisterClassForType()

unsigned llvm::RISCVTTIImpl::getRegisterClassForType ( bool  Vector,
Type Ty = nullptr 
) const
inline

◆ getRegisterClassName()

const char * llvm::RISCVTTIImpl::getRegisterClassName ( unsigned  ClassID) const
inline

Definition at line 407 of file RISCVTargetTransformInfo.h.

References FPRRC, GPRRC, llvm_unreachable, and VRRC.

◆ getRegUsageForType()

unsigned RISCVTTIImpl::getRegUsageForType ( Type Ty)

◆ getScalarizationOverhead()

InstructionCost RISCVTTIImpl::getScalarizationOverhead ( VectorType Ty,
const APInt DemandedElts,
bool  Insert,
bool  Extract,
TTI::TargetCostKind  CostKind,
ArrayRef< Value * >  VL = {} 
)

◆ getShuffleCost()

InstructionCost RISCVTTIImpl::getShuffleCost ( TTI::ShuffleKind  Kind,
VectorType Tp,
ArrayRef< int >  Mask,
TTI::TargetCostKind  CostKind,
int  Index,
VectorType SubTp,
ArrayRef< const Value * >  Args = {},
const Instruction CxtI = nullptr 
)

Definition at line 378 of file RISCVTargetTransformInfo.cpp.

References llvm::all_of(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::CallingConv::C, CostKind, llvm::createStrideMask(), llvm::divideCeil(), llvm::enumerate(), llvm::equal(), llvm::VectorType::get(), llvm::FixedVectorType::get(), llvm::Type::getContext(), llvm::FixedVectorType::getDoubleElementsVectorType(), llvm::VectorType::getElementCount(), llvm::VectorType::getElementType(), llvm::RISCVSubtarget::getELen(), llvm::Type::getInt1Ty(), llvm::RISCVTargetLowering::getLMULCost(), llvm::Operator::getOpcode(), llvm::Type::getPrimitiveSizeInBits(), llvm::RISCVSubtarget::getRealMaxVLen(), llvm::RISCVSubtarget::getRealMinVLen(), llvm::MVT::getScalarSizeInBits(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getShuffleCost(), getShuffleCost(), llvm::BasicTTIImplBase< RISCVTTIImpl >::getTypeLegalizationCost(), getVRGatherIndexType(), I, llvm::BasicTTIImplBase< RISCVTTIImpl >::improveShuffleKindFromMask(), llvm::Type::isIntegerTy(), llvm::ShuffleVectorInst::isInterleaveMask(), isRepeatedConcatMask(), llvm::Log2_32(), P, llvm::PoisonMaskElem, llvm::PowerOf2Ceil(), 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, llvm::TargetTransformInfo::SK_Transpose, llvm::TargetTransformInfo::TCC_Free, and llvm::transform().

Referenced by getInterleavedMemoryOpCost(), and getShuffleCost().

◆ getStoreImmCost()

InstructionCost RISCVTTIImpl::getStoreImmCost ( Type VecTy,
TTI::OperandValueInfo  OpInfo,
TTI::TargetCostKind  CostKind 
)

Return the cost of materializing an immediate for a value operand of a store instruction.

Definition at line 1655 of file RISCVTargetTransformInfo.cpp.

References assert(), CostKind, llvm::TargetTransformInfo::OperandValueInfo::isConstant(), and llvm::TargetTransformInfo::OperandValueInfo::isUniform().

Referenced by getMemoryOpCost().

◆ getStridedMemoryOpCost()

InstructionCost RISCVTTIImpl::getStridedMemoryOpCost ( unsigned  Opcode,
Type DataTy,
const Value Ptr,
bool  VariableMask,
Align  Alignment,
TTI::TargetCostKind  CostKind,
const Instruction I 
)

◆ getUnrollingPreferences()

void RISCVTTIImpl::getUnrollingPreferences ( Loop L,
ScalarEvolution SE,
TTI::UnrollingPreferences UP,
OptimizationRemarkEmitter ORE 
)

◆ getVectorInstrCost()

InstructionCost RISCVTTIImpl::getVectorInstrCost ( unsigned  Opcode,
Type Val,
TTI::TargetCostKind  CostKind,
unsigned  Index,
Value Op0,
Value Op1 
)

◆ getVPLegalizationStrategy()

TargetTransformInfo::VPLegalization llvm::RISCVTTIImpl::getVPLegalizationStrategy ( const VPIntrinsic PI) const
inline

◆ getVScaleForTuning()

std::optional< unsigned > RISCVTTIImpl::getVScaleForTuning ( ) const

◆ hasActiveVectorLength()

bool RISCVTTIImpl::hasActiveVectorLength ( unsigned  Opcode,
Type DataType,
Align  Alignment 
) const

◆ isElementTypeLegalForScalableVector()

bool llvm::RISCVTTIImpl::isElementTypeLegalForScalableVector ( Type Ty) const
inline

◆ isLegalInterleavedAccessType()

bool llvm::RISCVTTIImpl::isLegalInterleavedAccessType ( VectorType VTy,
unsigned  Factor,
Align  Alignment,
unsigned  AddrSpace 
)
inline

◆ isLegalMaskedCompressStore()

bool RISCVTTIImpl::isLegalMaskedCompressStore ( Type DataTy,
Align  Alignment 
)

Definition at line 2364 of file RISCVTargetTransformInfo.cpp.

References isLegalMaskedLoadStore().

◆ isLegalMaskedExpandLoad()

bool RISCVTTIImpl::isLegalMaskedExpandLoad ( Type DataType,
Align  Alignment 
)

◆ isLegalMaskedGather()

bool llvm::RISCVTTIImpl::isLegalMaskedGather ( Type DataType,
Align  Alignment 
)
inline

Definition at line 273 of file RISCVTargetTransformInfo.h.

References isLegalMaskedGatherScatter().

Referenced by getGatherScatterOpCost().

◆ isLegalMaskedGatherScatter()

bool llvm::RISCVTTIImpl::isLegalMaskedGatherScatter ( Type DataType,
Align  Alignment 
)
inline

◆ isLegalMaskedLoad()

bool llvm::RISCVTTIImpl::isLegalMaskedLoad ( Type DataType,
Align  Alignment 
)
inline

Definition at line 243 of file RISCVTargetTransformInfo.h.

References isLegalMaskedLoadStore().

◆ isLegalMaskedLoadStore()

bool llvm::RISCVTTIImpl::isLegalMaskedLoadStore ( Type DataType,
Align  Alignment 
)
inline

◆ isLegalMaskedScatter()

bool llvm::RISCVTTIImpl::isLegalMaskedScatter ( Type DataType,
Align  Alignment 
)
inline

Definition at line 276 of file RISCVTargetTransformInfo.h.

References isLegalMaskedGatherScatter().

Referenced by getGatherScatterOpCost().

◆ isLegalMaskedStore()

bool llvm::RISCVTTIImpl::isLegalMaskedStore ( Type DataType,
Align  Alignment 
)
inline

Definition at line 246 of file RISCVTargetTransformInfo.h.

References isLegalMaskedLoadStore().

◆ isLegalStridedLoadStore()

bool llvm::RISCVTTIImpl::isLegalStridedLoadStore ( Type DataType,
Align  Alignment 
)
inline

◆ isLegalToVectorizeReduction()

bool llvm::RISCVTTIImpl::isLegalToVectorizeReduction ( const RecurrenceDescriptor RdxDesc,
ElementCount  VF 
) const
inline

◆ isLSRCostLess()

bool RISCVTTIImpl::isLSRCostLess ( const TargetTransformInfo::LSRCost C1,
const TargetTransformInfo::LSRCost C2 
)

◆ isProfitableToSinkOperands()

bool RISCVTTIImpl::isProfitableToSinkOperands ( Instruction I,
SmallVectorImpl< Use * > &  Ops 
) const

Check if sinking I's operands to I's basic block is profitable, because the operands can be folded into a target instruction, e.g.

splats of scalars can fold into vector instructions.

Definition at line 2500 of file RISCVTargetTransformInfo.cpp.

References llvm::any_of(), canSplatOperand(), llvm::enumerate(), llvm::RISCVSubtarget::hasVInstructions(), I, Insn, llvm::PatternMatch::m_InsertElt(), llvm::PatternMatch::m_Shuffle(), llvm::PatternMatch::m_Undef(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_ZeroInt(), llvm::PatternMatch::match(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().

◆ isVScaleKnownToBeAPowerOfTwo()

bool llvm::RISCVTTIImpl::isVScaleKnownToBeAPowerOfTwo ( ) const
inline

◆ preferEpilogueVectorization()

bool llvm::RISCVTTIImpl::preferEpilogueVectorization ( ) const
inline

Definition at line 114 of file RISCVTargetTransformInfo.h.

◆ shouldConsiderAddressTypePromotion()

bool RISCVTTIImpl::shouldConsiderAddressTypePromotion ( const Instruction I,
bool AllowPromotionWithoutCommonHeader 
)

See if I should be considered for address type promotion.

We check if I is a sext with right type and used in memory accesses. If it used in a "complex" getelementptr, we allow it to be promoted without finding other sext instructions that sign extended the same initial value. A getelementptr is considered as "complex" if it has more than 2 operands.

Definition at line 2379 of file RISCVTargetTransformInfo.cpp.

References llvm::Type::getInt64Ty(), and I.

◆ shouldExpandReduction()

bool RISCVTTIImpl::shouldExpandReduction ( const IntrinsicInst II) const

Definition at line 288 of file RISCVTargetTransformInfo.cpp.

References II.

◆ supportsScalableVectors()

bool llvm::RISCVTTIImpl::supportsScalableVectors ( ) const
inline

Definition at line 97 of file RISCVTargetTransformInfo.h.


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