LLVM
15.0.0git
|
LinearPolySize is a base class to represent sizes. More...
#include "llvm/Support/TypeSize.h"
Public Types | |
enum | Dims : unsigned { FixedDim = 0, ScalableDim = 1 } |
using | ScalarTy = typename UnivariateLinearPolyBase< LeafTy >::ScalarTy |
![]() | |
using | ScalarTy = typename LinearPolyBaseTypeTraits< LeafTy >::ScalarTy |
Public Member Functions | |
ScalarTy | getKnownMinValue () const |
Returns the minimum value this size can represent. More... | |
bool | isScalable () const |
Returns whether the size is scaled by a runtime quantity (vscale). More... | |
bool | isKnownEven () const |
A return value of true indicates we know at compile time that the number of elements (vscale * Min) is definitely even. More... | |
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. More... | |
ScalarTy | getFixedValue () const |
LeafTy | 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. More... | |
LeafTy | multiplyCoefficientBy (ScalarTy RHS) const |
LeafTy | coefficientNextPowerOf2 () const |
bool | hasKnownScalarFactor (const LinearPolySize &RHS) const |
Returns true if there exists a value X where RHS.multiplyCoefficientBy(X) will result in a value whose size matches our own. More... | |
ScalarTy | getKnownScalarFactor (const LinearPolySize &RHS) const |
Returns a value X where RHS.multiplyCoefficientBy(X) will result in a value whose size matches our own. More... | |
void | print (raw_ostream &OS) const |
Printing function. More... | |
![]() | |
bool | operator== (const UnivariateLinearPolyBase &RHS) const |
bool | operator!= (const UnivariateLinearPolyBase &RHS) const |
bool | isZero () const |
bool | isNonZero () const |
operator bool () const | |
ScalarTy | getValue (unsigned Dim) const |
LeafTy | getWithIncrement (ScalarTy RHS) const |
Add RHS to the value at the univariate dimension. More... | |
LeafTy | getWithDecrement (ScalarTy RHS) const |
Subtract RHS from the value at the univariate dimension. More... | |
Static Public Member Functions | |
static LeafTy | getFixed (ScalarTy MinVal) |
static LeafTy | getScalable (ScalarTy MinVal) |
static LeafTy | get (ScalarTy MinVal, bool Scalable) |
static LeafTy | getNull () |
static bool | isKnownLT (const LinearPolySize &LHS, const LinearPolySize &RHS) |
static bool | isKnownGT (const LinearPolySize &LHS, const LinearPolySize &RHS) |
static bool | isKnownLE (const LinearPolySize &LHS, const LinearPolySize &RHS) |
static bool | isKnownGE (const LinearPolySize &LHS, const LinearPolySize &RHS) |
Protected Member Functions | |
LinearPolySize (ScalarTy MinVal, Dims D) | |
LinearPolySize (const UnivariateLinearPolyBase< LeafTy > &V) | |
![]() | |
UnivariateLinearPolyBase (ScalarTy Val, unsigned UnivariateDim) | |
Friends | |
class | UnivariateLinearPolyBase< LeafTy > |
Additional Inherited Members | |
![]() | |
static constexpr auto | Dimensions = LinearPolyBaseTypeTraits<LeafTy>::Dimensions |
![]() | |
ScalarTy | Value |
unsigned | UnivariateDim |
LinearPolySize is a base class to represent sizes.
It is either fixed-sized or it is scalable-sized, but it cannot be both.
Definition at line 264 of file TypeSize.h.
using llvm::LinearPolySize< LeafTy >::ScalarTy = typename UnivariateLinearPolyBase<LeafTy>::ScalarTy |
Definition at line 271 of file TypeSize.h.
enum llvm::LinearPolySize::Dims : unsigned |
Enumerator | |
---|---|
FixedDim | |
ScalableDim |
Definition at line 272 of file TypeSize.h.
|
inlineprotected |
Definition at line 275 of file TypeSize.h.
Referenced by llvm::LinearPolySize< TypeSize >::get(), llvm::LinearPolySize< TypeSize >::getFixed(), and llvm::LinearPolySize< TypeSize >::getScalable().
|
inlineprotected |
Definition at line 278 of file TypeSize.h.
|
inline |
Definition at line 370 of file TypeSize.h.
Referenced by llvm::TargetLoweringBase::getVectorTypeBreakdown().
|
inline |
We do not provide the '/' operator here because division for polynomial types does not work in the same way as for normal integer types.
We can only divide the minimum value (or coefficient) by RHS, which is not the same as (Min * Vscale) / RHS The caller is recommended to use this function in combination with isKnownMultipleOf(RHS), which lets the caller know if it's possible to perform a lossless divide by RHS.
Definition at line 360 of file TypeSize.h.
Referenced by llvm::LegalizerHelper::fewerElementsVectorShuffle(), getHalfSizedType(), and llvm::TargetLoweringBase::getVectorTypeBreakdown().
|
inlinestatic |
|
inlinestatic |
Definition at line 283 of file TypeSize.h.
|
inline |
Definition at line 312 of file TypeSize.h.
Referenced by llvm::LoopVectorizationCostModel::computeMaxVF(), llvm::VPWidenPointerInductionRecipe::execute(), llvm::SelectionDAG::FoldConstantArithmetic(), llvm::AArch64TTIImpl::getMaxNumElements(), llvm::AArch64TargetLowering::hasAndNot(), llvm::X86TTIImpl::isLegalBroadcastLoad(), llvm::AArch64TTIImpl::isLegalBroadcastLoad(), llvm::VFABI::mangleTLIVectorName(), llvm::AArch64TargetLowering::ReconstructShuffle(), llvm::LoopVectorizationCostModel::selectVectorizationFactor(), llvm::TargetLowering::SimplifyDemandedBits(), and llvm::TargetLowering::SimplifyDemandedVectorElts().
|
inline |
Returns the minimum value this size can represent.
Definition at line 296 of file TypeSize.h.
Referenced by buildScalarSteps(), clampDynamicVectorIndex(), llvm::LinearPolySize< TypeSize >::coefficientNextPowerOf2(), llvm::TargetLoweringBase::computeRegisterProperties(), llvm::createStepForVF(), llvm::RISCVTargetLowering::decomposeSubvectorInsertExtractToSubRegs(), llvm::LinearPolySize< TypeSize >::divideCoefficientBy(), llvm::VPReplicateRecipe::execute(), foldCastShuffle(), llvm::VPTransformState::get(), llvm::VPLane::getAsRuntimeExpr(), getCopyFromPartsVector(), llvm::SelectionDAG::GetDependentSplitDestVTs(), llvm::LinearPolySize< TypeSize >::getFixedValue(), llvm::RISCVTTIImpl::getGatherScatterOpCost(), llvm::DenseMapInfo< ElementCount, void >::getHashValue(), llvm::LinearPolySize< TypeSize >::getKnownScalarFactor(), llvm::VPLane::getLastLaneForVF(), llvm::RISCVTargetLowering::getLMUL(), llvm::AArch64TTIImpl::getMaxNumElements(), llvm::VPLane::getNumCachedLanes(), llvm::LLT::getNumElements(), llvm::InnerLoopVectorizer::getOrCreateVectorTripCount(), llvm::EVT::getPow2VectorType(), llvm::MVT::getPow2VectorType(), llvm::getRuntimeVF(), llvm::LoopVectorizationCostModel::getVectorCallCost(), llvm::EVT::getVectorMinNumElements(), llvm::TargetLoweringBase::getVectorTypeBreakdown(), llvm::LinearPolySize< TypeSize >::hasKnownScalarFactor(), instCombineSVETBL(), llvm::VFRange::isEmpty(), llvm::LinearPolySize< TypeSize >::isKnownEven(), llvm::LinearPolySize< TypeSize >::isKnownMultipleOf(), lowerVectorIntrinsicScalars(), llvm::VPLane::mapToCacheIndex(), llvm::LinearPolySize< TypeSize >::multiplyCoefficientBy(), llvm::AArch64TargetLowering::PerformDAGCombine(), performLastTrueTestVectorCombine(), llvm::LoopVectorizationPlanner::plan(), llvm::LoopVectorizationPlanner::planInVPlanNativePath(), llvm::VPlan::prepareToExecute(), llvm::LinearPolySize< TypeSize >::print(), llvm::LoopVectorizationCostModel::selectEpilogueVectorizationFactor(), llvm::LoopVectorizationCostModel::selectInterleaveCount(), llvm::LoopVectorizationCostModel::selectVectorizationFactor(), llvm::LoopVectorizationCostModel::setCostBasedWideningDecision(), llvm::InnerLoopVectorizer::setDebugLocFromInst(), simplifyShuffleVectorInst(), llvm::InnerLoopVectorizer::vectorizeInterleaveGroup(), llvm::VFRange::VFRange(), and llvm::InnerLoopVectorizer::widenCallInstruction().
|
inline |
Returns a value X where RHS.multiplyCoefficientBy(X) will result in a value whose size matches our own.
Definition at line 385 of file TypeSize.h.
|
inlinestatic |
Definition at line 293 of file TypeSize.h.
|
inlinestatic |
Definition at line 286 of file TypeSize.h.
|
inline |
Returns true if there exists a value X where RHS.multiplyCoefficientBy(X) will result in a value whose size matches our own.
Definition at line 378 of file TypeSize.h.
Referenced by llvm::LinearPolySize< TypeSize >::getKnownScalarFactor().
|
inline |
A return value of true indicates we know at compile time that the number of elements (vscale * Min) is definitely even.
However, returning false does not guarantee that the total number of elements is odd.
Definition at line 302 of file TypeSize.h.
Referenced by llvm::SelectionDAG::SplitEVL().
|
inlinestatic |
Definition at line 346 of file TypeSize.h.
|
inlinestatic |
Definition at line 334 of file TypeSize.h.
|
inlinestatic |
Definition at line 340 of file TypeSize.h.
|
inlinestatic |
Definition at line 328 of file TypeSize.h.
|
inline |
This function tells the caller whether the element count is known at compile time to be a multiple of the scalar value RHS.
Definition at line 305 of file TypeSize.h.
Referenced by getHalfSizedType(), llvm::EVT::isByteSized(), llvm::LLT::isByteSized(), and llvm::MVT::isByteSized().
|
inline |
Returns whether the size is scaled by a runtime quantity (vscale).
Definition at line 298 of file TypeSize.h.
Referenced by buildScalarSteps(), clampDynamicVectorIndex(), llvm::LinearPolySize< TypeSize >::coefficientNextPowerOf2(), llvm::LoopVectorizationCostModel::collectInstsToScalarize(), computeKnownBitsFromOperator(), llvm::SelectionDAG::CreateStackTemporary(), llvm::createStepForVF(), llvm::LinearPolySize< TypeSize >::divideCoefficientBy(), llvm::InnerLoopVectorizer::emitIterationCountCheck(), llvm::VPWidenPointerInductionRecipe::execute(), llvm::VPReplicateRecipe::execute(), llvm::VPScalarIVStepsRecipe::execute(), llvm::FixedScalableVFPair::FixedScalableVFPair(), llvm::SelectionDAG::FoldConstantArithmetic(), llvm::AArch64TargetLowering::functionArgumentNeedsConsecutiveRegisters(), llvm::VPTransformState::get(), llvm::TargetTransformInfoImplBase::getCastInstrCost(), getCopyFromPartsVector(), llvm::SelectionDAG::GetDependentSplitDestVTs(), getElementIndex(), llvm::LinearPolySize< TypeSize >::getFixedValue(), llvm::DenseMapInfo< ElementCount, void >::getHashValue(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getIntrinsicInstrCost(), llvm::VPLane::getLastLaneForVF(), llvm::AArch64TTIImpl::getMaxNumElements(), llvm::AArch64InstrInfo::getMemOperandWithOffsetWidth(), llvm::VPLane::getNumCachedLanes(), llvm::EVT::getPow2VectorType(), llvm::MVT::getPow2VectorType(), llvm::Type::getPrimitiveSizeInBits(), llvm::getRuntimeVF(), llvm::LLT::getSizeInBytes(), llvm::EVT::getStoreSize(), llvm::MVT::getStoreSize(), llvm::DataLayout::getTypeStoreSize(), llvm::TargetLoweringBase::getVectorTypeBreakdown(), llvm::VPRecipeBuilder::handleReplication(), llvm::AArch64TargetLowering::hasAndNot(), llvm::LinearPolySize< TypeSize >::hasKnownScalarFactor(), llvm::InlineFunction(), llvm::isAArch64FrameOffsetLegal(), llvm::InductionDescriptor::isInductionPHI(), llvm::X86TTIImpl::isLegalBroadcastLoad(), llvm::AArch64TTIImpl::isLegalBroadcastLoad(), llvm::RISCVTTIImpl::isLegalToVectorizeReduction(), llvm::AArch64TTIImpl::isLegalToVectorizeReduction(), isLoadInvariantInLoop(), llvm::VFABI::mangleTLIVectorName(), llvm::VPLane::mapToCacheIndex(), llvm::LinearPolySize< TypeSize >::multiplyCoefficientBy(), llvm::VPWidenPointerInductionRecipe::onlyScalarsGenerated(), llvm::LoopVectorizationPlanner::plan(), llvm::LoopVectorizationPlanner::planInVPlanNativePath(), llvm::LinearPolySize< TypeSize >::print(), replaceWithCallToVeclib(), llvm::LoopVectorizationCostModel::selectEpilogueVectorizationFactor(), llvm::LoopVectorizationCostModel::selectVectorizationFactor(), llvm::LoopVectorizationCostModel::setCostBasedWideningDecision(), llvm::TargetLowering::SimplifyDemandedBits(), llvm::TargetLowering::SimplifyDemandedVectorElts(), simplifyShuffleVectorInst(), valueCoversEntireFragment(), llvm::InnerLoopVectorizer::vectorizeInterleaveGroup(), llvm::VFRange::VFRange(), llvm::ObjectSizeOffsetVisitor::visitAllocaInst(), and widenVectorToPartType().
|
inline |
Definition at line 365 of file TypeSize.h.
|
inline |
|
friend |
Definition at line 268 of file TypeSize.h.