diff --git a/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td b/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td index 96ea659dd1f49..b630a73cbf45e 100644 --- a/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td +++ b/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td @@ -114,8 +114,8 @@ def PDL_ApplyNativeRewriteOp OptionalAttr:$constParams); let results = (outs Variadic:$results); let assemblyFormat = [{ - $name ($constParams^)? (`(` $args^ `:` type($args) `)`)? `:` type($results) - attr-dict + $name ($constParams^)? (`(` $args^ `:` type($args) `)`)? + (`:` type($results)^)? attr-dict }]; } diff --git a/mlir/test/Dialect/PDL/ops.mlir b/mlir/test/Dialect/PDL/ops.mlir index 1993895c0d6de..8a35693fa7064 100644 --- a/mlir/test/Dialect/PDL/ops.mlir +++ b/mlir/test/Dialect/PDL/ops.mlir @@ -110,3 +110,12 @@ pdl.pattern @infer_type_from_type_used_in_match : benefit(1) { %newOp = pdl.operation "foo.op" -> (%types, %otherTypes : !pdl.range, !pdl.range) } } + +// ----- + +pdl.pattern @apply_rewrite_with_no_results : benefit(1) { + %root = pdl.operation + pdl.rewrite %root { + pdl.apply_native_rewrite "NativeRewrite"(%root : !pdl.operation) + } +}