Skip to content

Commit fed5dd7

Browse files
committed
document InferReturnTypes
1 parent d8d507c commit fed5dd7

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

mlir/include/mlir/Interfaces/InferTypeOpInterface.td

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ def InferTypeOpInterface : OpInterface<"InferTypeOpInterface"> {
6767
The return types may be elided or specific elements be null for elements
6868
that should just be returned but not verified.
6969

70-
Be aware that this method is supposed to be called with valid arguments,
71-
e.g., operands are verified, or it may result in an undefined behavior.
70+
Because this method can be called from within different stages of IR
71+
verification, implementations should not assume the arguments to
72+
represent fully valid IR and are responsible for checking inputs for
73+
validity to the degree necessary to perform the return type inference.
7274
}],
7375
/*retTy=*/"::mlir::LogicalResult",
7476
/*methodName=*/"refineReturnTypes",
@@ -143,8 +145,10 @@ def InferShapedTypeOpInterface : OpInterface<"InferShapedTypeOpInterface"> {
143145
may be returned by this function while returning success. E.g., partial
144146
population of components is not error condition.
145147

146-
Be aware that this method is supposed to be called with valid arguments,
147-
e.g., operands are verified, or it may result in an undefined behavior.
148+
Because this method can be called from within different stages of IR
149+
verification, implementations should not assume the arguments to
150+
represent fully valid IR and are responsible for checking inputs for
151+
validity to the degree necessary to perform the return type inference.
148152
}],
149153
/*retTy=*/"::mlir::LogicalResult",
150154
/*methodName=*/"inferReturnTypeComponents",

0 commit comments

Comments
 (0)