[all-commits] [llvm/llvm-project] 24685a: [mlir][python] allow for detaching operations from...

ftynse via All-commits all-commits at lists.llvm.org
Sun Oct 31 01:42:31 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 24685aaeb7371137e74d8290a3cf9c8ad2d544a9
      https://github.com/llvm/llvm-project/commit/24685aaeb7371137e74d8290a3cf9c8ad2d544a9
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2021-10-31 (Sun, 31 Oct 2021)

  Changed paths:
    M mlir/include/mlir-c/IR.h
    M mlir/lib/Bindings/Python/IRCore.cpp
    M mlir/lib/Bindings/Python/IRModule.h
    M mlir/lib/CAPI/IR/IR.cpp
    M mlir/lib/IR/Operation.cpp
    M mlir/test/python/ir/operation.py

  Log Message:
  -----------
  [mlir][python] allow for detaching operations from a block

Provide support for removing an operation from the block that contains it and
moving it back to detached state. This allows for the operation to be moved to
a different block, a common IR manipulation for, e.g., module merging.

Also fix a potential one-past-end iterator dereference in Operation::moveAfter
discovered in the process.

Reviewed By: mehdi_amini

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




More information about the All-commits mailing list