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

Matthias Springer llvmlistbot at llvm.org
Fri Feb 6 09:57:19 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
----------------
matthias-springer wrote:

I dropped the second sentence. It's explained in more detail on the interface method.

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


More information about the Mlir-commits mailing list