[all-commits] [llvm/llvm-project] c325e9: [mlir][linalg] Swap tensor.extract_slice(linalg.fill)

Lei Zhang via All-commits all-commits at lists.llvm.org
Tue Sep 20 14:35:15 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c325e978b529e7e899a31cd2693fbc1a676afcf0
      https://github.com/llvm/llvm-project/commit/c325e978b529e7e899a31cd2693fbc1a676afcf0
  Author: Lei Zhang <antiagainst at google.com>
  Date:   2022-09-20 (Tue, 20 Sep 2022)

  Changed paths:
    M mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
    M mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
    A mlir/lib/Dialect/Linalg/Transforms/SwapExtractSliceWithFillPatterns.cpp
    A mlir/test/Dialect/Linalg/swap-extract-slice-with-fill.mlir
    M mlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp

  Log Message:
  -----------
  [mlir][linalg] Swap tensor.extract_slice(linalg.fill)

This commit adds a pattern to swap

```
tensor.extract_slice(linalg.fill(%cst, %init))
```
into
```
linalg.fill(%cst, tensor.extract_slice(%init))
```
when the linalg.fill op have no other users.
This helps to reduce the fill footprint.

Reviewed By: mravishankar

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




More information about the All-commits mailing list