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

Mehdi Amini llvmlistbot at llvm.org
Mon Mar 23 03:54:10 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()))
----------------
joker-eph wrote:

```suggestion
  if (!isa_or_null<BuiltinDialect>(memorySpace.getDialect()))
```

This should be enough to fix this I'd think?

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


More information about the Mlir-commits mailing list