Skip to content

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

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

Merged
merged 1 commit into from
Apr 23, 2024
Merged

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.

Mogball pushed a commit that referenced this pull request Apr 22, 2024
The comment is misleading because `propertiesAttr` is not actually
ignored when the operation isn't unregistered.

stack-info: PR: #89634, branch: users/Mogball/stack/2
@Mogball Mogball force-pushed the users/Mogball/stack/2 branch from b0871b7 to af37ebd Compare April 22, 2024 17:29
@llvmbot llvmbot added mlir:core MLIR Core Infrastructure mlir labels Apr 22, 2024
@Mogball Mogball requested a review from joker-eph April 22, 2024 17:29
@llvmbot
Copy link
Member

llvmbot commented Apr 22, 2024

@llvm/pr-subscribers-mlir

@llvm/pr-subscribers-mlir-core

Author: Jeff Niu (Mogball)

Changes

Stacked PRs:

  • ->#89634

[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/89634.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:

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

stack-info: PR: #89634, branch: users/Mogball/stack/2
@Mogball Mogball force-pushed the users/Mogball/stack/2 branch from af37ebd to 1e2fb38 Compare April 22, 2024 18:00
@Mogball Mogball merged commit e0c2848 into main Apr 23, 2024
@Mogball Mogball deleted the users/Mogball/stack/2 branch April 23, 2024 15:36
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