Confusion about one-shot-bufferization dealloc memory

at the slide of (page 63), it indicate the one-shot-buffer will dealloc automatically for allocs that do not escape block boundaries.

but at the Bufferization - MLIR, it said:

One-Shot Bufferize leaks all memory and does not generate any buffer deallocations. The -buffer-deallocation-pipeline has to be run afterwards to insert the deallocation operations.

pls help me to clear it, thanks

Hi @alanguo1234 , what is shown on the slides used to be the case, but there were recent changes. Please, take a look at:

  1. [mlir][bufferization] Add an ownership based buffer deallocation pass… · llvm/llvm-project@01334d1 · GitHub
  2. [PSA] Bufferization: New Buffer Deallocation Pipeline

Hope this helps.

it mean in the past versions, one-shot-bufferization dealloc automatically. now It don’t do that, after one-shot-bufferize, need to use buffer-deallocation-pipeline or OwnershipBasedBufferDeallocationPass to dealloc it, do i understand correctly? thanks

Correct, I suggest using:

Hi chenlini
clear now, thanks for your patient guide.