[all-commits] [llvm/llvm-project] afeda4: [mlir][python] provide access to function argument...

ftynse via All-commits all-commits at lists.llvm.org
Thu Sep 30 00:38:29 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: afeda4b9ed881fb3f1b4340b8afa9963656013dc
      https://github.com/llvm/llvm-project/commit/afeda4b9ed881fb3f1b4340b8afa9963656013dc
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2021-09-30 (Thu, 30 Sep 2021)

  Changed paths:
    M mlir/lib/Bindings/Python/IRCore.cpp
    M mlir/lib/Bindings/Python/PybindUtils.h
    M mlir/python/mlir/dialects/_builtin_ops_ext.py
    M mlir/test/python/dialects/builtin.py
    M mlir/test/python/ir/operation.py

  Log Message:
  -----------
  [mlir][python] provide access to function argument/result attributes

Without this change, these attributes can only be accessed through the generic
operation attribute dictionary provided the caller knows the special operation
attribute names used for this purpose. Add some Python wrapping to support this
use case.

Also provide access to function arguments usable inside the function along with
a couple of quality-of-life improvements in using block arguments (function
arguments being the arguments of its entry block).

Reviewed By: stellaraccident

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


  Commit: 8c1b785ce110b754c2112906021a929ddd32f587
      https://github.com/llvm/llvm-project/commit/8c1b785ce110b754c2112906021a929ddd32f587
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2021-09-30 (Thu, 30 Sep 2021)

  Changed paths:
    M mlir/python/CMakeLists.txt
    A mlir/python/mlir/dialects/SCFOps.td
    A mlir/python/mlir/dialects/_scf_ops_ext.py
    A mlir/python/mlir/dialects/scf.py
    A mlir/test/python/dialects/scf.py

  Log Message:
  -----------
  [mlir][python] provide bindings for the SCF dialect

This is an important core dialect that has not been exposed previously. Set up
the default bindings generation and provide a nicer wrapper for the `for` loop
with access to the loop configuration and body.

Depends On D110758

Reviewed By: stellaraccident

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


Compare: https://github.com/llvm/llvm-project/compare/455b60ccfbfd...8c1b785ce110


More information about the All-commits mailing list