MLIR
18.0.0git
|
Construction/uniquing key class for LLVM dialect structure storage. More...
#include "Dialect/LLVMIR/IR/TypeDetail.h"
Public Member Functions | |
Key (StringRef name, bool opaque, ArrayRef< Type > types=std::nullopt) | |
Constructs a key for an identified struct. More... | |
Key (ArrayRef< Type > types, bool packed) | |
Constructs a key for a literal struct. More... | |
bool | isIdentified () const |
Checks a specific property of the struct. More... | |
bool | isPacked () const |
bool | isOpaque () const |
StringRef | getIdentifier () const |
Returns the identifier of a key for identified structs. More... | |
ArrayRef< Type > | getTypeList () const |
Returns the list of type contained in the key of a literal struct. More... | |
ArrayRef< Type > | getIdentifiedStructBody () const |
Returns the list of type contained in an identified struct. More... | |
llvm::hash_code | hashValue () const |
Returns the hash value of the key. More... | |
bool | operator== (const Key &other) const |
Compares two keys. More... | |
Key | copyIntoAllocator (TypeStorageAllocator &allocator) const |
Copies dynamically-sized components of the key into the given allocator. More... | |
Construction/uniquing key class for LLVM dialect structure storage.
Note that this is a transient helper data structure that is NOT stored. Therefore, it intentionally avoids bit manipulation and type erasure in pointers to make manipulation more straightforward. Not all elements of the key participate in uniquing, but all elements participate in construction.
Definition at line 69 of file TypeDetail.h.
|
inline |
Constructs a key for an identified struct.
Definition at line 72 of file TypeDetail.h.
Referenced by copyIntoAllocator().
Constructs a key for a literal struct.
Definition at line 76 of file TypeDetail.h.
|
inline |
Copies dynamically-sized components of the key into the given allocator.
Definition at line 142 of file TypeDetail.h.
References mlir::StorageUniquer::StorageAllocator::copyInto(), isIdentified(), and Key().
Referenced by mlir::LLVM::detail::LLVMStructTypeStorage::construct().
|
inline |
Returns the list of type contained in an identified struct.
Definition at line 107 of file TypeDetail.h.
References isIdentified().
Referenced by mlir::AttrTypeSubElementHandler< LLVM::detail::LLVMStructTypeStorage::Key >::walk().
|
inline |
Returns the identifier of a key for identified structs.
Definition at line 93 of file TypeDetail.h.
References isIdentified().
Referenced by hashValue(), mlir::LLVM::detail::LLVMStructTypeStorage::LLVMStructTypeStorage(), and operator==().
Returns the list of type contained in the key of a literal struct.
Definition at line 100 of file TypeDetail.h.
References isIdentified().
Referenced by hashValue(), mlir::LLVM::detail::LLVMStructTypeStorage::LLVMStructTypeStorage(), operator==(), mlir::AttrTypeSubElementHandler< LLVM::detail::LLVMStructTypeStorage::Key >::replace(), and mlir::AttrTypeSubElementHandler< LLVM::detail::LLVMStructTypeStorage::Key >::walk().
|
inline |
Returns the hash value of the key.
This combines various flags into a single value: the identified flag sets the first bit, and the packedness flag sets the second bit. Opacity bit is only used for construction and does not participate in uniquing.
Definition at line 117 of file TypeDetail.h.
References getIdentifier(), getTypeList(), isIdentified(), and isPacked().
Referenced by mlir::LLVM::detail::LLVMStructTypeStorage::hashKey().
|
inline |
Checks a specific property of the struct.
Definition at line 80 of file TypeDetail.h.
Referenced by copyIntoAllocator(), getIdentifiedStructBody(), getIdentifier(), getTypeList(), hashValue(), isOpaque(), isPacked(), mlir::LLVM::detail::LLVMStructTypeStorage::LLVMStructTypeStorage(), operator==(), mlir::AttrTypeSubElementHandler< LLVM::detail::LLVMStructTypeStorage::Key >::replace(), and mlir::AttrTypeSubElementHandler< LLVM::detail::LLVMStructTypeStorage::Key >::walk().
|
inline |
Definition at line 86 of file TypeDetail.h.
References isIdentified().
Referenced by mlir::LLVM::detail::LLVMStructTypeStorage::LLVMStructTypeStorage().
|
inline |
Definition at line 81 of file TypeDetail.h.
References isIdentified().
Referenced by hashValue(), mlir::LLVM::detail::LLVMStructTypeStorage::LLVMStructTypeStorage(), operator==(), and mlir::AttrTypeSubElementHandler< LLVM::detail::LLVMStructTypeStorage::Key >::replace().
|
inline |
Compares two keys.
Definition at line 132 of file TypeDetail.h.
References getIdentifier(), getTypeList(), isIdentified(), and isPacked().