|
MLIR 23.0.0git
|
Type storage for SPIR-V structure types: More...
Public Types | |
| using | KeyTy |
| A storage key is divided into 2 parts: | |
Public Member Functions | |
| StructTypeStorage (StringRef identifier) | |
| Construct a storage object for an identified struct type. | |
| StructTypeStorage (unsigned numMembers, Type const *memberTypes, StructType::OffsetInfo const *layoutInfo, unsigned numMemberDecorations, StructType::MemberDecorationInfo const *memberDecorationsInfo, unsigned numStructDecorations, StructType::StructDecorationInfo const *structDecorationsInfo) | |
| Construct a storage object for a literal struct type. | |
| bool | operator== (const KeyTy &key) const |
| For identified structs, return true if the given key contains the same identifier. | |
| ArrayRef< Type > | getMemberTypes () const |
| ArrayRef< StructType::OffsetInfo > | getOffsetInfo () const |
| ArrayRef< StructType::MemberDecorationInfo > | getMemberDecorationsInfo () const |
| ArrayRef< StructType::StructDecorationInfo > | getStructDecorationsInfo () const |
| StringRef | getIdentifier () const |
| bool | isIdentified () const |
| LogicalResult | mutate (TypeStorageAllocator &allocator, ArrayRef< Type > structMemberTypes, ArrayRef< StructType::OffsetInfo > structOffsetInfo, ArrayRef< StructType::MemberDecorationInfo > structMemberDecorationInfo, ArrayRef< StructType::StructDecorationInfo > structDecorationInfo) |
| Sets the struct type content for identified structs. | |
| Public Member Functions inherited from mlir::TypeStorage | |
| const AbstractType & | getAbstractType () |
| Return the abstract type descriptor for this type. | |
Static Public Member Functions | |
| static StructTypeStorage * | construct (TypeStorageAllocator &allocator, const KeyTy &key) |
| If the given key contains a non-empty identifier, this method constructs an identified struct and leaves the rest of the struct type data to be set through a later call to StructType::trySetBody(...). | |
Public Attributes | |
| llvm::PointerIntPair< Type const *, 1, bool > | memberTypesAndIsBodySet |
| StructType::OffsetInfo const * | offsetInfo |
| unsigned | numMembers |
| unsigned | numMemberDecorations |
| StructType::MemberDecorationInfo const * | memberDecorationsInfo |
| unsigned | numStructDecorations |
| StructType::StructDecorationInfo const * | structDecorationsInfo |
| StringRef | identifier |
Additional Inherited Members | |
| Protected Member Functions inherited from mlir::TypeStorage | |
| TypeStorage () | |
| This constructor is used by derived classes as part of the TypeUniquer. | |
| Protected Member Functions inherited from mlir::StorageUniquer::BaseStorage | |
| BaseStorage ()=default | |
Type storage for SPIR-V structure types:
Structures are uniqued using:
Identified structures only have a mutable component consisting of:
Definition at line 897 of file SPIRVTypes.cpp.
A storage key is divided into 2 parts:
An identified struct type is uniqued only by the first part (field 0) of the key.
A literal struct type is uniqued only by the second part (fields 1, 2, 3 and 4) of the key. The identifier field (field 0) must be empty.
Definition at line 937 of file SPIRVTypes.cpp.
|
inline |
Construct a storage object for an identified struct type.
A struct type associated with such storage must call StructType::trySetBody(...) later in order to mutate the storage object providing the actual content.
Definition at line 901 of file SPIRVTypes.cpp.
References false, identifier, memberDecorationsInfo, memberTypesAndIsBodySet, nullptr, numMemberDecorations, numMembers, numStructDecorations, offsetInfo, and structDecorationsInfo.
Referenced by construct().
|
inline |
Construct a storage object for a literal struct type.
A struct type associated with such storage is immutable.
Definition at line 909 of file SPIRVTypes.cpp.
References false, memberDecorationsInfo, memberTypesAndIsBodySet, numMemberDecorations, numMembers, numStructDecorations, offsetInfo, and structDecorationsInfo.
|
inlinestatic |
If the given key contains a non-empty identifier, this method constructs an identified struct and leaves the rest of the struct type data to be set through a later call to StructType::trySetBody(...).
If, on the other hand, the key contains an empty identifier, a literal struct is constructed using the other fields of the key.
Definition at line 963 of file SPIRVTypes.cpp.
References mlir::StorageUniquer::StorageAllocator::allocate(), mlir::StorageUniquer::StorageAllocator::copyInto(), identifier, numMemberDecorations, numStructDecorations, and StructTypeStorage().
|
inline |
|
inline |
Definition at line 1025 of file SPIRVTypes.cpp.
References memberDecorationsInfo, and numMemberDecorations.
Referenced by mutate(), and operator==().
Definition at line 1014 of file SPIRVTypes.cpp.
References memberTypesAndIsBodySet, and numMembers.
Referenced by mutate(), and operator==().
|
inline |
Definition at line 1018 of file SPIRVTypes.cpp.
References numMembers, and offsetInfo.
Referenced by mutate(), and operator==().
|
inline |
Definition at line 1033 of file SPIRVTypes.cpp.
References numStructDecorations, and structDecorationsInfo.
Referenced by mutate(), and operator==().
|
inline |
Definition at line 1042 of file SPIRVTypes.cpp.
References identifier.
Referenced by mutate(), and operator==().
|
inline |
Sets the struct type content for identified structs.
Calling this method is only valid for identified structs.
Fails under the following conditions:
Definition at line 1053 of file SPIRVTypes.cpp.
References mlir::StorageUniquer::StorageAllocator::copyInto(), getMemberDecorationsInfo(), getMemberTypes(), getOffsetInfo(), getStructDecorationsInfo(), isIdentified(), memberDecorationsInfo, memberTypesAndIsBodySet, numMemberDecorations, numMembers, numStructDecorations, offsetInfo, structDecorationsInfo, and success().
For identified structs, return true if the given key contains the same identifier.
For literal structs, return true if the given key contains a matching list of member types + offset info + decoration info.
Definition at line 947 of file SPIRVTypes.cpp.
References getIdentifier(), getMemberDecorationsInfo(), getMemberTypes(), getOffsetInfo(), getStructDecorationsInfo(), and isIdentified().
| StringRef mlir::spirv::detail::StructTypeStorage::identifier |
Definition at line 1103 of file SPIRVTypes.cpp.
Referenced by construct(), getIdentifier(), isIdentified(), and StructTypeStorage().
| StructType::MemberDecorationInfo const* mlir::spirv::detail::StructTypeStorage::memberDecorationsInfo |
Definition at line 1100 of file SPIRVTypes.cpp.
Referenced by getMemberDecorationsInfo(), mutate(), StructTypeStorage(), and StructTypeStorage().
| llvm::PointerIntPair<Type const *, 1, bool> mlir::spirv::detail::StructTypeStorage::memberTypesAndIsBodySet |
Definition at line 1096 of file SPIRVTypes.cpp.
Referenced by getMemberTypes(), mutate(), StructTypeStorage(), and StructTypeStorage().
| unsigned mlir::spirv::detail::StructTypeStorage::numMemberDecorations |
Definition at line 1099 of file SPIRVTypes.cpp.
Referenced by construct(), getMemberDecorationsInfo(), mutate(), StructTypeStorage(), and StructTypeStorage().
| unsigned mlir::spirv::detail::StructTypeStorage::numMembers |
Definition at line 1098 of file SPIRVTypes.cpp.
Referenced by getMemberTypes(), getOffsetInfo(), mutate(), StructTypeStorage(), and StructTypeStorage().
| unsigned mlir::spirv::detail::StructTypeStorage::numStructDecorations |
Definition at line 1101 of file SPIRVTypes.cpp.
Referenced by construct(), getStructDecorationsInfo(), mutate(), StructTypeStorage(), and StructTypeStorage().
| StructType::OffsetInfo const* mlir::spirv::detail::StructTypeStorage::offsetInfo |
Definition at line 1097 of file SPIRVTypes.cpp.
Referenced by getOffsetInfo(), mutate(), StructTypeStorage(), and StructTypeStorage().
| StructType::StructDecorationInfo const* mlir::spirv::detail::StructTypeStorage::structDecorationsInfo |
Definition at line 1102 of file SPIRVTypes.cpp.
Referenced by getStructDecorationsInfo(), mutate(), StructTypeStorage(), and StructTypeStorage().