Sort MemTile ObjectFifos by buffer size and spill to least-used neighbor#3116
Open
yenjames wants to merge 3 commits into
Open
Sort MemTile ObjectFifos by buffer size and spill to least-used neighbor#3116yenjames wants to merge 3 commits into
yenjames wants to merge 3 commits into
Conversation
When multiple MemTile ObjectFifos need to spill buffers to adjacent tiles, IR order can cause suboptimal allocation where large buffers find no spill room because smaller ones already consumed neighbor capacity. Sort MemTile-producer ObjectFifos by buffer size descending before allocation so large buffers get priority. Also sort neighbor tiles by remaining capacity when spilling, preferring the neighbor with more room.
Contributor
Coverage ReportCreated: 2026-05-27 17:24Click here for information about interpreting this report.
Generated by llvm-cov -- llvm version 18.1.3 |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the ObjectFifo stateful transform’s MemTile allocation heuristic to prioritize larger MemTile buffers and choose less-used adjacent MemTiles for spill placement, with tests adjusted to be less sensitive to resulting IR emission order.
Changes:
- Sorts MemTile-producer ObjectFifos by per-buffer size before creating buffers/locks.
- Sorts candidate spill neighbor MemTiles by current memory usage before allocation.
- Adds a MemTile spill-order regression test and updates existing FileCheck patterns to tolerate reordered output.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
lib/Dialect/AIE/Transforms/AIEObjectFifoStatefulTransform.cpp |
Adds MemTile FIFO size ordering and least-used-neighbor spill ordering. |
test/objectFifo-stateful-transform/adjacent_memtile_allocation/memtile_spill_order.mlir |
Adds regression coverage for size-prioritized MemTile spill allocation. |
test/objectFifo-stateful-transform/repeat_count/link_repeat_count_test.mlir |
Updates FileCheck variables/patterns for reordered emission. |
test/objectFifo-stateful-transform/repeat_count/link_join_repeat_count_test.mlir |
Updates FileCheck patterns for reordered emission. |
test/objectFifo-stateful-transform/init_values/init_values_join_output_test.mlir |
Updates FileCheck patterns for reordered emission. |
test/objectFifo-stateful-transform/init_values/init_values_join_input_test.mlir |
Updates FileCheck patterns for reordered emission. |
test/objectFifo-stateful-transform/dma_transformations/nd_dma_fromStream_join.mlir |
Updates FileCheck patterns for reordered emission. |
test/objectFifo-stateful-transform/dma_transformations/memtile_padding_test.mlir |
Updates FileCheck patterns and lock coverage for reordered emission. |
test/objectFifo-stateful-transform/debug_features/disable_synchronization_test_distribute.mlir |
Updates FileCheck patterns for reordered emission and SSA renumbering. |
test/objectFifo-stateful-transform/data_movement_patterns/link/link_test_join_offsets.mlir |
Updates FileCheck patterns for reordered emission. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jgmelber
approved these changes
May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
allocation, giving large buffers priority for home MemTile placement
and spill target selection. Non-MemTile fifos keep their original IR
positions undisturbed.
preferring the neighbor with more room to avoid blocking adjacent
MemTiles that also need spill space.
Changes
AIEObjectFifoStatefulTransform.cpp: Extract MemTile-producer fifos,stable_sort by buffer size descending, re-insert at original slots.
Neighbor tiles stable_sorted by used memory ascending before spill
iteration.
memtile_spill_order.mlir: Three MemTile fifos where IR-orderallocation fails but size-sorted allocation succeeds.