Skip to content

Offset loops#2156

Closed
ThrudPrimrose wants to merge 13 commits into
mainfrom
offset-loops
Closed

Offset loops#2156
ThrudPrimrose wants to merge 13 commits into
mainfrom
offset-loops

Conversation

@ThrudPrimrose

@ThrudPrimrose ThrudPrimrose commented Sep 23, 2025

Copy link
Copy Markdown
Collaborator

Mainly designed to replace (int i = 1; i < something; i ++) loops with (int i = 0; i < something; i++) loops and thus get rid of having many memlets that look like i - 1, j - 1 by offseting to map and then adding the negative of the offset to the memlets, getting clearer offsets that are easier to read.

The pass supports both Loop regions and maps. And this:
image

Becomes this:
image
image

(The j is offset is correct, I also normalize the loop using the API of loop regions)

@ThrudPrimrose ThrudPrimrose marked this pull request as ready for review September 25, 2025 09:09
@ThrudPrimrose ThrudPrimrose reopened this Sep 25, 2025
@ThrudPrimrose ThrudPrimrose reopened this Sep 25, 2025
@ThrudPrimrose ThrudPrimrose marked this pull request as draft September 25, 2025 09:11
@ThrudPrimrose ThrudPrimrose marked this pull request as ready for review October 8, 2025 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant