[all-commits] [llvm/llvm-project] da784e: [mlir] Add a utility function to make a region iso...

MaheshRavishankar via All-commits all-commits at lists.llvm.org
Thu Apr 20 09:40:46 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: da784e77da7715f7c1da9918e1a2bf2239c5fd06
      https://github.com/llvm/llvm-project/commit/da784e77da7715f7c1da9918e1a2bf2239c5fd06
  Author: Mahesh Ravishankar <ravishankarm at google.com>
  Date:   2023-04-20 (Thu, 20 Apr 2023)

  Changed paths:
    M mlir/include/mlir/Transforms/RegionUtils.h
    M mlir/lib/Transforms/Utils/RegionUtils.cpp
    A mlir/test/Transforms/make-isolated-from-above.mlir
    M mlir/test/lib/Dialect/Test/TestOps.td
    M mlir/test/lib/Transforms/CMakeLists.txt
    A mlir/test/lib/Transforms/TestMakeIsolatedFromAbove.cpp
    M mlir/tools/mlir-opt/mlir-opt.cpp

  Log Message:
  -----------
  [mlir] Add a utility function to make a region isolated from above.

The utility functions takes a region and makes it isolated from above
by appending to the entry block arguments that represent the captured
values and replacing all uses of the captured values within the region
with the newly added arguments. The captures values are returned.

The utility function also takes an optional callback that allows
cloning operations that define the captured values into the region
during the process of making it isolated from above. The cloned value
is no longer a captured values. The operands of the operation are then
captured values. This is done transitively allow cloning of a DAG of
operations into the region based on the callback.

Reviewed By: jpienaar

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




More information about the All-commits mailing list