[all-commits] [llvm/llvm-project] 8260db: [mlir][Python] Return and accept OpView for all fu...

Stella Laurenzo via All-commits all-commits at lists.llvm.org
Tue Nov 3 22:49:17 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 8260db752c91e0c368b88607132be0a9cd9362ba
      https://github.com/llvm/llvm-project/commit/8260db752c91e0c368b88607132be0a9cd9362ba
  Author: Stella Laurenzo <stellaraccident at gmail.com>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M mlir/lib/Bindings/Python/Globals.h
    M mlir/lib/Bindings/Python/IRModules.cpp
    M mlir/lib/Bindings/Python/IRModules.h
    M mlir/lib/Bindings/Python/MainModule.cpp
    M mlir/test/Bindings/Python/ir_operation.py

  Log Message:
  -----------
  [mlir][Python] Return and accept OpView for all functions.

* All functions that return an Operation now return an OpView.
* All functions that accept an Operation now accept an _OperationBase, which both Operation and OpView extend and can resolve to the backing Operation.
* Moves user-facing instance methods from Operation -> _OperationBase so that both can have the same API.
* Concretely, this means that if there are custom op classes defined (i.e. in Python), any iteration or creation will return the appropriate instance (i.e. if you get/create an std.addf, you will get an instance of the mlir.dialects.std.AddFOp class, getting full access to any custom API it exposes).
* Refactors all __eq__ methods after realizing the proper way to do this for _OperationBase.

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




More information about the All-commits mailing list