[PATCH] D79329: [MLIR] Update the FunctionAndBlockSignatureConverter and NonVoidToVoidReturnOpConverter of Buffer Assignment

Ehsan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 7 05:38:01 PDT 2020


dfki-ehna marked 2 inline comments as done.
dfki-ehna added inline comments.


================
Comment at: mlir/test/Transforms/buffer-placement-prepration.mlir:34
+// CHECK-SAME: (i1, f16)
+//      CHECK: linalg.copy(%[[ARG2]], %[[RESULT]])
+//      CHECK: return %[[ARG0]], %[[ARG1]]
----------------
herhut wrote:
> If this returned a memref before, why would it not return a memref now? We should only rewrite the return values that got rewritten from `tensor` to `memref`. Not the ones that already were a `memref`. I'd assume those would be left alone.
The idea of removing all Memref types from function results is proposed to avoid placing a DeallocOp after the return operation using buffer-placement pass. This case would happen if there is a defining operation for a return operand.

```
func @memref_in_function_results(%arg0: i1, %arg1: f16, %arg2:memref<2xf32>) -> (i1, memref<2xf32>, f16){
  %0 = alloc() : memref<2xf32>,
  lhlo.exp(%arg2, %0)
  return %arg0, %0, %arg1  : i1, memref<2xf32>, f16
}
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79329/new/

https://reviews.llvm.org/D79329





More information about the llvm-commits mailing list