[all-commits] [llvm/llvm-project] 3b2004: [mlir][bufferization] Add TensorCopyInsertion pass

Matthias Springer via All-commits all-commits at lists.llvm.org
Thu Jun 9 12:56:30 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3b2004e16b30e60ab1e3eaca3398e303270cb666
      https://github.com/llvm/llvm-project/commit/3b2004e16b30e60ab1e3eaca3398e303270cb666
  Author: Matthias Springer <springerm at google.com>
  Date:   2022-06-09 (Thu, 09 Jun 2022)

  Changed paths:
    M mlir/include/mlir/Dialect/Bufferization/Transforms/Passes.h
    M mlir/include/mlir/Dialect/Bufferization/Transforms/Passes.td
    A mlir/include/mlir/Dialect/Bufferization/Transforms/TensorCopyInsertion.h
    M mlir/lib/Dialect/Bufferization/Transforms/CMakeLists.txt
    A mlir/lib/Dialect/Bufferization/Transforms/TensorCopyInsertion.cpp
    A mlir/test/Dialect/Bufferization/Transforms/tensor-copy-insertion.mlir

  Log Message:
  -----------
  [mlir][bufferization] Add TensorCopyInsertion pass

This pass runs the One-Shot Analysis to find out which tensor OpOperands must bufferize out-of-place. It then rewrites those tensor OpOperands to explicit allocations with a copy in the form of `bufferization.alloc_tensor`. The resulting IR can then be bufferized without having to care about read-after-write conflicts.

This change makes it possible to connect One-Shot Analysis to other bufferizations such as the sparse compiler.

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




More information about the All-commits mailing list