Skip to content

[mlir] NFC: Clarify documentation on InferShapedTypeOpInterface::inferReturnTypeComponents #70350

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 2 commits into from
Nov 13, 2023

Conversation

ubfx
Copy link
Member

@ubfx ubfx commented Oct 26, 2023

This patch copies a sentence from the documentation of InferTypeOpInterface::inferReturnTypes() to InferShapedTypeOpInterface::inferReturnTypeComponents(), clarifying that the method expects valid (verified) input arguments.

@ubfx ubfx requested review from jpienaar and joker-eph October 26, 2023 16:35
@llvmbot llvmbot added the mlir label Oct 26, 2023
@llvmbot
Copy link
Member

llvmbot commented Oct 26, 2023

@llvm/pr-subscribers-mlir

Author: Felix Schneider (ubfx)

Changes

This patch copies a sentence from the documentation of InferTypeOpInterface::inferReturnTypes() to InferShapedTypeOpInterface::inferReturnTypeComponents(), clarifying that the method expects valid (verified) input arguments.


Full diff: https://github.com/llvm/llvm-project/pull/70350.diff

1 Files Affected:

  • (modified) mlir/include/mlir/Interfaces/InferTypeOpInterface.td (+3)
diff --git a/mlir/include/mlir/Interfaces/InferTypeOpInterface.td b/mlir/include/mlir/Interfaces/InferTypeOpInterface.td
index c5eeeaf58a7b4f8..d32dc16f6f734ae 100644
--- a/mlir/include/mlir/Interfaces/InferTypeOpInterface.td
+++ b/mlir/include/mlir/Interfaces/InferTypeOpInterface.td
@@ -142,6 +142,9 @@ def InferShapedTypeOpInterface : OpInterface<"InferShapedTypeOpInterface"> {
       Unknown (e.g., unranked) shape and nullptrs for element type and attribute
       may be returned by this function while returning success. E.g., partial
       population of components is not error condition.
+
+      Be aware that this method is supposed to be called with valid arguments,
+      e.g., operands are verified, or it may result in an undefined behavior.
       }],
       /*retTy=*/"::mlir::LogicalResult",
       /*methodName=*/"inferReturnTypeComponents",

ubfx added 2 commits November 9, 2023 21:48
…rReturnTypeComponents

This patch copies a sentence from the documentation of
`InferTypeOpInterface::inferReturnTypes()` to
`InferShapedTypeOpInterface::inferReturnTypeComponents()`, clarifying
that the method expects valid (verified) input arguments.
@ubfx ubfx force-pushed the infer-return-type-components-doc branch from a930b23 to fed5dd7 Compare November 9, 2023 20:58
@ubfx ubfx requested a review from joker-eph November 13, 2023 14:18
@ubfx ubfx merged commit 08e8dac into llvm:main Nov 13, 2023
@ubfx ubfx deleted the infer-return-type-components-doc branch November 13, 2023 18:54
zahiraam pushed a commit to zahiraam/llvm-project that referenced this pull request Nov 20, 2023
…lvm#70350)

This patch clarifies the documentation of methods `inferReturnTypeComponents()`
and `inferReturnTypes()` regarding verified/valid arguments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants