[PATCH] D80696: [MLIR][BufferPlacement] Support functions that return Memref typed results

Ehsan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 28 07:35:16 PDT 2020


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


================
Comment at: mlir/test/lib/Transforms/TestBufferPlacement.cpp:77
 
-      // Move regions from the old operation to the new one.
-      auto &region = linalgOp.region();
-      rewriter.inlineRegionBefore(op.region(), region, region.end());
-
-      // TODO: verify the internal memref-based linalg functionality.
-      auto &entryBlock = region.front();
-      for (auto result : results) {
-        auto type = result.getType().cast<ShapedType>();
-        entryBlock.addArgument(type.getElementType());
+      // Create a new block in the region of the new Generic Op.
+      Block &oldBlock = op.getRegion().front();
----------------
herhut wrote:
> Looking at this again, would it not be easier to use `rewriter.inlineRegionBefore` to move over the entire region into the new op and then only add the new arguments to the first block? Sorry for not suggesting this earlier.
Thanks for the suggestion. The problem in this way is that we should add the new arguments using block.addArgument which happens outside of the rewriter and is not undoable.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80696





More information about the llvm-commits mailing list