[all-commits] [llvm/llvm-project] 974c15: [mlir][python] Downcast attributes in more places

rk via All-commits all-commits at lists.llvm.org
Mon Jul 10 19:01:48 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 974c1596abdea379ec468bf14c3681fad7a53987
      https://github.com/llvm/llvm-project/commit/974c1596abdea379ec468bf14c3681fad7a53987
  Author: Rahul Kayaith <rkayaith at gmail.com>
  Date:   2023-07-10 (Mon, 10 Jul 2023)

  Changed paths:
    M mlir/lib/Bindings/Python/IRAttributes.cpp
    M mlir/lib/Bindings/Python/IRCore.cpp
    M mlir/lib/Bindings/Python/IRModule.h
    M mlir/lib/Bindings/Python/IRTypes.cpp
    M mlir/test/python/ir/array_attributes.py
    M mlir/test/python/ir/attributes.py
    M mlir/test/python/ir/builtin_types.py
    M mlir/test/python/ir/operation.py
    M mlir/test/python/ir/symbol_table.py

  Log Message:
  -----------
  [mlir][python] Downcast attributes in more places

Update remaining `PyAttribute`-returning APIs to return `MlirAttribute` instead,
so that they go through the downcasting mechanism.

Reviewed By: makslevental

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


  Commit: 82bbebbfc257255abf4d861c2ec7542220e42993
      https://github.com/llvm/llvm-project/commit/82bbebbfc257255abf4d861c2ec7542220e42993
  Author: Rahul Kayaith <rkayaith at gmail.com>
  Date:   2023-07-10 (Mon, 10 Jul 2023)

  Changed paths:
    M mlir/include/mlir/Bindings/Python/Attributes.td
    M mlir/test/mlir-tblgen/op-python-bindings.td
    M mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp

  Log Message:
  -----------
  [mlir][python] Replace PythonAttr mappings with downcasting

Since op `Attribute`s are automatically downcasted on access, these mappings
aren't necessary anymore. Instead we just always generate the getters/setters
for attributes even if there isn't a `PythonAttr` mapping.

depends on D154462

Reviewed By: ftynse

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


Compare: https://github.com/llvm/llvm-project/compare/1d92b68ead0c...82bbebbfc257


More information about the All-commits mailing list