[Mlir-commits] [mlir] Reimplementing target description concept using DLTI attribute (PR #92138)

Mehdi Amini llvmlistbot at llvm.org
Wed Jun 5 21:37:51 PDT 2024


================
@@ -362,6 +479,28 @@ def DataLayoutOpInterface : OpInterface<"DataLayoutOpInterface"> {
         return ::mlir::detail::getDefaultStackAlignment(entry);
       }]
     >,
+    StaticInterfaceMethod<
+      /*description=*/"Returns the max vector op width, if the property is "
+                      "defined. Otherwise, it returns std::nullopt.",
+      /*retTy=*/"std::optional<uint32_t>",
+      /*methodName=*/"getMaxVectorOpWidth",
+      /*args=*/(ins "::mlir::DataLayoutEntryInterface":$entry),
+      /*methodBody=*/"",
+      /*defaultImplementation=*/[{
+        return ::mlir::detail::getMaxVectorOpWidth(entry);
+      }]
+    >,
+    StaticInterfaceMethod<
+      /*description=*/"Returns the L1 cache size in bytes, if the property is "
+                      "defined. Otherwise, it returns std::nullopt.",
+      /*retTy=*/"std::optional<uint32_t>",
+      /*methodName=*/"getL1CacheSizeInBytes",
+      /*args=*/(ins "::mlir::DataLayoutEntryInterface":$entry),
+      /*methodBody=*/"",
+      /*defaultImplementation=*/[{
+        return ::mlir::detail::getL1CacheSizeInBytes(entry);
+      }]
----------------
joker-eph wrote:

(same here)

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


More information about the Mlir-commits mailing list