Skip to content

Commit e00e740

Browse files
committed
add CurrVS->NumPacked != VS->NumPacked check
1 parent ee16a4b commit e00e740

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

llvm/lib/Transforms/Scalar/Scalarizer.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,11 @@ bool ScalarizerVisitor::splitCall(CallInst &CI) {
737737
// This case does not seem to happen, but it is possible for
738738
// VectorSplit.NumPacked >= NumElems. If that happens a VectorSplit
739739
// is not returned and we will bailout of handling this call.
740-
if (!CurrVS)
740+
// The secondary bailout case is if NumPacked does not match.
741+
// This can happen if ScalarizeMinBits is not set to the default.
742+
// This means with certain ScalarizeMinBits intrinsics like frexp
743+
// will only scalarize when the struct elements have the same bitness.
744+
if (!CurrVS || CurrVS->NumPacked != VS->NumPacked)
741745
return false;
742746
if (isVectorIntrinsicWithStructReturnOverloadAtField(ID, I))
743747
Tys.push_back(CurrVS->SplitTy);

0 commit comments

Comments
 (0)