LLVM 17.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]
Collaboration diagram for llvm::ElementCount:
Collaboration 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 279 of file TypeSize.h.

Constructor & Destructor Documentation

◆ ElementCount()

constexpr llvm::ElementCount::ElementCount ( )
inlineconstexpr

Definition at line 289 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 291 of file TypeSize.h.

References ElementCount().

Referenced by addMappingsFromTLI(), applyDupLane(), areRuntimeChecksProfitable(), llvm::LegalizerHelper::bitcastExtractVectorElt(), bitcastToVectorElement32(), llvm::CastInst::castIsValid(), llvm::LegalizeMutations::changeElementCountTo(), llvm::LegalizeRuleSet::clampMaxNumElements(), llvm::IRBuilderBase::CreateVectorSplat(), llvm::VectorizationFactor::Disabled(), fewerEltsToSize64Vector(), llvm::LLT::fixed_vector(), llvm::FixedVectorType::get(), getBitcastRegisterType(), getCopyToPartsVector(), llvm::getCoverTy(), llvm::ConstantAggregateZero::getElementCount(), llvm::getGCDType(), 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(), getVectorTypeBreakdownMVT(), llvm::TargetLibraryInfoImpl::getWidestVF(), llvm::isTLIScalarize(), llvm::AMDGPULegalizerInfo::legalizeImageIntrinsic(), llvm::LLT::LLT(), llvm::LoopVectorizeHints::LoopVectorizeHints(), mutationIsSane(), numVectorEltsOrZero(), llvm::VPlanTransforms::optimizeInductions(), performVSelectCombine(), llvm::LoopVectorizationPlanner::plan(), llvm::LoopVectorizationPlanner::planInVPlanNativePath(), llvm::LLT::pointer(), replaceWithCallToVeclib(), llvm::LLT::scalar(), llvm::LoopVectorizationCostModel::selectEpilogueVectorizationFactor(), llvm::LoopVectorizationCostModel::selectVectorizationFactor(), llvm::LoopVectorizationCostModel::setCostBasedWideningDecision(), llvm::VectorBuilder::setStaticVL(), splitUnequalType(), llvm::ToVectorTy(), 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

◆ isVector()

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

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