[PATCH] D80785: [MLIR][BUFFER_PLACEMENT] Introduce CallOp converter for buffer placement

Ehsan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 29 03:45:30 PDT 2020


dfki-ehna created this revision.
Herald added subscribers: llvm-commits, jurahul, Kayjukh, frgossen, grosul1, Joonsoo, stephenneuendorffer, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, jpienaar, rriddle, mehdi_amini.
Herald added a project: LLVM.
dfki-ehna added reviewers: herhut, pifon2a, rriddle.
dfki-ehna added a project: MLIR.
pifon2a added inline comments.
pifon2a accepted this revision.
This revision is now accepted and ready to land.


================
Comment at: mlir/lib/Transforms/BufferPlacement.cpp:508
+
+      // No replaces are required.
+      replacingValues.push_back(nullptr);
----------------
nit: `No replacing is required.`


================
Comment at: mlir/test/Transforms/buffer-placement-preparation.mlir:214
+func @callee(%arg1: tensor<5xf32>) -> tensor<5xf32> {
+  %0 = linalg.generic {args_in = 1 : i64, args_out = 1 : i64, indexing_maps = [#map0, #map0], iterator_types = ["parallel"]} %arg1 {
+  ^bb0(%gen1_arg0: f32):
----------------
Please, format IR to fit 80 chars, smth like:
  %0 = linalg.generic {
         args_in = 1 : i64, 
         args_out = 1 : i64,
         indexing_maps = [#map0, #map0], 
         iterator_types = ["parallel"]
       } %arg1 {



================
Comment at: mlir/test/Transforms/buffer-placement-preparation.mlir:257
+
+// CHECK-LABEL: func @callee
+func @callee(%arg1: tensor<5xf32>) -> (tensor<5xf32>, memref<2xf32>) {
----------------
that's nice that we can already do that!


Add `BufferAssignmentCallOpConverter` as a pattern rewriter for Buffer Placement. It matches the signature of the caller operation with the callee after rewriting the callee with `FunctionAndBlockSignatureConverter`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80785

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80785.267160.patch
Type: text/x-patch
Size: 8558 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200529/a0b0284e/attachment.bin>


More information about the llvm-commits mailing list