Skip to content

Commit

Permalink
[SLP]Correctly calculate mask for the inserted vector
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-bataev committed Jan 8, 2025
1 parent b9c932e commit 5b76a2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4972,8 +4972,8 @@ static Value *createInsertVector(
const unsigned VecVF = getNumElements(Vec->getType());
SmallVector<int> Mask(VecVF, PoisonMaskElem);
std::iota(Mask.begin(), std::next(Mask.begin(), Index), 0);
for (unsigned I : seq<unsigned>(Index, SubVecVF))
Mask[I] = I - Index + VecVF;
for (unsigned I : seq<unsigned>(SubVecVF))
Mask[I + Index] = I + VecVF;
if (Generator) {
Vec = Generator(Vec, V, Mask);
} else {
Expand Down

0 comments on commit 5b76a2e

Please sign in to comment.