-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[MLIR] Define memory effects for memref.prefetch
operation
#151261
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
Merged
ftynse
merged 16 commits into
llvm:main
from
AlexandreEichenberger:memref-prefetch-side-effect
Oct 8, 2025
Merged
Changes from 4 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
7078f7d
add MemWrite side effect to memref.prefetch
AlexandreEichenberger 3f91e0f
update
AlexandreEichenberger 3a7212a
added memref.prefetch MemWrite side effect
AlexandreEichenberger daaabfb
Merge branch 'main' into memref-prefetch-side-effect
AlexandreEichenberger 23b37c5
update
AlexandreEichenberger 429910e
added comments to responde to review
AlexandreEichenberger 0c3cdcb
Merge branch 'main' into memref-prefetch-side-effect
AlexandreEichenberger 9c410c6
Merge branch 'main' into memref-prefetch-side-effect
AlexandreEichenberger 789c474
Merge branch 'main' into memref-prefetch-side-effect
AlexandreEichenberger cc864c7
Merge branch 'main' into memref-prefetch-side-effect
AlexandreEichenberger 4b0a756
response to suggestions
AlexandreEichenberger 3af3996
update
AlexandreEichenberger 8b8d76b
Merge branch 'main' into memref-prefetch-side-effect
AlexandreEichenberger 1fbc305
Merge branch 'main' into memref-prefetch-side-effect
AlexandreEichenberger 07c76bf
Merge branch 'main' into memref-prefetch-side-effect
AlexandreEichenberger 0f96d60
Merge branch 'main' into memref-prefetch-side-effect
AlexandreEichenberger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need to "write to the buffer" semantically here?
(it's worth a comment, as this may not be intuitive!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion, will add a comment. It's basically to ensure that dead-code analysis does not remove the operation. It is inline with making that operation a "volatile" so that it remains in place with respect to the other load/store of the prefetched data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't be removing the operation if it doesn't declare any side effects at all though, and conservatively assume it has all possible side effects. It feels like there's a bug somewhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ftynse I believe the source of the problem is that without side-effects defined, the buffer allocation will fail:
So we need to add side effects, and the part about
is only an answer to "why write and not just read".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative design here, more SSA-friendly, would be for the op to be side-effect free and return a token to be consumed later by some load operation.