[mlir][PDL] Add support for variadic operands and results in the PDL Interpreter
authorRiver Riddle <riddleriver@gmail.com>
Tue, 16 Mar 2021 20:11:50 +0000 (13:11 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Tue, 16 Mar 2021 20:20:19 +0000 (13:20 -0700)
commit3a833a0e0e526d4ef3f0037eaa2ace3511f216ce
tree9335991abc9bb8a5c62a975dd768c9f1a48a9add
parent1eb6994d6ab18d5f6555acf515d27e2076fbea8a
[mlir][PDL] Add support for variadic operands and results in the PDL Interpreter

This revision extends the PDL Interpreter 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_interp.check_types : Compare a range of types with a known range.
* pdl_interp.create_types : Create a constant range of types.
* pdl_interp.get_operands : Get a range of operands from an operation.
* pdl_interp.get_results : Get a range of results from an operation.
* pdl_interp.switch_types : Switch on a range of types.

This revision handles adding support in the interpreter dialect and the conversion from PDL to PDLInterp. Support for variadic operands and results in the bytecode will be added in a followup revision.

Differential Revision: https://reviews.llvm.org/D95722
15 files changed:
mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td
mlir/include/mlir/IR/OpBase.td
mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp
mlir/lib/Conversion/PDLToPDLInterp/Predicate.cpp
mlir/lib/Conversion/PDLToPDLInterp/Predicate.h
mlir/lib/Conversion/PDLToPDLInterp/PredicateTree.cpp
mlir/lib/Conversion/PDLToPDLInterp/PredicateTree.h
mlir/lib/Dialect/PDLInterp/IR/PDLInterp.cpp
mlir/lib/Rewrite/ByteCode.cpp
mlir/lib/TableGen/Predicate.cpp
mlir/test/Conversion/PDLToPDLInterp/pdl-to-pdl-interp-matcher.mlir
mlir/test/Conversion/PDLToPDLInterp/pdl-to-pdl-interp-rewriter.mlir
mlir/test/Dialect/PDLInterp/ops.mlir
mlir/test/Rewrite/pdl-bytecode.mlir
mlir/test/mlir-tblgen/op-attribute.td