diff --git a/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td b/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td --- a/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td +++ b/mlir/include/mlir/Dialect/PDL/IR/PDLOps.td @@ -114,8 +114,8 @@ 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 --- a/mlir/test/Dialect/PDL/ops.mlir +++ b/mlir/test/Dialect/PDL/ops.mlir @@ -110,3 +110,12 @@ %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) + } +}