Skip to content

Commit 0b53076

Browse files
committed
[SLP][REVEC] Make castToScalarTyElem support vector instructions.
1 parent 9402541 commit 0b53076

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
@@ -11818,10 +11818,10 @@ class BoUpSLP::ShuffleInstructionBuilder final : public BaseShuffleAnalysis {
1181811818
Value *castToScalarTyElem(Value *V,
1181911819
std::optional<bool> IsSigned = std::nullopt) {
1182011820
auto *VecTy = cast<VectorType>(V->getType());
11821-
if (VecTy->getElementType() == ScalarTy)
11821+
if (VecTy->getElementType() == ScalarTy->getScalarType())
1182211822
return V;
1182311823
return Builder.CreateIntCast(
11824-
V, VectorType::get(ScalarTy, VecTy->getElementCount()),
11824+
V, VectorType::get(ScalarTy->getScalarType(), VecTy->getElementCount()),
1182511825
IsSigned.value_or(!isKnownNonNegative(V, SimplifyQuery(*R.DL))));
1182611826
}
1182711827

0 commit comments

Comments
 (0)