Skip to content

[mlir] Update comment about propertiesAttr (NFC) #89631

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

Mogball
Copy link
Contributor

@Mogball Mogball commented Apr 22, 2024

Stacked PRs:


[mlir] Update comment about propertiesAttr (NFC)

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

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

stack-info: PR: #89631, branch: users/Mogball/stack/1
@Mogball Mogball force-pushed the users/Mogball/stack/1 branch from 5bfaf90 to 75068fa Compare April 22, 2024 17:02
@llvmbot llvmbot added mlir:core MLIR Core Infrastructure mlir labels Apr 22, 2024
@llvmbot
Copy link
Member

llvmbot commented Apr 22, 2024

@llvm/pr-subscribers-mlir

Author: Jeff Niu (Mogball)

Changes

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 --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:

@llvmbot
Copy link
Member

llvmbot commented Apr 22, 2024

@llvm/pr-subscribers-mlir-core

Author: Jeff Niu (Mogball)

Changes

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 --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:

@Mogball Mogball closed this Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mlir:core MLIR Core Infrastructure mlir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants