[Mlir-commits] [mlir] [MLIR] Add index bitwidth to the DataLayout (PR #85927)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Wed Mar 20 07:59:00 PDT 2024


================
@@ -345,6 +345,8 @@ TEST(DataLayout, NullSpec) {
   EXPECT_EQ(layout.getTypeABIAlignment(Float16Type::get(&ctx)), 16u);
   EXPECT_EQ(layout.getTypePreferredAlignment(IntegerType::get(&ctx, 42)), 128u);
   EXPECT_EQ(layout.getTypePreferredAlignment(Float16Type::get(&ctx)), 32u);
+  EXPECT_EQ(layout.getTypeIndexBitwidth(Float16Type::get(&ctx)), std::nullopt);
+  EXPECT_EQ(*layout.getTypeIndexBitwidth(IndexType::get(&ctx)), 64u);
----------------
ftynse wrote:

Nit: don't dereference to be consistent with the code below.

https://github.com/llvm/llvm-project/pull/85927


More information about the Mlir-commits mailing list