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

Jeff Niu llvmlistbot at llvm.org
Mon Apr 22 11:00:26 PDT 2024


https://github.com/Mogball updated https://github.com/llvm/llvm-project/pull/89634

>From 1e2fb38a36241511c02a6b9fa224e02ba2014c1a 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.

stack-info: PR: https://github.com/llvm/llvm-project/pull/89634, branch: users/Mogball/stack/2
---
 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..cdb75a3777ad80 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