1//===- llvm/DerivedTypes.h - Classes for handling data types ----*- C++ -*-===// 3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4// See https://llvm.org/LICENSE.txt for license information. 5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7//===----------------------------------------------------------------------===// 9// This file contains the declarations of classes that represent "derived 10// types". These are things like "arrays of x" or "structure of x, y, z" or 11// "function returning x taking (y,z) as parameters", etc... 13// The implementations of these classes live in the Type.cpp file. 15//===----------------------------------------------------------------------===// 17#ifndef LLVM_IR_DERIVEDTYPES_H 18#define LLVM_IR_DERIVEDTYPES_H 35template <
typename T>
classExpected;
38/// Class to represent integer types. Note that this class is also used to 39/// represent the built-in integer types: Int1Ty, Int8Ty, Int16Ty, Int32Ty and 41/// Integer representation type 51 /// This enum is just used to hold constants we need for IntegerType. 54MAX_INT_BITS = (1<<23)
///< Maximum number of bits that can be specified 55 ///< Note that bit width is stored in the Type classes SubclassData field 56 ///< which has 24 bits. SelectionDAG type legalization can require a 57 ///< power of 2 IntegerType, so limit to the largest representable power 61 /// This static method is the primary way of constructing an IntegerType. 62 /// If an IntegerType with the same NumBits value was previously instantiated, 63 /// that instance will be returned. Otherwise a new one will be created. Only 64 /// one instance with a given NumBits value is ever created. 65 /// Get or create an IntegerType instance. 68 /// Returns type twice as wide the input type. 73 /// Get the number of bits in this IntegerType 76 /// Return a bitmask with ones set for all of the bits that can be set by an 77 /// unsigned version of this type. This is 0xFF for i8, 0xFFFF for i16, etc. 82 /// Return a uint64_t with just the most significant bit set (the sign bit, if 83 /// the value is treated as a signed number). 88 /// For example, this is 0xFF for an 8 bit integer, 0xFFFF for i16, etc. 89 /// @returns a bit mask with ones set for all the bits of this type. 90 /// Get a bit mask for this type. 93 /// Methods for support type inquiry through isa, cast, and dyn_cast. 100return cast<IntegerType>(
this)->getBitWidth();
103/// Class to represent function types 112 /// This static method is the primary way of constructing a FunctionType. 116 /// Create a FunctionType taking no parameters. 119 /// Return true if the specified type is valid as a return type. 122 /// Return true if the specified type is valid as an argument type. 136 /// Parameter type accessors. 142 /// Return the number of fixed parameters this function type requires. 143 /// This does not consider varargs. 146 /// Methods for support type inquiry through isa, cast, and dyn_cast. 152"Alignment sufficient for objects appended to FunctionType");
155return cast<FunctionType>(
this)->isVarArg();
159return cast<FunctionType>(
this)->getParamType(i);
163return cast<FunctionType>(
this)->getNumParams();
166/// A handy container for a FunctionType+Callee-pointer pair, which can be 167/// passed around as a single entity. This assists in replacing the use of 168/// PointerType::getElementType() to access the function's type, since that's 169/// slated for removal as part of the [opaque pointer types] project. 172// Allow implicit conversion from types which have a getFunctionType member 173// (e.g. Function and InlineAsm). 174template <
typename T,
typename U = decltype(&T::getFunctionType)>
179 : FnTy(FnTy), Callee(Callee) {
180assert((FnTy ==
nullptr) == (Callee ==
nullptr));
191explicitoperatorbool() {
return Callee; }
195Value *Callee =
nullptr;
198/// Class to represent struct types. There are two different kinds of struct 199/// types: Literal structs and Identified structs. 201/// Literal struct types (e.g. { i32, i32 }) are uniqued structurally, and must 202/// always have a body when created. You can get one of these by using one of 203/// the StructType::get() forms. 205/// Identified structs (e.g. %foo or %42) may optionally have a name and are not 206/// uniqued. The names for identified structs are managed at the LLVMContext 207/// level, so there can only be a single identified struct with a given name in 208/// a particular LLVMContext. Identified structs may also optionally be opaque 209/// (have no body specified). You get one of these by using one of the 210/// StructType::create() forms. 212/// Independent of what kind of struct you have, the body of a struct type are 213/// laid out in memory consecutively with the elements directly one after the 214/// other (if the struct is packed) or (if not packed) with padding between the 215/// elements as defined by DataLayout (which is required to match what the code 216/// generator for a target expects). 222 /// This is the contents of the SubClassData field. 227 SCDB_ContainsScalableVector = 16,
228 SCDB_NotContainsScalableVector = 32,
229 SCDB_ContainsNonGlobalTargetExtType = 64,
230 SCDB_NotContainsNonGlobalTargetExtType = 128,
231 SCDB_ContainsNonLocalTargetExtType = 64,
232 SCDB_NotContainsNonLocalTargetExtType = 128,
235 /// For a named struct that actually has a name, this is a pointer to the 236 /// symbol table entry (maintained by LLVMContext) for the struct. 237 /// This is null if the type is an literal struct or if it is a identified 238 /// type that has an empty name. 245 /// This creates an identified struct. 255template <
class... Tys>
258assert(elt1 &&
"Cannot create a struct type with no elements with this");
262 /// This static method is the primary way to create a literal StructType. 266 /// Create an empty structure type. 269 /// This static method is a convenience method for creating structure types by 270 /// specifying the elements as arguments. Note that this method always returns 271 /// a non-packed struct, and requires at least one element type. 272template <
class... Tys>
275assert(elt1 &&
"Cannot create a struct type with no elements with this");
280 /// Return the type with the specified name, or null if there is none by that 286 /// Return true if this type is uniqued by structural equivalence, false if it 287 /// is a struct definition. 290 /// Return true if this is a type with an identity that has no body specified 291 /// yet. These prints as 'opaque' in .ll files. 294 /// isSized - Return true if this is a sized type. 297 /// Returns true if this struct contains a scalable vector. 301 /// Return true if this type is or contains a target extension type that 302 /// disallows being used as a global. 307 /// Return true if this type is or contains a target extension type that 308 /// disallows being used as a local. 313 /// Returns true if this struct contains homogeneous scalable vector types. 314 /// Note that the definition of homogeneous scalable vector type is not 315 /// recursive here. That means the following structure will return false 316 /// when calling this function. 317 /// {{<vscale x 2 x i32>, <vscale x 4 x i64>}, 318 /// {<vscale x 2 x i32>, <vscale x 4 x i64>}} 321 /// Return true if this struct is non-empty and all element types are the 325 /// Return true if this is a named struct that has a non-empty name. 328 /// Return the name for this struct type if it has an identity. 329 /// This may return an empty string for an unnamed struct type. Do not call 330 /// this on an literal type. 333 /// Change the name of this type to the specified name, or to a name with a 334 /// suffix if there is a collision. Do not call this on an literal type. 337 /// Specify a body for an opaque identified type, which must not make the type 341 /// Specify a body for an opaque identified type or return an error if it 342 /// would make the type recursive. 345 /// Return an error if the body for an opaque identified type would make it 349 /// Return true if the specified type is valid as a element type. 352// Iterator access to the elements. 361 /// Return true if this is layout identical to the specified struct. 364 /// Random access to the elements 370 /// Given an index value into the type, return the type of the element. 376 /// Methods for support type inquiry through isa, cast, and dyn_cast. 383return cast<StructType>(
this)->getName();
387return cast<StructType>(
this)->getNumElements();
391return cast<StructType>(
this)->getElementType(
N);
394/// Class to represent array types. 396 /// The element type of the array. 398 /// Number of elements in the array. 410 /// This static method is the primary way to construct an ArrayType 413 /// Return true if the specified type is valid as a element type. 416 /// Methods for support type inquiry through isa, cast, and dyn_cast. 423return cast<ArrayType>(
this)->getNumElements();
426/// Base class of all SIMD vector types 428 /// A fully specified VectorType is of the form <vscale x n x Ty>. 'n' is the 429 /// minimum number of elements of type Ty contained within the vector, and 430 /// 'vscale x' indicates that the total element count is an integer multiple 431 /// of 'n', where the multiple is either guaranteed to be one, or is 432 /// statically unknown at compile time. 434 /// If the multiple is known to be 1, then the extra term is discarded in 437 /// <4 x i32> - a vector containing 4 i32s 438 /// <vscale x 4 x i32> - a vector containing an unknown integer multiple 441 /// The element type of the vector. 445 /// The element quantity of this vector. The meaning of this value depends 446 /// on the type of vector: 447 /// - For FixedVectorType = <ElementQuantity x ty>, there are 448 /// exactly ElementQuantity elements in this vector. 449 /// - For ScalableVectorType = <vscale x ElementQuantity x ty>, 450 /// there are vscale * ElementQuantity elements in this vector, where 451 /// vscale is a runtime-constant integer greater than 0. 462 /// This static method is the primary way to construct an VectorType. 475 /// This static method gets a VectorType with the same number of elements as 476 /// the input type, and the element type is an integer type of the same width 477 /// as the input element type. 480assert(EltBits &&
"Element size must be of a non-zero size");
485 /// This static method is like getInteger except that the element types are 486 /// twice as wide as the elements in the input type. 493// This static method gets a VectorType with the same number of elements as 494// the input type, and the element type is an integer or float type which 495// is half as wide as the elements in the input type. 511assert((EltBits & 1) == 0 &&
512"Cannot truncate vector element with odd bit-width");
518// This static method returns a VectorType with a larger number of elements 519// of a smaller type than the input element type. For example, a <4 x i64> 520// subdivided twice would return <16 x i16> 522for (
int i = 0; i < NumSubdivs; ++i) {
529 /// This static method returns a VectorType with half as many elements as the 530 /// input type and the same element type. 533assert(EltCnt.isKnownEven() &&
534"Cannot halve vector with odd number of elements.");
536 EltCnt.divideCoefficientBy(2));
539 /// This static method returns a VectorType with twice as many elements as the 540 /// input type and the same element type. 543assert((EltCnt.getKnownMinValue() * 2ull) <= UINT_MAX &&
544"Too many elements in vector");
548 /// Return true if the specified type is valid as a element type. 551 /// Return an ElementCount instance to represent the (possibly scalable) 552 /// number of elements in the vector. 555 /// Methods for support type inquiry through isa, cast, and dyn_cast. 562/// Class to represent fixed width SIMD vectors 584return cast<FixedVectorType>(
590return cast<FixedVectorType>(
609/// Class to represent scalable SIMD vectors 629return cast<ScalableVectorType>(
635return cast<ScalableVectorType>(
641return cast<ScalableVectorType>(
652return cast<ScalableVectorType>(
656 /// Get the minimum number of elements in this vector. The actual number of 657 /// elements in the vector is an integer multiple of this value. 669/// Class to represent pointers. 677 /// This constructs a pointer to an object of the specified type in a numbered 680 /// This constructs an opaque pointer to an object in a numbered address 684 /// This constructs a pointer to an object of the specified type in the 685 /// default address space (address space zero). 690 /// This constructs an opaque pointer to an object in the 691 /// default address space (address space zero). 696 /// Return true if the specified type is valid as a element type. 699 /// Return true if we can load or store from a pointer to this type. 702 /// Return the address space of the Pointer type. 705 /// Implement support type inquiry through isa, cast, and dyn_cast. 714"Original type expected to be a vector of integers or a scalar integer.");
715if (
auto *VTy = dyn_cast<VectorType>(
this))
718return cast<IntegerType>(
this)->getExtendedType();
722if (
auto *VTy = dyn_cast<VectorType>(
this))
730"Original type expected to be a vector of integers or a scalar integer.");
738/// Class to represent target extensions types, which are generally 739/// unintrospectable from target-independent optimizations. 741/// Target extension types have a string name, and optionally have type and/or 742/// integer parameters. The exact meaning of any parameters is dependent on the 748// These strings are ultimately owned by the context. 756 /// Return a target extension type having the specified name and optional 757 /// type and integer parameters. 762 /// Return a target extension type having the specified name and optional 763 /// type and integer parameters, or an appropriate Error if it fails the 764 /// parameters check. 765static Expected<TargetExtType *>
getOrError(LLVMContext &Context,
767 ArrayRef<Type *> Types = {},
768 ArrayRef<unsigned> Ints = {});
770 /// Check that a newly created target extension type has the expected number 771 /// of type parameters and integer parameters, returning the type itself if OK 772 /// or an appropriate Error if not. 773static Expected<TargetExtType *>
checkParams(TargetExtType *TTy);
775 /// Return the name for this target extension type. Two distinct target 776 /// extension types may have the same name if their type or integer parameters 780 /// Return the type parameters for this particular target extension type. If 781 /// there are no parameters, an empty array is returned. 795 /// Return the integer parameters for this particular target extension type. 796 /// If there are no parameters, an empty array is returned. 805 /// zeroinitializer is valid for this target extension type. 807 /// This type may be used as the value type of a global variable. 809 /// This type may be allocated on the stack, either as the allocated type 810 /// of an alloca instruction or as a byval function parameter. 814 /// Returns true if the target extension type contains the given property. 817 /// Returns an underlying layout type for the target extension type. This 818 /// type can be used to query size and alignment information, if it is 819 /// appropriate (although note that the layout type may also be void). It is 820 /// not legal to bitcast between this type and the layout type, however. 823 /// Methods for support type inquiry through isa, cast, and dyn_cast. 828return cast<TargetExtType>(
this)->getName();
831}
// end namespace llvm 833#endif// LLVM_IR_DERIVEDTYPES_H Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
Given that RA is a live value
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file contains some templates that are useful if you are working with the STL at all.
Class for arbitrary precision integers.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Class to represent array types.
uint64_t getNumElements() const
static bool isValidElementType(Type *ElemTy)
Return true if the specified type is valid as a element type.
static ArrayType * get(Type *ElementType, uint64_t NumElements)
This static method is the primary way to construct an ArrayType.
ArrayType & operator=(const ArrayType &)=delete
ArrayType(const ArrayType &)=delete
static bool classof(const Type *T)
Methods for support type inquiry through isa, cast, and dyn_cast.
Type * getElementType() const
static constexpr ElementCount get(ScalarTy MinVal, bool Scalable)
Lightweight error class with error context and mandatory checking.
Class to represent fixed width SIMD vectors.
unsigned getNumElements() const
static FixedVectorType * getDoubleElementsVectorType(FixedVectorType *VTy)
static FixedVectorType * getInteger(FixedVectorType *VTy)
static FixedVectorType * getSubdividedVectorType(FixedVectorType *VTy, int NumSubdivs)
static FixedVectorType * getExtendedElementVectorType(FixedVectorType *VTy)
FixedVectorType(Type *ElTy, unsigned NumElts)
static FixedVectorType * get(Type *ElementType, const FixedVectorType *FVTy)
static FixedVectorType * getTruncatedElementVectorType(FixedVectorType *VTy)
static bool classof(const Type *T)
static FixedVectorType * get(Type *ElementType, unsigned NumElts)
static FixedVectorType * getHalfElementsVectorType(FixedVectorType *VTy)
A handy container for a FunctionType+Callee-pointer pair, which can be passed around as a single enti...
FunctionCallee(std::nullptr_t)
FunctionType * getFunctionType()
FunctionCallee(FunctionType *FnTy, Value *Callee)
Class to represent function types.
param_iterator param_begin() const
static bool isValidArgumentType(Type *ArgTy)
Return true if the specified type is valid as an argument type.
unsigned getNumParams() const
Return the number of fixed parameters this function type requires.
Type::subtype_iterator param_iterator
Type * getParamType(unsigned i) const
Parameter type accessors.
static bool isValidReturnType(Type *RetTy)
Return true if the specified type is valid as a return type.
FunctionType(const FunctionType &)=delete
ArrayRef< Type * > params() const
FunctionType & operator=(const FunctionType &)=delete
static bool classof(const Type *T)
Methods for support type inquiry through isa, cast, and dyn_cast.
Type * getReturnType() const
param_iterator param_end() const
static FunctionType * get(Type *Result, ArrayRef< Type * > Params, bool isVarArg)
This static method is the primary way of constructing a FunctionType.
Class to represent integer types.
static IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
uint64_t getSignBit() const
Return a uint64_t with just the most significant bit set (the sign bit, if the value is treated as a ...
APInt getMask() const
For example, this is 0xFF for an 8 bit integer, 0xFFFF for i16, etc.
IntegerType * getExtendedType() const
Returns type twice as wide the input type.
unsigned getBitWidth() const
Get the number of bits in this IntegerType.
uint64_t getBitMask() const
Return a bitmask with ones set for all of the bits that can be set by an unsigned version of this typ...
@ MIN_INT_BITS
Minimum number of bits that can be specified.
@ MAX_INT_BITS
Maximum number of bits that can be specified.
static bool classof(const Type *T)
Methods for support type inquiry through isa, cast, and dyn_cast.
IntegerType(LLVMContext &C, unsigned NumBits)
This is an important class for using LLVM in a threaded context.
Class to represent pointers.
static bool isLoadableOrStorableType(Type *ElemTy)
Return true if we can load or store from a pointer to this type.
PointerType(const PointerType &)=delete
static PointerType * getUnqual(LLVMContext &C)
This constructs an opaque pointer to an object in the default address space (address space zero).
static PointerType * get(Type *ElementType, unsigned AddressSpace)
This constructs a pointer to an object of the specified type in a numbered address space.
static bool classof(const Type *T)
Implement support type inquiry through isa, cast, and dyn_cast.
static bool isValidElementType(Type *ElemTy)
Return true if the specified type is valid as a element type.
PointerType & operator=(const PointerType &)=delete
static PointerType * getUnqual(Type *ElementType)
This constructs a pointer to an object of the specified type in the default address space (address sp...
unsigned getAddressSpace() const
Return the address space of the Pointer type.
Class to represent scalable SIMD vectors.
static ScalableVectorType * get(Type *ElementType, const ScalableVectorType *SVTy)
static ScalableVectorType * getInteger(ScalableVectorType *VTy)
static ScalableVectorType * get(Type *ElementType, unsigned MinNumElts)
static bool classof(const Type *T)
static ScalableVectorType * getExtendedElementVectorType(ScalableVectorType *VTy)
static ScalableVectorType * getHalfElementsVectorType(ScalableVectorType *VTy)
static ScalableVectorType * getSubdividedVectorType(ScalableVectorType *VTy, int NumSubdivs)
static ScalableVectorType * getDoubleElementsVectorType(ScalableVectorType *VTy)
unsigned getMinNumElements() const
Get the minimum number of elements in this vector.
ScalableVectorType(Type *ElTy, unsigned MinNumElts)
static ScalableVectorType * getTruncatedElementVectorType(ScalableVectorType *VTy)
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
StringRef - Represent a constant reference to a string, i.e.
Class to represent struct types.
static bool classof(const Type *T)
Methods for support type inquiry through isa, cast, and dyn_cast.
static std::enable_if_t< are_base_of< Type, Tys... >::value, StructType * > create(StringRef Name, Type *elt1, Tys *... elts)
bool indexValid(const Value *V) const
static StructType * get(LLVMContext &Context, ArrayRef< Type * > Elements, bool isPacked=false)
This static method is the primary way to create a literal StructType.
element_iterator element_end() const
StructType(const StructType &)=delete
ArrayRef< Type * > elements() const
void setBody(ArrayRef< Type * > Elements, bool isPacked=false)
Specify a body for an opaque identified type, which must not make the type recursive.
bool containsHomogeneousScalableVectorTypes() const
Returns true if this struct contains homogeneous scalable vector types.
Error checkBody(ArrayRef< Type * > Elements)
Return an error if the body for an opaque identified type would make it recursive.
bool containsNonLocalTargetExtType() const
bool containsHomogeneousTypes() const
Return true if this struct is non-empty and all element types are the same.
element_iterator element_begin() const
static StructType * getTypeByName(LLVMContext &C, StringRef Name)
Return the type with the specified name, or null if there is none by that name.
static StructType * create(LLVMContext &Context, StringRef Name)
This creates an identified struct.
static bool isValidElementType(Type *ElemTy)
Return true if the specified type is valid as a element type.
unsigned getNumElements() const
Random access to the elements.
bool isSized(SmallPtrSetImpl< Type * > *Visited=nullptr) const
isSized - Return true if this is a sized type.
Type * getTypeAtIndex(unsigned N) const
StructType & operator=(const StructType &)=delete
void setName(StringRef Name)
Change the name of this type to the specified name, or to a name with a suffix if there is a collisio...
bool isLayoutIdentical(StructType *Other) const
Return true if this is layout identical to the specified struct.
bool isScalableTy() const
Error setBodyOrError(ArrayRef< Type * > Elements, bool isPacked=false)
Specify a body for an opaque identified type or return an error if it would make the type recursive.
Type * getTypeAtIndex(const Value *V) const
Given an index value into the type, return the type of the element.
bool hasName() const
Return true if this is a named struct that has a non-empty name.
bool isLiteral() const
Return true if this type is uniqued by structural equivalence, false if it is a struct definition.
bool indexValid(unsigned Idx) const
bool containsNonGlobalTargetExtType() const
bool isOpaque() const
Return true if this is a type with an identity that has no body specified yet.
Type * getElementType(unsigned N) const
Type::subtype_iterator element_iterator
static std::enable_if_t< are_base_of< Type, Tys... >::value, StructType * > get(Type *elt1, Tys *... elts)
This static method is a convenience method for creating structure types by specifying the elements as...
StringRef getName() const
Return the name for this struct type if it has an identity.
Symbol info for RuntimeDyld.
Class to represent target extensions types, which are generally unintrospectable from target-independ...
ArrayRef< Type * > type_params() const
Return the type parameters for this particular target extension type.
unsigned getNumIntParameters() const
type_param_iterator type_param_end() const
Type::subtype_iterator type_param_iterator
static TargetExtType * get(LLVMContext &Context, StringRef Name, ArrayRef< Type * > Types={}, ArrayRef< unsigned > Ints={})
Return a target extension type having the specified name and optional type and integer parameters.
Type * getTypeParameter(unsigned i) const
unsigned getNumTypeParameters() const
ArrayRef< unsigned > int_params() const
Return the integer parameters for this particular target extension type.
type_param_iterator type_param_begin() const
static Expected< TargetExtType * > checkParams(TargetExtType *TTy)
Check that a newly created target extension type has the expected number of type parameters and integ...
unsigned getIntParameter(unsigned i) const
TargetExtType(const TargetExtType &)=delete
bool hasProperty(Property Prop) const
Returns true if the target extension type contains the given property.
TargetExtType & operator=(const TargetExtType &)=delete
@ HasZeroInit
zeroinitializer is valid for this target extension type.
@ CanBeGlobal
This type may be used as the value type of a global variable.
@ CanBeLocal
This type may be allocated on the stack, either as the allocated type of an alloca instruction or as ...
StringRef getName() const
Return the name for this target extension type.
static Expected< TargetExtType * > getOrError(LLVMContext &Context, StringRef Name, ArrayRef< Type * > Types={}, ArrayRef< unsigned > Ints={})
Return a target extension type having the specified name and optional type and integer parameters,...
Type * getLayoutType() const
Returns an underlying layout type for the target extension type.
static bool classof(const Type *T)
Methods for support type inquiry through isa, cast, and dyn_cast.
The instances of the Type class are immutable: once they are created, they are never changed.
static Type * getHalfTy(LLVMContext &C)
unsigned getIntegerBitWidth() const
Type * getStructElementType(unsigned N) const
bool isIntOrIntVectorTy() const
Return true if this is an integer type or a vector of integer types.
StringRef getStructName() const
Type *const * subtype_iterator
unsigned getStructNumElements() const
unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
uint64_t getArrayNumElements() const
bool containsNonLocalTargetExtType() const
TypeID
Definitions of all of the base types for the Type system.
@ TargetExtTyID
Target extension type.
@ ScalableVectorTyID
Scalable SIMD vector type.
@ FloatTyID
32-bit floating point type
@ IntegerTyID
Arbitrary bit width integers.
@ FixedVectorTyID
Fixed width SIMD vector type.
@ DoubleTyID
64-bit floating point type
unsigned getNumContainedTypes() const
Return the number of types in the derived type.
unsigned NumContainedTys
Keeps track of how many Type*'s there are in the ContainedTys list.
static IntegerType * getIntNTy(LLVMContext &C, unsigned N)
StringRef getTargetExtName() const
unsigned getScalarSizeInBits() const LLVM_READONLY
If this is a vector type, return the getPrimitiveSizeInBits value for the element type.
Type * getWithNewBitWidth(unsigned NewBitWidth) const
Given an integer or vector type, change the lane bitwidth to NewBitwidth, whilst keeping the old numb...
Type * getWithNewType(Type *EltTy) const
Given vector type, change the element type, whilst keeping the old number of elements.
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
Type *const * ContainedTys
A pointer to the array of Types contained by this Type.
unsigned getSubclassData() const
bool isFunctionVarArg() const
void setSubclassData(unsigned val)
bool isFloatingPointTy() const
Return true if this is one of the floating-point types.
bool isScalableTy() const
Type * getExtendedType() const
Given scalar/vector integer type, returns a type with elements twice as wide as in the original type.
static Type * getFloatTy(LLVMContext &C)
TypeID getTypeID() const
Return the type id for the type.
Type * getFunctionParamType(unsigned i) const
TypeSize getPrimitiveSizeInBits() const LLVM_READONLY
Return the basic size of this type if it is a primitive type.
Type * getContainedType(unsigned i) const
This method is used to implement the type iterator (defined at the end of the file).
bool containsNonGlobalTargetExtType() const
unsigned getFunctionNumParams() const
Type * getScalarType() const
If this is a vector type, return the element type, otherwise return 'this'.
LLVM Value Representation.
Base class of all SIMD vector types.
static VectorType * getHalfElementsVectorType(VectorType *VTy)
This static method returns a VectorType with half as many elements as the input type and the same ele...
static VectorType * getExtendedElementVectorType(VectorType *VTy)
This static method is like getInteger except that the element types are twice as wide as the elements...
static bool classof(const Type *T)
Methods for support type inquiry through isa, cast, and dyn_cast.
ElementCount getElementCount() const
Return an ElementCount instance to represent the (possibly scalable) number of elements in the vector...
static VectorType * getSubdividedVectorType(VectorType *VTy, int NumSubdivs)
static VectorType * getInteger(VectorType *VTy)
This static method gets a VectorType with the same number of elements as the input type,...
static VectorType * get(Type *ElementType, ElementCount EC)
This static method is the primary way to construct an VectorType.
const unsigned ElementQuantity
The element quantity of this vector.
static VectorType * get(Type *ElementType, const VectorType *Other)
static VectorType * getTruncatedElementVectorType(VectorType *VTy)
static bool isValidElementType(Type *ElemTy)
Return true if the specified type is valid as a element type.
VectorType & operator=(const VectorType &)=delete
static VectorType * getDoubleElementsVectorType(VectorType *VTy)
This static method returns a VectorType with twice as many elements as the input type and the same el...
static VectorType * get(Type *ElementType, unsigned NumElements, bool Scalable)
VectorType(const VectorType &)=delete
Type * getElementType() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ C
The default llvm calling convention, compatible with C.
Type
MessagePack types as defined in the standard, with the exception of Integer being divided into a sign...
This is an optimization pass for GlobalISel generic memory operations.
std::conjunction< std::is_base_of< T, Ts >... > are_base_of
traits class for checking whether type T is a base class for all the given types in the variadic list...