[all-commits] [llvm/llvm-project] e7cb71: [mlir][Linalg] Pattern to fuse pad operation with ...

MaheshRavishankar via All-commits all-commits at lists.llvm.org
Tue Jan 11 13:37:41 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e7cb716ef95551000d9de2d0334ab1bf84a120a3
      https://github.com/llvm/llvm-project/commit/e7cb716ef95551000d9de2d0334ab1bf84a120a3
  Author: MaheshRavishankar <ravishankarm at google.com>
  Date:   2022-01-11 (Tue, 11 Jan 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/PadOpInterchange.cpp
    A mlir/test/Dialect/Linalg/pad_fusion.mlir
    M mlir/test/lib/Dialect/Linalg/CMakeLists.txt
    A mlir/test/lib/Dialect/Linalg/TestPadFusion.cpp
    M mlir/tools/mlir-opt/mlir-opt.cpp

  Log Message:
  -----------
  [mlir][Linalg] Pattern to fuse pad operation with elementwise operations.

Most convolution operations need explicit padding of the input to
ensure all accesses are inbounds. In such cases, having a pad
operation can be a significant overhead. One way to reduce that
overhead is to try to fuse the pad operation with the producer of its
source.

A sequence

```
linalg.generic -> linalg.pad_tensor
```

can be replaced with

```
linalg.fill -> tensor.extract_slice -> linalg.generic ->
tensor.insert_slice.
```

if the `linalg.generic` has all parallel iterator types.

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




More information about the All-commits mailing list