[all-commits] [llvm/llvm-project] 180f9e: [mlir][linalg] LinalgOp-anchored empty tensor elim...

Matthias Springer via All-commits all-commits at lists.llvm.org
Mon Jul 3 00:23:10 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 180f9ef8b79bc4ef9aec89e7648a2d5f45100264
  Author: Matthias Springer <me at m-sp.org>
  Date:   2023-07-03 (Mon, 03 Jul 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td
    M mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
    M mlir/lib/Dialect/Linalg/TransformOps/CMakeLists.txt
    M mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
    M mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
    A mlir/lib/Dialect/Linalg/Transforms/EliminateEmptyTensors.cpp
    A mlir/test/Dialect/Linalg/one-shot-bufferize-empty-tensor-elimination.mlir
    M utils/bazel/llvm-project-overlay/mlir/BUILD.bazel

  Log Message:
  [mlir][linalg] LinalgOp-anchored empty tensor elimination

This revision adds a pre-bufferization transform that can reduce the number of allocation. It is similar to `bufferization.eliminate_empty_tensors`, but specific to LinalgOp.

The transform looks for `tensor.empty` ops where the SSA use-def chain ends in an "ins" operand of a `LinalgOp`. If the same `LinalgOp` has an unused "outs" operand (and some other conditions are met), this "outs" operand can be used instead of the `tensor.empty` and the "ins" operand can be turned into an "outs" operand.

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

More information about the All-commits mailing list