[Mlir-commits] [mlir] [mlir] Update comment about `propertiesAttr` (NFC) (PR #89633)

Jeff Niu llvmlistbot at llvm.org
Mon Apr 22 10:06:59 PDT 2024


https://github.com/Mogball created https://github.com/llvm/llvm-project/pull/89633

[mlir] Update comment about `propertiesAttr` (NFC)

The comment is misleading because `propertiesAttr` is not actually
ignored when the operation isn't unregistered.

>From b0871b76cc4ef2b913300dc4c7f84af87ea441ac Mon Sep 17 00:00:00 2001
From: Mogball <jeff at modular.com>
Date: Mon, 22 Apr 2024 17:02:17 +0000
Subject: [PATCH] [mlir] Update comment about `propertiesAttr` (NFC)

The comment is misleading because `propertiesAttr` is not actually
ignored when the operation isn't unregistered.
---
 mlir/include/mlir/IR/OperationSupport.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

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:



More information about the Mlir-commits mailing list