[all-commits] [llvm/llvm-project] 7f2236: [mlir][linalg] Add output tensor args folding for ...

Alexander Belyaev via All-commits all-commits at lists.llvm.org
Thu Mar 25 10:12:25 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7f2236cf581e6d666e4c3eb512a76f1608fe0bf7
      https://github.com/llvm/llvm-project/commit/7f2236cf581e6d666e4c3eb512a76f1608fe0bf7
  Author: Alexander Belyaev <pifon at google.com>
  Date:   2021-03-25 (Thu, 25 Mar 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td
    M mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
    M mlir/test/Dialect/Linalg/canonicalize.mlir

  Log Message:
  -----------
  [mlir][linalg] Add output tensor args folding for linalg.tiled_loop.

Folds away TiledLoopOp output tensors when the following conditions are met:
* result of `linalg.tiled_loop` has no uses
* output tensor is the argument of `linalg.yield`

Example:

```
%0 = linalg.tiled_loop ...  outs (%out, %out_buf:tensor<...>, memref<...>) {
  ...
  linalg.yield %out : tensor ...
}
```

Becomes

```
linalg.tiled_loop ...  outs (%out_buf:memref<...>) {
  ...
  linalg.yield
}
```

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




More information about the All-commits mailing list