[Mlir-commits] [mlir] [mlir] Accept OpaqueAttr as a valid memory space if the context allows unregistered dialects (PR #187682)

Matthias Springer llvmlistbot at llvm.org
Mon Mar 23 03:58:25 PDT 2026


================
@@ -616,6 +616,12 @@ bool mlir::detail::isSupportedMemorySpace(Attribute memorySpace) {
   if (llvm::isa<IntegerAttr, StringAttr, DictionaryAttr>(memorySpace))
     return true;
 
+  // Allow opaque attributes if unregistered dialects are allowed.
+  // They hold unregistered custom dialect attributes.
+  if (memorySpace.getContext()->allowsUnregisteredDialects() &&
+      isa<OpaqueAttr>(memorySpace))
+    return true;
+
   // Allow custom dialect attributes.
   if (!isa<BuiltinDialect>(memorySpace.getDialect()))
----------------
matthias-springer wrote:

I think this won't help because the `OpaqueAttr` belongs to the builtin dialect.

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


More information about the Mlir-commits mailing list