Skip to content

Commit f792860

Browse files
committed
Address comment
Created using spr 1.3.5
1 parent ebd516d commit f792860

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff 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)) {

0 commit comments

Comments
 (0)