[mlir:PDL] Fix a syntax ambiguity in pdl.attribute
authorRiver Riddle <riddleriver@gmail.com>
Tue, 26 Apr 2022 18:21:18 +0000 (11:21 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Thu, 28 Apr 2022 19:57:59 +0000 (12:57 -0700)
commitd4381b3f93a6e53e1b35232b9a0039b1f5e04c6a
tree5037f6fa145803787a8158664b3aea93bd99d514
parent92a836da07596a9e409c3b4231fe727e0924d0e4
[mlir:PDL] Fix a syntax ambiguity in pdl.attribute

pdl.attribute currently has a syntax ambiguity that leads to the incorrect parsing
of pdl.attribute operations with locations that don't also have a constant value. For example:

```
pdl.attribute loc("foo")
```

The above IR is treated as being a pdl.attribute with a constant value containing the location,
`loc("foo")`, which is incorrect. This commit changes the syntax to use `= <constant-value>` to
clearly distinguish when the constant value is present, as opposed to just trying to parse an attribute.

Differential Revision: https://reviews.llvm.org/D124582
mlir/include/mlir/Dialect/PDL/IR/PDLOps.td
mlir/test/Conversion/PDLToPDLInterp/pdl-to-pdl-interp-matcher.mlir
mlir/test/Conversion/PDLToPDLInterp/pdl-to-pdl-interp-rewriter.mlir
mlir/test/Dialect/PDL/invalid.mlir
mlir/test/Dialect/PDL/ops.mlir
mlir/test/Integration/Dialect/PDL/CPU/multiroot.mlir
mlir/test/mlir-pdll/CodeGen/MLIR/expr.pdll
mlir/test/python/dialects/pdl_ops.py