-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[mlir][LinAlg] Vectorize reverse-like ops using vector.gather ops. #83205
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
hanhanW
merged 1 commit into
llvm:main
from
hanhanW:vectorize-reverse-like-using-gather
Feb 28, 2024
Merged
Changes from all commits
Commits
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.
Instead of removing the sub operation we may want to check that the sub is of the form
index - loop_invariant
. This should ensure that the index is monotonically increasing.Additionally, we may want this function to return not only true or false but also if the index is an increasing or decreasing contiguous index. Then, the case sub
loop_invariant - index
should return a decreasing index and we can generate a gather for that case for now. That should leave the code ready to easily generate the proper transfer 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.
Also wondering... shouldn't the condition below be a
&=
instead of an or?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.
yeah, totally agree with what you said. Checking that the sub is of
the form index - loop_invariant
is also the thing in my mind, but I think @banach-space should weigh in, while he's OOO this week. I have few questions too:sub
op to the list while there are no other tests about it.&=
.Can we land this as what it is for now to unblock correctness issue, and follow-up on this after Andrzej is back?
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.
+1 to landing this as is
Both issues that you mention look like my oversight, sorry for that.
There’s quite a few cases for tensor.extract and I struggled to come up with good tests to cover all of them.
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.
SGTM, if one of you approve the PR, I'll land it. Thanks!