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 @@ -152,7 +152,7 @@ let arguments = (ins Optional:$type, OptionalAttr:$value); let results = (outs PDL_Attribute:$attr); - let assemblyFormat = "attr-dict (`:` $type^)? ($value^)?"; + let assemblyFormat = "(`:` $type^)? ($value^)? attr-dict-with-keyword"; let builders = [ OpBuilder<(ins CArg<"Value", "Value()">:$type), [{ diff --git a/mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td b/mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td --- a/mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td +++ b/mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td @@ -413,7 +413,7 @@ let arguments = (ins AnyAttr:$value); let results = (outs PDL_Attribute:$attribute); - let assemblyFormat = "$value attr-dict"; + let assemblyFormat = "$value attr-dict-with-keyword"; let builders = [ OpBuilder<(ins "Attribute":$value), [{ 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 @@ -119,3 +119,13 @@ pdl.apply_native_rewrite "NativeRewrite"(%root : !pdl.operation) } } + +// ----- + +pdl.pattern @attribute_with_dict : benefit(1) { + %root = pdl.operation + pdl.rewrite %root { + %attr = pdl.attribute {some_unit_attr} attributes {pdl.special_attribute} + pdl.apply_native_rewrite "NativeRewrite"(%attr : !pdl.attribute) + } +}