Skip to content

Commit 15138b0

Browse files
committed
[SLP][REVEC] Make castToScalarTyElem support vector instructions.
1 parent 9361e8b commit 15138b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11817,10 +11817,10 @@ class BoUpSLP::ShuffleInstructionBuilder final : public BaseShuffleAnalysis {
1181711817
Value *castToScalarTyElem(Value *V,
1181811818
std::optional<bool> IsSigned = std::nullopt) {
1181911819
auto *VecTy = cast<VectorType>(V->getType());
11820-
if (VecTy->getElementType() == ScalarTy)
11820+
if (VecTy->getElementType() == ScalarTy->getScalarType())
1182111821
return V;
1182211822
return Builder.CreateIntCast(
11823-
V, VectorType::get(ScalarTy, VecTy->getElementCount()),
11823+
V, VectorType::get(ScalarTy->getScalarType(), VecTy->getElementCount()),
1182411824
IsSigned.value_or(!isKnownNonNegative(V, SimplifyQuery(*R.DL))));
1182511825
}
1182611826

0 commit comments

Comments
 (0)