[TableGen] Support creating multi-result ops in result patterns
authorLei Zhang <antiagainst@google.com>
Thu, 4 Jul 2019 00:17:33 +0000 (17:17 -0700)
committerjpienaar <jpienaar@google.com>
Thu, 4 Jul 2019 01:17:49 +0000 (18:17 -0700)
commit9cde4be7a5ff9c6dc15f01947e37f66e1da5dba7
tree00f639249c9b9a18f5975f3ea1fd3932b4b05bbb
parente7d594bb1c7eda850a86839bde1292d1786d30e2
[TableGen] Support creating multi-result ops in result patterns

This CL introduces a new syntax for creating multi-result ops and access their
results in result patterns. Specifically, if a multi-result op is unbound or
bound to a name without a trailing `__N` suffix, it will act as a value pack
and expand to all its values. If a multi-result op is bound to a symbol with
`__N` suffix, only the N-th result will be extracted and used.

PiperOrigin-RevId: 256465208
mlir/include/mlir/IR/OpBase.td
mlir/test/lib/TestDialect/TestOps.td
mlir/test/mlir-tblgen/pattern-bound-symbol.td
mlir/test/mlir-tblgen/pattern-multi-result-op.td
mlir/test/mlir-tblgen/pattern.mlir
mlir/tools/mlir-tblgen/RewriterGen.cpp