[all-commits] [llvm/llvm-project] a5d09c: [mlir][scf] Implement BufferizableOpInterface for ...
Matthias Springer via All-commits
all-commits at lists.llvm.org
Fri May 6 01:28:54 PDT 2022
Author: Matthias Springer <springerm at google.com>
Date: 2022-05-06 (Fri, 06 May 2022)
[mlir][scf] Implement BufferizableOpInterface for scf::WhileOp
This follows the same implementation strategy as scf::ForOp and common functionality is extracted into helper functions.
This implementation works well in cases where each yielded value (from either body/condition region) is equivalent to the corresponding bbArg of the parent block. In that case, each OpResult of the loop may be aliasing with the corresponding OpOperand of the loop (and with no other OpOperand).
In the absence of said equivalence relationship, new buffer copies must be inserted, so that the aliasing OpOperand/OpResult contract of scf::WhileOp is honored. In essence, by yielding a newly allocated buffer, we can enforce the specified may-alias relationship. (Newly allocated buffers cannot alias with any OpOperands of the loop.)
Differential Revision: https://reviews.llvm.org/D124929
More information about the All-commits