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

3 comments on commit 5b76a2e

@alexfh
Copy link
Contributor

@alexfh alexfh commented on 5b76a2e Jan 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @alexey-bataev, a combination of 0d921f9 and this commit has caused a test to fail for us when compiled for aarch64. I'm not yet sure it's a miscompilation, but it might be. We're investigating, but, given that the other commit is tagged NFC, I suppose, it shouldn't have caused behavior change in any case. Could you double-check that these two commits are doing what you intended them to do?

@alexey-bataev
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, fixed some in 2b1e037

@alexfh
Copy link
Contributor

@alexfh alexfh commented on 5b76a2e Jan 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, fixed some in 2b1e037

Thank you! The test failure disappeared after this.

Please sign in to comment.