Skip to content

Commit 3e35ab7

Browse files
committed
[SLP][REVEC] Apply comment.
1 parent 5c8f656 commit 3e35ab7

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10205,16 +10205,16 @@ BoUpSLP::getEntryCost(const TreeEntry *E, ArrayRef<Value *> VectorizedVals,
1020510205
unsigned GroupSize = SVNumElements / SV->getShuffleMask().size();
1020610206
for (size_t I = 0, E = VL.size(); I != E; I += GroupSize) {
1020710207
ArrayRef<Value *> Group = VL.slice(I, GroupSize);
10208-
SmallVector<int> ExtractionIndex(SVNumElements);
10209-
for_each(Group, [&](Value *V) {
10210-
auto *SV = cast<ShuffleVectorInst>(V);
10211-
int Index;
10212-
SV->isExtractSubvectorMask(Index);
10213-
for (int I :
10214-
seq<int>(Index, Index + SV->getShuffleMask().size()))
10215-
ExtractionIndex.push_back(I);
10216-
});
10217-
if (!is_sorted(ExtractionIndex)) {
10208+
int NextIndex = 0;
10209+
if (!all_of(Group, [&](Value *V) {
10210+
auto *SV = cast<ShuffleVectorInst>(V);
10211+
int Index;
10212+
SV->isExtractSubvectorMask(Index);
10213+
if (NextIndex != Index)
10214+
return false;
10215+
NextIndex += SV->getShuffleMask().size();
10216+
return true;
10217+
})) {
1021810218
IsIdentity = false;
1021910219
break;
1022010220
}

0 commit comments

Comments
 (0)