[Mlir-commits] [mlir] [mlir][bufferization] Buffer deallocation: skip ops that do not operate on buffers (PR #75126)

Matthias Springer llvmlistbot at llvm.org
Tue Dec 12 01:32:23 PST 2023


================
@@ -48,6 +48,19 @@ static Value buildBoolValue(OpBuilder &builder, Location loc, bool value) {
 
 static bool isMemref(Value v) { return v.getType().isa<BaseMemRefType>(); }
 
+/// Return "true" if the given op has buffer semantics. I.e., it has buffer
+/// operands, buffer results and/or buffer region entry block arguments.
----------------
matthias-springer wrote:

I updated the PR so that ops with Allocate/Free side effects (or ops for which we do not know for sure whether they have them or not) are no longer skipped, even if the op has no memref operands and/or op results. This should take care of ops that implicitly mutate global state. I'm going to update #75127 so that the `BufferDeallocationOpInterface` will be called for those. (In fact for any ops that may have an `Allocate` side effect.)


https://github.com/llvm/llvm-project/pull/75126


More information about the Mlir-commits mailing list