[Mlir-commits] [mlir] [mlir][IR] Generalize`DenseElementsAttr` to custom element types (PR #179122)

Jeremy Kun llvmlistbot at llvm.org
Thu Feb 5 13:53:22 PST 2026


================
@@ -41,12 +41,83 @@ def VectorElementTypeInterface : TypeInterface<"VectorElementTypeInterface"> {
   }];
 }
 
+//===----------------------------------------------------------------------===//
+// DenseElementTypeInterface
+//===----------------------------------------------------------------------===//
+
+def DenseElementTypeInterface : TypeInterface<"DenseElementType"> {
+  let cppNamespace = "::mlir";
+  let description = [{
+    This interface allows custom types to be used as element types in
+    DenseElementsAttr. Types implementing this interface define:
+
+    1. The bit size for element storage. Only full byte sizes are supported
----------------
j2kun wrote:

This note could be misinterpreted as asking the implementer of this interface to byte-align the bit size, especially since it's the first thing one reads when learning about this interface.

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


More information about the Mlir-commits mailing list