[all-commits] [llvm/llvm-project] 580915: [mlir] Expose Value hierarchy to Python bindings

ftynse via All-commits all-commits at lists.llvm.org
Wed Oct 21 00:53:05 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 580915d6a2970022d5b7e05d4587de0fd7126c31
      https://github.com/llvm/llvm-project/commit/580915d6a2970022d5b7e05d4587de0fd7126c31
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2020-10-21 (Wed, 21 Oct 2020)

  Changed paths:
    M mlir/include/mlir-c/IR.h
    M mlir/lib/Bindings/Python/IRModules.cpp
    M mlir/lib/Bindings/Python/IRModules.h
    M mlir/lib/CAPI/IR/IR.cpp
    M mlir/test/Bindings/Python/ir_operation.py

  Log Message:
  -----------
  [mlir] Expose Value hierarchy to Python bindings

Values are ubiquitous in the IR, in particular block argument and operation
results are Values. Define Python classes for BlockArgument, OpResult and their
common ancestor Value. Define pseudo-container classes for lists of block
arguments and operation results, and use these containers to access the
corresponding values in blocks and operations.

Differential Revision: https://reviews.llvm.org/D89778


  Commit: 31782cd2199b808cda6733d6448e1314e2c8ec96
      https://github.com/llvm/llvm-project/commit/31782cd2199b808cda6733d6448e1314e2c8ec96
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2020-10-21 (Wed, 21 Oct 2020)

  Changed paths:
    M mlir/lib/Bindings/Python/IRModules.cpp

  Log Message:
  -----------
  [mlir] Use the correct base class for Attributes in Python bindings

The pybind class typedef for concrete attribute classes was erroneously
deriving all of them from PyAttribute instead of the provided base class. This
has not been triggering any error because only one level of the hierarchy is
currently exposed.

Differential Revision: https://reviews.llvm.org/D89779


  Commit: f6f27115e622f2cc6b20579e9d7d84c2304091a1
      https://github.com/llvm/llvm-project/commit/f6f27115e622f2cc6b20579e9d7d84c2304091a1
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2020-10-21 (Wed, 21 Oct 2020)

  Changed paths:
    M mlir/lib/Bindings/Python/IRModules.cpp

  Log Message:
  -----------
  [mlir] Fix copy-pasted docstrings in Python bindings

Docstrings for `__str__` method in many classes was recycling the constant
string defined for `Type`, without being types themselves. Use proper
docstrings instead. Since they are succint, use string literals instead of
top-level constants to avoid further mistakes.

Differential Revision: https://reviews.llvm.org/D89780


Compare: https://github.com/llvm/llvm-project/compare/d4d0b41a822b...f6f27115e622


More information about the All-commits mailing list