LLVM 22.0.0git
|
Base class which can be used to help build a TTI implementation. More...
#include "llvm/CodeGen/BasicTTIImpl.h"
Protected Member Functions | |
BasicTTIImplBase (const TargetMachine *TM, const DataLayout &DL) | |
virtual | ~BasicTTIImplBase ()=default |
![]() | |
TargetTransformInfoImplCRTPBase (const DataLayout &DL) | |
![]() | |
TargetTransformInfoImplBase (const DataLayout &DL) | |
unsigned | minRequiredElementSize (const Value *Val, bool &isSigned) const |
bool | isStridedAccess (const SCEV *Ptr) const |
const SCEVConstant * | getConstantStrideStep (ScalarEvolution *SE, const SCEV *Ptr) const |
bool | isConstantStridedAccessLessThan (ScalarEvolution *SE, const SCEV *Ptr, int64_t MergeDistance) const |
Protected Attributes | |
const DataLayout & | DL |
![]() | |
const DataLayout & | DL |
Additional Inherited Members | |
![]() | |
typedef TargetTransformInfo | TTI |
Base class which can be used to help build a TTI implementation.
This class provides as much implementation of the TTI interface as is possible using the target independent parts of the code generator.
In order to subclass it, your class must implement a getST() method to return the subtarget, and a getTLI() method to return the target lowering. We need these methods implemented in the derived class so that this class doesn't have to duplicate storage for them.
Definition at line 82 of file BasicTTIImpl.h.
|
inlineexplicitprotected |
Definition at line 367 of file BasicTTIImpl.h.
|
protectedvirtualdefault |
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 410 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 692 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 376 of file BasicTTIImpl.h.
References llvm::TargetLoweringBase::allowsMisalignedMemoryAccesses(), llvm::BitWidth, Context, E, llvm::CallingConv::Fast, llvm::EVT::getIntegerVT(), and llvm::MachineMemOperand::MONone.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 384 of file BasicTTIImpl.h.
References llvm::TargetLoweringBase::getTargetMachine().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 419 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Reimplemented in llvm::LoongArchTTIImpl, and llvm::SystemZTTIImpl.
Definition at line 861 of file BasicTTIImpl.h.
References llvm::MCSubtargetInfo::enableWritePrefetching().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 3054 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 1033 of file BasicTTIImpl.h.
References llvm::TargetTransformInfo::OK_AnyValue, and llvm::TargetTransformInfo::OP_None.
Referenced by llvm::WebAssemblyTTIImpl::getArithmeticInstrCost().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 3174 of file BasicTTIImpl.h.
References assert(), CostKind, llvm::BasicTTIImplBase< T >::getOrderedReductionCost(), llvm::BasicTTIImplBase< T >::getTreeReductionCost(), and llvm::TargetTransformInfo::requiresOrderedReduction().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 428 of file BasicTTIImpl.h.
References llvm::TargetMachine::getAssumedAddrSpace(), and llvm::TargetLoweringBase::getTargetMachine().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Reimplemented in llvm::X86TTIImpl.
Definition at line 831 of file BasicTTIImpl.h.
References llvm::TargetTransformInfoImplBase::getCacheAssociativity(), and llvm::MCSubtargetInfo::getCacheAssociativity().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Reimplemented in llvm::GCNTTIImpl, llvm::HexagonTTIImpl, llvm::LoongArchTTIImpl, llvm::PPCTTIImpl, and llvm::SystemZTTIImpl.
Definition at line 841 of file BasicTTIImpl.h.
References llvm::MCSubtargetInfo::getCacheLineSize().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Reimplemented in llvm::X86TTIImpl.
Definition at line 825 of file BasicTTIImpl.h.
References llvm::BasicTTIImplBase< T >::getCacheSize().
Referenced by llvm::BasicTTIImplBase< T >::getCacheSize().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 695 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Compute a cost of the given call instruction.
Compute the cost of calling function F with return type RetTy and argument types Tys. F might be nullptr, in this case the cost of an arbitrary call with the specified signature will be returned. This is used, for instance, when we estimate call of a vector counterpart of the given function.
F | Called function, might be nullptr. |
RetTy | Return value types. |
Tys | Argument types. |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 3031 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 1196 of file BasicTTIImpl.h.
References assert(), CostKind, llvm::BasicTTIImplBase< T >::DL, llvm::TargetTransformInfoImplBase::getCastInstrCost(), llvm::TargetTransformInfo::getCastInstrCost(), llvm::EVT::getEVT(), llvm::VectorType::getHalfElementsVectorType(), llvm::InstructionCost::getInvalid(), llvm::BasicTTIImplBase< T >::getScalarizationOverhead(), llvm::TargetLoweringBase::getTypeAction(), llvm::BasicTTIImplBase< T >::getTypeLegalizationCost(), llvm::TargetLoweringBase::getValueType(), I, llvm::TargetLoweringBase::InstructionOpcodeToISD(), llvm::TargetLoweringBase::isFreeAddrSpaceCast(), llvm::TargetLoweringBase::isLoadExtLegal(), llvm::TargetLoweringBase::isOperationExpand(), llvm::TargetLoweringBase::isOperationLegalOrPromote(), llvm::TargetLoweringBase::isTruncateFree(), llvm::TargetLoweringBase::isZExtFree(), llvm_unreachable, llvm::TargetTransformInfo::Normal, llvm::ISD::SEXTLOAD, llvm::TargetLoweringBase::TypeSplitVector, and llvm::ISD::ZEXTLOAD.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 1366 of file BasicTTIImpl.h.
References CostKind, llvm::TargetTransformInfoImplBase::getCFInstrCost(), and I.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 1371 of file BasicTTIImpl.h.
References llvm::TargetTransformInfo::OK_AnyValue, and llvm::TargetTransformInfo::OP_None.
Referenced by llvm::BasicTTIImplBase< T >::getIntrinsicInstrCost().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 788 of file BasicTTIImpl.h.
References llvm::TargetTransformInfoImplBase::getEpilogueVectorizationMinVF().
|
inlineoverridevirtual |
Try to find the estimated number of clusters. Note that the number of clusters identified in this function could be different from the actual numbers found in lowering. This function ignore switches that are lowered with a mix of jump table / bit test / BTree. This function was initially intended to be used when estimating the cost of switch in inline cost heuristic, but it's a generic cost model to be used in other places (e.g., in loop unrolling).
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 564 of file BasicTTIImpl.h.
References llvm::TargetLoweringBase::areJTsAllowed(), llvm::BasicTTIImplBase< T >::DL, llvm::TargetTransformInfoImplBase::getDataLayout(), llvm::DataLayout::getIndexSizeInBits(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::TargetLoweringBase::isSuitableForBitTests(), llvm::TargetLoweringBase::isSuitableForJumpTable(), N, Range, llvm::APInt::sgt(), llvm::SmallPtrSetImplBase::size(), and llvm::APInt::slt().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 1567 of file BasicTTIImpl.h.
References CostKind.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 3234 of file BasicTTIImpl.h.
References CostKind, llvm::IntegerType::get(), llvm::VectorType::get(), llvm::Type::getContext(), llvm::Type::getInt1Ty(), and llvm::TargetTransformInfo::None.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 1356 of file BasicTTIImpl.h.
References CostKind, llvm::VectorType::getElementType(), Index, and llvm::TargetTransformInfo::None.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 414 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 662 of file BasicTTIImpl.h.
References llvm::BasicTTIImplBase< T >::DL, llvm::ISD::FADD, llvm::TargetLoweringBase::getValueType(), llvm::TargetLoweringBase::isOperationLegalOrCustomOrPromote(), llvm::TargetTransformInfo::TCC_Basic, and llvm::TargetTransformInfo::TCC_Expensive.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 1558 of file BasicTTIImpl.h.
References CostKind.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplCRTPBase< T >.
Definition at line 558 of file BasicTTIImpl.h.
References CostKind, llvm::TargetTransformInfoImplCRTPBase< T >::getGEPCost(), Operands, and Ptr.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 1457 of file BasicTTIImpl.h.
References assert(), CostKind, getNumElements(), and Index.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 700 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 691 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 1589 of file BasicTTIImpl.h.
References assert(), CostKind, llvm::BitVector::count(), llvm::divideCeil(), llvm::FixedVectorType::get(), llvm::APInt::getAllOnes(), llvm::Type::getInt8Ty(), llvm::InstructionCost::getInvalid(), llvm::MVT::getStoreSize(), llvm::BasicTTIImplBase< T >::getTypeLegalizationCost(), llvm::InstructionCost::getValue(), llvm::APInt::getZero(), Index, llvm::InstructionCost::isValid(), llvm::BitVector::set(), llvm::APInt::setBit(), and llvm::ArrayRef< T >::size().
|
inlineoverridevirtual |
Get intrinsic cost based on arguments.
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 1734 of file BasicTTIImpl.h.
References assert(), llvm::CmpInst::BAD_ICMP_PREDICATE, CostKind, llvm::Data, llvm::BasicTTIImplBase< T >::DL, llvm::ArrayRef< T >::drop_back(), llvm::ArrayRef< T >::drop_front(), llvm::Exponent, llvm::VectorType::get(), llvm::DataLayout::getABITypeAlign(), llvm::IntrinsicCostAttributes::getArgs(), llvm::IntrinsicCostAttributes::getArgTypes(), llvm::TargetLoweringBase::getBitWidthForCttzElements(), llvm::BasicTTIImplBase< T >::getCmpSelInstrCost(), llvm::getContainedTypes(), llvm::ElementCount::getFixed(), llvm::IntrinsicCostAttributes::getFlags(), llvm::VPIntrinsic::getFunctionalIntrinsicIDForVP(), llvm::VPIntrinsic::getFunctionalOpcodeForVP(), llvm::IntrinsicCostAttributes::getID(), llvm::IntrinsicCostAttributes::getInst(), llvm::Type::getIntNTy(), llvm::TargetTransformInfoImplBase::getIntrinsicInstrCost(), llvm::InstructionCost::getInvalid(), llvm::RTLIB::getMODF(), llvm::TargetTransformInfo::getOperandInfo(), llvm::BasicTTIImplBase< T >::getOperandsScalarizationOverhead(), llvm::IntrinsicCostAttributes::getReturnType(), llvm::BasicTTIImplBase< T >::getScalarizationOverhead(), llvm::EVT::getScalarType(), llvm::RTLIB::getSINCOS(), llvm::RTLIB::getSINCOSPI(), getType(), llvm::BasicTTIImplBase< T >::getTypeBasedIntrinsicInstrCost(), llvm::BasicTTIImplBase< T >::getTypeLegalizationCost(), llvm::TargetLoweringBase::getValueType(), llvm::EVT::getVectorElementCount(), llvm::getVectorizedTypeVF(), llvm::getVScaleRange(), llvm::APInt::getZero(), I, llvm::CmpInst::ICMP_EQ, Index, llvm::TargetLoweringBase::isCheapToSpeculateCtlz(), llvm::TargetLoweringBase::isCheapToSpeculateCttz(), llvm::TargetTransformInfo::OperandValueInfo::isConstant(), llvm::isPowerOf2_32(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isScalable(), llvm::ElementCount::isScalar(), llvm::Intrinsic::isTargetIntrinsic(), llvm::IntrinsicCostAttributes::isTypeBasedOnly(), llvm::ElementCount::isVector(), llvm::isVectorizedTy(), llvm::VPBinOpIntrinsic::isVPBinOp(), llvm::VPCastIntrinsic::isVPCast(), llvm::VPCmpIntrinsic::isVPCmp(), llvm::VPIntrinsic::isVPIntrinsic(), llvm::VPReductionIntrinsic::isVPReduction(), llvm::TargetTransformInfo::OperandValueInfo::Kind, llvm_unreachable, llvm::TargetTransformInfo::None, llvm::TargetTransformInfo::OP_None, Ptr, RetTy, llvm::TargetTransformInfo::SK_ExtractSubvector, llvm::TargetTransformInfo::SK_InsertSubvector, llvm::TargetTransformInfo::SK_Splice, llvm::TargetTransformInfo::TCC_Basic, X, and Y.
Referenced by llvm::BasicTTIImplBase< T >::getMinMaxReductionCost().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 1549 of file BasicTTIImpl.h.
References CostKind.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 1031 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 857 of file BasicTTIImpl.h.
References llvm::MCSubtargetInfo::getMaxPrefetchIterationsAhead().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 879 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 1503 of file BasicTTIImpl.h.
References llvm::TargetTransformInfo::OK_AnyValue, and llvm::TargetTransformInfo::OP_None.
|
inlineoverridevirtual |
Try to calculate op costs for min/max reduction operations.
CondTy | Conditional type for the Select instruction. |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 3186 of file BasicTTIImpl.h.
References CostKind, llvm::FixedVectorType::get(), llvm::VectorType::getElementType(), llvm::BasicTTIImplBase< T >::getIntrinsicInstrCost(), llvm::InstructionCost::getInvalid(), llvm::Log2_32(), llvm::TargetTransformInfo::SK_ExtractSubvector, and llvm::TargetTransformInfo::SK_PermuteSingleSrc.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Reimplemented in llvm::SystemZTTIImpl.
Definition at line 849 of file BasicTTIImpl.h.
References llvm::MCSubtargetInfo::getMinPrefetchStride().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 3263 of file BasicTTIImpl.h.
References CostKind, llvm::VectorType::get(), and llvm::TargetTransformInfo::None.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 3036 of file BasicTTIImpl.h.
References llvm::divideCeil(), llvm::Type::getContext(), llvm::VectorType::getElementType(), llvm::EVT::getTypeForEVT(), llvm::BasicTTIImplBase< T >::getTypeLegalizationCost(), and llvm::has_single_bit().
|
inlineoverridevirtual |
Estimate the overhead of scalarizing an instruction's operands.
The (potentially vector) types to use for each of argument are passes via Tys.
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 957 of file BasicTTIImpl.h.
References CostKind, and llvm::BasicTTIImplBase< T >::getScalarizationOverhead().
Referenced by llvm::BasicTTIImplBase< T >::getIntrinsicInstrCost(), and llvm::BasicTTIImplBase< T >::getScalarizationOverhead().
|
inline |
Try to calculate the cost of performing strict (in-order) reductions, which involves doing a sequence of floating point additions in lane order, starting with an initial value.
For example, consider a scalar initial value 'InitVal' of type float and a vector of type <4 x float>:
Vector = <float v0, float v1, float v2, float v3>
add1 = InitVal + v0 add2 = add1 + v1 add3 = add2 + v2 add4 = add3 + v3
As a simple estimate we can say the cost of such a reduction is 4 times the cost of a scalar FP addition. We can only estimate the costs for fixed-width vectors here because for scalable vectors we do not know the runtime number of operations.
Definition at line 3156 of file BasicTTIImpl.h.
References CostKind, llvm::VectorType::getElementType(), llvm::InstructionCost::getInvalid(), llvm::FixedVectorType::getNumElements(), and llvm::BasicTTIImplBase< T >::getScalarizationOverhead().
Referenced by llvm::BasicTTIImplBase< T >::getArithmeticReductionCost().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 774 of file BasicTTIImpl.h.
References llvm::TargetTransformInfo::PeelingPreferences::AllowLoopNestsPeeling, llvm::TargetTransformInfo::PeelingPreferences::AllowPeeling, llvm::TargetTransformInfo::PeelingPreferences::PeelCount, and llvm::TargetTransformInfo::PeelingPreferences::PeelProfiledIterations.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 438 of file BasicTTIImpl.h.
References llvm::TargetMachine::getPredicatedAddrSpace(), and llvm::TargetLoweringBase::getTargetMachine().
|
inline |
Definition at line 472 of file BasicTTIImpl.h.
References llvm::TargetLoweringBase::getPreferredLargeGEPBaseOffset().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 797 of file BasicTTIImpl.h.
References llvm::TargetTransformInfoImplBase::getPreferredTailFoldingStyle().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Reimplemented in llvm::GCNTTIImpl, llvm::HexagonTTIImpl, llvm::LoongArchTTIImpl, llvm::PPCTTIImpl, and llvm::SystemZTTIImpl.
Definition at line 845 of file BasicTTIImpl.h.
References llvm::MCSubtargetInfo::getPrefetchDistance().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 875 of file BasicTTIImpl.h.
References llvm::TypeSize::getFixed().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 553 of file BasicTTIImpl.h.
References llvm::BasicTTIImplBase< T >::DL, llvm::Type::getContext(), llvm::TargetLoweringBase::getNumRegisters(), and llvm::TargetLoweringBase::getValueType().
Referenced by llvm::BasicTTIImplBase< T >::getVectorInstrCost().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 1471 of file BasicTTIImpl.h.
References assert(), CostKind, llvm::FixedVectorType::get(), llvm::APInt::getBitWidth(), and llvm::APIntOps::ScaleBitMask().
|
inline |
Helper wrapper for the DemandedElts variant of getScalarizationOverhead.
Definition at line 942 of file BasicTTIImpl.h.
References CostKind, llvm::APInt::getAllOnes(), and llvm::InstructionCost::getInvalid().
|
inlineoverridevirtual |
Estimate the overhead of scalarizing an instruction.
Insert and Extract are set if the demanded result elements need to be inserted and/or extracted from vectors.
FIXME: a bitfield is not a reasonable abstraction for talking about which elements are needed from a scalable vector
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 888 of file BasicTTIImpl.h.
Referenced by llvm::BasicTTIImplBase< T >::getCastInstrCost(), llvm::BasicTTIImplBase< T >::getIntrinsicInstrCost(), llvm::BasicTTIImplBase< T >::getOperandsScalarizationOverhead(), llvm::BasicTTIImplBase< T >::getOrderedReductionCost(), llvm::BasicTTIImplBase< T >::getScalarizationOverhead(), and llvm::BasicTTIImplBase< T >::getTypeBasedIntrinsicInstrCost().
|
inline |
Estimate the overhead of scalarizing the inputs and outputs of an instruction, with return type RetTy and arguments Args of type Tys.
If Args are unknown (empty), then the cost associated with one argument is added as a heuristic.
Definition at line 978 of file BasicTTIImpl.h.
References CostKind, llvm::BasicTTIImplBase< T >::getOperandsScalarizationOverhead(), llvm::BasicTTIImplBase< T >::getScalarizationOverhead(), and RetTy.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 523 of file BasicTTIImpl.h.
References llvm::TargetLoweringBase::AddrMode::BaseGV, llvm::TargetLoweringBase::AddrMode::BaseOffs, llvm::BasicTTIImplBase< T >::DL, llvm::StackOffset::getFixed(), llvm::InstructionCost::getInvalid(), llvm::StackOffset::getScalable(), llvm::TargetLoweringBase::AddrMode::HasBaseReg, llvm::BasicTTIImplBase< T >::isLegalAddressingMode(), llvm::TargetLoweringBase::AddrMode::ScalableOffset, and llvm::TargetLoweringBase::AddrMode::Scale.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 1167 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 476 of file BasicTTIImpl.h.
References llvm::BasicTTIImplBase< T >::DL, llvm::FixedVectorType::get(), llvm::Type::getContext(), llvm::TargetLoweringBase::getTypeToTransformTo(), llvm::TargetLoweringBase::getValueType(), llvm::TargetLoweringBase::isTruncStoreLegal(), and llvm::ISD::STORE.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 1577 of file BasicTTIImpl.h.
|
inline |
Try to calculate arithmetic and shuffle op costs for reduction intrinsics.
We're assuming that reduction operation are performing the following way:
val1 = shufflevector<n x t> val, <n x t> undef, <n x i32> <i32 n/2, i32 n/2 + 1, ..., i32 n, i32 undef, ..., i32 undef> -------------—v----------—/ -------—v---------—/ n/2 elements n/2 elements red1 = op <n x t> val, <n x t> val1 After this operation we have a vector red1 where only the first n/2 elements are meaningful, the second n/2 elements are undefined and can be dropped. All other operations are actually working with the vector of length n/2, not n, though the real vector length is still n. val2 = shufflevector<n x t> red1, <n x t> undef, <n x i32> <i32 n/4, i32 n/4 + 1, ..., i32 n/2, i32 undef, ..., i32 undef> -------------—v----------—/ -------—v---------—/ n/4 elements 3*n/4 elements red2 = op <n x t> red1, <n x t> val2 - working with the vector of length n/2, the resulting vector has length n/4 etc.
The cost model should take into account that the actual length of the vector is reduced on each iteration.
Definition at line 3080 of file BasicTTIImpl.h.
References llvm::CmpInst::BAD_ICMP_PREDICATE, CostKind, llvm::IntegerType::get(), llvm::FixedVectorType::get(), llvm::Type::getContext(), llvm::VectorType::getElementType(), llvm::Type::getInt1Ty(), llvm::InstructionCost::getInvalid(), llvm::Log2_32(), llvm::CmpInst::makeCmpResultType(), llvm::TargetTransformInfo::None, llvm::TargetTransformInfo::SK_ExtractSubvector, and llvm::TargetTransformInfo::SK_PermuteSingleSrc.
Referenced by llvm::BasicTTIImplBase< T >::getArithmeticReductionCost().
|
inline |
Get intrinsic cost based on argument types.
If ScalarizationCostPassed is std::numeric_limits<unsigned>::max(), the cost of scalarizing the arguments and the return value will be computed based on types.
Definition at line 2197 of file BasicTTIImpl.h.
References llvm::ISD::ABS, llvm::any_of(), assert(), llvm::CmpInst::BAD_ICMP_PREDICATE, llvm::ISD::BITREVERSE, llvm::ISD::BSWAP, CostKind, llvm::StructType::create(), llvm::ISD::CTLZ, llvm::ISD::CTPOP, llvm::ISD::CTTZ, llvm::BasicTTIImplBase< T >::DL, llvm::SmallVectorBase< Size_T >::empty(), llvm::ISD::FABS, llvm::ISD::FACOS, llvm::ISD::FASIN, llvm::ISD::FATAN, llvm::ISD::FATAN2, llvm::ISD::FCANONICALIZE, llvm::ISD::FCEIL, llvm::CmpInst::FCMP_UNO, llvm::ISD::FCOPYSIGN, llvm::ISD::FCOS, llvm::ISD::FCOSH, llvm::ISD::FEXP, llvm::ISD::FEXP10, llvm::ISD::FEXP2, llvm::ISD::FFLOOR, llvm::ISD::FLDEXP, llvm::ISD::FLOG, llvm::ISD::FLOG10, llvm::ISD::FLOG2, llvm::ISD::FMA, llvm::ISD::FMAXIMUM, llvm::ISD::FMAXIMUMNUM, llvm::ISD::FMAXNUM, llvm::ISD::FMAXNUM_IEEE, llvm::ISD::FMINIMUM, llvm::ISD::FMINIMUMNUM, llvm::ISD::FMINNUM, llvm::ISD::FMINNUM_IEEE, llvm::ISD::FMODF, llvm::ISD::FNEARBYINT, llvm::ISD::FP_TO_SINT_SAT, llvm::ISD::FP_TO_UINT_SAT, llvm::ISD::FPOW, llvm::ISD::FRINT, llvm::ISD::FROUND, llvm::ISD::FROUNDEVEN, llvm::ISD::FSHL, llvm::ISD::FSHR, llvm::ISD::FSIN, llvm::ISD::FSINCOS, llvm::ISD::FSINCOSPI, llvm::ISD::FSINH, llvm::ISD::FSQRT, llvm::ISD::FTAN, llvm::ISD::FTANH, llvm::ISD::FTRUNC, llvm::VectorType::get(), llvm::IntrinsicCostAttributes::getArgTypes(), llvm::getArithmeticReductionInstruction(), llvm::getContainedTypes(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getFixedValue(), llvm::IntrinsicCostAttributes::getFlags(), llvm::CmpIntrinsic::getGTPredicate(), llvm::IntrinsicCostAttributes::getID(), llvm::IntrinsicCostAttributes::getInst(), llvm::InstructionCost::getInvalid(), llvm::CmpIntrinsic::getLTPredicate(), llvm::getMinMaxReductionIntrinsicOp(), llvm::FixedVectorType::getNumElements(), getNumElements(), llvm::IntrinsicCostAttributes::getReturnType(), llvm::IntrinsicCostAttributes::getScalarizationCost(), llvm::BasicTTIImplBase< T >::getScalarizationOverhead(), llvm::Type::getScalarSizeInBits(), llvm::Type::getScalarType(), llvm::BasicTTIImplBase< T >::getTypeLegalizationCost(), llvm::TargetLoweringBase::getValueType(), llvm::getVectorizedTypeVF(), llvm::Type::getWithNewBitWidth(), llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_NE, llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_UGT, llvm::CmpInst::ICMP_ULT, llvm::TargetLoweringBase::isFAbsFree(), llvm::TargetLoweringBase::isOperationCustom(), llvm::TargetLoweringBase::isOperationLegal(), llvm::TargetLoweringBase::isOperationLegalOrPromote(), llvm::isPowerOf2_32(), llvm::isVectorizedTy(), llvm::Type::isVectorTy(), llvm::ISD::LLRINT, llvm::ISD::LLROUND, llvm_unreachable, llvm::ISD::LRINT, llvm::ISD::LROUND, llvm::TargetTransformInfo::None, llvm::TargetTransformInfo::OK_AnyValue, llvm::TargetTransformInfo::OK_UniformConstantValue, llvm::TargetTransformInfo::OP_None, llvm::SmallVectorTemplateBase< T, bool >::push_back(), RetTy, llvm::ISD::SADDO, llvm::ISD::SADDSAT, llvm::ISD::SCMP, llvm::TargetLoweringBase::shouldExpandCmpUsingSelects(), llvm::SmallVectorBase< Size_T >::size(), llvm::TargetTransformInfo::SK_Broadcast, llvm::TargetTransformInfo::SK_Reverse, llvm::IntrinsicCostAttributes::skipScalarizationCost(), llvm::ISD::SMAX, llvm::ISD::SMIN, llvm::ISD::SMULFIX, llvm::ISD::SMULO, llvm::ISD::SSUBO, llvm::ISD::SSUBSAT, llvm::ISD::STRICT_FMA, llvm::TargetTransformInfo::TCC_Basic, llvm::TargetTransformInfo::TCC_Expensive, llvm::TargetTransformInfo::TCK_CodeSize, llvm::toScalarizedTy(), llvm::ISD::UADDO, llvm::ISD::UADDSAT, llvm::ISD::UCMP, llvm::UMax, llvm::ISD::UMAX, llvm::UMin, llvm::ISD::UMIN, llvm::ISD::UMULFIX, llvm::ISD::UMULO, llvm::ISD::USUBO, and llvm::ISD::USUBSAT.
Referenced by llvm::BasicTTIImplBase< T >::getIntrinsicInstrCost().
|
inline |
Estimate the cost of type-legalization and the legalized type.
Definition at line 997 of file BasicTTIImpl.h.
References llvm::CallingConv::C, llvm::BasicTTIImplBase< T >::DL, llvm::Type::getContext(), llvm::InstructionCost::getInvalid(), llvm::EVT::getSimpleVT(), llvm::TargetLoweringBase::getTypeConversion(), llvm::TargetLoweringBase::getValueType(), llvm::EVT::isSimple(), llvm::TargetLoweringBase::TypeExpandInteger, llvm::TargetLoweringBase::TypeLegal, llvm::TargetLoweringBase::TypeScalarizeScalableVector, and llvm::TargetLoweringBase::TypeSplitVector.
Referenced by llvm::BasicTTIImplBase< T >::getCastInstrCost(), llvm::BasicTTIImplBase< T >::getInterleavedMemoryOpCost(), llvm::BasicTTIImplBase< T >::getIntrinsicInstrCost(), llvm::BasicTTIImplBase< T >::getNumberOfParts(), and llvm::BasicTTIImplBase< T >::getTypeBasedIntrinsicInstrCost().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 702 of file BasicTTIImpl.h.
References llvm::TargetTransformInfo::UnrollingPreferences::BEInsns, llvm::OptimizationRemarkEmitter::emit(), F, getCalledFunction(), I, llvm::TargetTransformInfoImplBase::isLoweredToCall(), llvm::TargetTransformInfo::UnrollingPreferences::OptSizeThreshold, llvm::TargetTransformInfo::UnrollingPreferences::Partial, llvm::TargetTransformInfo::UnrollingPreferences::PartialOptSizeThreshold, llvm::TargetTransformInfo::UnrollingPreferences::PartialThreshold, llvm::PartialUnrollingThreshold, llvm::TargetTransformInfo::UnrollingPreferences::Runtime, and llvm::TargetTransformInfo::UnrollingPreferences::UpperBound.
Referenced by llvm::ARMTTIImpl::getUnrollingPreferences(), and llvm::RISCVTTIImpl::getUnrollingPreferences().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 1443 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 1423 of file BasicTTIImpl.h.
References llvm::BasicTTIImplBase< T >::getRegUsageForType(), and llvm::Type::getScalarType().
Referenced by llvm::WebAssemblyTTIImpl::getVectorInstrCost().
|
inlineoverridevirtual |
ScalarUserAndIdx | encodes the information about extracts from a vector with 'Scalar' being the value being extracted,'User' being the user of the extract(nullptr if user is not known before vectorization) and 'Idx' being the extract lane. |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 1434 of file BasicTTIImpl.h.
|
inline |
Definition at line 3281 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 880 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 398 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 653 of file BasicTTIImpl.h.
References llvm::BasicTTIImplBase< T >::DL, llvm::ISD::FSQRT, llvm::TargetLoweringBase::getValueType(), llvm::TargetLoweringBase::isOperationLegalOrCustom(), and llvm::TargetLoweringBase::isTypeLegal().
|
inline |
Definition at line 1111 of file BasicTTIImpl.h.
References llvm::all_of(), llvm::FixedVectorType::get(), llvm::VectorType::getElementCount(), llvm::VectorType::getElementType(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getKnownMinValue(), llvm::BasicTTIImplBase< T >::improveShuffleKindFromMask(), Index, llvm::ShuffleVectorInst::isExtractSubvectorMask(), llvm::ShuffleVectorInst::isInsertSubvectorMask(), llvm::ShuffleVectorInst::isReverseMask(), llvm::ShuffleVectorInst::isSelectMask(), llvm::ShuffleVectorInst::isSpliceMask(), llvm::ShuffleVectorInst::isTransposeMask(), llvm::ShuffleVectorInst::isZeroEltSplatMask(), llvm::TargetTransformInfo::SK_Broadcast, llvm::TargetTransformInfo::SK_ExtractSubvector, llvm::TargetTransformInfo::SK_InsertSubvector, llvm::TargetTransformInfo::SK_PermuteSingleSrc, llvm::TargetTransformInfo::SK_PermuteTwoSrc, llvm::TargetTransformInfo::SK_Reverse, llvm::TargetTransformInfo::SK_Select, llvm::TargetTransformInfo::SK_Splice, and llvm::TargetTransformInfo::SK_Transpose.
Referenced by llvm::BasicTTIImplBase< T >::improveShuffleKindFromMask().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 802 of file BasicTTIImpl.h.
References II, and llvm::TargetTransformInfoImplBase::instCombineIntrinsic().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 404 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 660 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 782 of file BasicTTIImpl.h.
References llvm::TargetTransformInfoImplBase::isHardwareLoopProfitable().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 496 of file BasicTTIImpl.h.
References llvm::BasicTTIImplBase< T >::DL, llvm::TargetLoweringBase::getValueType(), and llvm::TargetLoweringBase::isIndexedLoadLegal().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 501 of file BasicTTIImpl.h.
References llvm::BasicTTIImplBase< T >::DL, llvm::TargetLoweringBase::getValueType(), and llvm::TargetLoweringBase::isIndexedStoreLegal().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 447 of file BasicTTIImpl.h.
References llvm::TargetLoweringBase::isLegalAddImmediate().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 459 of file BasicTTIImpl.h.
References llvm::TargetLoweringBase::AddrMode::BaseGV, llvm::TargetLoweringBase::AddrMode::BaseOffs, llvm::BasicTTIImplBase< T >::DL, llvm::TargetLoweringBase::AddrMode::HasBaseReg, I, llvm::TargetLoweringBase::isLegalAddressingMode(), llvm::TargetLoweringBase::AddrMode::ScalableOffset, and llvm::TargetLoweringBase::AddrMode::Scale.
Referenced by llvm::BasicTTIImplBase< T >::getScalingFactorCost().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 451 of file BasicTTIImpl.h.
References llvm::TargetLoweringBase::isLegalAddScalableImmediate().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 455 of file BasicTTIImpl.h.
References llvm::TargetLoweringBase::isLegalICmpImmediate().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 506 of file BasicTTIImpl.h.
References llvm::TargetTransformInfoImplBase::isLSRCostLess().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 424 of file BasicTTIImpl.h.
References llvm::TargetLoweringBase::getTargetMachine(), and llvm::TargetMachine::isNoopAddrSpaceCast().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 511 of file BasicTTIImpl.h.
References llvm::TargetTransformInfoImplBase::isNumRegsMajorCostOfLSR().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 519 of file BasicTTIImpl.h.
References I, and llvm::TargetTransformInfoImplBase::isProfitableLSRChainElement().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 542 of file BasicTTIImpl.h.
References I, and llvm::TargetLoweringBase::isProfitableToHoist().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 432 of file BasicTTIImpl.h.
References llvm::TargetLoweringBase::getTargetMachine(), llvm::TargetMachine::Options, llvm::ThreadModel::Single, and llvm::TargetOptions::ThreadModel.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 402 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 920 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 930 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 925 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 936 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 538 of file BasicTTIImpl.h.
References llvm::TargetLoweringBase::isTruncateFree().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 548 of file BasicTTIImpl.h.
References llvm::BasicTTIImplBase< T >::DL, llvm::TargetLoweringBase::getValueType(), and llvm::TargetLoweringBase::isTypeLegal().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 406 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 883 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 792 of file BasicTTIImpl.h.
References llvm::TargetTransformInfoImplBase::preferPredicateOverEpilogue().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 672 of file BasicTTIImpl.h.
References llvm::BasicTTIImplBase< T >::DL, llvm::Function::getAttributes(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::Value::getType(), llvm::TargetLoweringBase::getValueType(), and llvm::TargetLoweringBase::isIntDivCheap().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 442 of file BasicTTIImpl.h.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 622 of file BasicTTIImpl.h.
References llvm::ISD::BR_JT, llvm::ISD::BRIND, and llvm::TargetLoweringBase::isOperationLegalOrCustom().
|
inlineoverridevirtual |
Relative lookup table entries consist of 32-bit offsets. Do not generate relative lookup tables for large code models in 64-bit achitectures where 32-bit offsets might not be enough.
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 628 of file BasicTTIImpl.h.
References llvm::Triple::aarch64, llvm::Triple::getArch(), llvm::TargetLoweringBase::getTargetMachine(), llvm::Triple::isArch64Bit(), llvm::Triple::isOSDarwin(), llvm::CodeModel::Large, and llvm::CodeModel::Medium.
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 515 of file BasicTTIImpl.h.
References llvm::TargetTransformInfoImplBase::shouldDropLSRSolutionIfLessProfitable().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Reimplemented in llvm::GCNTTIImpl.
Definition at line 865 of file BasicTTIImpl.h.
References llvm::MCSubtargetInfo::shouldPrefetchAddressSpace().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 807 of file BasicTTIImpl.h.
References II, and llvm::TargetTransformInfoImplBase::simplifyDemandedUseBitsIntrinsic().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 814 of file BasicTTIImpl.h.
References II, and llvm::TargetTransformInfoImplBase::simplifyDemandedVectorEltsIntrinsic().
|
inlineoverridevirtual |
Reimplemented from llvm::TargetTransformInfoImplBase.
Definition at line 546 of file BasicTTIImpl.h.
References llvm::TargetSubtargetInfo::useAA().
|
protected |
Definition at line 39 of file TargetTransformInfoImpl.h.
Referenced by llvm::BasicTTIImplBase< T >::getCastInstrCost(), llvm::BasicTTIImplBase< T >::getEstimatedNumberOfCaseClusters(), llvm::BasicTTIImplBase< T >::getFPOpCost(), llvm::BasicTTIImplBase< T >::getIntrinsicInstrCost(), llvm::BasicTTIImplBase< T >::getRegUsageForType(), llvm::BasicTTIImplBase< T >::getScalingFactorCost(), llvm::BasicTTIImplBase< T >::getStoreMinimumVF(), llvm::BasicTTIImplBase< T >::getTypeBasedIntrinsicInstrCost(), llvm::BasicTTIImplBase< T >::getTypeLegalizationCost(), llvm::BasicTTIImplBase< T >::haveFastSqrt(), llvm::BasicTTIImplBase< T >::isIndexedLoadLegal(), llvm::BasicTTIImplBase< T >::isIndexedStoreLegal(), llvm::BasicTTIImplBase< T >::isLegalAddressingMode(), llvm::BasicTTIImplBase< T >::isTypeLegal(), and llvm::BasicTTIImplBase< T >::preferToKeepConstantsAttached().