diff --git a/mlir/include/mlir/Interfaces/InferTypeOpInterface.td b/mlir/include/mlir/Interfaces/InferTypeOpInterface.td --- a/mlir/include/mlir/Interfaces/InferTypeOpInterface.td +++ b/mlir/include/mlir/Interfaces/InferTypeOpInterface.td @@ -38,19 +38,20 @@ }], /*retTy=*/"LogicalResult", /*methodName=*/"inferReturnTypes", - /*args=*/(ins "MLIRContext*":$context, - "Optional":$location, - "ValueRange":$operands, - "DictionaryAttr":$attributes, - "RegionRange":$regions, - "SmallVectorImpl&":$inferredReturnTypes) + /*args=*/(ins "::mlir::MLIRContext *":$context, + "::llvm::Optional<::mlir::Location>":$location, + "::mlir::ValueRange":$operands, + "::mlir::DictionaryAttr":$attributes, + "::mlir::RegionRange":$regions, + "::llvm::SmallVectorImpl<::mlir::Type>&":$inferredReturnTypes) >, StaticInterfaceMethod< /*desc=*/"Returns whether two array of types are compatible result types" " for an op.", /*retTy=*/"bool", /*methodName=*/"isCompatibleReturnTypes", - /*args=*/(ins "ArrayRef":$lhs, "ArrayRef":$rhs), + /*args=*/(ins "::llvm::ArrayRef<::mlir::Type>":$lhs, + "::llvm::ArrayRef<::mlir::Type>":$rhs), /*methodBody=*/[{ return ConcreteOp::isCompatibleReturnTypes(lhs, rhs); }], diff --git a/mlir/test/lib/Dialect/Test/TestOps.td b/mlir/test/lib/Dialect/Test/TestOps.td --- a/mlir/test/lib/Dialect/Test/TestOps.td +++ b/mlir/test/lib/Dialect/Test/TestOps.td @@ -1000,7 +1000,7 @@ let results = (outs I32:$result1, F32:$result2, F32:$result3); } -def AnotherThreeResultOp : TEST_Op<"another_three_result"> { +def AnotherThreeResultOp : TEST_Op<"another_three_result", [DeclareOpInterfaceMethods]> { let arguments = (ins MultiResultOpEnum:$kind); let results = (outs I32:$result1, F32:$result2, F32:$result3); } diff --git a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp --- a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp +++ b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp @@ -453,10 +453,10 @@ genVerifier(); genCanonicalizerDecls(); genFolderDecls(); + genTypeInterfaceMethods(); genOpInterfaceMethods(); generateOpFormat(op, opClass); genSideEffectInterfaceMethods(); - genTypeInterfaceMethods(); } void OpEmitter::emitDecl(const Operator &op, raw_ostream &os) { @@ -1739,7 +1739,6 @@ auto *method = opClass.addMethodAndPrune("::mlir::LogicalResult", "inferReturnTypes", OpMethod::MP_Static, std::move(paramList)); - auto &body = method->body(); body << " inferredReturnTypes.resize(" << op.getNumResults() << ");\n";