20 #include "llvm/ADT/bit.h"
21 #include "llvm/Support/TrailingObjects.h"
34 using KeyTy = std::tuple<unsigned, IntegerType::SignednessSemantics>;
64 using KeyTy = std::tuple<TypeRange, TypeRange>;
74 auto [inputs, results] = key;
78 types.reserve(inputs.size() + results.size());
79 types.append(inputs.begin(), inputs.end());
80 types.append(results.begin(), results.end());
105 public llvm::TrailingObjects<TupleTypeStorage, Type> {
114 auto byteSize = TupleTypeStorage::totalSizeToAlloc<Type>(key.size());
119 std::uninitialized_copy(key.begin(), key.end(),
120 result->getTrailingObjects<
Type>());
131 return {getTrailingObjects<Type>(),
size()};
Attributes are known-constant values of operations.
MLIRContext is the top-level object for a collection of MLIR operations.
This is a utility allocator used to allocate memory for instances of derived types.
ArrayRef< T > copyInto(ArrayRef< T > elements)
Copy the specified array of elements into memory managed by our bump pointer allocator.
T * allocate()
Allocate an instance of the provided type.
This class provides an abstraction over the various different ranges of value types.
Base storage class appearing in a Type.
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
Attribute wrapIntegerMemorySpace(unsigned memorySpace, MLIRContext *ctx)
Wraps deprecated integer memory space to the new Attribute form.
unsigned getMemorySpaceAsInt(Attribute memorySpace)
[deprecated] Returns the memory space in old raw integer representation.
bool isSupportedMemorySpace(Attribute memorySpace)
Checks if the memorySpace has supported Attribute type.
Attribute skipDefaultMemorySpace(Attribute memorySpace)
Replaces default memorySpace (integer == 0) with empty Attribute.
inline ::llvm::hash_code hash_value(const PolynomialBase< D, T > &arg)
Include the generated interface declarations.
Function Type Storage and Uniquing.
std::tuple< TypeRange, TypeRange > KeyTy
The hash key used for uniquing.
ArrayRef< Type > getResults() const
ArrayRef< Type > getInputs() const
FunctionTypeStorage(unsigned numInputs, unsigned numResults, Type const *inputsAndResults)
Type const * inputsAndResults
static FunctionTypeStorage * construct(TypeStorageAllocator &allocator, const KeyTy &key)
Construction.
bool operator==(const KeyTy &key) const
Integer Type Storage and Uniquing.
bool operator==(const KeyTy &key) const
static IntegerTypeStorage * construct(TypeStorageAllocator &allocator, KeyTy key)
static llvm::hash_code hashKey(const KeyTy &key)
IntegerTypeStorage(unsigned width, IntegerType::SignednessSemantics signedness)
IntegerType::SignednessSemantics signedness
std::tuple< unsigned, IntegerType::SignednessSemantics > KeyTy
The hash key used for uniquing.
A type representing a collection of other types.
unsigned numElements
The number of tuple elements.
unsigned size() const
Return the number of held types.
static TupleTypeStorage * construct(TypeStorageAllocator &allocator, TypeRange key)
Construction.
ArrayRef< Type > getTypes() const
Return the held types.
TupleTypeStorage(unsigned numTypes)
bool operator==(const KeyTy &key) const