diff --git a/mlir/lib/Parser/TypeParser.cpp b/mlir/lib/Parser/TypeParser.cpp --- a/mlir/lib/Parser/TypeParser.cpp +++ b/mlir/lib/Parser/TypeParser.cpp @@ -34,6 +34,8 @@ case Token::kw_f16: case Token::kw_f32: case Token::kw_f64: + case Token::kw_f80: + case Token::kw_f128: case Token::kw_index: case Token::kw_none: case Token::exclamation_identifier: diff --git a/mlir/test/IR/parser.mlir b/mlir/test/IR/parser.mlir --- a/mlir/test/IR/parser.mlir +++ b/mlir/test/IR/parser.mlir @@ -1420,3 +1420,7 @@ // be handled by the dialect. // CHECK: test.dialect_custom_format_fallback custom_format_fallback test.dialect_custom_format_fallback custom_format_fallback + +// Check that an op with an optional result parses f80 as type. +// CHECK: test.format_optional_result_d_op : f80 +test.format_optional_result_d_op : f80 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 @@ -1962,6 +1962,12 @@ (`:` functional-type($optional, $variadic)^)? attr-dict }]>; +def FormatOptionalResultDOp + : TEST_Op<"format_optional_result_d_op" > { + let results = (outs Optional:$optional); + let assemblyFormat = "(`:` type($optional)^)? attr-dict"; +} + def FormatTwoVariadicOperandsNoBuildableTypeOp : TEST_Op<"format_two_variadic_operands_no_buildable_type_op", [AttrSizedOperandSegments]> {