[all-commits] [llvm/llvm-project] 934e2f: [mlir][linalg] ComprehensiveBufferize: Do not copy...

Matthias Springer via All-commits all-commits at lists.llvm.org
Wed Sep 15 01:32:42 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 934e2f695e18033fdf740ab45bb5b0dfdf453c19
      https://github.com/llvm/llvm-project/commit/934e2f695e18033fdf740ab45bb5b0dfdf453c19
  Author: Matthias Springer <springerm at google.com>
  Date:   2021-09-15 (Wed, 15 Sep 2021)

  Changed paths:
    M mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp

  Log Message:
  -----------
  [mlir][linalg] ComprehensiveBufferize: Do not copy InitTensorOp results

E.g.:

```
%2 = memref.alloc() {alignment = 128 : i64} : memref<256x256xf32>
%3 = memref.alloc() {alignment = 128 : i64} : memref<256x256xf32>

// ... (%3 is not written to)

linalg.copy(%3, %2) : memref<256x256xf32>, memref<256x256xf32>
vector.transfer_write %11, %2[%c0, %c0] {in_bounds = [true, true]} : vector<256x256xf32>, memref<256x256xf32>
```

Avoid copies of %3 if %3 came directly from an InitTensorOp.

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




More information about the All-commits mailing list