[all-commits] [llvm/llvm-project] c645ea: Add InsertionPoint and context managers to the Pyt...

Stella Laurenzo via All-commits all-commits at lists.llvm.org
Thu Oct 29 17:53:37 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c645ea5e29e5e42598c3be67a28698405e8bc563
      https://github.com/llvm/llvm-project/commit/c645ea5e29e5e42598c3be67a28698405e8bc563
  Author: Stella Laurenzo <stellaraccident at gmail.com>
  Date:   2020-10-29 (Thu, 29 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/dialects.py
    A mlir/test/Bindings/Python/insertion_point.py
    M mlir/test/Bindings/Python/ir_operation.py
    M mlir/test/CAPI/ir.c

  Log Message:
  -----------
  Add InsertionPoint and context managers to the Python API.

* Removes index based insertion. All insertion now happens through the insertion point.
* Introduces thread local context managers for implicit creation relative to an insertion point.
* Introduces (but does not yet use) binding the Context to the thread local context stack. Intent is to refactor all methods to take context optionally and have them use the default if available.
* Adds C APIs for mlirOperationGetParentOperation(), mlirOperationGetBlock() and mlirBlockGetTerminator().
* Removes an assert in PyOperation creation that was incorrectly constraining. There is already a TODO to rework the keepAlive field that it was guarding and without the assert, it is no worse than the current state.

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




More information about the All-commits mailing list