LLVM 19.0.0git
Public Member Functions | Static Public Member Functions | List of all members
llvm::ElementCount Class Reference

#include "llvm/Support/TypeSize.h"

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

Public Member Functions

constexpr ElementCount ()
 
constexpr bool isScalar () const
 Exactly one element.
 
constexpr bool isVector () const
 One or more elements.
 
- Public Member Functions inherited from llvm::details::FixedOrScalableQuantity< ElementCount, unsigned >
constexpr bool operator== (const FixedOrScalableQuantity &RHS) const
 
constexpr bool operator!= (const FixedOrScalableQuantity &RHS) const
 
constexpr bool isZero () const
 
constexpr bool isNonZero () const
 
 operator bool () const
 
constexpr ElementCount getWithIncrement (ScalarTy RHS) const
 Add RHS to the underlying quantity.
 
constexpr ScalarTy getKnownMinValue () const
 Returns the minimum value this quantity can represent.
 
constexpr bool isScalable () const
 Returns whether the quantity is scaled by a runtime quantity (vscale).
 
constexpr bool isKnownEven () const
 A return value of true indicates we know at compile time that the number of elements (vscale * Min) is definitely even.
 
constexpr bool isKnownMultipleOf (ScalarTy RHS) const
 This function tells the caller whether the element count is known at compile time to be a multiple of the scalar value RHS.
 
constexpr ScalarTy getFixedValue () const
 
constexpr ElementCount divideCoefficientBy (ScalarTy RHS) const
 We do not provide the '/' operator here because division for polynomial types does not work in the same way as for normal integer types.
 
constexpr ElementCount multiplyCoefficientBy (ScalarTy RHS) const
 
constexpr ElementCount coefficientNextPowerOf2 () const
 
constexpr bool hasKnownScalarFactor (const FixedOrScalableQuantity &RHS) const
 Returns true if there exists a value X where RHS.multiplyCoefficientBy(X) will result in a value whose quantity matches our own.
 
constexpr ScalarTy getKnownScalarFactor (const FixedOrScalableQuantity &RHS) const
 Returns a value X where RHS.multiplyCoefficientBy(X) will result in a value whose quantity matches our own.
 
void print (raw_ostream &OS) const
 Printing function.
 

Static Public Member Functions

static constexpr ElementCount getFixed (ScalarTy MinVal)
 
static constexpr ElementCount getScalable (ScalarTy MinVal)
 
static constexpr ElementCount get (ScalarTy MinVal, bool Scalable)
 
- Static Public Member Functions inherited from llvm::details::FixedOrScalableQuantity< ElementCount, unsigned >
static constexpr bool isKnownLT (const FixedOrScalableQuantity &LHS, const FixedOrScalableQuantity &RHS)
 
static constexpr bool isKnownGT (const FixedOrScalableQuantity &LHS, const FixedOrScalableQuantity &RHS)
 
static constexpr bool isKnownLE (const FixedOrScalableQuantity &LHS, const FixedOrScalableQuantity &RHS)
 
static constexpr bool isKnownGE (const FixedOrScalableQuantity &LHS, const FixedOrScalableQuantity &RHS)
 

Additional Inherited Members

- Public Types inherited from llvm::details::FixedOrScalableQuantity< ElementCount, unsigned >
using ScalarTy = unsigned
 
- Protected Member Functions inherited from llvm::details::FixedOrScalableQuantity< ElementCount, unsigned >
constexpr FixedOrScalableQuantity ()=default
 
constexpr FixedOrScalableQuantity (ScalarTy Quantity, bool Scalable)
 
- Protected Attributes inherited from llvm::details::FixedOrScalableQuantity< ElementCount, unsigned >
ScalarTy Quantity
 
bool Scalable
 

Detailed Description

Definition at line 284 of file TypeSize.h.

Constructor & Destructor Documentation

◆ ElementCount()

constexpr llvm::ElementCount::ElementCount ( )
inlineconstexpr

Definition at line 294 of file TypeSize.h.

Referenced by get(), getFixed(), and getScalable().

Member Function Documentation

◆ get()

static constexpr ElementCount llvm::ElementCount::get ( ScalarTy  MinVal,
bool  Scalable 
)
inlinestaticconstexpr

◆ getFixed()

static constexpr ElementCount llvm::ElementCount::getFixed ( ScalarTy  MinVal)
inlinestaticconstexpr

