Skip to content
Merged
Changes from all commits
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
5 changes: 3 additions & 2 deletions llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13925,10 +13925,11 @@ bool SLPVectorizerPass::vectorizeStores(ArrayRef<StoreInst *> Stores,
unsigned MinVF = TTI->getStoreMinimumVF(
R.getMinVF(DL->getTypeSizeInBits(ValueTy)), StoreTy, ValueTy);

if (MaxVF <= MinVF) {
if (MaxVF < MinVF) {
Copy link
Member

Choose a reason for hiding this comment

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

I mean this change increases cases, where the vectorization may be triggered, since you're loosening the restriction. So need to add the test for such a case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I might be missing something here. The original code only guarded the debug output by this check AFAICT, but always also reached the for loop below, which would not be entered if MaxVF < MinVF.

Now the code continues early instead of reaching the for loop, so it should only restrict the cases where we execute the loop below (and could vectorize)?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, Yes, missed there were continue before.

LLVM_DEBUG(dbgs() << "SLP: Vectorization infeasible as MaxVF (" << MaxVF
<< ") <= "
<< ") < "
<< "MinVF (" << MinVF << ")\n");
continue;
}

// FIXME: Is division-by-2 the correct step? Should we assert that the
Expand Down