[Mlir-commits] [mlir] [mlir] Clone attrs of unregistered dialect ops (PR #151847)

Mehdi Amini llvmlistbot at llvm.org
Mon Aug 4 06:13:19 PDT 2025


joker-eph wrote:

I wonder if the fix shouldn't be instead:

```
diff --git a/mlir/lib/IR/MLIRContext.cpp b/mlir/lib/IR/MLIRContext.cpp
index 06ec1c85fb4d..2d5381d43f86 100644
--- a/mlir/lib/IR/MLIRContext.cpp
+++ b/mlir/lib/IR/MLIRContext.cpp
@@ -884,6 +884,8 @@ int OperationName::UnregisteredOpModel::getOpPropertyByteSize() {
 void OperationName::UnregisteredOpModel::initProperties(
     OperationName opName, OpaqueProperties storage, OpaqueProperties init) {
   new (storage.as<Attribute *>()) Attribute();
+  if (init)
+    *storage.as<Attribute *>() = *init.as<Attribute *>();
 }
 void OperationName::UnregisteredOpModel::deleteProperties(
     OpaqueProperties prop) {
```

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


More information about the Mlir-commits mailing list