Definition at line 296 of file TypeSize.h.

References ElementCount().

Referenced by addMappingsFromTLI(), areRuntimeChecksProfitable(), llvm::LegalizerHelper::bitcastExtractVectorElt(), bitcastToVectorElement32(), llvm::LoopVectorizationCostModel::calculateRegisterUsage(), llvm::CastInst::castIsValid(), llvm::LegalizeMutations::changeElementCountTo(), llvm::LegalizeRuleSet::clampMaxNumElements(), llvm::IRBuilderBase::CreateVectorSplat(), llvm::VectorizationFactor::Disabled(), expandAbs(), expandAnyIntrinsic(), expandExpIntrinsic(), expandLogIntrinsic(), expandRcpIntrinsic(), fewerEltsToSize64Vector(), llvm::LLT::fixed_vector(), llvm::slpvectorizer::BoUpSLP::ShuffleCostEstimator::gather(), llvm::FixedVectorType::get(), getBitcastRegisterType(), getCopyToPartsVector(), llvm::getCoverTy(), llvm::ConstantAggregateZero::getElementCount(), llvm::ConstantExpr::getGetElementPtr(), llvm::BasicTTIImplBase< T >::getIntrinsicInstrCost(), llvm::HexagonTTIImpl::getMinimumVF(), getNarrowTypeBreakDown(), getPow2VectorType(), llvm::ConstantDataVector::getRaw(), llvm::VFShape::getScalarShape(), llvm::slpvectorizer::BoUpSLP::LookAheadHeuristics::getShallowScore(), llvm::AArch64TTIImpl::getShuffleCost(), llvm::ConstantDataVector::getSplat(), llvm::DenseMapInfo< ElementCount, void >::getTombstoneKey(), getVectorCallCosts(), llvm::TargetLoweringBase::getVectorTypeBreakdown(), llvm::AArch64TargetLowering::getVectorTypeBreakdownForCallingConv(), getVectorTypeBreakdownMVT(), llvm::TargetLibraryInfoImpl::getWidestVF(), llvm::isTLIScalarize(), legalizeAndOptimizeInductions(), llvm::AMDGPULegalizerInfo::legalizeImageIntrinsic(), llvm::LLT::LLT(), llvm::LoopVectorizeHints::LoopVectorizeHints(), mutationIsSane(), numVectorEltsOrZero(), performVSelectCombine(), llvm::LoopVectorizationPlanner::plan(), llvm::LoopVectorizationPlanner::planInVPlanNativePath(), llvm::LLT::pointer(), replaceWithCallToVeclib(), llvm::LoopVectorizePass::runImpl(), llvm::LLT::scalar(), llvm::LoopVectorizationPlanner::selectEpilogueVectorizationFactor(), llvm::LoopVectorizationCostModel::setCostBasedWideningDecision(), llvm::VectorBuilder::setStaticVL(), splitUnequalType(), llvm::LLT::token(), llvm::ToVectorTy(), llvm::VFABI::tryDemangleForVFABI(), llvm::LegalizationArtifactCombiner::tryFoldUnmergeCast(), llvm::LoopVectorizeHints::vectorizeAnalysisPassName(), and widenToNextPowerOf2().

◆ getScalable()

static constexpr ElementCount llvm::ElementCount::getScalable ( ScalarTy  MinVal)
inlinestaticconstexpr

◆ isScalar()

constexpr bool llvm::ElementCount::isScalar ( ) const
inlineconstexpr

Exactly one element.

Definition at line 307 of file TypeSize.h.

References llvm::details::FixedOrScalableQuantity< ElementCount, unsigned >::getKnownMinValue(), and llvm::details::FixedOrScalableQuantity< ElementCount, unsigned >::isScalable().

