llvm-project
f5111c17 - [mlir][bufferization] add same-block alloc lifetime analysis for static buffer planning

Commit
142 days ago
[mlir][bufferization] add same-block alloc lifetime analysis for static buffer planning Adds an analysis-only pass that finds same-block memref.alloc/dealloc pairs eligible for static memory reuse. For each eligible alloc it computes a conservative alias-aware lifetime interval using BufferViewFlowAnalysis, collects size/alignment metadata, and emits op remarks. Ineligible allocs get a skip reason (dynamic shape, nested in loop/conditional, no unique same-block dealloc, escaping alias). Aggregate counts are tracked as pass statistics. No IR mutations. Intended to run after the deallocation pipeline (ownership-based-buffer-deallocation + bufferization-lower-deallocations). This is the first upstream step for a buffer reuse pass discussed in the MLIR discourse thread (RFC: GSoC buffer reuse pass for non-overlapping allocations after lower-deallocations). Adds six lit/FileCheck tests covering the main eligibility paths. Signed-off-by: KrxGu <krishom70@gmail.com>
Author
Committer
Parents
Loading