[mlir][PDL] Add support for variadic operands and results in the PDL byte code
authorRiver Riddle <riddleriver@gmail.com>
Tue, 16 Mar 2021 20:12:01 +0000 (13:12 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Tue, 16 Mar 2021 20:20:19 +0000 (13:20 -0700)
commit85ab413b53aeb135eb58dab066afcbf20bef0cf8
tree84027944cde9adb2a8fe4b22b6ce7b5f85000254
parent3a833a0e0e526d4ef3f0037eaa2ace3511f216ce
[mlir][PDL] Add support for variadic operands and results in the PDL byte code

Supporting ranges in the byte code requires additional complexity, given that a range can't be easily representable as an opaque void *, as is possible with the existing bytecode value types (Attribute, Type, Value, etc.). To enable representing a range with void *, an auxillary storage is used for the actual range itself, with the pointer being passed around in the normal byte code memory. For type ranges, a TypeRange is stored. For value ranges, a ValueRange is stored. The above problem represents a majority of the complexity involved in this revision, the rest is adapting/adding byte code operations to support the changes made to the PDL interpreter in the parent revision.

After this revision, PDL will have initial end-to-end support for variadic operands/results.

Differential Revision: https://reviews.llvm.org/D95723
mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td
mlir/include/mlir/IR/PatternMatch.h
mlir/include/mlir/IR/TypeRange.h
mlir/lib/IR/PatternMatch.cpp
mlir/lib/Rewrite/ByteCode.cpp
mlir/lib/Rewrite/ByteCode.h
mlir/lib/Rewrite/PatternApplicator.cpp
mlir/test/Rewrite/pdl-bytecode.mlir
mlir/test/lib/Rewrite/TestPDLByteCode.cpp