LLVM 18.0.0git
|
#include "llvm/Support/TypeSize.h"
Public Types | |
using | ScalarTy = ValueTy |
Public Member Functions | |
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 LeafTy | 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 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. | |
constexpr LeafTy | multiplyCoefficientBy (ScalarTy RHS) const |
constexpr LeafTy | 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 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) |
Protected Member Functions | |
constexpr | FixedOrScalableQuantity ()=default |
constexpr | FixedOrScalableQuantity (ScalarTy Quantity, bool Scalable) |
Protected Attributes | |
ScalarTy | Quantity = 0 |
bool | Scalable = false |
Friends | |
constexpr LeafTy & | operator+= (LeafTy &LHS, const LeafTy &RHS) |
constexpr LeafTy & | operator-= (LeafTy &LHS, const LeafTy &RHS) |
constexpr LeafTy & | operator*= (LeafTy &LHS, ScalarTy RHS) |
constexpr LeafTy | operator+ (const LeafTy &LHS, const LeafTy &RHS) |
constexpr LeafTy | operator- (const LeafTy &LHS, const LeafTy &RHS) |
constexpr LeafTy | operator* (const LeafTy &LHS, ScalarTy RHS) |
template<typename U = ScalarTy> | |
constexpr std::enable_if_t< std::is_signed_v< U >, LeafTy > | operator- (const LeafTy &LHS) |
Definition at line 91 of file TypeSize.h.
using llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::ScalarTy = ValueTy |
Definition at line 93 of file TypeSize.h.
|
constexprprotecteddefault |
|
inlineconstexprprotected |
Definition at line 100 of file TypeSize.h.
|
inlineconstexpr |
Definition at line 242 of file TypeSize.h.
References llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getKnownMinValue(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isScalable(), and llvm::NextPowerOf2().
Referenced by llvm::TargetLoweringBase::getTypeConversion(), and llvm::TargetLoweringBase::getVectorTypeBreakdown().
|
inlineconstexpr |
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 234 of file TypeSize.h.
References llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getKnownMinValue(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isScalable(), and RHS.
Referenced by getHalfSizedType(), llvm::TargetLoweringBase::getTypeConversion(), llvm::TargetLoweringBase::getVectorTypeBreakdown(), llvm::AArch64TargetLowering::lowerDeinterleaveIntrinsicToLoad(), llvm::LegalizerHelper::lowerEXT(), and llvm::AArch64TargetLowering::lowerInterleaveIntrinsicToStore().
|
inlineconstexpr |
Definition at line 182 of file TypeSize.h.
References assert(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getKnownMinValue(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isScalable(), and llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isZero().
Referenced by areExtractShuffleVectors(), llvm::slpvectorizer::BoUpSLP::BoUpSLP(), buildCopyFromRegs(), buildFrameDebugInfo(), llvm::ARMTargetLowering::canCombineStoreAndExtract(), llvm::LoopVectorizationCostModel::computeMaxVF(), doInstrumentAddress(), llvm::VPWidenPointerInductionRecipe::execute(), llvm::SelectionDAG::FoldConstantArithmetic(), llvm::InstCombinerImpl::foldGEPICmp(), getAvailableLoadStore(), getBufferRsrcRegisterType(), llvm::TargetTransformInfoImplBase::getCastInstrCost(), getFauxShuffleMask(), llvm::MVT::getFixedSizeInBits(), llvm::EVT::getFixedSizeInBits(), llvm::TargetTransformInfoImplCRTPBase< T >::getGEPCost(), llvm::ARMTTIImpl::getInterleavedMemoryOpCost(), llvm::X86TTIImpl::getLoadStoreVecRegBitWidth(), llvm::RISCVTTIImpl::getMaximumVF(), llvm::AArch64TTIImpl::getMaxNumElements(), llvm::HexagonTTIImpl::getMemoryOpCost(), llvm::getPtrStride(), llvm::MVT::getScalarSizeInBits(), llvm::EVT::getScalarSizeInBits(), llvm::MVT::getScalarStoreSize(), llvm::EVT::getScalarStoreSize(), llvm::DataLayout::getTypeSizeInBits(), getUniformBase(), llvm::SystemZTTIImpl::getVectorTruncCost(), llvm::AArch64TargetLowering::hasAndNot(), llvm::InlineFunction(), isFPIntrinsic(), isKnownNonZeroFromOperator(), llvm::AArch64TTIImpl::isLegalBroadcastLoad(), llvm::X86TTIImpl::isLegalBroadcastLoad(), isLoadInvariantInLoop(), isObjectSizeLessThanOrEq(), llvm::isSafeToLoadUnconditionally(), llvm::SystemZTargetLowering::isTruncateFree(), llvm::AArch64TargetLowering::isTruncateFree(), llvm::MSP430TargetLowering::isTruncateFree(), llvm::VFABI::mangleTLIVectorName(), MatchingStackOffset(), llvm::LoopVectorizationPlanner::planInVPlanNativePath(), llvm::AArch64TargetLowering::ReconstructShuffle(), llvm::SCEVExpander::replaceCongruentIVs(), llvm::TargetLowering::SimplifyDemandedBits(), llvm::TargetLowering::SimplifyDemandedVectorElts(), TypeSizeToSizeIndex(), llvm::UpgradeIntrinsicCall(), UpgradeMaskedLoad(), llvm::LLT::vector(), llvm::InstCombinerImpl::visitGetElementPtrInst(), and widenSubVector().
|
inlineconstexpr |
Returns the minimum value this quantity can represent.
Definition at line 163 of file TypeSize.h.
References llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::Quantity.
Referenced by areRuntimeChecksProfitable(), clampDynamicVectorIndex(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::coefficientNextPowerOf2(), computeKnownBitsFromOperator(), llvm::LoopVectorizationCostModel::computeMaxVF(), llvm::TargetLoweringBase::computeRegisterProperties(), llvm::AArch64TargetLowering::createComplexDeinterleavingIR(), llvm::SelectionDAG::CreateStackTemporary(), llvm::RISCVTargetLowering::decomposeSubvectorInsertExtractToSubRegs(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::divideCoefficientBy(), llvm::InnerLoopVectorizer::emitIterationCountCheck(), llvm::VFRange::end(), llvm::VPReplicateRecipe::execute(), llvm::VPScalarIVStepsRecipe::execute(), llvm::VPRegionBlock::execute(), llvm::TargetLowering::expandVectorSplice(), findMemType(), llvm::InnerLoopVectorizer::fixVectorizedLoop(), llvm::AArch64TargetLowering::functionArgumentNeedsConsecutiveRegisters(), llvm::VPTransformState::get(), llvm::VPLane::getAsRuntimeExpr(), getCopyFromPartsVector(), llvm::SelectionDAG::GetDependentSplitDestVTs(), llvm::LoopVectorizationCostModel::getDivRemSpeculationCost(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getFixedValue(), llvm::DenseMapInfo< ElementCount, void >::getHashValue(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getKnownScalarFactor(), llvm::VPLane::getLastLaneForVF(), llvm::RISCVTargetLowering::getLMUL(), llvm::AArch64TTIImpl::getMaxNumElements(), llvm::AArch64InstrInfo::getMemOperandWithOffsetWidth(), llvm::VPLane::getNumCachedLanes(), llvm::LLT::getNumElements(), llvm::AArch64TargetLowering::getNumInterleavedAccesses(), llvm::InnerLoopVectorizer::getOrCreateVectorTripCount(), llvm::MVT::getPow2VectorType(), llvm::EVT::getPow2VectorType(), llvm::LLT::getSizeInBytes(), llvm::MVT::getStoreSize(), llvm::EVT::getStoreSize(), llvm::DataLayout::getTypeStoreSize(), llvm::LoopVectorizationCostModel::getVectorCallCost(), llvm::EVT::getVectorMinNumElements(), llvm::TargetLoweringBase::getVectorTypeBreakdown(), HasAddressTaken(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::hasKnownScalarFactor(), llvm::TargetLowering::IncrementMemoryAddress(), llvm::isAArch64FrameOffsetLegal(), llvm::CastInst::isBitCastable(), llvm::VFRange::isEmpty(), llvm::LoopVectorizationCostModel::isEpilogueVectorizationProfitable(), isIndvarOverflowCheckKnownFalse(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isKnownEven(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isKnownMultipleOf(), isPackedVectorType(), llvm::LoopVectorizationLegality::isUniform(), isValidEGW(), llvm::RISCVTargetLowering::joinRegisterPartsIntoValue(), llvm::AArch64TargetLowering::lowerDeinterleaveIntrinsicToLoad(), llvm::AArch64TargetLowering::lowerInterleaveIntrinsicToStore(), LowerSVEIntrinsicEXT(), lowerVectorIntrinsicScalars(), llvm::VPLane::mapToCacheIndex(), llvm::MemSDNode::MemSDNode(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::multiplyCoefficientBy(), llvm::VPlanTransforms::optimizeForVFAndUF(), performGatherLoadCombine(), performLastTrueTestVectorCombine(), performLD1Combine(), performScatterStoreCombine(), llvm::LoopVectorizationPlanner::plan(), llvm::LoopVectorizationPlanner::planInVPlanNativePath(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::print(), llvm::LoopVectorizationPlanner::selectEpilogueVectorizationFactor(), llvm::LoopVectorizationCostModel::selectInterleaveCount(), llvm::FunctionLoweringInfo::set(), llvm::LoopVectorizationCostModel::setCostBasedWideningDecision(), llvm::VPTransformState::setDebugLocFrom(), simplifyShuffleVectorInst(), llvm::RISCVTargetLowering::splitValueIntoRegisterParts(), llvm::InnerLoopVectorizer::vectorizeInterleaveGroup(), llvm::VFRange::VFRange(), llvm::InstCombinerImpl::visitAllocaInst(), and llvm::ObjectSizeOffsetVisitor::visitAllocaInst().
|
inlineconstexpr |
Returns a value X where RHS.multiplyCoefficientBy(X) will result in a value whose quantity matches our own.
Definition at line 259 of file TypeSize.h.
References assert(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getKnownMinValue(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::hasKnownScalarFactor(), and RHS.
|
inlineconstexpr |
Add RHS
to the underlying quantity.
Definition at line 158 of file TypeSize.h.
References llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::Quantity, RHS, and llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::Scalable.
|
inlineconstexpr |
Returns true if there exists a value X where RHS.multiplyCoefficientBy(X) will result in a value whose quantity matches our own.
Definition at line 251 of file TypeSize.h.
References llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getKnownMinValue(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isScalable(), and RHS.
Referenced by llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getKnownScalarFactor().
|
inlineconstexpr |
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 171 of file TypeSize.h.
References llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getKnownMinValue().
Referenced by llvm::SelectionDAG::SplitEVL().
|
inlinestaticconstexpr |
Definition at line 219 of file TypeSize.h.
|
inlinestaticconstexpr |
Definition at line 205 of file TypeSize.h.
|
inlinestaticconstexpr |
Definition at line 212 of file TypeSize.h.
|
inlinestaticconstexpr |
Definition at line 198 of file TypeSize.h.
|
inlineconstexpr |
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 175 of file TypeSize.h.
References llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getKnownMinValue(), and RHS.
Referenced by getHalfSizedType(), llvm::LLT::isByteSized(), llvm::MVT::isByteSized(), llvm::EVT::isByteSized(), isSupportedAccessType(), and promoteAllocaUserToVector().
|
inlineconstexpr |
Definition at line 153 of file TypeSize.h.
References llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::Quantity.
Referenced by llvm::LoopVectorizationCostModel::computeMaxVF(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::operator bool(), and replaceWithCallToVeclib().
|
inlineconstexpr |
Returns whether the quantity is scaled by a runtime quantity (vscale).
Definition at line 166 of file TypeSize.h.
References llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::Scalable.
Referenced by areRuntimeChecksProfitable(), clampDynamicVectorIndex(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::coefficientNextPowerOf2(), llvm::LoopVectorizationCostModel::collectInstsToScalarize(), computeKnownBitsFromOperator(), llvm::ComputeValueVTs(), llvm::SelectionDAG::CreateStackTemporary(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::divideCoefficientBy(), doInstrumentAddress(), llvm::InnerLoopVectorizer::emitIterationCountCheck(), llvm::VPWidenPointerInductionRecipe::execute(), llvm::VPReplicateRecipe::execute(), llvm::VPWidenMemoryInstructionRecipe::execute(), llvm::VPScalarIVStepsRecipe::execute(), llvm::VPRegionBlock::execute(), llvm::FixedScalableVFPair::FixedScalableVFPair(), llvm::SelectionDAG::FoldConstantArithmetic(), llvm::AArch64TargetLowering::functionArgumentNeedsConsecutiveRegisters(), llvm::VPTransformState::get(), getAssignmentInfoImpl(), getAvailableLoadStore(), llvm::TargetTransformInfoImplBase::getCastInstrCost(), getCopyFromPartsVector(), llvm::SelectionDAG::GetDependentSplitDestVTs(), llvm::LoopVectorizationCostModel::getDivRemSpeculationCost(), llvm::StructLayout::getElementContainingOffset(), getElementIndex(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getFixedValue(), llvm::DenseMapInfo< ElementCount, void >::getHashValue(), llvm::BasicTTIImplBase< T >::getIntrinsicInstrCost(), llvm::VPLane::getLastLaneForVF(), llvm::RISCVTTIImpl::getMaxInterleaveFactor(), llvm::AArch64TTIImpl::getMaxNumElements(), llvm::AArch64InstrInfo::getMemOperandWithOffsetWidth(), llvm::VPLane::getNumCachedLanes(), llvm::ScalarEvolution::getOffsetOfExpr(), llvm::MVT::getPow2VectorType(), llvm::EVT::getPow2VectorType(), llvm::LLT::getSizeInBytes(), llvm::MVT::getStoreSize(), llvm::EVT::getStoreSize(), llvm::TargetLoweringBase::getTypeConversion(), getTypePartition(), llvm::DataLayout::getTypeStoreSize(), getUniformBase(), llvm::LoopVectorizationCostModel::getVectorCallCost(), llvm::TargetLoweringBase::getVectorTypeBreakdown(), llvm::AArch64TargetLowering::hasAndNot(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::hasKnownScalarFactor(), llvm::InlineFunction(), llvm::isAArch64FrameOffsetLegal(), llvm::LoopVectorizationCostModel::isEpilogueVectorizationProfitable(), isIndvarOverflowCheckKnownFalse(), llvm::AArch64TTIImpl::isLegalBroadcastLoad(), llvm::X86TTIImpl::isLegalBroadcastLoad(), llvm::AArch64TTIImpl::isLegalToVectorizeReduction(), llvm::RISCVTTIImpl::isLegalToVectorizeReduction(), isLoadInvariantInLoop(), isObjectSizeLessThanOrEq(), llvm::isSafeToLoadUnconditionally(), llvm::LoopVectorizationLegality::isUniform(), llvm::VFABI::mangleTLIVectorName(), llvm::VPLane::mapToCacheIndex(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::multiplyCoefficientBy(), llvm::VPWidenPointerInductionRecipe::onlyScalarsGenerated(), llvm::LoopVectorizationPlanner::plan(), llvm::LoopVectorizationPlanner::planInVPlanNativePath(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::print(), replaceWithCallToVeclib(), llvm::LoopVectorizationPlanner::selectEpilogueVectorizationFactor(), llvm::LoopVectorizationCostModel::setCostBasedWideningDecision(), llvm::TargetLowering::SimplifyDemandedBits(), llvm::TargetLowering::SimplifyDemandedVectorElts(), simplifyShuffleVectorInst(), TypeSizeToSizeIndex(), llvm::InnerLoopVectorizer::vectorizeInterleaveGroup(), llvm::VFRange::VFRange(), llvm::ObjectSizeOffsetVisitor::visitAllocaInst(), and widenVectorToPartType().
|
inlineconstexpr |
Definition at line 151 of file TypeSize.h.
References llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::Quantity.
Referenced by llvm::LoopVectorizationCostModel::collectInstsToScalarize(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getFixedValue(), llvm::InnerLoopVectorizer::InnerLoopVectorizer(), isGEPKnownNonNull(), llvm::isTLIScalarize(), llvm::EVT::isZeroSized(), llvm::SPIRVCallLowering::lowerCall(), llvm::LoopVectorizationPlanner::plan(), llvm::LoopVectorizationPlanner::planInVPlanNativePath(), llvm::IRTranslator::runOnMachineFunction(), and llvm::InstCombinerImpl::visitGetElementPtrInst().
|
inlineconstexpr |
Definition at line 238 of file TypeSize.h.
References llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getKnownMinValue(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isScalable(), and RHS.
Referenced by llvm::createStepForVF(), and getWideningInterleave().
|
inlineexplicit |
Definition at line 155 of file TypeSize.h.
References llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isNonZero().
|
inlineconstexpr |
Definition at line 147 of file TypeSize.h.
References llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::Quantity, RHS, and llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::Scalable.
|
inlineconstexpr |
Definition at line 143 of file TypeSize.h.
References llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::Quantity, RHS, and llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::Scalable.
|
inline |
Printing function.
Definition at line 265 of file TypeSize.h.
References llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getKnownMinValue(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isScalable(), and OS.
Referenced by llvm::operator<<().
|
friend |
Definition at line 130 of file TypeSize.h.
|
friend |
Definition at line 115 of file TypeSize.h.
|
friend |
Definition at line 120 of file TypeSize.h.
|
friend |
Definition at line 103 of file TypeSize.h.
|
friend |
Definition at line 137 of file TypeSize.h.
|
friend |
Definition at line 125 of file TypeSize.h.
|
friend |
Definition at line 109 of file TypeSize.h.
|
protected |
Definition at line 96 of file TypeSize.h.
Referenced by llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getKnownMinValue(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getWithIncrement(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isNonZero(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isZero(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::operator!=(), and llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::operator==().
|
protected |
Definition at line 97 of file TypeSize.h.
Referenced by llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getWithIncrement(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isScalable(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::operator!=(), and llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::operator==().