[mlir][python] Usability improvements for Python bindings
authorAlex Zinenko <zinenko@google.com>
Mon, 4 Oct 2021 09:38:20 +0000 (11:38 +0200)
committerAlex Zinenko <zinenko@google.com>
Mon, 4 Oct 2021 09:45:25 +0000 (11:45 +0200)
commited9e52f3af4e1d95033268b60b91cbdebe38182c
tree38693dcde1e5454223866afe740ba61385f26e3a
parentc7bd6435993ffbe0fbd1a06c2ba6fb55575edbe1
[mlir][python] Usability improvements for Python bindings

Provide a couple of quality-of-life usability improvements for Python bindings,
in particular:

  * give access to the list of types for the list of op results or block
    arguments, similarly to ValueRange->TypeRange,

  * allow for constructing empty dictionary arrays,

  * support construction of array attributes by concatenating an existing
    attribute with a Python list of attributes.

All these are required for the upcoming customization of builtin and standard
ops.

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D110946
mlir/lib/Bindings/Python/IRAttributes.cpp
mlir/lib/Bindings/Python/IRCore.cpp
mlir/test/python/ir/attributes.py
mlir/test/python/ir/operation.py