Skip to content

[SLP]Model single unique value insert + shuffle as splat + select, where profitable #136590

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
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix formatting
Created using spr 1.3.5
  • Loading branch information
alexey-bataev committed Apr 21, 2025
commit c7f8ecc846df5cb8abba39a0b94c40a562284dc4
5 changes: 3 additions & 2 deletions llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17312,7 +17312,7 @@ ResTy BoUpSLP::processBuildVector(const TreeEntry *E, Type *ScalarTy,
Vec, V);
// Shuffle required?
if (count(BVMask, PoisonMaskElem) <
static_cast<int>(BVMask.size() - 1)) {
static_cast<int>(BVMask.size() - 1)) {
SmallVector<int> NewMask(Mask.begin(), Mask.end());
for (auto [Idx, I] : enumerate(BVMask))
if (I != PoisonMaskElem)
Expand All @@ -17329,7 +17329,8 @@ ResTy BoUpSLP::processBuildVector(const TreeEntry *E, Type *ScalarTy,
Vec = ShuffleBuilder.gather(NonConstants, Mask.size(), Vec);
} else {
Value *V = *find_if_not(NonConstants, IsaPred<UndefValue>);
SmallVector<Value *> Values(NonConstants.size(), PoisonValue::get(ScalarTy));
SmallVector<Value *> Values(NonConstants.size(),
PoisonValue::get(ScalarTy));
Values[0] = V;
Value *BV = ShuffleBuilder.gather(Values, BVMask.size());
SmallVector<int> SplatMask(BVMask.size(), PoisonMaskElem);
Expand Down
Loading