[all-commits] [llvm/llvm-project] fdb41a: [mlir][tensor] Implement ReifyRankedShapedTypeOpIn...

Matthias Springer via All-commits all-commits at lists.llvm.org
Wed Mar 16 02:59:45 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fdb41a22ac33edc29703ec9545a451c07bfcfdf8
      https://github.com/llvm/llvm-project/commit/fdb41a22ac33edc29703ec9545a451c07bfcfdf8
  Author: Matthias Springer <springerm at google.com>
  Date:   2022-03-16 (Wed, 16 Mar 2022)

  Changed paths:
    M mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td
    M mlir/lib/Dialect/Tensor/IR/TensorOps.cpp

  Log Message:
  -----------
  [mlir][tensor] Implement ReifyRankedShapedTypeOpInterface on GenerateOp

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


  Commit: 9e24f0f4589dfdbc405f72eddd174af7511b2ff3
      https://github.com/llvm/llvm-project/commit/9e24f0f4589dfdbc405f72eddd174af7511b2ff3
  Author: Matthias Springer <springerm at google.com>
  Date:   2022-03-16 (Wed, 16 Mar 2022)

  Changed paths:
    M mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h
    M mlir/include/mlir/Dialect/Bufferization/Transforms/OneShotAnalysis.h
    M mlir/lib/Dialect/Bufferization/IR/BufferizableOpInterface.cpp
    M mlir/lib/Dialect/Bufferization/Transforms/Bufferize.cpp
    M mlir/lib/Dialect/Bufferization/Transforms/OneShotAnalysis.cpp
    M mlir/lib/Dialect/Tensor/Transforms/BufferizableOpInterfaceImpl.cpp
    M mlir/test/Dialect/Bufferization/Transforms/one-shot-bufferize.mlir
    M mlir/test/Dialect/Linalg/comprehensive-module-bufferize.mlir

  Log Message:
  -----------
  [mlir][bufferize] Do not deallocate allocs that are returned from a block

Such IR is rejected by default, but can be allowed with `allow-return-memref`. In preparation of future refactorings, do not deallocate such buffers.

One-Shot Analysis now gathers information about yielded tensors, so that we know during the actual bufferization whether a newly allocated buffer should be deallocated again. (Otherwise, it will leak. This will be addressed in a subsequent commit that also makes `allow-return-memref` a non-experimental flag.)

As a cleanup, `allow-return-memref` is now part of OneShotBufferizationOptions. (It was previously ignored by AlwaysCopyBufferizationState.) Moreover, AlwaysCopyBufferizationState now asserts that `create-deallocs` is deactivated to prevent surprising behavior.

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


Compare: https://github.com/llvm/llvm-project/compare/07d5339819e2...9e24f0f4589d


More information about the All-commits mailing list