|
9 | 9 | // This file contains a set of interfaces that can be used to define information |
10 | 10 | // related to type inference. |
11 | 11 | // |
| 12 | +// This interface is also used by ODS to create builders for operations that |
| 13 | +// do not require result type to be specified. Including this interface in |
| 14 | +// dialect op definitions is sufficient to result in such builders being |
| 15 | +// automatically generated for trivially buildable result types. |
| 16 | +// |
12 | 17 | //===----------------------------------------------------------------------===// |
13 | 18 |
|
14 | 19 | #ifndef MLIR_INFERTYPEOPINTERFACE |
@@ -37,6 +42,10 @@ def InferTypeOpInterface : OpInterface<"InferTypeOpInterface"> { |
37 | 42 | and the regions of the op. Be aware that this method is supposed to be |
38 | 43 | called with valid arguments, e.g., operands are verified, or it may result |
39 | 44 | in an undefined behavior. |
| 45 | + |
| 46 | + The inferred result types may be less precise than what may be specified |
| 47 | + directly or produced by refinement, but are required to be compatible |
| 48 | + (as defined by the op's compatibility function). |
40 | 49 | }], |
41 | 50 | /*retTy=*/"::llvm::LogicalResult", |
42 | 51 | /*methodName=*/"inferReturnTypes", |
@@ -67,10 +76,10 @@ def InferTypeOpInterface : OpInterface<"InferTypeOpInterface"> { |
67 | 76 | The return types may be elided or specific elements be null for elements |
68 | 77 | that should just be returned but not verified. |
69 | 78 |
|
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. |
| 79 | + This method may be called from within different stages of IR verification, |
| 80 | + implementations should not assume the arguments to represent fully valid |
| 81 | + IR and are responsible for checking inputs for validity to the degree |
| 82 | + necessary to perform the return type inference. |
74 | 83 | }], |
75 | 84 | /*retTy=*/"::llvm::LogicalResult", |
76 | 85 | /*methodName=*/"refineReturnTypes", |
@@ -100,8 +109,7 @@ def InferTypeOpInterface : OpInterface<"InferTypeOpInterface"> { |
100 | 109 | }] |
101 | 110 | >, |
102 | 111 | StaticInterfaceMethod< |
103 | | - /*desc=*/"Returns whether two array of types are compatible result types" |
104 | | - " for an op.", |
| 112 | + /*desc=*/"Returns whether two type ranges are compatible result types.", |
105 | 113 | /*retTy=*/"bool", |
106 | 114 | /*methodName=*/"isCompatibleReturnTypes", |
107 | 115 | /*args=*/(ins "::mlir::TypeRange":$lhs, "::mlir::TypeRange":$rhs), |
|
0 commit comments