Skip to content

Commit 25b9018

Browse files
committed
[SLP][REVEC] Add assert.
1 parent 3e35ab7 commit 25b9018

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10198,6 +10198,8 @@ BoUpSLP::getEntryCost(const TreeEntry *E, ArrayRef<Value *> VectorizedVals,
1019810198
// If a group uses mask in order, the shufflevector can be
1019910199
// eliminated by instcombine. Then the cost is 0.
1020010200
bool IsIdentity = true;
10201+
assert(isa<ShuffleVectorInst>(VL.front()) &&
10202+
"Not supported shufflevector usage.");
1020110203
auto *SV = cast<ShuffleVectorInst>(VL.front());
1020210204
unsigned SVNumElements =
1020310205
cast<FixedVectorType>(SV->getOperand(0)->getType())
@@ -10207,9 +10209,14 @@ BoUpSLP::getEntryCost(const TreeEntry *E, ArrayRef<Value *> VectorizedVals,
1020710209
ArrayRef<Value *> Group = VL.slice(I, GroupSize);
1020810210
int NextIndex = 0;
1020910211
if (!all_of(Group, [&](Value *V) {
10212+
assert(isa<ShuffleVectorInst>(V) &&
10213+
"Not supported shufflevector usage.");
1021010214
auto *SV = cast<ShuffleVectorInst>(V);
1021110215
int Index;
10212-
SV->isExtractSubvectorMask(Index);
10216+
bool isExtractSubvectorMask =
10217+
SV->isExtractSubvectorMask(Index);
10218+
assert(isExtractSubvectorMask &&
10219+
"Not supported shufflevector usage.");
1021310220
if (NextIndex != Index)
1021410221
return false;
1021510222
NextIndex += SV->getShuffleMask().size();

0 commit comments

Comments
 (0)