Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let LiftStructViews lift interstate edge struct accesses to views #1827

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

phschaad
Copy link
Collaborator

@phschaad phschaad commented Dec 13, 2024

LiftStructViews is a necessary pass for ensuring structure member accesses and container array accesses work correctly, by lifting accesses to them into a 'tower of views' that correctly traces their accesses to the root data container. However, this previously did not consider interstate edges. This PR fixes this by making two changes:

  • Allow LiftStructViews to lift struct accesses on interstate edges to the correct tower of views, by inserting a lifting state right before the interstate edge, where views are constructed. The interstate edge is then re-written to access the correct view instead.
  • Fix ArrayElimination to correctly handle these views, which are not directly connected to other nodes, by preventing it from incorrectly merging or removing them. This is done by allowing source/sink view nodes to be merged correctly, i.e., when they are 'the same view', i.e., their view memlets are identical.

This shows an example of the constructed tower of views for a complex interstate edge struct access:

image

@phschaad phschaad marked this pull request as draft December 13, 2024 09:53
@phschaad phschaad requested a review from tbennun December 13, 2024 11:24
@phschaad phschaad marked this pull request as ready for review December 13, 2024 11:24
@phschaad phschaad requested a review from acalotoiu December 13, 2024 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant