-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[LV] Support scalable interleave groups for factors 3,5,6 and 7 #141865
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
lukel97
merged 15 commits into
llvm:main
from
lukel97:loop-vectorize/interleave-factors-3567
Jun 12, 2025
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
d7c9f20
[LV] Support scalable interleave groups for factors 3,5,6 and 7
lukel97 90a5528
Use isPowerOf2_32 in AArch64 TTI check
lukel97 c65b866
Move TempDeinterleavedValues outside of the loop
lukel97 c28663f
Update comment
lukel97 b901b2d
Remove extraneous breaks
lukel97 203d204
Add test for power of 2 factor > 8
lukel97 2d98d9a
Merge branch 'main' into loop-vectorize/interleave-factors-3567
lukel97 d6f7e85
Fix typo in comment
lukel97 a591238
Get intrinsic ID helpers to VectorUtils
lukel97 4f40562
Merge branch 'main' of github.com:llvm/llvm-project into loop-vectori…
lukel97 4bb7405
Add TODO to possibly remove factor > 8 support
lukel97 181bdc3
Merge branch 'main' of github.com:llvm/llvm-project into loop-vectori…
lukel97 abb0bf7
Remove recursive [de]interleaving code, and tighten assertions so Fac…
lukel97 1b1cc2d
Fix typo
lukel97 b50af17
Use table of intrinsics for intrinsic ID lookup
lukel97 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
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
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
Oops, something went wrong.
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.
I'm confused about why factors 5 and 7 seem to be working fine?
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.
I guess you meant why factors or 5 and 7 used to work fine? I think that's because vectorizer has never asked for interleaving non-power-of-two factors before (until now, ofc)
Uh oh!
There was an error while loading. Please reload this page.
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.
I think the TODO comment above confused me: why is factor 3 a TODO, even though the test seems to be fine?
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.
I don't think there is a factor 3 test for AArch64 in this patch.
Uh oh!
There was an error while loading. Please reload this page.
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.
The loop vectorizer never called
getInterleavedMemoryOpCost
with a non-power-of-2 factor w/ scalable VF before, it bailed earlier ininterleavedAccessCanBeWidened
, so this is to preserve the existing behaviour. I.e. it currently only scalably vectorizes factors 2 and 4