| 9613a850 | 26-Apr-2022 |
River Riddle <[email protected]> |
[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 a
[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
show more ...
|
| 1eb6994d | 16-Mar-2021 |
River Riddle <[email protected]> |
[mlir][PDL] Add support for variadic operands and results in PDL
This revision extends the PDL dialect to add support for variadic operands and results, with ranges of these values represented via t
[mlir][PDL] Add support for variadic operands and results in PDL
This revision extends the PDL dialect to add support for variadic operands and results, with ranges of these values represented via the recently added !pdl.range type. To support this extension, three new operations have been added that closely match the single variant: * pdl.operands : Define a range of input operands. * pdl.results : Extract a result group from an operation. * pdl.types : Define a handle to a range of types.
Support for these in the pdl interpreter dialect and byte code will be added in followup revisions.
Differential Revision: https://reviews.llvm.org/D95721
show more ...
|