14#ifndef LLVM_ABI_TYPES_H
15#define LLVM_ABI_TYPES_H
49 TypeSize StoreSizeInBits = getTypeStoreSizeInBits();
53 TypeSize getTypeStoreSizeInBits()
const {
57 return {AlignedSizeInBits, BaseSize.
isScalable()};
102 ValueType(ValueType) {}
118 ElementType(ElementType) {}
127 const Type *ElementType;
137 bool IsBitInt =
false)
139 IsSigned(IsSigned), IsBitInt(IsBitInt) {}
161 Semantics(&FloatSemantics) {}
196 bool IsFunctionPointer;
203 IsFunctionPointer(IsFunctionPointer) {}
213 const Type *ElementType;
219 bool IsMatrixType =
false)
222 ElementType(ElementType), NumElements(NumElements),
223 IsMatrix(IsMatrixType) {}
259 const Type *ElementType;
263 static TypeSize computeSizeInBits(
const Type *ElementType,
265 return TypeSize(ElementType->getSizeInBits().getFixedValue() *
266 NumElements.getKnownMinValue(),
267 NumElements.isScalable());
275 ElementType(ElementType), NumElements(NumElements), VecKind(VecKind) {}
312 Vec(Vec), NumVectors(NumVectors) {}
366 BaseClasses(Bases), VirtualBaseClasses(VBases), Packing(Pack),
389 return VirtualBaseClasses.size();
397 return VirtualBaseClasses;
441 bool IsBitInt =
false) {
451 unsigned Addrspace = 0) {
458 bool IsMatrixType =
false) {
459 return new (Allocator.Allocate<
ArrayType>())
460 ArrayType(ElementType, NumElements, SizeInBits, IsMatrixType);
473 assert(NumVectors >= 2 && NumVectors <= 4 &&
474 "tuple types hold 2, 3, or 4 vectors");
482 const Type *PredicateBit =
494 FieldInfo *FieldArray =
Allocator.Allocate<FieldInfo>(Fields.
size());
495 std::copy(Fields.
begin(), Fields.
end(), FieldArray);
497 FieldInfo *BaseArray =
nullptr;
498 if (!BaseClasses.empty()) {
499 BaseArray =
Allocator.Allocate<FieldInfo>(BaseClasses.size());
500 std::copy(BaseClasses.begin(), BaseClasses.end(), BaseArray);
503 FieldInfo *VBaseArray =
nullptr;
504 if (!VirtualBaseClasses.
empty()) {
505 VBaseArray =
Allocator.Allocate<FieldInfo>(VirtualBaseClasses.
size());
506 std::copy(VirtualBaseClasses.
begin(), VirtualBaseClasses.
end(),
515 RecordType(FieldsRef, BasesRef, VBasesRef,
Size, Align, Pack, RecFlags);
524 for (
size_t I = 0,
E = Fields.
size();
I !=
E; ++
I) {
526 Field.OffsetInBits = 0;
539 uint64_t ElementSizeInBits = ElementType->getSizeInBits().getFixedValue();
540 uint64_t ComplexSizeInBits = ElementSizeInBits * 2;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file declares a class to represent arbitrary precision floating point values and provide a varie...
This file defines the BumpPtrAllocator interface.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
OptimizedStructLayoutField Field
FunctionLoweringInfo::StatepointRelocationRecord RecordType
Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
Get the array size.
bool empty() const
Check if the array is empty.
static constexpr ElementCount getScalable(ScalarTy MinVal)
const Type * getElementType() const
bool isMatrixType() const
static bool classof(const Type *T)
ArrayType(const Type *ElementType, uint64_t NumElements, uint64_t SizeInBits, bool IsMatrixType=false)
uint64_t getNumElements() const
const Type * getValueType() const
AtomicType(const Type *ValueType, uint64_t SizeInBits, Align Alignment)
static bool classof(const Type *T)
ComplexType(const Type *ElementType, uint64_t SizeInBits, Align Alignment)
const Type * getElementType() const
static bool classof(const Type *T)
FloatType(const fltSemantics &FloatSemantics, Align ABIAlign)
const fltSemantics * getSemantics() const
static bool classof(const Type *T)
static bool classof(const Type *T)
IntegerType(uint64_t BitWidth, Align ABIAlign, bool IsSigned, bool IsBitInt=false)
bool isFunctionPointer() const
static bool classof(const Type *T)
MemberPointerType(bool IsFunctionPointer, uint64_t SizeInBits, Align ABIAlign, unsigned AddressSpace=0)
PointerLikeType(TypeKind K, TypeSize SizeInBits, Align ABIAlign, unsigned AS)
static bool classof(const Type *T)
bool isMemberPointer() const
unsigned getAddrSpace() const
PointerType(uint64_t Size, Align ABIAlign, unsigned AddressSpace=0)
static bool classof(const Type *T)
bool isPolymorphic() const
bool canPassInRegisters() const
LLVM_ABI const FieldInfo * getElementContainingOffset(unsigned OffsetInBits) const
Returns the field, base, or virtual base whose extent contains OffsetInBits, or nullptr if no such el...
ArrayRef< FieldInfo > getBaseClasses() const
uint32_t getNumBaseClasses() const
ArrayRef< FieldInfo > getFields() const
uint32_t getNumVirtualBaseClasses() const
bool hasFlexibleArrayMember() const
bool isTransparentUnion() const
static bool classof(const Type *T)
LLVM_ABI bool isEmpty() const
RecordType(ArrayRef< FieldInfo > StructFields, ArrayRef< FieldInfo > Bases, ArrayRef< FieldInfo > VBases, TypeSize Size, Align Align, StructPacking Pack=StructPacking::Default, RecordFlags RecFlags=RecordFlags::None)
uint32_t getNumFields() const
ArrayRef< FieldInfo > getVirtualBaseClasses() const
StructPacking getPacking() const
A homogeneous tuple of 2, 3, or 4 identical vectors, such as the AArch64 SVE types svint32x3_t and sv...
const VectorType * getVectorType() const
unsigned getNumVectors() const
TupleType(const VectorType *Vec, unsigned NumVectors)
static bool classof(const Type *T)
const ComplexType * getComplexType(const Type *ElementType, Align Align)
const FloatType * getFloatType(const fltSemantics &Semantics, Align Align)
const IntegerType * getIntegerType(uint64_t BitWidth, Align Align, bool Signed, bool IsBitInt=false)
const AtomicType * getAtomicType(const Type *ValueType, uint64_t SizeInBits, Align Align)
const VectorType * getSVECountType(Align ABIAlign)
Creates the AArch64 __SVCount_t type.
const MemberPointerType * getMemberPointerType(bool IsFunctionPointer, uint64_t SizeInBits, Align Align)
const RecordType * getRecordType(ArrayRef< FieldInfo > Fields, TypeSize Size, Align Align, StructPacking Pack=StructPacking::Default, ArrayRef< FieldInfo > BaseClasses={}, ArrayRef< FieldInfo > VirtualBaseClasses={}, RecordFlags RecFlags=RecordFlags::None)
TypeBuilder(BumpPtrAllocator &Alloc)
const TupleType * getTupleType(const VectorType *Vec, unsigned NumVectors)
Creates a homogeneous tuple of NumVectors copies of Vec.
const VectorType * getVectorType(const Type *ElementType, ElementCount NumElements, Align Align, VectorKind VecKind=VectorKind::Generic)
const ArrayType * getArrayType(const Type *ElementType, uint64_t NumElements, uint64_t SizeInBits, bool IsMatrixType=false)
const PointerType * getPointerType(uint64_t Size, Align Align, unsigned Addrspace=0)
const VoidType * getVoidType()
const RecordType * getUnionType(ArrayRef< FieldInfo > Fields, TypeSize Size, Align Align, StructPacking Pack=StructPacking::Default, RecordFlags RecFlags=RecordFlags::None)
Represents the ABI-specific view of a type in LLVM.
TypeSize getTypeAllocSize() const
bool isMemberPointer() const
TypeSize getSizeInBits() const
Type(TypeKind K, TypeSize SizeInBits, Align ABIAlign)
Align getAlignment() const
ElementCount getNumElements() const
const Type * getElementType() const
VectorKind getVectorKind() const
static bool classof(const Type *T)
VectorType(const Type *ElementType, ElementCount NumElements, Align ABIAlign, VectorKind VecKind=VectorKind::Generic)
bool isSVEType() const
Returns true for any of the AArch64 SVE flavors.
bool isFixedLength() const
bool isSVEPredicate() const
static bool classof(const Type *T)
constexpr ScalarTy getFixedValue() const
constexpr bool isScalable() const
Returns whether the quantity is scaled by a runtime quantity (vscale).
constexpr ScalarTy getKnownMinValue() const
Returns the minimum value this quantity can represent.
constexpr bool isZero() const
@ LLVM_MARK_AS_BITMASK_ENUM
VectorKind
Distinguishes the vector flavors that ABIs have to treat differently.
@ SVEPredicate
An AArch64 SVE predicate vector, such as svbool_t.
@ SVEData
An AArch64 SVE data vector, such as svint32_t.
@ Generic
A plain vector, such as a Neon vector or a GCC vector_size vector.
@ SVECount
The AArch64 __SVCount_t type.
This is an optimization pass for GlobalISel generic memory operations.
constexpr T alignToPowerOf2(U Value, V Align)
Will overflow only if result is not representable in T.
constexpr uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
ArrayRef(const T &OneElt) -> ArrayRef< T >
constexpr unsigned BitWidth
PointerUnion< const Value *, const PseudoSourceValue * > ValueType
BumpPtrAllocatorImpl<> BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
This struct is a compact representation of a valid (non-zero power of two) alignment.
FieldInfo(const Type *FieldType, uint64_t OffsetInBits=0, bool IsBitField=false, uint64_t BitFieldWidth=0, bool IsUnnamedBitField=false, bool HasNoUniqueAddress=false)
LLVM_ABI bool isEmpty() const