20#include "llvm/ADT/bit.h"
21#include "llvm/Support/TrailingObjects.h"
34 using KeyTy = std::tuple<unsigned, IntegerType::SignednessSemantics>;
37 return llvm::hash_value(key);
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 private llvm::TrailingObjects<TupleTypeStorage, Type> {
106 friend llvm::TrailingObjects<TupleTypeStorage, Type>;
115 auto byteSize = TupleTypeStorage::totalSizeToAlloc<Type>(key.size());
120 llvm::uninitialized_copy(key,
result->getTrailingObjects());
Attributes are known-constant values of operations.
MLIRContext is the top-level object for a collection of MLIR operations.
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.
TypeStorage()
This constructor is used by derived classes as part of the TypeUniquer.
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.
Include the generated interface declarations.
StorageUniquer::StorageAllocator TypeStorageAllocator
This is a utility allocator used to allocate memory for instances of derived Types.
static FunctionTypeStorage * construct(TypeStorageAllocator &allocator, const KeyTy &key)
Construction.
std::tuple< TypeRange, TypeRange > KeyTy
The hash key used for uniquing.
FunctionTypeStorage(unsigned numInputs, unsigned numResults, Type const *inputsAndResults)
ArrayRef< Type > getResults() const
ArrayRef< Type > getInputs() const
Type const * inputsAndResults
bool operator==(const KeyTy &key) const
bool operator==(const KeyTy &key) const
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.
static IntegerTypeStorage * construct(TypeStorageAllocator &allocator, KeyTy key)
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