-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[IA][RISCV] Recognize deinterleaved loads that could lower to strided segmented loads #151612
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
mshockwave
merged 9 commits into
llvm:main
from
mshockwave:patch/inerleaved-access-strided-segmented
Aug 12, 2025
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c722014
Pre-commit test
mshockwave 9d6ef18
[IA][RISCV] Recognize deinterleaved loads that could lower to strided…
mshockwave 95f772e
fixup! Clean up the tests
mshockwave 7bb4ec3
fixup! Recognizing masks assembled by AND
mshockwave f5507fb
fixup! Reject cases where Factor != MaskFactor in other targets
mshockwave 8e4b79e
fixup! Address review comments
mshockwave 3f992d6
fixup! Passing APInt GapMask instead of MaskFactor
mshockwave 1f5ab33
fixup! Split combined mask into another patch
mshockwave 705b7a6
fixup! Address review comments
mshockwave 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17254,7 +17254,7 @@ static Function *getStructuredStoreFunction(Module *M, unsigned Factor, | |
| /// %vec1 = extractelement { <4 x i32>, <4 x i32> } %ld2, i32 1 | ||
| bool AArch64TargetLowering::lowerInterleavedLoad( | ||
| Instruction *Load, Value *Mask, ArrayRef<ShuffleVectorInst *> Shuffles, | ||
| ArrayRef<unsigned> Indices, unsigned Factor) const { | ||
| ArrayRef<unsigned> Indices, unsigned Factor, const APInt &GapMask) const { | ||
| assert(Factor >= 2 && Factor <= getMaxSupportedInterleaveFactor() && | ||
| "Invalid interleave factor"); | ||
| assert(!Shuffles.empty() && "Empty shufflevector input"); | ||
|
|
@@ -17264,7 +17264,7 @@ bool AArch64TargetLowering::lowerInterleavedLoad( | |
| auto *LI = dyn_cast<LoadInst>(Load); | ||
| if (!LI) | ||
| return false; | ||
| assert(!Mask && "Unexpected mask on a load"); | ||
| assert(!Mask && GapMask.popcount() == Factor && "Unexpected mask on a load"); | ||
|
|
||
| const DataLayout &DL = LI->getDataLayout(); | ||
|
||
|
|
||
|
|
||
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
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.
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.
We talked about this offline, but I'm more and more coming to the view we should have made these a set of utility routines (usable by each target), and simply passed the mask operand through (or maybe not even that.) More of an aside for longer term consideration than a comment on this review.