[Mlir-commits] [mlir] [mlir] Update comment about `propertiesAttr` (NFC) (PR #89631)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Apr 22 10:03:29 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir-core
Author: Jeff Niu (Mogball)
<details>
<summary>Changes</summary>
Stacked PRs:
* __->__#<!-- -->89631
--- --- ---
### [mlir] Update comment about `propertiesAttr` (NFC)
The comment is misleading because `propertiesAttr` is not actually
ignored when the operation isn't unregistered.
---
Full diff: https://github.com/llvm/llvm-project/pull/89631.diff
1 Files Affected:
- (modified) mlir/include/mlir/IR/OperationSupport.h (+6-3)
``````````diff
diff --git a/mlir/include/mlir/IR/OperationSupport.h b/mlir/include/mlir/IR/OperationSupport.h
index 2c1c490aac49b8..2c6e8253b4327a 100644
--- a/mlir/include/mlir/IR/OperationSupport.h
+++ b/mlir/include/mlir/IR/OperationSupport.h
@@ -960,9 +960,12 @@ struct OperationState {
/// Regions that the op will hold.
SmallVector<std::unique_ptr<Region>, 1> regions;
- // If we're creating an unregistered operation, this Attribute is used to
- // build the properties. Otherwise it is ignored. For registered operations
- // see the `getOrAddProperties` method.
+ // This Attribute is used to opaquely construct the properties of the
+ // operation. If we're creating an unregistered operation, the Attribute is
+ // used as-is as the Properties storage of the operation. Otherwise, the
+ // operation properties are constructed opaquely using its
+ // `setPropertiesFromAttr` hook. Note that `getOrAddProperties` is the
+ // preferred method to construct properties from C++.
Attribute propertiesAttr;
private:
``````````
</details>
https://github.com/llvm/llvm-project/pull/89631
More information about the Mlir-commits
mailing list