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

Ehsan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 07:59:47 PDT 2020


dfki-ehna created this revision.
Herald added subscribers: llvm-commits, Kayjukh, frgossen, grosul1, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, jpienaar, rriddle, mehdi_amini.
Herald added a project: LLVM.
dfki-ehna edited the summary of this revision.
dfki-ehna added reviewers: mehdi_amini, pifon2a, herhut.
dfki-ehna added a project: MLIR.

Making these two converters more generic. FunctionAndBlockSignatureConverter now moves only memref results (after type conversion) to the function argument and keeps other legal function results unchanged. NonVoidToVoidReturnOpConverter is renamed to NoBufferOperandsReturnOpConverter. It removes only the buffer operands from the operands of the converted ReturnOp and inserts CopyOps to copy each buffer to the target function argument.

Input:

  func @example(%arg0: tensor<4x8xf32>, %arg1: i1) -> (tensor<4x8xf32>, i1) {
      return %arg0, %arg1 : i1, tensor<4x8xf32>
  }

Output:

  func @example(%arg0: memref<4x8xf32>, %arg1: i1, %arg2: memref<4x8xf32>) -> (i1) {
      copy(%arg0, %arg2) : memref<4x8xf32>, memref<4x8xf32>
      return %arg1 : i1
  }


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79329

Files:
  mlir/include/mlir/Transforms/BufferPlacement.h
  mlir/lib/Transforms/BufferPlacement.cpp
  mlir/test/Transforms/buffer-placement-prepration.mlir
  mlir/test/lib/Transforms/TestBufferPlacement.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79329.261816.patch
Type: text/x-patch
Size: 10033 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200504/30911bb2/attachment.bin>


More information about the llvm-commits mailing list