forked from OSchip/llvm-project
9613a850b6
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 |
||
---|---|---|
.. | ||
canonicalize.mlir | ||
invalid-types.mlir | ||
invalid.mlir | ||
ops.mlir |