Concrete BasicTTIImpl that can be used if no further customization is needed.

Synopsis

Declared in <llvm/CodeGen/BasicTTIImpl.h>

class BasicTTIImpl
    : public BasicTTIImplBase<BasicTTIImpl>

Base Classes

Name

Description

BasicTTIImplBase<BasicTTIImpl>

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

Member Functions

Name

Description

BasicTTIImpl [constructor]

Construct a BasicTTIImpl for function F under target machine TM.

addrspacesMayAlias [virtual]

Return false if an AS0 address cannot possibly alias an AS1 address.

adjustInliningThreshold [virtual]

Return an additive adjustment to the inlining threshold for call CB.

allowsMisalignedMemoryAccesses [virtual]

Return true if the target supports misaligned memory accesses.

areInlineCompatible [virtual]

Return true if Caller and Callee have compatible inline attributes.

collectFlatAddressOperands [virtual]

Collect flat‐address operand indexes of intrinsic IID into OpIndexes.

enableWritePrefetching [virtual]

Return true if prefetching should also be done for writes.

getAddressComputationCost [virtual]

Return the cost of address computation for a memory access.

getArithmeticInstrCost [virtual]

Approximate the reciprocal throughput of an arithmetic or logic op.

getArithmeticReductionCost [virtual]

Calculate the cost of a vector arithmetic reduction.

getAssumedAddrSpace [virtual]

Return an address space the target assumes for pointer value V.

getBranchMispredictPenalty [virtual]

Return the estimated latency penalty of a branch misprediction.

getCFInstrCost [virtual]

Return the expected cost of a control‐flow instruction.

getCacheAssociativity [virtual]

Return the associativity of cache level Level, if available.

getCacheLineSize [virtual]

Return the size of a cache line in bytes.

getCacheSize [virtual]

Return the size of cache level Level in bytes, if available.

getCallInstrCost [virtual]

Compute the cost of a call with the given signature.

getCallerAllocaCost [virtual]

Return the extra inlining threshold cost of leaving alloca AI in the caller.

getCastInstrCost [virtual]

Return the expected cost of a cast instruction.

getCmpSelInstrCost [virtual]

Return the expected cost of a compare or select instruction.

getEpilogueVectorizationMinVF [virtual]

Return the minimum VF for which epilogue vectorization should be considered.

getEstimatedNumberOfCaseClusters [virtual]

Estimate how many case clusters SI would lower into.

getExtendedReductionCost [virtual]

Return the cost of an extended reduction pattern.

getExtractWithExtendCost [virtual]

Return the expected cost of a sign‐ or zero‐extended vector extract.

getFPOpCost [virtual]

Return the expected cost of supporting floating‐point ops of type Ty.

getFlatAddressSpace [virtual]

Return the flat address space used to optimize addrspacecasts, or ~0u.

getGEPCost [virtual]

Estimate the cost of a GEP when lowered.

getIndexedVectorInstrCostFromEnd [virtual]

Return the cost of insert/extract Index lanes from the end of a vector.

getInlinerVectorBonusPercent [virtual]

Return the inliner bonus percent for vector‐dense callers/callees.

getInliningThresholdMultiplier [virtual]

Return a multiplier applied to the inlining threshold for this target.

getInterleavedMemoryOpCost [virtual]

Return the cost of an interleaved memory operation.

getIntrinsicInstrCost [virtual]

Return the cost of an intrinsic, analyzing real arguments when present.

getMaxInterleaveFactor [virtual]

Return the maximum interleave factor transforms should try for this target.

getMaxPrefetchIterationsAhead [virtual]

Return the maximum number of iterations to prefetch ahead.

getMaxVScale [virtual]

Return the architectural maximum vscale, if the target specifies one.

getMemIntrinsicInstrCost [virtual]

Return the cost of a memory intrinsic described by MICA.

getMemoryOpCost [virtual]

Return the cost of a load or store of type Src.

getMinMaxReductionCost [virtual]

Calculate the cost of min/max reduction operations.

getMinPrefetchStride [virtual]

Return the minimum stride in bytes where software prefetching helps.

getMulAccReductionCost [virtual]

Return the cost of a multiply‐accumulate reduction pattern.

getNumberOfParts [virtual]

Return how many pieces Tp must be split into during legalization.

getOperandsScalarizationOverhead [virtual]

Estimate the overhead of scalarizing an instruction's operands.

getOrderedReductionCost

Estimate the cost of a strict in‐order (ordered) reduction.

getPartialReductionCost [virtual]

Return the cost of a partial reduction to a narrower vector.

getPeelingPreferences [virtual]

Fill PP with target preferences for peeling loop L.

getPredicatedAddrSpace [virtual]

Return a predicate value and address space assumed for pointer V.

getPreferredLargeGEPBaseOffset

Return a preferred large GEP base offset within []`MinOffset,` MaxOffset].

getPreferredTailFoldingStyle [virtual]

Return the preferred style of tail folding for this target.

getPrefetchDistance [virtual]

Return how far before a load to place a prefetch, in instructions.

getRegUsageForType [virtual]

