This parameter gives the developers the freedom to choose their desired function signature conversion for preparing their functions for buffer placement. It is introduced for BufferAssignmentFuncOpConverter, and also for BufferAssignmentReturnOpConverter, and BufferAssignmentCallOpConverter to adapt the return and call operations with the selected function signature conversion. If the parameter is set, buffer placement won't also deallocate the returned buffers.
Here are the examples if it is set and unset:
Input IR:
func test(%arg0: tensor<4x8xf32>) -> tensor<4x8xf32> { return %arg0 : tensor<4x8xf32> }
func caller(%arg0: tensor<4x8xf32>) { %0 = call @test(%arg0) : (tensor<4x8xf32>) -> (tensor<4x8xf32>) return }
Transformed IR (allowMemrefFunctionResults = true):
func test(%arg0: memref<4x8xf32>) -> memref<4x8xf32> { return %arg0 : memref<4x8xf32> }
func caller(%arg0: memref<4x8xf32>) { %0 = call @test(%arg0) : (memref<4x8xf32>) -> (memref<4x8xf32>) return }
Transformed IR (allowMemrefFunctionResults = false):
func test(%arg0: memref<4x8xf32>, %result: memref<4x8xf32) { copy(%arg0, %result) return }
func caller(%arg0: memref<4x8xf32>) { %0 = alloc() : memref<4x8xf32> call @test(%arg0, %0) : (memref<4x8xf32>, memref<4x8xf32>) -> () return }
let's not have default values for allowMemrefFunctionResults.