[Mlir-commits] [mlir] [mlir][gpu] Declare memory effects on gpu.launch_func (PR #234427)
Jared Hoberock
llvmlistbot at llvm.org
Thu Oct 22 14:59:40 PDT 2026
jaredhoberock wrote:
> not declaring anything should be equivalent, so why isn't this something to fix on the client side?
The client in question is `ownership-based-buffer-deallocation`, which by design refuses ops with unknown memory effects.
The [rationale](https://github.com/llvm/llvm-project/blob/6989f0e555cb9ba5bf85858934063b1a08b8324a/mlir/lib/Dialect/Bufferization/Transforms/OwnershipBasedBufferDeallocation.cpp#L506-L516):
```
// (2) Memory side effects of unregistered ops are unknown. In particular, we
// do not know whether an unregistered op allocates memory or not.
// - Ops with recursive memory effects are allowed. All nested ops in the
// regions of `op` will be analyzed separately.
// - Call ops are allowed even though they typically do not implement the
// MemoryEffectOpInterface. They usually do not have side effects apart
// from the callee, which will be analyzed separately. (This is similar to
// "recursive memory effects".)
```
So it makes an exception for call ops, but `gpu.launch_func` doesn't implement `CallOpInterface`. Declaring read & write is true of `gpu.launch_func` and seemed simpler than teaching the bufferization pass about GPU launches.
What do you think?
https://github.com/llvm/llvm-project/pull/234427
More information about the Mlir-commits
mailing list