[Mlir-commits] [mlir] [mlir][linalg] Add more precise memory effects to linalg op (PR #92079)
donald chen
llvmlistbot at llvm.org
Fri May 17 08:46:49 PDT 2024
================
@@ -289,6 +289,9 @@ def MapOp : LinalgStructuredBase_Op<"map", [
bool payloadUsesValueFromOperand(OpOperand * opOperand) {
if (isDpsInit(opOperand)) return false;
+ if (getOperation()->getRegion(0).empty()) {
+ return true;
+ }
----------------
cxy-1993 wrote:
> `linalg.map { arith.addf }` is just a pretty-printed version. It has a region with an `arith.addf` and `linalg.yield` terminator.
You are right. I reviewed why I thought this way: before this, I didn't add handling for when region was empty, leading to some core dump issues during part of the bufferization tests. This happened because the 'cloneWithoutRegions' function was called during the bufferization process, and in this function, the side effects of 'op' were queried, unfortunately, at this time region was still empty. So, I'd like to solicit opinions from both of you: in this situation, can we conservatively assume that all operands can be read and written to? @matthias-springer @ftynse
https://github.com/llvm/llvm-project/pull/92079
More information about the Mlir-commits
mailing list