[PATCH] D78484: Providing buffer assignment for MLIR

Ehsan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 22 07:00:58 PDT 2020


dfki-ehna marked an inline comment as done.
dfki-ehna added inline comments.


================
Comment at: mlir/include/mlir/Transforms/BufferAssignment.h:107
+    auto numReturnValues = returnOp.getNumOperands();
+    auto funcOp = returnOp.template getParentOfType<FuncOp>();
+    auto numFuncArgs = funcOp.getNumArguments();
----------------
mehdi_amini wrote:
> rriddle wrote:
> > Do we need to hard-code FuncOp here? Could we instead just check the number of arguments in the entry block of the function? Or is there some better way to make this more general?
> I agree. Some tricky part is that this goes with the other pattern above which is also hard-coded on FuncOp and this pattern can only operate correctly after the other one rewrote the function. This is an even stronger point of coupling I believe.
Thanks for the suggestion. Replaced with the block entry.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78484





More information about the llvm-commits mailing list