Return the estimated number of registers required to represent Ty.

getRegisterBitWidth [virtual]

Return the bit width of the largest register of kind K.

getReplicationShuffleCost [virtual]

Return the cost of replicating VF elements of type EltTy.

getScalarizationOverhead

getScalarizationOverhead overloads

getScalingFactorCost [virtual]

Return the cost of the scaling factor in addressing mode for type Ty.

getShuffleCost [virtual]

Return the cost of a shuffle producing DstTy from SrcTy.

getStoreMinimumVF [virtual]

Return a smaller store VF that may still be profitable to vectorize.

getTreeReductionCost

Estimate arithmetic and shuffle costs for a tree‐wise reduction.

getTypeBasedIntrinsicInstrCost

Return an intrinsic cost based on argument types only.

getTypeLegalizationCost

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

getUnrollingPreferences [virtual]

Fill UP with target preferences for unrolling loop L.

getVScaleForTuning [virtual]

Return the vscale value to use when tuning the cost model.

getVectorInstrCost

getVectorInstrCost overloads

getVectorSplitCost

Return the cost of splitting a vector into legal parts.

hasBranchDivergence [virtual]

Return true if branch divergence exists for threads executing F.

haveFastClmul [virtual]

Return true if the hardware has a fast carry‐less multiply for Ty.

haveFastSqrt [virtual]

Return true if the hardware has a fast square‐root for type Ty.

improveShuffleKindFromMask

Refine Kind using Mask, updating Index and SubTy when needed.

instCombineIntrinsic [virtual]

Attempt target‐specific InstCombine folds for intrinsic II.

isFCmpOrdCheaperThanFCmpZero [virtual]

Return true if an ordered FP compare is cheaper than comparing against zero.

isHardwareLoopProfitable [virtual]

Return true if converting loop L into a hardware loop looks profitable.

isIndexedLoadLegal [virtual]

Return true if an indexed load of mode M for type Ty is legal.

isIndexedStoreLegal [virtual]

Return true if an indexed store of mode M for type Ty is legal.

isLSRCostLess [virtual]

Return true if LSR cost C1 is lower than C2.

isLegalAddImmediate [virtual]

Return true if imm is a legal immediate for an add on this target.

isLegalAddScalableImmediate [virtual]

Return true if adding scalable immediate Imm (times vscale) is legal.

isLegalAddressingMode [virtual]

Return true if the described addressing mode is legal for type Ty.

isLegalICmpImmediate [virtual]

Return true if imm is a legal immediate for an icmp on this target.

isNoopAddrSpaceCast [virtual]

Return true if casting from FromAS to ToAS is a no‐op.

isNumRegsMajorCostOfLSR [virtual]

Return true if register count is the major cost metric for LSR.

isProfitableLSRChainElement [virtual]

Return true if LSR should keep optimizing a chain that includes I.

isProfitableToHoist [virtual]

Return true if it is profitable to hoist I out of a then/else region.

isSingleThreaded [virtual]

Return true if the target is configured for a single‐threaded model.

isTargetIntrinsicWithOverloadTypeAtArg [virtual]

Return true if the vector intrinsic overloads on the type at OpdIdx.

isTargetIntrinsicWithScalarOpAtArg [virtual]

Return true if the vector form of the intrinsic has a scalar at ScalarOpdIdx.

isTargetIntrinsicWithStructReturnOverloadAtField [virtual]

Return true if a struct‐returning target intrinsic overloads field RetIdx.

isTruncateFree [virtual]

Return true if truncating Ty1 to Ty2 is free on this target.

isTypeLegal [virtual]

Return true if Ty is a legal type for this target.

isValidAddrSpaceCast [virtual]

Return true if casting from FromAS to ToAS is valid on this target.

preferTailFoldingOverEpilogue [virtual]

Return true if a tail‐folded vector loop is preferred over a scalar epilogue.

preferToKeepConstantsAttached [virtual]

Return true if constants should stay attached to Inst for codegen quality.

rewriteIntrinsicWithAddressSpace [virtual]

Rewrite intrinsic II replacing flat‐address operand OldV with NewV.

shouldBuildLookupTables [virtual]

Return true if switches should be turned into lookup tables on this target.

shouldBuildRelLookupTables [virtual]

Return true if lookup tables should use relative offsets on this target.

shouldDropLSRSolutionIfLessProfitable [virtual]

Return true if LSR should drop solutions worse than the baseline.

shouldPrefetchAddressSpace [virtual]

Return true if the target wants a prefetch in address space AS.

simplifyDemandedUseBitsIntrinsic [virtual]

Simplify a target intrinsic using demanded result bits.

simplifyDemandedVectorEltsIntrinsic [virtual]

Simplify a target intrinsic using demanded vector elements.

useAA [virtual]

Return true if the target benefits from alias‐analysis in codegen.

Protected Using Declarations

Name

Description

DL

Data layout associated with this TTI implementation.

getScalarizationOverhead

Expose base‐class scalarization overhead helpers.

Friends

Name

Description

llvm::BasicTTIImplBase

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

Created with MrDocs