[llvm-branch-commits] [mlir] [mlir][Transforms] Support rolling back properties in dialect conversion (PR #82474)

Matthias Springer via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Feb 21 01:18:52 PST 2024


================
@@ -1002,12 +1002,31 @@ class ModifyOperationRewrite : public OperationRewrite {
       : OperationRewrite(Kind::ModifyOperation, rewriterImpl, op),
         loc(op->getLoc()), attrs(op->getAttrDictionary()),
         operands(op->operand_begin(), op->operand_end()),
-        successors(op->successor_begin(), op->successor_end()) {}
+        successors(op->successor_begin(), op->successor_end()) {
+    if (OpaqueProperties prop = op->getPropertiesStorage()) {
+      // Make a copy of the properties.
+      int size = op->getPropertiesStorageSize();
+      propertiesStorage = operator new(size);
+      memcpy(propertiesStorage, prop.as<void *>(), size);
----------------
matthias-springer wrote:

Changed to `copyOpProperties`.

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


More information about the llvm-branch-commits mailing list