File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -9857,16 +9857,13 @@ void BoUpSLP::transformNodes() {
98579857 // Do not try to vectorize small splats (less than vector register and
98589858 // only with the single non-undef element).
98599859 bool IsSplat = isSplat(Slice);
9860- if (Slices.empty() || !IsSplat ||
9861- (VF <= 2 &&
9862- 2 * std::clamp(
9863- ::getNumberOfParts(
9864- *TTI, getWidenedType(Slice.front()->getType(), VF)),
9865- 1U, VF - 1) !=
9866- std::clamp(::getNumberOfParts(
9867- *TTI, getWidenedType(Slice.front()->getType(),
9868- 2 * VF)),
9869- 1U, 2 * VF)) ||
9860+ bool IsTwoRegisterSplat = true;
9861+ if (IsSplat && VF == 2) {
9862+ unsigned NumRegs2VF = ::getNumberOfParts(
9863+ *TTI, getWidenedType(Slice.front()->getType(), 2 * VF));
9864+ IsTwoRegisterSplat = NumRegs2VF == 2;
9865+ }
9866+ if (Slices.empty() || !IsSplat || !IsTwoRegisterSplat ||
98709867 count(Slice, Slice.front()) ==
98719868 static_cast<long>(isa<UndefValue>(Slice.front()) ? VF - 1
98729869 : 1)) {
You can’t perform that action at this time.
0 commit comments