[#llvm-BasicTTIImplBase-03] = xref:llvm.adoc[llvm]::BasicTTIImplBase :relfileprefix: ../ :mrdocs: Base class which can be used to help build a TTI implementation. == Synopsis Declared in `<llvm/CodeGen/BasicTTIImpl.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> class BasicTTIImplBase : public xref:llvm/TargetTransformInfoImplCRTPBase-08.adoc[TargetTransformInfoImplCRTPBase<T>] ---- == Description 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. == Base Classes [cols="1,4"] |=== | Name| Description | `xref:llvm/TargetTransformInfoImplCRTPBase-08.adoc[TargetTransformInfoImplCRTPBase<T>]` | CRTP base class for use as a mix‐in that aids implementing a TargetTransformInfo‐compatible class. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:llvm/TargetTransformInfoImplBase/LSRWithInstrQueries.adoc[`LSRWithInstrQueries`] [.small]#[virtual]# | Return true if LSR should use instruction‐level TTI queries. | xref:llvm/BasicTTIImplBase-03/addrspacesMayAlias.adoc[`addrspacesMayAlias`] | Return false if an `AS0` address cannot possibly alias an `AS1` address. | xref:llvm/BasicTTIImplBase-03/adjustInliningThreshold.adoc[`adjustInliningThreshold`] | Return an additive adjustment to the inlining threshold for call `CB.` | xref:llvm/TargetTransformInfoImplBase/allowVectorElementIndexingUsingGEP.adoc[`allowVectorElementIndexingUsingGEP`] [.small]#[virtual]# | Return true if vector element indexing via GEP is allowed. | xref:llvm/BasicTTIImplBase-03/allowsMisalignedMemoryAccesses.adoc[`allowsMisalignedMemoryAccesses`] | Return true if the target supports misaligned memory accesses. | xref:llvm/BasicTTIImplBase-03/areInlineCompatible.adoc[`areInlineCompatible`] | Return true if `Caller` and `Callee` have compatible inline attributes. | xref:llvm/TargetTransformInfoImplBase/areTypesABICompatible.adoc[`areTypesABICompatible`] [.small]#[virtual]# | Return true if the types are ABI‐compatible between caller and callee. | xref:llvm/TargetTransformInfoImplBase/canHaveNonUndefGlobalInitializerInAddressSpace.adoc[`canHaveNonUndefGlobalInitializerInAddressSpace`] [.small]#[virtual]# | Return true if globals in this address space may have non‐undef initializers. | xref:llvm/TargetTransformInfoImplBase/canMacroFuseCmp.adoc[`canMacroFuseCmp`] [.small]#[virtual]# | Return true if the target can macro‐fuse a compare and branch. | xref:llvm/TargetTransformInfoImplBase/canSaveCmp.adoc[`canSaveCmp`] [.small]#[virtual]# | Return true if the target can save a loop‐count compare. | xref:llvm/BasicTTIImplBase-03/collectFlatAddressOperands.adoc[`collectFlatAddressOperands`] | Collect flat‐address operand indexes of intrinsic `IID` into `OpIndexes.` | xref:llvm/TargetTransformInfoImplBase/collectKernelLaunchBounds.adoc[`collectKernelLaunchBounds`] [.small]#[virtual]# | Collect kernel launch bounds metadata for the function. | xref:llvm/TargetTransformInfoImplBase/computeKnownBitsAddrSpaceCast-05.adoc[`computeKnownBitsAddrSpaceCast`] | Compute known bits across an address‐space cast. | xref:llvm/TargetTransformInfoImplBase/enableAggressiveInterleaving.adoc[`enableAggressiveInterleaving`] [.small]#[virtual]# | Return true if aggressive interleaved unrolling should be enabled. | xref:llvm/TargetTransformInfoImplBase/enableInterleavedAccessVectorization.adoc[`enableInterleavedAccessVectorization`] [.small]#[virtual]# | Return true if interleaved access vectorization is enabled. | xref:llvm/TargetTransformInfoImplBase/enableMaskedInterleavedAccessVectorization.adoc[`enableMaskedInterleavedAccessVectorization`] [.small]#[virtual]# | Return true if masked interleaved access vectorization is enabled. | xref:llvm/TargetTransformInfoImplBase/enableMemCmpExpansion.adoc[`enableMemCmpExpansion`] [.small]#[virtual]# | Return options controlling expansion of memcmp‐like operations. | xref:llvm/TargetTransformInfoImplBase/enableOrderedReductions.adoc[`enableOrderedReductions`] [.small]#[virtual]# | Return true if ordered reductions should be enabled for this target. | xref:llvm/TargetTransformInfoImplBase/enableScalableVectorization.adoc[`enableScalableVectorization`] [.small]#[virtual]# | Return true if scalable vectorization should be enabled. | xref:llvm/TargetTransformInfoImplBase/enableSelectOptimize.adoc[`enableSelectOptimize`] [.small]#[virtual]# | Return true if the Select Optimization pass should run. | xref:llvm/BasicTTIImplBase-03/enableWritePrefetching.adoc[`enableWritePrefetching`] | Return true if prefetching should also be done for writes. | xref:llvm/TargetTransformInfoImplBase/forceScalarizeMaskedGather.adoc[`forceScalarizeMaskedGather`] [.small]#[virtual]# | Return true if masked gathers must be scalarized for this type. | xref:llvm/TargetTransformInfoImplBase/forceScalarizeMaskedScatter.adoc[`forceScalarizeMaskedScatter`] [.small]#[virtual]# | Return true if masked scatters must be scalarized for this type. | xref:llvm/TargetTransformInfoImplBase/getAddrSpaceCastPreservedPtrMask.adoc[`getAddrSpaceCastPreservedPtrMask`] [.small]#[virtual]# | Return a mask of pointer bits preserved by an address‐space cast. | xref:llvm/BasicTTIImplBase-03/getAddressComputationCost.adoc[`getAddressComputationCost`] | Return the cost of address computation for a memory access. | xref:llvm/TargetTransformInfoImplBase/getAltInstrCost.adoc[`getAltInstrCost`] [.small]#[virtual]# | Estimate the cost of an alternating‐opcode vector instruction. | xref:llvm/BasicTTIImplBase-03/getArithmeticInstrCost.adoc[`getArithmeticInstrCost`] | Approximate the reciprocal throughput of an arithmetic or logic op. | xref:llvm/BasicTTIImplBase-03/getArithmeticReductionCost.adoc[`getArithmeticReductionCost`] | Calculate the cost of a vector arithmetic reduction. | xref:llvm/BasicTTIImplBase-03/getAssumedAddrSpace.adoc[`getAssumedAddrSpace`] | Return an address space the target assumes for pointer value `V.` | xref:llvm/TargetTransformInfoImplBase/getAtomicMemIntrinsicMaxElementSize.adoc[`getAtomicMemIntrinsicMaxElementSize`] [.small]#[virtual]# | Return the max element size for unordered‐atomic memory intrinsics. | xref:llvm/BasicTTIImplBase-03/getBranchMispredictPenalty.adoc[`getBranchMispredictPenalty`] | Return the estimated latency penalty of a branch misprediction. | xref:llvm/BasicTTIImplBase-03/getCFInstrCost.adoc[`getCFInstrCost`] | Return the expected cost of a control‐flow instruction. | xref:llvm/BasicTTIImplBase-03/getCacheAssociativity.adoc[`getCacheAssociativity`] | Return the associativity of cache level `Level,` if available. | xref:llvm/BasicTTIImplBase-03/getCacheLineSize.adoc[`getCacheLineSize`] | Return the size of a cache line in bytes. | xref:llvm/BasicTTIImplBase-03/getCacheSize.adoc[`getCacheSize`] | Return the size of cache level `Level` in bytes, if available. | xref:llvm/BasicTTIImplBase-03/getCallInstrCost.adoc[`getCallInstrCost`] | Compute the cost of a call with the given signature. | xref:llvm/BasicTTIImplBase-03/getCallerAllocaCost.adoc[`getCallerAllocaCost`] | Return the extra inlining threshold cost of leaving alloca `AI` in the caller. | xref:llvm/BasicTTIImplBase-03/getCastInstrCost.adoc[`getCastInstrCost`] | Return the expected cost of a cast instruction. | xref:llvm/BasicTTIImplBase-03/getCmpSelInstrCost.adoc[`getCmpSelInstrCost`] | Return the expected cost of a compare or select instruction. | xref:llvm/TargetTransformInfoImplBase/getCostOfKeepingLiveOverCall.adoc[`getCostOfKeepingLiveOverCall`] [.small]#[virtual]# | Estimate the cost of keeping values of the given types live across a call. | xref:llvm/TargetTransformInfoImplBase/getDataLayout.adoc[`getDataLayout`] [.small]#[virtual]# | Return the data layout used by this TTI implementation. | xref:llvm/BasicTTIImplBase-03/getEpilogueVectorizationMinVF.adoc[`getEpilogueVectorizationMinVF`] | Return the minimum VF for which epilogue vectorization should be considered. | xref:llvm/BasicTTIImplBase-03/getEstimatedNumberOfCaseClusters.adoc[`getEstimatedNumberOfCaseClusters`] | Estimate how many case clusters `SI` would lower into. | xref:llvm/BasicTTIImplBase-03/getExtendedReductionCost.adoc[`getExtendedReductionCost`] | Return the cost of an extended reduction pattern. | xref:llvm/BasicTTIImplBase-03/getExtractWithExtendCost.adoc[`getExtractWithExtendCost`] | Return the expected cost of a sign‐ or zero‐extended vector extract. | xref:llvm/BasicTTIImplBase-03/getFPOpCost.adoc[`getFPOpCost`] | Return the expected cost of supporting floating‐point ops of type `Ty.` | xref:llvm/TargetTransformInfoImplBase/getFeatureMask.adoc[`getFeatureMask`] [.small]#[virtual]# | Return the feature bitmask for multi‐versioning of the function. | xref:llvm/BasicTTIImplBase-03/getFlatAddressSpace.adoc[`getFlatAddressSpace`] | Return the flat address space used to optimize addrspacecasts, or ~0u. | xref:llvm/BasicTTIImplBase-03/getGEPCost.adoc[`getGEPCost`] | Estimate the cost of a GEP when lowered. | xref:llvm/TargetTransformInfoImplBase/getGISelRematGlobalCost.adoc[`getGISelRematGlobalCost`] [.small]#[virtual]# | Return the GlobalISel cost of rematerializing a global value. | xref:llvm/BasicTTIImplBase-03/getIndexedVectorInstrCostFromEnd.adoc[`getIndexedVectorInstrCostFromEnd`] | Return the cost of insert/extract Index lanes from the end of a vector. | xref:llvm/TargetTransformInfoImplBase/getInlineCallPenalty.adoc[`getInlineCallPenalty`] [.small]#[virtual]# | Return the call penalty used when evaluating inlining of a call. | xref:llvm/BasicTTIImplBase-03/getInlinerVectorBonusPercent.adoc[`getInlinerVectorBonusPercent`] | Return the inliner bonus percent for vector‐dense callers/callees. | xref:llvm/TargetTransformInfoImplBase/getInliningCostBenefitAnalysisProfitableMultiplier.adoc[`getInliningCostBenefitAnalysisProfitableMultiplier`] [.small]#[virtual]# | Return the profitable multiplier used by inlining cost‐benefit analysis. | xref:llvm/TargetTransformInfoImplBase/getInliningCostBenefitAnalysisSavingsMultiplier.adoc[`getInliningCostBenefitAnalysisSavingsMultiplier`] [.small]#[virtual]# | Return the savings multiplier used by inlining cost‐benefit analysis. | xref:llvm/TargetTransformInfoImplBase/getInliningLastCallToStaticBonus.adoc[`getInliningLastCallToStaticBonus`] [.small]#[virtual]# | Return the bonus applied when inlining the last call to a static function. | xref:llvm/BasicTTIImplBase-03/getInliningThresholdMultiplier.adoc[`getInliningThresholdMultiplier`] | Return a multiplier applied to the inlining threshold for this target. | xref:llvm/TargetTransformInfoImplBase/getInsertExtractValueCost.adoc[`getInsertExtractValueCost`] [.small]#[virtual]# | Estimate the cost of an insertvalue or extractvalue instruction. | xref:llvm/TargetTransformInfoImplCRTPBase-08/getInstructionCost.adoc[`getInstructionCost`] [.small]#[virtual]# | Estimate the cost of a given IR user when lowered. | xref:llvm/TargetTransformInfoImplBase/getIntImmCodeSizeCost.adoc[`getIntImmCodeSizeCost`] [.small]#[virtual]# | Estimate the code‐size cost of materializing an integer immediate. | xref:llvm/TargetTransformInfoImplBase/getIntImmCost.adoc[`getIntImmCost`] [.small]#[virtual]# | Estimate the cost of materializing an integer immediate of the type. | xref:llvm/TargetTransformInfoImplBase/getIntImmCostInst.adoc[`getIntImmCostInst`] [.small]#[virtual]# | Estimate the cost of an integer immediate used by an instruction. | xref:llvm/TargetTransformInfoImplBase/getIntImmCostIntrin.adoc[`getIntImmCostIntrin`] [.small]#[virtual]# | Estimate the cost of an integer immediate used by an intrinsic. | xref:llvm/BasicTTIImplBase-03/getInterleavedMemoryOpCost.adoc[`getInterleavedMemoryOpCost`] | Return the cost of an interleaved memory operation. | xref:llvm/BasicTTIImplBase-03/getIntrinsicInstrCost.adoc[`getIntrinsicInstrCost`] | Return the cost of an intrinsic, analyzing real arguments when present. | xref:llvm/TargetTransformInfoImplBase/getLoadStoreVecRegBitWidth.adoc[`getLoadStoreVecRegBitWidth`] [.small]#[virtual]# | Return the vector register bit width used for load/store in the address space. | xref:llvm/TargetTransformInfoImplBase/getLoadVectorFactor.adoc[`getLoadVectorFactor`] [.small]#[virtual]# | Return the load vectorization factor capped for this target. | xref:llvm/BasicTTIImplBase-03/getMaxInterleaveFactor.adoc[`getMaxInterleaveFactor`] | Return the maximum interleave factor transforms should try for this target. | xref:llvm/TargetTransformInfoImplBase/getMaxMemIntrinsicInlineSizeThreshold.adoc[`getMaxMemIntrinsicInlineSizeThreshold`] [.small]#[virtual]# | Return the max memcpy/memset size inlined as a sequence of loads and stores. | xref:llvm/TargetTransformInfoImplBase/getMaxNumArgs.adoc[`getMaxNumArgs`] [.small]#[virtual]# | Return the maximum number of arguments supported for a call. | xref:llvm/BasicTTIImplBase-03/getMaxPrefetchIterationsAhead.adoc[`getMaxPrefetchIterationsAhead`] | Return the maximum number of iterations to prefetch ahead. | xref:llvm/BasicTTIImplBase-03/getMaxVScale.adoc[`getMaxVScale`] | Return the architectural maximum vscale, if the target specifies one. | xref:llvm/TargetTransformInfoImplBase/getMaximumVF.adoc[`getMaximumVF`] [.small]#[virtual]# | Return the maximum vectorization factor for the element width and opcode. | xref:llvm/BasicTTIImplBase-03/getMemIntrinsicInstrCost.adoc[`getMemIntrinsicInstrCost`] | Return the cost of a memory intrinsic described by `MICA.` | xref:llvm/TargetTransformInfoImplBase/getMemcpyCost.adoc[`getMemcpyCost`] [.small]#[virtual]# | Estimate the cost of a memcpy intrinsic instruction. | xref:llvm/TargetTransformInfoImplBase/getMemcpyLoopLoweringType.adoc[`getMemcpyLoopLoweringType`] [.small]#[virtual]# | Return the type used to lower a memcpy loop iteration. | xref:llvm/TargetTransformInfoImplBase/getMemcpyLoopResidualLoweringType.adoc[`getMemcpyLoopResidualLoweringType`] [.small]#[virtual]# | Append types used to lower residual bytes of a memcpy loop. | xref:llvm/BasicTTIImplBase-03/getMemoryOpCost.adoc[`getMemoryOpCost`] | Return the cost of a load or store of type `Src.` | xref:llvm/BasicTTIImplBase-03/getMinMaxReductionCost.adoc[`getMinMaxReductionCost`] | Calculate the cost of min/max reduction operations. | xref:llvm/TargetTransformInfoImplBase/getMinPageSize.adoc[`getMinPageSize`] [.small]#[virtual]# | Return the minimum page size in bytes, if known. | xref:llvm/BasicTTIImplBase-03/getMinPrefetchStride.adoc[`getMinPrefetchStride`] | Return the minimum stride in bytes where software prefetching helps. | xref:llvm/TargetTransformInfoImplBase/getMinTripCountTailFoldingThreshold.adoc[`getMinTripCountTailFoldingThreshold`] [.small]#[virtual]# | Return the minimum trip count for considering tail folding. | xref:llvm/TargetTransformInfoImplBase/getMinVectorRegisterBitWidth.adoc[`getMinVectorRegisterBitWidth`] [.small]#[virtual]# | Return the minimum vector register bit width for this target. | xref:llvm/TargetTransformInfoImplBase/getMinimumLookupTableEntryBitWidth.adoc[`getMinimumLookupTableEntryBitWidth`] [.small]#[virtual]# | Return the minimum integer bit width for switch lookup table entries. | xref:llvm/TargetTransformInfoImplBase/getMinimumVF.adoc[`getMinimumVF`] [.small]#[virtual]# | Return the minimum vectorization factor for the element width. | xref:llvm/BasicTTIImplBase-03/getMulAccReductionCost.adoc[`getMulAccReductionCost`] | Return the cost of a multiply‐accumulate reduction pattern. | xref:llvm/TargetTransformInfoImplBase/getNumBytesToPadGlobalArray.adoc[`getNumBytesToPadGlobalArray`] [.small]#[virtual]# | Return how many padding bytes to append to a global array. | xref:llvm/BasicTTIImplBase-03/getNumberOfParts.adoc[`getNumberOfParts`] | Return how many pieces `Tp` must be split into during legalization. | xref:llvm/TargetTransformInfoImplBase/getNumberOfRegisters.adoc[`getNumberOfRegisters`] [.small]#[virtual]# | Return the number of registers in the given register class. | xref:llvm/BasicTTIImplBase-03/getOperandsScalarizationOverhead.adoc[`getOperandsScalarizationOverhead`] | Estimate the overhead of scalarizing an instruction's operands. | xref:llvm/TargetTransformInfoImplBase/getOrCreateResultFromMemIntrinsic.adoc[`getOrCreateResultFromMemIntrinsic`] [.small]#[virtual]# | Return or create a value representing the result of a memory intrinsic. | xref:llvm/BasicTTIImplBase-03/getOrderedReductionCost.adoc[`getOrderedReductionCost`] | Estimate the cost of a strict in‐order (ordered) reduction. | xref:llvm/BasicTTIImplBase-03/getPartialReductionCost.adoc[`getPartialReductionCost`] | Return the cost of a partial reduction to a narrower vector. | xref:llvm/BasicTTIImplBase-03/getPeelingPreferences.adoc[`getPeelingPreferences`] | Fill `PP` with target preferences for peeling loop `L.` | xref:llvm/TargetTransformInfoImplCRTPBase-08/getPointersChainCost.adoc[`getPointersChainCost`] [.small]#[virtual]# | Estimate the cost of a chain of related pointer values when lowered. | xref:llvm/TargetTransformInfoImplBase/getPopcntSupport.adoc[`getPopcntSupport`] [.small]#[virtual]# | Return how population‐count is supported for the integer width. | xref:llvm/BasicTTIImplBase-03/getPredicatedAddrSpace.adoc[`getPredicatedAddrSpace`] | Return a predicate value and address space assumed for pointer `V.` | xref:llvm/TargetTransformInfoImplBase/getPredictableBranchThreshold.adoc[`getPredictableBranchThreshold`] [.small]#[virtual]# | Return the probability threshold for treating a branch as predictable. | xref:llvm/TargetTransformInfoImplBase/getPreferredAddressingMode.adoc[`getPreferredAddressingMode`] [.small]#[virtual]# | Return the preferred addressing mode for LSR to generate. | xref:llvm/TargetTransformInfoImplBase/getPreferredExpandedReductionShuffle.adoc[`getPreferredExpandedReductionShuffle`] [.small]#[virtual]# | Return the preferred shuffle strategy when expanding a reduction. | xref:llvm/BasicTTIImplBase-03/getPreferredLargeGEPBaseOffset.adoc[`getPreferredLargeGEPBaseOffset`] | Return a preferred large GEP base offset within []`MinOffset,` `MaxOffset].` | xref:llvm/BasicTTIImplBase-03/getPreferredTailFoldingStyle.adoc[`getPreferredTailFoldingStyle`] | Return the preferred style of tail folding for this target. | xref:llvm/BasicTTIImplBase-03/getPrefetchDistance.adoc[`getPrefetchDistance`] | Return how far before a load to place a prefetch, in instructions. | xref:llvm/TargetTransformInfoImplBase/getPriorityMask.adoc[`getPriorityMask`] [.small]#[virtual]# | Return the priority bitmask for multi‐versioning of the function. | xref:llvm/BasicTTIImplBase-03/getRegUsageForType.adoc[`getRegUsageForType`] | Return the estimated number of registers required to represent `Ty.` | xref:llvm/BasicTTIImplBase-03/getRegisterBitWidth.adoc[`getRegisterBitWidth`] | Return the bit width of the largest register of kind `K.` | xref:llvm/TargetTransformInfoImplBase/getRegisterClassForType.adoc[`getRegisterClassForType`] [.small]#[virtual]# | Return the register class ID used for the type. | xref:llvm/TargetTransformInfoImplBase/getRegisterClassName.adoc[`getRegisterClassName`] [.small]#[virtual]# | Return a printable name for the register class ID. | xref:llvm/TargetTransformInfoImplBase/getRegisterClassReloadCost.adoc[`getRegisterClassReloadCost`] [.small]#[virtual]# | Estimate the cost of reloading a register into the class. | xref:llvm/TargetTransformInfoImplBase/getRegisterClassSpillCost.adoc[`getRegisterClassSpillCost`] [.small]#[virtual]# | Estimate the cost of spilling a register from the class. | xref:llvm/BasicTTIImplBase-03/getReplicationShuffleCost.adoc[`getReplicationShuffleCost`] | Return the cost of replicating `VF` elements of type `EltTy.` | xref:llvm/BasicTTIImplBase-03/getScalarizationOverhead-01.adoc[`getScalarizationOverhead`] | `getScalarizationOverhead` overloads | xref:llvm/BasicTTIImplBase-03/getScalingFactorCost.adoc[`getScalingFactorCost`] | Return the cost of the scaling factor in addressing mode for type `Ty.` | xref:llvm/BasicTTIImplBase-03/getShuffleCost.adoc[`getShuffleCost`] | Return the cost of a shuffle producing `DstTy` from `SrcTy.` | xref:llvm/BasicTTIImplBase-03/getStoreMinimumVF.adoc[`getStoreMinimumVF`] | Return a smaller store VF that may still be profitable to vectorize. | xref:llvm/TargetTransformInfoImplBase/getStoreVectorFactor.adoc[`getStoreVectorFactor`] [.small]#[virtual]# | Return the store vectorization factor capped for this target. | xref:llvm/TargetTransformInfoImplBase/getTgtMemIntrinsic.adoc[`getTgtMemIntrinsic`] [.small]#[virtual]# | Fill MemIntrinsicInfo for a target memory intrinsic, if recognized. | xref:llvm/BasicTTIImplBase-03/getTreeReductionCost.adoc[`getTreeReductionCost`] | Estimate arithmetic and shuffle costs for a tree‐wise reduction. | xref:llvm/BasicTTIImplBase-03/getTypeBasedIntrinsicInstrCost.adoc[`getTypeBasedIntrinsicInstrCost`] | Return an intrinsic cost based on argument types only. | xref:llvm/BasicTTIImplBase-03/getTypeLegalizationCost.adoc[`getTypeLegalizationCost`] | Estimate the cost of type‐legalization and the legalized type. | xref:llvm/BasicTTIImplBase-03/getUnrollingPreferences.adoc[`getUnrollingPreferences`] | Fill `UP` with target preferences for unrolling loop `L.` | xref:llvm/TargetTransformInfoImplBase/getVPLegalizationStrategy.adoc[`getVPLegalizationStrategy`] [.small]#[virtual]# | Return how vector‐predicated operations should be legalized. | xref:llvm/BasicTTIImplBase-03/getVScaleForTuning.adoc[`getVScaleForTuning`] | Return the vscale value to use when tuning the cost model. | xref:llvm/TargetTransformInfoImplBase/getValueUniformity.adoc[`getValueUniformity`] [.small]#[virtual]# | Return target‐specific uniformity information for a value. | xref:llvm/BasicTTIImplBase-03/getVectorInstrCost-09.adoc[`getVectorInstrCost`] | `getVectorInstrCost` overloads | xref:llvm/BasicTTIImplBase-03/getVectorSplitCost.adoc[`getVectorSplitCost`] | Return the cost of splitting a vector into legal parts. | xref:llvm/TargetTransformInfoImplBase/hasActiveVectorLength.adoc[`hasActiveVectorLength`] [.small]#[virtual]# | Return true if the target has an active vector length mechanism. | xref:llvm/TargetTransformInfoImplBase/hasArmWideBranch.adoc[`hasArmWideBranch`] [.small]#[virtual]# | Return true if the target has a wide ARM/Thumb branch. | xref:llvm/BasicTTIImplBase-03/hasBranchDivergence.adoc[`hasBranchDivergence`] | Return true if branch divergence exists for threads executing `F.` | xref:llvm/TargetTransformInfoImplBase/hasConditionalLoadStoreForType.adoc[`hasConditionalLoadStoreForType`] [.small]#[virtual]# | Return true if conditional load/store is available for the type. | xref:llvm/TargetTransformInfoImplBase/hasDivRemOp.adoc[`hasDivRemOp`] [.small]#[virtual]# | Return true if the target has a combined div/rem operation for the type. | xref:llvm/TargetTransformInfoImplBase/hasVolatileVariant.adoc[`hasVolatileVariant`] [.small]#[virtual]# | Return true if the memory instruction has a volatile variant for the address space. | xref:llvm/BasicTTIImplBase-03/haveFastClmul.adoc[`haveFastClmul`] | Return true if the hardware has a fast carry‐less multiply for `Ty.` | xref:llvm/BasicTTIImplBase-03/haveFastSqrt.adoc[`haveFastSqrt`] | Return true if the hardware has a fast square‐root for type `Ty.` | xref:llvm/BasicTTIImplBase-03/improveShuffleKindFromMask.adoc[`improveShuffleKindFromMask`] | Refine `Kind` using `Mask,` updating `Index` and `SubTy` when needed. | xref:llvm/BasicTTIImplBase-03/instCombineIntrinsic.adoc[`instCombineIntrinsic`] | Attempt target‐specific InstCombine folds for intrinsic `II.` | xref:llvm/TargetTransformInfoImplBase/isElementTypeLegalForScalableVector.adoc[`isElementTypeLegalForScalableVector`] [.small]#[virtual]# | Return true if the element type is legal in a scalable vector. | xref:llvm/TargetTransformInfoImplCRTPBase-08/isExpensiveToSpeculativelyExecute.adoc[`isExpensiveToSpeculativelyExecute`] [.small]#[virtual]# | Return true if the instruction is too expensive to speculate. | xref:llvm/BasicTTIImplBase-03/isFCmpOrdCheaperThanFCmpZero.adoc[`isFCmpOrdCheaperThanFCmpZero`] | Return true if an ordered FP compare is cheaper than comparing against zero. | xref:llvm/TargetTransformInfoImplBase/isFPVectorizationPotentiallyUnsafe.adoc[`isFPVectorizationPotentiallyUnsafe`] [.small]#[virtual]# | Return true if FP vectorization may be unsafe on this target. | xref:llvm/BasicTTIImplBase-03/isHardwareLoopProfitable.adoc[`isHardwareLoopProfitable`] | Return true if converting loop `L` into a hardware loop looks profitable. | xref:llvm/BasicTTIImplBase-03/isIndexedLoadLegal.adoc[`isIndexedLoadLegal`] | Return true if an indexed load of mode `M` for type `Ty` is legal. | xref:llvm/BasicTTIImplBase-03/isIndexedStoreLegal.adoc[`isIndexedStoreLegal`] | Return true if an indexed store of mode `M` for type `Ty` is legal. | xref:llvm/BasicTTIImplBase-03/isLSRCostLess.adoc[`isLSRCostLess`] | Return true if LSR cost `C1` is lower than `C2.` | xref:llvm/BasicTTIImplBase-03/isLegalAddImmediate.adoc[`isLegalAddImmediate`] | Return true if `imm` is a legal immediate for an add on this target. | xref:llvm/BasicTTIImplBase-03/isLegalAddScalableImmediate.adoc[`isLegalAddScalableImmediate`] | Return true if adding scalable immediate `Imm` (times vscale) is legal. | xref:llvm/BasicTTIImplBase-03/isLegalAddressingMode.adoc[`isLegalAddressingMode`] | Return true if the described addressing mode is legal for type `Ty.` | xref:llvm/TargetTransformInfoImplBase/isLegalAltInstr.adoc[`isLegalAltInstr`] [.small]#[virtual]# | Return true if the alternating‐opcode pattern can be lowered efficiently. | xref:llvm/TargetTransformInfoImplBase/isLegalBroadcastLoad.adoc[`isLegalBroadcastLoad`] [.small]#[virtual]# | Return true if the target supports broadcast loads of the given shape. | xref:llvm/BasicTTIImplBase-03/isLegalICmpImmediate.adoc[`isLegalICmpImmediate`] | Return true if `imm` is a legal immediate for an icmp on this target. | xref:llvm/TargetTransformInfoImplBase/isLegalInterleavedAccessType.adoc[`isLegalInterleavedAccessType`] [.small]#[virtual]# | Return true if interleaved access is legal for the given vector type. | xref:llvm/TargetTransformInfoImplBase/isLegalMaskedCompressStore.adoc[`isLegalMaskedCompressStore`] [.small]#[virtual]# | Return true if the target supports masked compress stores. | xref:llvm/TargetTransformInfoImplBase/isLegalMaskedExpandLoad.adoc[`isLegalMaskedExpandLoad`] [.small]#[virtual]# | Return true if the target supports masked expand loads. | xref:llvm/TargetTransformInfoImplBase/isLegalMaskedGather.adoc[`isLegalMaskedGather`] [.small]#[virtual]# | Return true if the target supports masked gather of the given type. | xref:llvm/TargetTransformInfoImplBase/isLegalMaskedLoad.adoc[`isLegalMaskedLoad`] [.small]#[virtual]# | Return true if the target supports masked loads of the given type. | xref:llvm/TargetTransformInfoImplBase/isLegalMaskedScatter.adoc[`isLegalMaskedScatter`] [.small]#[virtual]# | Return true if the target supports masked scatter of the given type. | xref:llvm/TargetTransformInfoImplBase/isLegalMaskedStore.adoc[`isLegalMaskedStore`] [.small]#[virtual]# | Return true if the target supports masked stores of the given type. | xref:llvm/TargetTransformInfoImplBase/isLegalMaskedVectorHistogram.adoc[`isLegalMaskedVectorHistogram`] [.small]#[virtual]# | Return true if the target supports masked vector histogram updates. | xref:llvm/TargetTransformInfoImplBase/isLegalNTLoad.adoc[`isLegalNTLoad`] [.small]#[virtual]# | Return true if the target supports nontemporal loads of the given type. | xref:llvm/TargetTransformInfoImplBase/isLegalNTStore.adoc[`isLegalNTStore`] [.small]#[virtual]# | Return true if the target supports nontemporal stores of the given type. | xref:llvm/TargetTransformInfoImplBase/isLegalStridedLoadStore.adoc[`isLegalStridedLoadStore`] [.small]#[virtual]# | Return true if the target supports strided load/store of the given type. | xref:llvm/TargetTransformInfoImplBase/isLegalToVectorizeLoad.adoc[`isLegalToVectorizeLoad`] [.small]#[virtual]# | Return true if the load may be vectorized. | xref:llvm/TargetTransformInfoImplBase/isLegalToVectorizeLoadChain.adoc[`isLegalToVectorizeLoadChain`] [.small]#[virtual]# | Return true if a load chain of the given size may be vectorized. | xref:llvm/TargetTransformInfoImplBase/isLegalToVectorizeReduction.adoc[`isLegalToVectorizeReduction`] [.small]#[virtual]# | Return true if the reduction may be vectorized at the given VF. | xref:llvm/TargetTransformInfoImplBase/isLegalToVectorizeStore.adoc[`isLegalToVectorizeStore`] [.small]#[virtual]# | Return true if the store may be vectorized. | xref:llvm/TargetTransformInfoImplBase/isLegalToVectorizeStoreChain.adoc[`isLegalToVectorizeStoreChain`] [.small]#[virtual]# | Return true if a store chain of the given size may be vectorized. | xref:llvm/TargetTransformInfoImplBase/isLoweredToCall.adoc[`isLoweredToCall`] [.small]#[virtual]# | Return true if calls to the function lower to an actual call instruction. | xref:llvm/TargetTransformInfoImplBase/isMultiversionedFunction.adoc[`isMultiversionedFunction`] [.small]#[virtual]# | Return true if the function is multi‐versioned. | xref:llvm/BasicTTIImplBase-03/isNoopAddrSpaceCast.adoc[`isNoopAddrSpaceCast`] | Return true if casting from `FromAS` to `ToAS` is a no‐op. | xref:llvm/BasicTTIImplBase-03/isNumRegsMajorCostOfLSR.adoc[`isNumRegsMajorCostOfLSR`] | Return true if register count is the major cost metric for LSR. | xref:llvm/BasicTTIImplBase-03/isProfitableLSRChainElement.adoc[`isProfitableLSRChainElement`] | Return true if LSR should keep optimizing a chain that includes `I.` | xref:llvm/BasicTTIImplBase-03/isProfitableToHoist.adoc[`isProfitableToHoist`] | Return true if it is profitable to hoist `I` out of a then/else region. | xref:llvm/TargetTransformInfoImplBase/isProfitableToSinkOperands.adoc[`isProfitableToSinkOperands`] [.small]#[virtual]# | Return true if sinking the instruction's operands is profitable. | xref:llvm/BasicTTIImplBase-03/isSingleThreaded.adoc[`isSingleThreaded`] | Return true if the target is configured for a single‐threaded model. | xref:llvm/BasicTTIImplBase-03/isTargetIntrinsicWithOverloadTypeAtArg.adoc[`isTargetIntrinsicWithOverloadTypeAtArg`] | Return true if the vector intrinsic overloads on the type at `OpdIdx.` | xref:llvm/BasicTTIImplBase-03/isTargetIntrinsicWithScalarOpAtArg.adoc[`isTargetIntrinsicWithScalarOpAtArg`] | Return true if the vector form of the intrinsic has a scalar at `ScalarOpdIdx.` | xref:llvm/BasicTTIImplBase-03/isTargetIntrinsicWithStructReturnOverloadAtField.adoc[`isTargetIntrinsicWithStructReturnOverloadAtField`] | Return true if a struct‐returning target intrinsic overloads field `RetIdx.` | xref:llvm/BasicTTIImplBase-03/isTruncateFree.adoc[`isTruncateFree`] | Return true if truncating `Ty1` to `Ty2` is free on this target. | xref:llvm/BasicTTIImplBase-03/isTypeLegal.adoc[`isTypeLegal`] | Return true if `Ty` is a legal type for this target. | xref:llvm/TargetTransformInfoImplBase/isUniform.adoc[`isUniform`] [.small]#[virtual]# | Return true if the instruction is uniform given the uniform operand mask. | xref:llvm/BasicTTIImplBase-03/isValidAddrSpaceCast.adoc[`isValidAddrSpaceCast`] | Return true if casting from `FromAS` to `ToAS` is valid on this target. | xref:llvm/TargetTransformInfoImplBase/isVectorShiftByScalarCheap.adoc[`isVectorShiftByScalarCheap`] [.small]#[virtual]# | Return true if vector shifts by a scalar amount are cheap. | xref:llvm/TargetTransformInfoImplBase/preferAlternateOpcodeVectorization.adoc[`preferAlternateOpcodeVectorization`] [.small]#[virtual]# | Return true if alternating‐opcode vectorization is preferred. | xref:llvm/TargetTransformInfoImplBase/preferEpilogueVectorization.adoc[`preferEpilogueVectorization`] [.small]#[virtual]# | Return true if epilogue vectorization is preferred for the iteration count. | xref:llvm/TargetTransformInfoImplBase/preferFixedOverScalableIfEqualCost.adoc[`preferFixedOverScalableIfEqualCost`] [.small]#[virtual]# | Return true if fixed vectors are preferred when costs are equal. | xref:llvm/TargetTransformInfoImplBase/preferInLoopReduction.adoc[`preferInLoopReduction`] [.small]#[virtual]# | Return true if in‐loop reductions are preferred for the recurrence. | xref:llvm/TargetTransformInfoImplBase/preferPredicatedReductionSelect.adoc[`preferPredicatedReductionSelect`] [.small]#[virtual]# | Return true if predicated reduction selects are preferred. | xref:llvm/TargetTransformInfoImplBase/preferSLPInstCountCheck.adoc[`preferSLPInstCountCheck`] [.small]#[virtual]# | Return true if SLP should use the instruction‐count profitability check. | xref:llvm/BasicTTIImplBase-03/preferTailFoldingOverEpilogue.adoc[`preferTailFoldingOverEpilogue`] | Return true if a tail‐folded vector loop is preferred over a scalar epilogue. | xref:llvm/BasicTTIImplBase-03/preferToKeepConstantsAttached.adoc[`preferToKeepConstantsAttached`] | Return true if constants should stay attached to `Inst` for codegen quality. | xref:llvm/TargetTransformInfoImplBase/prefersVectorizedAddressing.adoc[`prefersVectorizedAddressing`] [.small]#[virtual]# | Return true if the target prefers addresses kept in vector form. | xref:llvm/BasicTTIImplBase-03/rewriteIntrinsicWithAddressSpace.adoc[`rewriteIntrinsicWithAddressSpace`] | Rewrite intrinsic `II` replacing flat‐address operand `OldV` with `NewV.` | xref:llvm/BasicTTIImplBase-03/shouldBuildLookupTables.adoc[`shouldBuildLookupTables`] | Return true if switches should be turned into lookup tables on this target. | xref:llvm/TargetTransformInfoImplBase/shouldBuildLookupTablesForConstant.adoc[`shouldBuildLookupTablesForConstant`] [.small]#[virtual]# | Return true if a switch on this constant may use a lookup table. | xref:llvm/BasicTTIImplBase-03/shouldBuildRelLookupTables.adoc[`shouldBuildRelLookupTables`] | Return true if lookup tables should use relative offsets on this target. | xref:llvm/TargetTransformInfoImplBase/shouldConsiderAddressTypePromotion.adoc[`shouldConsiderAddressTypePromotion`] [.small]#[virtual]# | Return true if address type promotion should be considered for the instruction. | xref:llvm/TargetTransformInfoImplBase/shouldConsiderVectorizationRegPressure.adoc[`shouldConsiderVectorizationRegPressure`] [.small]#[virtual]# | Return true if register pressure should influence vectorization decisions. | xref:llvm/TargetTransformInfoImplBase/shouldCopyAttributeWhenOutliningFrom.adoc[`shouldCopyAttributeWhenOutliningFrom`] [.small]#[virtual]# | Return true if the attribute should be copied when outlining from the caller. | xref:llvm/BasicTTIImplBase-03/shouldDropLSRSolutionIfLessProfitable.adoc[`shouldDropLSRSolutionIfLessProfitable`] | Return true if LSR should drop solutions worse than the baseline. | xref:llvm/TargetTransformInfoImplBase/shouldExpandReduction.adoc[`shouldExpandReduction`] [.small]#[virtual]# | Return true if the reduction intrinsic should be expanded. | xref:llvm/TargetTransformInfoImplBase/shouldMaximizeVectorBandwidth.adoc[`shouldMaximizeVectorBandwidth`] [.small]#[virtual]# | Return true if vectorization should maximize bandwidth for the kind. | xref:llvm/BasicTTIImplBase-03/shouldPrefetchAddressSpace.adoc[`shouldPrefetchAddressSpace`] | Return true if the target wants a prefetch in address space `AS.` | xref:llvm/TargetTransformInfoImplBase/shouldTreatInstructionLikeSelect.adoc[`shouldTreatInstructionLikeSelect`] [.small]#[virtual]# | Return true if the instruction should be treated like a select. | xref:llvm/BasicTTIImplBase-03/simplifyDemandedUseBitsIntrinsic.adoc[`simplifyDemandedUseBitsIntrinsic`] | Simplify a target intrinsic using demanded result bits. | xref:llvm/BasicTTIImplBase-03/simplifyDemandedVectorEltsIntrinsic.adoc[`simplifyDemandedVectorEltsIntrinsic`] | Simplify a target intrinsic using demanded vector elements. | xref:llvm/TargetTransformInfoImplBase/supportsEfficientVectorElementLoadStore.adoc[`supportsEfficientVectorElementLoadStore`] [.small]#[virtual]# | Return true if element‐wise vector load/store is efficient. | xref:llvm/TargetTransformInfoImplBase/supportsScalableVectors.adoc[`supportsScalableVectors`] [.small]#[virtual]# | Return true if the target supports scalable vectors. | xref:llvm/TargetTransformInfoImplCRTPBase-08/supportsTailCallFor.adoc[`supportsTailCallFor`] [.small]#[virtual]# | Return true if the target supports a tail call for the given call site. | xref:llvm/TargetTransformInfoImplBase/supportsTailCalls.adoc[`supportsTailCalls`] [.small]#[virtual]# | Return true if the target supports tail calls. | xref:llvm/BasicTTIImplBase-03/useAA.adoc[`useAA`] | Return true if the target benefits from alias‐analysis in codegen. | xref:llvm/TargetTransformInfoImplBase/useColdCCForColdCall.adoc[`useColdCCForColdCall`] [.small]#[virtual]# | Return true if cold calling convention should be used for cold calls. | xref:llvm/TargetTransformInfoImplBase/useFastCCForInternalCall.adoc[`useFastCCForInternalCall`] [.small]#[virtual]# | Return true if fastcc should be used for internal calls. |=== == Protected Type Aliases [cols="1,4"] |=== | Name| Description | xref:llvm/TargetTransformInfoImplBase/TTI.adoc[`TTI`] | Alias for TargetTransformInfo used by default TTI implementations. |=== == Protected Member Functions [cols="1,4"] |=== | Name| Description | xref:llvm/BasicTTIImplBase-03/2constructor.adoc[`BasicTTIImplBase`] [.small]#[constructor]# | Construct a BasicTTIImplBase using data layout `DL.` | xref:llvm/BasicTTIImplBase-03/2destructor.adoc[`~BasicTTIImplBase`] [.small]#[destructor]# | Destroy a BasicTTIImplBase. | xref:llvm/TargetTransformInfoImplBase/getConstantStrideStep.adoc[`getConstantStrideStep`] | Return the constant stride step of a strided SCEV pointer, if any. | xref:llvm/TargetTransformInfoImplBase/isConstantStridedAccessLessThan.adoc[`isConstantStridedAccessLessThan`] | Return true if the constant stride is strictly less than MergeDistance. | xref:llvm/TargetTransformInfoImplBase/isStridedAccess.adoc[`isStridedAccess`] | Return true if the SCEV pointer expression is a strided access. | xref:llvm/TargetTransformInfoImplBase/minRequiredElementSize.adoc[`minRequiredElementSize`] | Return the minimum bit width needed to hold the value without the sign bit. |=== == Protected Data Members [cols="1,4"] |=== | Name| Description | xref:llvm/TargetTransformInfoImplBase/DL.adoc[`DL`] | Data layout for the module being analyzed. |=== == Protected Using Declarations [cols="1,4"] |=== | Name| Description | xref:llvm/BasicTTIImplBase-03/DL.adoc[`DL`] | Data layout associated with this TTI implementation. | xref:llvm/BasicTTIImplBase-03/getScalarizationOverhead-0cb.adoc[`getScalarizationOverhead`] | Expose base‐class scalarization overhead helpers. |=== == Derived Classes [cols="1,4"] |=== | Name| Description | xref:llvm/BasicTTIImpl.adoc[`BasicTTIImpl`] | Concrete BasicTTIImpl that can be used if no further customization is needed. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#