[llvm-branch-commits] [mlir] [Backport][MLIR] Properties.td fix from main commit 77f2560 (PR #165768)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Oct 30 12:01:35 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir-ods

Author: Lin-Ya Yu (yu810226)

<details>
<summary>Changes</summary>

This PR backports the change from commit 77f256070f985029a53da5e76ecd85ca7686a7ea
on `main` to `release/21.x`. Only mlir/include/mlir/IR/Properties.td is affected.

Original commit: https://github.com/llvm/llvm-project/commit/77f256070f985029a53da5e76ecd85ca7686a7ea

(cherry picked manually)

---
Full diff: https://github.com/llvm/llvm-project/pull/165768.diff


1 Files Affected:

- (modified) mlir/include/mlir/IR/Properties.td (+4-3) 


``````````diff
diff --git a/mlir/include/mlir/IR/Properties.td b/mlir/include/mlir/IR/Properties.td
index a6221f9aaaef9..a7ade0675b9bb 100644
--- a/mlir/include/mlir/IR/Properties.td
+++ b/mlir/include/mlir/IR/Properties.td
@@ -773,9 +773,10 @@ class OptionalProp<Property p, bit canDelegateParsing = 1>
   }];
   let writeToMlirBytecode = [{
     $_writer.writeOwnedBool($_storage.has_value());
-    if (!$_storage.has_value())
-      return;
-  }] # !subst("$_storage", "(*($_storage))", p.writeToMlirBytecode);
+    if ($_storage.has_value()) {
+      }] # !subst("$_storage", "(*($_storage))", p.writeToMlirBytecode) # [{
+    }
+  }];
 
   let hashProperty = !if(!empty(p.hashProperty), p.hashProperty,
     [{ hash_value($_storage.has_value() ? std::optional<::llvm::hash_code>{}] #

``````````

</details>


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


More information about the llvm-branch-commits mailing list