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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions mlir/include/mlir/Interfaces/InferTypeOpInterface.td
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ def InferTypeOpInterface : OpInterface<"InferTypeOpInterface"> {
The return types may be elided or specific elements be null for elements
that should just be returned but not verified.

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.
Because this method can be called from within different stages of IR
verification, implementations should not assume the arguments to
represent fully valid IR and are responsible for checking inputs for
validity to the degree necessary to perform the return type inference.
}],
/*retTy=*/"::mlir::LogicalResult",
/*methodName=*/"refineReturnTypes",
Expand Down Expand Up @@ -142,6 +144,11 @@ 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.

Because this method can be called from within different stages of IR
verification, implementations should not assume the arguments to
represent fully valid IR and are responsible for checking inputs for
validity to the degree necessary to perform the return type inference.
}],
/*retTy=*/"::mlir::LogicalResult",
/*methodName=*/"inferReturnTypeComponents",
Expand Down