llvm-project/mlir/test/Dialect/PDL
River Riddle 9613a850b6 [mlir:PDL] Rework errors for pdl.operations with non-inferrable results
We currently emit an error during verification if a pdl.operation with non-inferrable
results is used within a rewrite. This allows for catching some errors during compile
time, but is slightly broken. For one, the verification at the PDL level assumes that
all dialects have been loaded, which is true at run time, but may not be true when
the PDL is generated (such as via PDLL). This commit fixes this by not emitting the
error if the operation isn't registered, i.e. it uses the `mightHave` variant of trait/interface
methods.

Secondly, we currently don't verify when a pdl.operation has no explicit results, but the
operation being created is known to expect at least one. This commit adds a heuristic
error to detect these cases when possible and fail. We can't always capture when the user
made an error, but we can capture the most common case where the user expected an
operation to infer its result types (when it actually isn't possible).

Differential Revision: https://reviews.llvm.org/D124583
2022-04-28 12:58:00 -07:00
..
canonicalize.mlir [mlir][pdl] Make `pdl` the default dialect when parsing/printing 2022-01-20 20:22:53 +00:00
invalid-types.mlir Switch generatedTypeParser/generatedAttributeParser to return an OptionalParseResult 2021-03-09 19:43:45 +00:00
invalid.mlir [mlir:PDL] Rework errors for pdl.operations with non-inferrable results 2022-04-28 12:58:00 -07:00
ops.mlir [mlir:PDL] Fix a syntax ambiguity in pdl.attribute 2022-04-28 12:57:59 -07:00