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

Boyana Norris llvmlistbot at llvm.org
Mon Aug 4 08:59:32 PDT 2025


================
@@ -734,6 +734,12 @@ Operation *Operation::clone(IRMapping &mapper, CloneOptions options) {
   // Create the new operation.
   auto *newOp = create(getLoc(), getName(), getResultTypes(), operands, attrs,
                        getPropertiesStorage(), successors, getNumRegions());
+
+  // The builder overwrites the opaque properties with the attributes; hence,
+  // copy them after building the operation.
+  if (!isRegistered())
----------------
brnorris03 wrote:

I followed the @joker-eph's suggestion, which does this more cleanly, and so the above special case in `clone` is no longer required (and has been removed).

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


More information about the Mlir-commits mailing list