[Mlir-commits] [mlir] [mlir][bufferization] Fix SimplifyClones with dealloc before cloneOp (PR #79098)

Matthias Springer llvmlistbot at llvm.org
Tue Jan 23 00:26:46 PST 2024


================
@@ -505,6 +505,11 @@ struct SimplifyClones : public OpRewritePattern<CloneOp> {
     // of the source.
     for (Operation *pos = cloneOp->getNextNode(); pos != redundantDealloc;
          pos = pos->getNextNode()) {
+      // If the next node is nullptr, it indicates there is no redundantDealloc
+      // after cloneOp, means that there is a redundantDealloc preseding
----------------
matthias-springer wrote:

I think it could also mean that there is no dealloc at all. Can we phrase this along the lines of `Bail if we run out of operations while looking for a deallocation op.`?


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


More information about the Mlir-commits mailing list