[mlir][transform][structured][python] Allow str arg in match_op_names.
authorIngo Müller <ingomueller@google.com>
Thu, 20 Jul 2023 09:58:41 +0000 (09:58 +0000)
committerIngo Müller <ingomueller@google.com>
Fri, 21 Jul 2023 09:36:55 +0000 (09:36 +0000)
commit8fd207fd0dcc398c2fcfd953d7e3ebe7cb53f188
treec532c11ae6e3b6361bde5e40314908bd8dcfedac
parent522831384f9051c4e40d26ab8f6d1d0762d4f6aa
[mlir][transform][structured][python] Allow str arg in match_op_names.

Allow the `names` argument in `MatchOp.match_op_names` to be of type
`str` in addition to `Sequence[str]`. In this case, the argument is
treated as a list with one name, i.e., it is possible to write
`MatchOp.match_op_names(..., "test.dummy")` instead of
`MatchOp.match_op_names(..., ["test.dummy"])`.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D155807
mlir/python/mlir/dialects/_structured_transform_ops_ext.py
mlir/test/python/dialects/transform_structured_ext.py