Static Memory Planner for MLIR
MLIR already makes allocation and deallocation structure explicit after bufferization and the ownership-based deallocation pipeline, but it still lacks an upstream static memory planner that can analyze buffer lifetimes and safely reuse memory for well-structured workloads. This is especially valuable for structured ML, HPC, and accelerator-oriented compilation flows where dynamic allocation is expensive or undesirable. I propose to build this in two incremental steps. First, I will implement an analysis pass that identifies eligible memref.alloc / memref.dealloc patterns, performs alias-aware lifetime analysis, computes planning metadata such as size and alignment, and reports reusable candidates and skip reasons. Second, I will build a conservative rewrite pass that rewrites eligible dynamic allocations into memref.subview-based slices of one or more statically allocated arena memrefs for legality-gated v1 cases. The main deliverables are: an upstream analysis pass for static memory planning, a conservative v1 rewrite pass for same-block structured cases, memory-space-aware planning support, strong lit/FileCheck coverage, documentation of supported and unsupported cases, and an incremental PR series that is realistic to review and land upstream.
Project details
Technologies
Not listed in the archive