Skip to content

Commit 049e1cc

Browse files
committed
[SLP][REVEC] Fix false assumption of the source for castToScalarTyElem.
The argument V may come from adjustExtracts, which is the vector operand of ExtractElementInst. In addition, it is not existed in getTreeEntry. The vector operand of ExtractElementInst may have a type of <1 x Ty>, ensuring that the number of elements in ScalarTy and VecTy are equal. reference: #99411
1 parent 177ce19 commit 049e1cc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11850,8 +11850,7 @@ class BoUpSLP::ShuffleInstructionBuilder final : public BaseShuffleAnalysis {
1185011850
Value *castToScalarTyElem(Value *V,
1185111851
std::optional<bool> IsSigned = std::nullopt) {
1185211852
auto *VecTy = cast<VectorType>(V->getType());
11853-
assert(getNumElements(ScalarTy) < getNumElements(VecTy) &&
11854-
(getNumElements(VecTy) % getNumElements(ScalarTy) == 0));
11853+
assert(getNumElements(VecTy) % getNumElements(ScalarTy) == 0);
1185511854
if (VecTy->getElementType() == ScalarTy->getScalarType())
1185611855
return V;
1185711856
return Builder.CreateIntCast(

0 commit comments

Comments
 (0)