[all-commits] [llvm/llvm-project] 7161aa: [mlir][linalg][bufferize] Reimplementation of scf....

Matthias Springer via All-commits all-commits at lists.llvm.org
Wed Dec 15 01:29:42 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7161aa06ef53d3fc0ce30be77e932f3d30c68466
      https://github.com/llvm/llvm-project/commit/7161aa06ef53d3fc0ce30be77e932f3d30c68466
  Author: Matthias Springer <springerm at google.com>
  Date:   2021-12-15 (Wed, 15 Dec 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.h
    M mlir/lib/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.cpp
    M mlir/lib/Dialect/Linalg/ComprehensiveBufferize/BufferizationInterfaceImpl.cpp
    M mlir/lib/Dialect/Linalg/ComprehensiveBufferize/SCFInterfaceImpl.cpp
    M mlir/test/Dialect/Linalg/comprehensive-module-bufferize-partial.mlir
    M mlir/test/Dialect/Linalg/comprehensive-module-bufferize.mlir
    M mlir/test/lib/Dialect/Linalg/TestComprehensiveBufferize.cpp
    M utils/bazel/llvm-project-overlay/mlir/BUILD.bazel

  Log Message:
  -----------
  [mlir][linalg][bufferize] Reimplementation of scf.for bufferization

Instead of modifying the existing scf.for op, create a new op with memref OpOperands/OpResults and delete the old op.

New allocations / other memrefs can now be yielded from the loop. This functionality is deactivated by default and guarded against by AssertDestinationPassingStyle.

This change also introduces `replaceOp`, which will be utilized by all other `bufferize` implementations in future commits. Bufferization will then no longer rely on old (pre-bufferize) ops to DCE away. Instead old ops are deleted on the spot. This improves debuggability because there won't be any duplicate ops anymore (bufferized + not-yet-bufferized) when dumping IR during bufferization. It is also less fragile because unbufferized IR can no longer silently "hang around" due to an implementation bug.

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




More information about the All-commits mailing list