Referenced by areRuntimeChecksProfitable(), llvm::LoopVectorizationCostModel::collectInstsToScalarize(), llvm::LoopVectorizationCostModel::collectUniformsAndScalars(), llvm::VPInstruction::execute(), llvm::VPWidenGEPRecipe::execute(), llvm::VPFirstOrderRecurrencePHIRecipe::execute(), llvm::VPReductionPHIRecipe::execute(), llvm::VPReductionRecipe::execute(), llvm::VPWidenCanonicalIVRecipe::execute(), llvm::LoopVectorizationCostModel::expectedCost(), llvm::VPTransformState::get(), llvm::LoopVectorizationCostModel::getCallWideningDecision(), getCopyToPartsVector(), llvm::BasicTTIImplBase< T >::getIntrinsicInstrCost(), llvm::GCNTTIImpl::getMaxInterleaveFactor(), llvm::R600TTIImpl::getMaxInterleaveFactor(), llvm::RISCVTTIImpl::getMaxInterleaveFactor(), llvm::X86TTIImpl::getMaxInterleaveFactor(), llvm::AArch64TargetLowering::getNumRegistersForCallingConv(), llvm::TargetLoweringBase::getPreferredVectorAction(), llvm::AArch64TargetLowering::getRegisterTypeForCallingConv(), llvm::TargetLoweringBase::getTypeConversion(), llvm::LoopVectorizationCostModel::getVectorCallCost(), llvm::TargetLoweringBase::getVectorTypeBreakdown(), llvm::LoopVectorizationCostModel::isScalarAfterVectorization(), llvm::LoopVectorizationCostModel::isScalarWithPredication(), llvm::LoopVectorizationLegality::isUniform(), llvm::LoopVectorizationCostModel::isUniformAfterVectorization(), MaybeVectorizeType(), llvm::LoopVectorizationPlanner::plan(), llvm::LoopVectorizationPlanner::planInVPlanNativePath(), llvm::LoopVectorizePass::processLoop(), llvm::LoopVectorizationCostModel::selectInterleaveCount(), llvm::VPTransformState::set(), llvm::LoopVectorizationCostModel::setCallWideningDecision(), llvm::LoopVectorizationCostModel::setCostBasedWideningDecision(), llvm::LoopVectorizationCostModel::setVectorizedCallDecision(), and llvm::VPRecipeBuilder::tryToCreateWidenRecipe().

◆ isVector()

constexpr bool llvm::ElementCount::isVector ( ) const
inlineconstexpr

One or more elements.

Definition at line 311 of file TypeSize.h.

References llvm::details::FixedOrScalableQuantity< ElementCount, unsigned >::getKnownMinValue(), and llvm::details::FixedOrScalableQuantity< ElementCount, unsigned >::isScalable().

Referenced by llvm::LoopVectorizationCostModel::calculateRegisterUsage(), llvm::LoopVectorizationCostModel::canTruncateToMinimalBitwidth(), llvm::InnerLoopVectorizer::completeLoopSkeleton(), llvm::EpilogueVectorizerEpilogueLoop::createEpilogueVectorizedLoopSkeleton(), llvm::InnerLoopVectorizer::createVectorLoopSkeleton(), llvm::InnerLoopVectorizer::emitIterationCountCheck(), llvm::EpilogueVectorizerMainLoop::emitIterationCountCheck(), llvm::EpilogueVectorizerEpilogueLoop::emitMinimumVectorEpilogueIterCountCheck(), llvm::InnerLoopVectorizer::emitSCEVChecks(), llvm::VPWidenCastRecipe::execute(), llvm::VPWidenCallRecipe::execute(), llvm::VPWidenGEPRecipe::execute(), llvm::VPWidenIntOrFpInductionRecipe::execute(), llvm::VPFirstOrderRecurrencePHIRecipe::execute(), llvm::VPReductionRecipe::execute(), llvm::VPReplicateRecipe::execute(), llvm::VPWidenCanonicalIVRecipe::execute(), llvm::LoopVectorizationCostModel::expectedCost(), llvm::InnerLoopVectorizer::fixFixedOrderRecurrence(), llvm::InnerLoopVectorizer::fixVectorizedLoop(), llvm::BasicTTIImplBase< T >::getIntrinsicInstrCost(), llvm::InnerLoopVectorizer::getOrCreateVectorTripCount(), getStepVector(), llvm::LoopVectorizationCostModel::getWideningCost(), llvm::LoopVectorizationCostModel::getWideningDecision(), llvm::FixedScalableVFPair::hasVector(), llvm::LoopVectorizationCostModel::isLegalGatherOrScatter(), llvm::LoopVectorizationCostModel::isProfitableToScalarize(), llvm::LoopVectorizationCostModel::isScalarWithPredication(), llvm::LoopVectorizationPlanner::plan(), llvm::LoopVectorizePass::processLoop(), llvm::LoopVectorizationCostModel::selectInterleaveCount(), and llvm::LoopVectorizationCostModel::setWideningDecision().


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