[Mlir-commits] [mlir] [mlir][bufferization] Add best-fit algorithm to static memory planner (PR #207403)

Krish Gupta llvmlistbot at llvm.org
Sun Jul 5 12:36:18 PDT 2026


KrxGu wrote:

The comment is a bit hard to follow — it describes sizes in bytes but the allocations are typed (e.g. memref<1024xf32> = 4096 bytes). Would be clearer if the comment just stuck to one unit consistently, or used the actual MLIR types directly.
```
DenseMap<Operation *, int64_t> opIndex;
int64_t idx = 0;
for (Operation &op : *block)
opIndex[&op] = idx++;
// then for each candidate:
info.timeStart = opIndex[candidate.alloc.getOperation()];
info.timeEnd = opIndex[candidate.dealloc.getOperation()];
```

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


More information about the Mlir-commits mailing list