Index: mlir/include/mlir/IR/AttributeSupport.h =================================================================== --- mlir/include/mlir/IR/AttributeSupport.h +++ mlir/include/mlir/IR/AttributeSupport.h @@ -79,7 +79,7 @@ /// Base storage class appearing in an attribute. Derived storage classes should /// only be constructed within the context of the AttributeUniquer. -class AttributeStorage : public StorageUniquer::BaseStorage { +class alignas(8) AttributeStorage : public StorageUniquer::BaseStorage { friend detail::AttributeUniquer; friend StorageUniquer; Index: mlir/include/mlir/IR/Attributes.h =================================================================== --- mlir/include/mlir/IR/Attributes.h +++ mlir/include/mlir/IR/Attributes.h @@ -1699,7 +1699,8 @@ static inline mlir::Attribute getFromVoidPointer(void *ptr) { return mlir::Attribute::getFromOpaquePointer(ptr); } - static constexpr int NumLowBitsAvailable = 3; + static constexpr int NumLowBitsAvailable = + llvm::CTLog2(); }; template <> Index: mlir/lib/IR/AttributeDetail.h =================================================================== --- mlir/lib/IR/AttributeDetail.h +++ mlir/lib/IR/AttributeDetail.h @@ -84,7 +84,7 @@ construct(AttributeStorageAllocator &allocator, const KeyTy &key) { auto size = DictionaryAttributeStorage::totalSizeToAlloc( key.size()); - auto rawMem = allocator.allocate(size, alignof(NamedAttribute)); + auto rawMem = allocator.allocate(size, alignof(DictionaryAttributeStorage)); // Initialize the storage and trailing attribute list. auto result = ::new (rawMem) DictionaryAttributeStorage(key.size());