llvm::TypeSize

Synopsis

Declared in <llvm/Support/TypeSize.h>

class TypeSize
    : public details::FixedOrScalableQuantity<TypeSize, uint64_t>

Type Aliases

Name
ScalarTy

Member Functions

NameDescription
TypeSize [constructor]
coefficientNextPowerOf2
divideCoefficientBy 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.
getFixedValue
getKnownMinValue Returns the minimum value this quantity can represent.
getKnownScalarFactor Returns a value X where RHS.multiplyCoefficientBy(X) will result in a value whose quantity matches our own.
getWithIncrement Add RHS to the underlying quantity.
hasKnownScalarFactor Returns true if there exists a value X where RHS.multiplyCoefficientBy(X) will result in a value whose quantity matches our own.
isFixed Returns true if the quantity is not scaled by vscale.
isKnownEven 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.
isKnownMultipleOf isKnownMultipleOf overloads
isNonZero
isScalable Returns whether the quantity is scaled by a runtime quantity (vscale).
isZero
multiplyCoefficientBy
print Printing function.
operator ScalarTy Conversion to ScalarTy
operator bool Conversion to bool
operator== Equality operator
operator!= Inequality operator

Static Member Functions

Name
get
getFixed
getScalable
getZero
isKnownGE
isKnownGT
isKnownLE
isKnownLT

Protected Data Members

Name
Quantity
Scalable

Non-Member Functions

NameDescription
alignToReturns a TypeSize with a known minimum size that is the next integer (mod 2**64) that is greater than or equal to Quantity and is a multiple of Align. Align must be non-zero.
getBaseObjectSizeLike getObjectSize(), but only returns the size of base objects (like allocas, global variables and allocator calls) and std::nullopt otherwise. Requires ExactSizeFromOffset mode.