[all-commits] [llvm/llvm-project] 79f115: [mlir][bufferize] Avoid tensor copies when the dat...

Matthias Springer via All-commits all-commits at lists.llvm.org
Fri Jun 10 01:26:23 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 79f115911eebbd3c8f7758135e2533e041b0c2a3
      https://github.com/llvm/llvm-project/commit/79f115911eebbd3c8f7758135e2533e041b0c2a3
  Author: Matthias Springer <springerm at google.com>
  Date:   2022-06-10 (Fri, 10 Jun 2022)

  Changed paths:
    M mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h
    M mlir/lib/Dialect/Bufferization/IR/BufferizableOpInterface.cpp
    M mlir/test/Dialect/Bufferization/Transforms/tensor-copy-insertion.mlir

  Log Message:
  -----------
  [mlir][bufferize] Avoid tensor copies when the data is not read

There are various shortcuts in `BufferizationState::getBuffer` that avoid a buffer copy when we just need an allocation (and no initialization). This change adds those shortcuts to the TensorCopyInsertion pass, so that `getBuffer` can be simplified in a subsequent change.

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




More information about the All-commits mailing list